LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID cascade control

Solved!
Go to solution

Hi All,

 

I was looking at the PID cascade and selector VI example in Labview. I understand what the VI is doing. However, in the description it said "For simplicity, all variables in this demo are in percent. In a real application, you could normalize all the input and setpoint values to percent before passing them to the PID controllers."

 

How would I go about that (do i need to normalizing output values?) if for example I have the following values:

 

motor range: input/output 0-10V, control knob 0-60 hz

pressure sensor range: 0-25V, reads 0-5 bar

pressure set point range: 0 - 5 bars

 

Thanks!

 

 

0 Kudos
Message 1 of 6
(3,267 Views)

Hi wew,

 

you don't need to normalize PID in/out data to percent - you just need to adapt your P gain…

 

I never use any normalized data for PID control: IMHO it is much easier to see "real data" (like motor speed or temperature) as in/out instead of some scaled percentage values…

Best regards,
GerdW


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

Hi GerdW thanks for the reply!

 

I still dont see how proportion constant play a role in this case. For example, a valve takes 0-10V input and output. That would be the output parameter (limits) you would set on the PID vi. So then on your valve knob control, it will show 0-10V as min and max. If you want to control that by pressure setpoint and pressure PV, (0-60 psi for example), then the error (SP-PV) doesnt really work out because of the units, and they are not on the same scale. The SP-PV will never be 0 because the max value from valve is 10V. 

 

I have attached my own VI + subvi for reference. Everything is in percent, from 0-100 currently. If you change everything with following units:

 

-pressure setpoint range from 0-60 psi.

-motor voltage 0-10V

-valve constant set to 5 instead of 50% (for 5V is half open) 

-in the subvi (somewhat simulates pressure reading), divide the output by 10 so the output will correspond to 0-10V input to the pressure sensor.  

 

Then, everything doesnt work anymore like it used to anymore. 

 

 

 

Download All
0 Kudos
Message 3 of 6
(3,179 Views)

You can think of the proportional gain, Kp, as having units of process variable units / output units. So, in your case it would have units of psi/volt: for every 1 PSI of error, you'll get Kp volts of output.

 

If you're working in percent, and you then change to using direct engineering units, then you need to adjust your proportional gain to compensate. Due to the way the math works in the LabVIEW PID, you do not need to change your other gains.

0 Kudos
Message 4 of 6
(3,162 Views)

Hi Nath,

 

Thanks for the reply!

I drew a picture based on my understanding of your explanation. Could you see if this is right?

 

0 Kudos
Message 5 of 6
(3,145 Views)
Solution
Accepted by wew044

Your drawing is correct in that the setpoint minus the process variable is the error. Other than that I can't say as I'm not sure what else it is supposed to show. The correct value for Kp should be determined through some standard tuning method (Ziegler-Nichols, Cohen-Coon, etc); it's not simply the maximum error divided by the maximum output. However, if you have a working value for Kp scaled for something different (such as percent) you can calculate the equivalent Kp for the raw values simply by applying the percentage scaling to the existing Kp value.

0 Kudos
Message 6 of 6
(3,093 Views)