LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reversing direction of a linear actuator- event structure?

Solved!
Go to solution

Hello,

 

I am relatively new to LabVIEW, and I could use some help with programming a linear actuator. The actuator I am using is a Phidgets DC linear actuator L16-50-35-12-P. The actuator has a buiilt in potentiometer and I am able to access its voltage. Essentially what I want to program is when the actuator reaches a maximum position (user input) which is obtained from the potentiometer voltage, I want to reverse the sign of the input velocity. And when the actuator reaches a minimum position, I want to change the sign of the input velocity back to a positive value. I thought of using an event structure to program this, however I am unsure how to do so. Any tips would be much appreciated!

 

I've attached my program so far below, thanks!

 

 

0 Kudos
Message 1 of 9
(2,502 Views)

Events are for user interactions. Your loop is already spinning so just keep a state boolean in a shift register (two possible values, one per direction) and flip it whenever a boundary is reached. Use it's value to determine the travel direction.

0 Kudos
Message 2 of 9
(2,468 Views)

Thanks for the response,

 

I have two instances where I would want to reverse the direction, one when the actuator reaches xmin and one when the actuator reaches xmax. So I am trying how to incorporate both of these reverals with the two boundaries with the not function. Would you mind providing me with an example if you don't mind?

0 Kudos
Message 3 of 9
(2,463 Views)

@mpkennedy wrote:

Would you mind providing me with an example if you don't mind?


Try this.... (Probably needs a few tweaks to be useful)

0 Kudos
Message 4 of 9
(2,460 Views)

Thanks a lot for the example, I understand what you are saying now. would the "x" in the "in range and coerce function" be the current actuators position? The one thing I still don't understand in the example is adding the "coerced(x)" from the "in range and coerce function" and the output of the "select function." which wire would be the output velocity to the actuator motor?

 

0 Kudos
Message 5 of 9
(2,455 Views)

Yes, the input to the range function is the current position. You might have to be a bit more complicated, depending on the hardware. Maybe you want to reverse the position if it reached the safe limits. (0.2, 4.8) instead of stopping the loop.

 

I am not familiar with your hardware. Does a negative output velocity imply reverse movement?

0 Kudos
Message 6 of 9
(2,450 Views)

Yes, sorry, that is something I should have specified. A negative velocity indicates reverse movement. And yes, ultimately I want to reverse the direction at the safe limits (0.2 and 4.8). the current VI stops the loop at these limits just so I could test the actuators at different speed. Also, would the output of the "select function" go to the motors target velocity?

0 Kudos
Message 7 of 9
(2,446 Views)
Solution
Accepted by topic author mpkennedy

Yes, just select between +1 and -1 and multiply with the desired absolute velocity.

0 Kudos
Message 8 of 9
(2,444 Views)

Thank you! appreciate the help.

0 Kudos
Message 9 of 9
(2,437 Views)