LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID Gain Units

Solved!
Go to solution

Hello everyone,

 

Excited to be posting for the first time! Trying to start out small here with a simple control theory question.

 

I have been utilizing the LV PID VI in order to do some simple control. From some of the documentation found here, I see that the units of Kc represent (% of fullscale Output / % of fullscale Input). 

 

I am curious as to how LV determines the % of fullscale input. The % of fullscale output is covered by output range cluster that must be fed into the VI. 

KALTman_0-1588714200141.png

 

Is the VI somehow calculating this % fullscale input from the setpoint and the process variable? Or is the setpoint assumed to be the max and 0 assumed to be the min. Otherwise I would expect there to be an input for the VI that would describe the input range as well.

 

Let me know if there is anyway I can clarify the above question. 

 

Thanks,

 

Keith

 

-Keith
0 Kudos
Message 1 of 4
(2,986 Views)

Hi Keith,

 

welcome in the LabVIEW forum!

 


@KALTman wrote:

I have been utilizing the LV PID VI in order to do some simple control. From some of the documentation found here, I see that the units of Kc represent (% of fullscale Output / % of fullscale Input). 

 

Is the VI somehow calculating this % fullscale input from the setpoint and the process variable? Or is the setpoint assumed to be the max and 0 assumed to be the min. Otherwise I would expect there to be an input for the VI that would describe the input range as well.


The documentation you are linking to is for a different VI, but not for this SimplePID function! You also should read the full help entry, especially that note:

Note  The PID VIs do not use the setpoint range and output range information to convert values to percentages in the PID algorithm. The controller gain relates the output in engineering units to the input in engineering units. For example, a gain value of 1 produces an output of 10 for a difference between setpoint and process variable of 10, regardless of the output range and setpoint range.

 

Instead of asking for the internals of the PID function you could just open its block diagram and see for yourself! It calculates the error as sp-pv and then Kp is multiplied with this error term…

You may read up on Wikipedia about basic PID behaviour.

Best regards,
GerdW


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

Hey GerdW,

 

Thanks for the reply! I apologize for not thinking that all the way through, definitely should have just opened the VI. That answered most of my questions.

 

Maybe just a follow-up so that I understand thoroughly. I am trying to understand units of Kp and how it relates to the input and output in this VI.

 


Note  The PID VIs do not use the setpoint range and output range information to convert values to percentages in the PID algorithm. The controller gain relates the output in engineering units to the input in engineering units. For example, a gain value of 1 produces an output of 10 for a difference between setpoint and process variable of 10, regardless of the output range and setpoint range.


Am I correct in saying that the units of Kp in this VI are kind of arbitrary? I say this because the VI simply takes the output of the equation and checks to see if it is within the output range, and coerces the value if not. Regardless of what the units of the input are, it is going to be mapped to range/units of the output.

 

Thanks,

 

Keith 

 

-Keith
0 Kudos
Message 3 of 4
(2,920 Views)
Solution
Accepted by topic author KALTman

Hi Keith,

 

those ConvertFrom/ToEngineeringUnits expect a percentage at their inputs/outputs so they have to know the expected engineering value range and also can coerce the range.

 

But that only applies to these Conversion functions: the PID itself doesn't care about the input value range (as written in the help).

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 4
(2,906 Views)