LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to fix this VI?

I am working on this VI to control a motor. I will receive feedback from the motor on its position.

I will manually turn the motor, which will produce current/voltage. When the current (I found the relationship between the current and voltage being input into the motor) is lower than a threshold level, I want the VI to use the PID controller and turn the motor back to its original position (and resist the force I'm manually applying to the motor) which I've inputted. When the current is greater than the threshold value, I want the actual position of the motor to equal the desired position of the motor, so the program will allow me to turn the motor.

 

I seem to have that part figured out. However, after I have manually turned the motor, I will release it. When I release the motor, the current is now below the threshold value and the motor will start to turn back to the original inputted position. Is there a way to keep the motor from turning back to the original position? I want it to stay still after I stop turning it manually.

 

I have included my VIs, hopefully, it will make things clearer.

 

Thanks for the help.

 

 

Download All
0 Kudos
Message 1 of 4
(2,922 Views)
It's a little hard to follow your code, but when the current is above threshold, you want to change the set point of the PID loop to match its current position.  It looks like you will need to update Input 1 and/or Input 2 to change the setpoint when the current is above the threshold.
Randall Pursley
0 Kudos
Message 2 of 4
(2,881 Views)

Thank you Randall. I am a bit stuck on how to update my Input 1 though, since it is an inputted value that the user picks at the beginning. How would I be able to substitute this inputted value for the updated, current position.

 

 

0 Kudos
Message 3 of 4
(2,874 Views)
They looked like shared variables to me.  Why can't you just write to them again.
Randall Pursley
0 Kudos
Message 4 of 4
(2,849 Views)