05-05-2020 04:38 PM - edited 05-05-2020 04:40 PM
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.
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
Solved! Go to Solution.
05-06-2020 01:05 AM - edited 05-06-2020 01:07 AM
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.
05-06-2020 08:05 AM
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
05-06-2020 09:10 AM
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).