LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID vi unit conversion between minute and second and millisecond?

Solved!
Go to solution

Hi,

I am using the PID built-in vi (below) in my own vi, and as an example the gain parameters are as follows.

pidBlock.jpgpidTune.jpg

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.

pidconversion.png

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).

pidConvert.jpg

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?

timing.jpg

Thank you for your help and patience.

 

Xiaoshu

0 Kudos
Message 1 of 3
(3,986 Views)
Solution
Accepted by topic author xliu461

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!)

Best regards,
GerdW


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

Thank you

0 Kudos
Message 3 of 3
(3,125 Views)