LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with PID control

I'm trying to control the speed at which something moves, I'm calculating velocity by using distance/time, the speed will be controlled by a servo hydraulic vale, the valve is a two way valve and operates as follows, you control the valve by sending an analog voltage to the valve (0-10V).  0 V being fully open in reverse direction, 5 V being completely closed, and 10 V being fully open in the forward direction.  I'm not sure how to get the PID to output like this.  I currently have it wired so that 0 is off and 10 is fully on, but I'm not getting a very good output value.  I want the speed to be 10mm/s and when the systems reads a speed of 0 shouldn't the output be close to 10 to turn the valve fully on to reach this speed, the output that I get is only .05 and when the speed is 10 the output is 0 so it kinda seems like it is working but not all the way.

I hope this makes sense if not I can try to explain in more detail but never the less here is my code, thanks for any help

Download All
0 Kudos
Message 1 of 2
(2,599 Views)
 

Hi rocksolidsr,

If you only want the flow to be in the forward direction, you may want to try limiting the output to between 5 and 10 V.  The reason is that, when you first change the set point from 0 to 10 V, the output is currently below 5 V, so that the valve is actually allowing flow in the reverse direction, which is undesireable.  You can set this using the Output Range input of the PID Autotuning VI.

Regarding the outputs you are currently seeing, these are definitely the expected values for the current PID gains you have set up.  When your process variable and set point are equal, you will have an output of 0 because you are only using proportional control.  If you want better steady-state stability, then you should incorporate integral and derivative control as well.

In fact, there is a section of the PID Control Toolkit User Manual that is dedicated to manual PID tuning.  The section starts on page 3-3.  You may want to try following this procedure to see if you are able to get better results from your controller.

I hope this helps.


Rishee B.
Applications Engineer
National Instruments

 



Message Edited by risheeb on 04-07-2008 11:48 AM

0 Kudos
Message 2 of 2
(2,552 Views)