Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

PID VI - Output Range Question

I have a question concerning the PID VI and it's output range option.
 
"What is gained or lost from using 0-100 versus -100 to 100 for a default output range?"
 
My application:
 My application provides the PID VI a setpoint and a process variable, both in degrees Celsius. I see that the output from the VI has a default range of -100 to 100. The power supply that I want to power accepts an input range of 0.0035 - 0.020 mV.
 
If I simply enter that range into the VI, the output is either zero or 0.020.
 
I can get other values if I use the larger scale and then convert them to the smaller numbers. I am trying to decide between using the range 0 - 100 or going with the default range of -100 to 100 and simply cutting off anything below zero in the conversion to mV. What is gained or lost from using 0-100 versus -100 to 100 for a default output range?
 
Thank you
-Ron
0 Kudos
Message 1 of 8
(4,482 Views)
Here is an example of the four situations.
 
Thank you,
-Ron
0 Kudos
Message 2 of 8
(4,477 Views)
You'll want to use the last example, with the output range of the PID VI equal to the input range of your power supply.  You need to put that section of the code in a while loop and alter your setpoint to see how the output changes.  Don't forget that the PID parameters greatly affect the output.  You will want to use a very small proportional value, like 0.001 to see what I mean. Unless you are using some kind of cooling device, you don't need to have a negative output.
0 Kudos
Message 3 of 8
(4,475 Views)

I am having a similar problem.  I am using the PID vi to control the duty cycle of an H-bridge module which is supplying a Peltier cooler.  I have increased the proportional constant to get the output to change, but it pretty much only goes rail to rail.  When I set the maximum to 60 (60% duty cycle) and the minimum to 0, there is very little output between the limits.  It's pretty much 0 or 60, then switches to the other.  How can I get it to give me an output below the maximum, with slight deviations based on the difference between the control variable and the measured temperature?

0 Kudos
Message 4 of 8
(3,901 Views)

If you adjust P with I and D set to zero, at some P value you will start to see movement of your output.  Remember when using only P, the output is a factor of P and your error.

0 Kudos
Message 5 of 8
(3,891 Views)

Thanks for responding.  The thing that worries me is that when the output is responding to the error, it doesn't spend much time at intermediate values.  It is just going from the low limit to the high limit and vice verse.  Am I thinking about this the wrong way, or is it just a matter of getting the right parameters to get it to give an output at some intermediate value?

0 Kudos
Message 6 of 8
(3,878 Views)

What are your P, I, and D values?  What is the error(SP-PV)?  If I and D are zero, output=P*error.  If P=1, then the output should equal the error.

0 Kudos
Message 7 of 8
(3,874 Views)

Ah...  That makes sense.  If the output is equal to the error when P = 1 and I and D = 0, then I need to work out a factor that gives an appropriate response.  If the temperature difference between the measurement and the setpoint is 3 degrees C then the output would be 3 - which gives a 3% duty cycle which does not supply enough current to the Peltier to change the temperature.

0 Kudos
Message 8 of 8
(3,862 Views)