01-02-2020 09:58 AM - edited 01-02-2020 10:11 AM
Hi,
I am using the PID built-in vi (below) in my own vi, and as an example the gain parameters are as follows.
What I am not sure of is that why the Ti and Td are by default in unit of minute. And I found this conversion equation on ni.com.
My question is, do I literally plug in the numeric value of Ti (in unit of minute) into the equation, or do I convert Ti to a unit of second or millisecond first?
I did open up the PID sub-vi and see that there is a conversion from millisecond to second in the red circle (below), and a conversion from second to minute in the blue ellipse (below).
So I assume since everything is now in minutes, my integral gain would just be Kc/Ti, instead of Kc/(Ti*60)? i.e. no conversion needed.
Given the set of example values in the earlier image, my Kp=Kc=1, and Ki=Kc/Ti=1/0.01=100 or Ki=Kc/Ti/60=1.67?
Additionally, the control and sensing loop is timed in the following way (below). Does it affect the aforementioned PID gain units at all?
Thank you for your help and patience.
Xiaoshu
Solved! Go to Solution.
01-02-2020 12:36 PM - edited 01-02-2020 12:43 PM
Hi xliu,
@xliu461 wrote:
My question is, do I literally plug in the numeric value of Ti (in unit of minute) into the equation, or do I convert Ti to a unit of second or millisecond first?
Ti/Td are expected with unit minute, no need to convert to unit second (or millisecond)!
@xliu461 wrote:
I did open up the PID sub-vi and see that there is a conversion from millisecond to second in the red circle (below), and a conversion from second to minute in the blue ellipse (below).
This only calculates the PID internal timestep in seconds ("dt out"), then scales to minutes as used by PID calculations.
@xliu461 wrote:
So I assume since everything is now in minutes, my integral gain would just be Kc/Ti, instead of Kc/(Ti*60)? i.e. no conversion needed.
Given the set of example values in the earlier image, my Kp=Kc=1, and Ki=Kc/Ti=1/0.01=100 or Ki=Kc/Ti/60=1.67?
Your integral gain is Kc/Ti, with Ti expected with unit minute.
@xliu461 wrote:
Additionally, the control and sensing loop is timed in the following way (below). Does it affect the aforementioned PID gain units at all?
The shown loop waiting for some button will not affect the PID gains, but it will affect the PID operation as it seems to not allow calling the PID at regular time intervals.
(How is the PID even related to the shown part of your VI? Most often it makes sense to attach the full VI to allow more detailed analysis!)
01-09-2020 07:42 PM
Thank you