LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling linear actuator

Solved!
Go to solution

Greetings,

 

First thing, I'm a LabVIEW noobie. 

SETUP:

OS: Windows 7

Software: LabVIEW 13.1

DAQ: NI USB-6009

CVS is displacement per second. (Each line is 1 second) 

Problem: Controlling a linear actuator by using a string pot voltage output and a specified control curve (displacement per second in an excel file) to simulate a ~45 minute cycle. 

 

What I'm trying to do is compare the displacement of the actuator (from the voltage off the string pot converted from voltage per inch to show displacement) to the numerical displacement in the csv file. If the displacement in the excel file at a given time is larger than the displacement calculated at the string pot I want to have a digital output on my NI USB-6009 to send a high signal to my extend input on the actuator. If the displacement is smaller, high signal to the retract. 

 

How would I go about creating a curve from the CSV in a way that I can compare to the displacements?

 

Thanks,

Matthew

0 Kudos
Message 1 of 5
(3,205 Views)
Solution
Accepted by topic author Mhoppock

Hi Matthew,

 

are you trying to setup a PID control loop?

 

On your question: sounds like an array of (setpoint) values with respect to time...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(3,201 Views)

@GerdW wrote:

Hi Matthew,

 

are you trying to setup a PID control loop?

 

On your question: sounds like an array of (setpoint) values with respect to time...


 Wasn't intentionally creating a PID controller. I guess you could look at it as a really simple one. Just trying to see if I can wear out this actuator. 

 

Would I feed the array with the values of the excel file?

0 Kudos
Message 3 of 5
(3,196 Views)

Hi Matthew,

 

yes.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 5
(3,188 Views)

You say

 

"CVS is displacement per second. (Each line is 1 second) "

 

Which I assume you mean you have a spreadsheet file, comma-separated, of the target velocity profile. You can load the CSV file using the Read spreadsheet file vi with ',' as your delimiter.

 

As for control, you can only tell your device to go forward or backward at a constant velocity? Indeed, you could create a PID that controls the duty cycle of a PWM that tries to follow the velocity profile. The 6009 would be terrible for this though because it's counter can't be used as a PWM and it has no FIFO for any of its outputs. So like, you're kinda stuck just turning on and off the DOs every second. That is kinda crappy. Updating DOs and AOs can't be done faster than a few hundred Hz.

 

You could also change your set points from velocity to position by doing a running sum of the CSV file. Then comparing the voltage from your encoder to the file knowing the displacement / volts constant of your controller.

 

Just some ideas.

Message 5 of 5
(3,174 Views)