LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID contol, I value maximum?

Solved!
Go to solution

I guess finding that factor that needs to be multiplied to the period in min is a bit issue. Can we access the mathematical equations being used in the PID function in LabView? I have read through the help menu but havent came across the mathematical representations yet.

 

Thanks,

Isil

 

 

0 Kudos
Message 11 of 26
(1,304 Views)

@kurabiye wrote:

I guess finding that factor that needs to be multiplied to the period in min is a bit issue. Can we access the mathematical equations being used in the PID function in LabView? I have read through the help menu but havent came across the mathematical representations yet.


Let's back up a moment here.  The factor for calculating the integral time is dependent on the tuning method, not on the PID implementation.  You don't need to find the factor, you need to look it up depending on how you choose to do the tuning.  Are you using a particular tuning method (Ziegler-Nichols, Cohen-Coon, etc)?  Are you familiar with any of these methods?  The Lakeshore manual, or at least the part you quoted, does not provide very detailed information.  You can try using the oscillation period directly as the reset time, it might be close enough.

 

The equations used to calculate the LabVIEW PID output are described in the PID toolkit manual, and you can open up the VIs to see how they work.

0 Kudos
Message 12 of 26
(1,293 Views)

Nathand,

 

   I am using Ziegler–Nichols method which you may see the recommended P, I, D values on the attached table Ku is the proportional gain where the oscilaltions starts, Pu is the period of that oscillations . Once you find the starting point of the sustained oscillations with only P parameter, you start introducing the I parameter as defined. I dont plan to use D at all. So let me give you an example, my Ku value where I see sustained oscillations is 6, that gives me a P value of 6*0.5=3 in the first calculation. Then, when I introduce I, my new P becomes as 0.45*6=2.7 and my osicllation period is 40 sec which is 40/60 min. so then my I would be 1.2*2.7/(40/60)= 4.860min^-1. Since Min^-1 is not the unit we want for the integral term, I take the 1/4.86=0.2058 min as the integral time for labview input. Does that look ok ?

 

   Now, the interesting thing is at T=310 set point, P= 3 and I=0.5 gives the best results even though they differ from Ziegler Method values. I will look into more temperature values If my I calculation method seems right.

 

Thanks,

0 Kudos
Message 13 of 26
(1,279 Views)

The Ziegler-Nichols method, like all empirical tuning methods, is just a way to get a good starting point.  It is not unusual to adjust the value slightly from the recommendations produced by the tuning method.  There are no "perfect" tuning values (unless your system is completely linear and you have a perfect mathematical model, in which case you can do all the transfer function math to determine ideal values - but that's rare in real life).

 

Your math is mostly correct, but you should read through the LabVIEW PID manual more carefully.  You'll see that it internally multiplies proportional gain by the reciprocal of the integral time to get the integral gain, so you should not use the proportional gain to calculate the integral time.  In your example calculation the integral time should be (40/60)/1.2 = 0.555, which is almost exactly the value you found to give good results (of course you can also calculate this as 0.2058*2.7).

Message 14 of 26
(1,267 Views)

Nathand, I really appreciate your work. Now I am in the process of defining appropriate PID values for different Temperatures. I am not sure If I should open up a new post but now I started doing the gain scheduling.

 

Lets say when I am at 300K and setpoint is 350K, the PID values that works for 350K (which are defined when the temperature is closer such as 340K) is not functional, meaning the system is slow) 

 

That problem seems to be solved when I use P only (no I). So in my gain scheduling program should I also take the difference of current point and set point to define PID values in addition to the temperature range ? such as If the difference is more than 10K, take the I=0?  Or is there a simpler way? 

 

Once I solve that I plan to have 9 diffrent PID settings for 9 Temperature values, which can be inputted with case structures ? 

 

 

0 Kudos
Message 15 of 26
(1,257 Views)

I'm surprised that you can't find tuning values that work across a 50K range, although I also know nothing about your system.  It's unusual to need gain scheduling in such small increments.  Can you provide data (either a graph or spreadsheet) of the setpoint, controller output, and system response (measured temperature)?  When you're at 300K, is it holding that temperature, or is the actual temperature slightly higher?  Normally integral control will speed up, not slow down, the response (assuming P is constant), but if you're actually at, say, 301K for a long period of time when your setpoint is 300K, the integrator will build up a large error that must be offset, and that action can appear as a slow controller.  If that's the case, you might try setting the "Reinitialize" input of the PID function to True every time the setpoint changes (but only for a single loop cycle) and see if it helps, since that will clear the integrator.  However, it would be better to find tuning values that prevent the integrator from accumulating too much error.

0 Kudos
Message 16 of 26
(1,251 Views)
As I mentioned that was only an example . My temperature range goes up higher to 700K. I plan to tune for several of them but when the difference between set and current temperature is too high, it doesn't heat up fast for the PI condition unless I remove I. But you mentioned it shouldn't be the case so I might try to re initialize to remove the past errors and see what happens .


Let's assume I have overcome this issue and have x PI values for x temperatures. How to assign them to my pid control vi should be with case structures ? Or event structures ? Or neither one ?
0 Kudos
Message 17 of 26
(1,244 Views)

If integral control is consistently slowing the controller response (versus no I and the same P) then something is wrong.  My guess is accumulated error, as I mentioned, but that's only a guess since I have no details about your system.

 

For gain scheduling, I would use the "PID Gain Schedule" VI included with the PID toolkit (you are using the LabVIEW PID toolkit, right?).

0 Kudos
Message 18 of 26
(1,242 Views)

I am using the PID function from the functions palette. I am not using PID toolkit If that means a different tool seperately downloaded. So I have found gain schedule Vi from the functions palette. I looked at one example, it was mainly time controlled to select which PID parameters to use. Mine will be temperature dependent. Lets say for x temperature use a b and c values for PID. So do I need to add loops and cases? 

0 Kudos
Message 19 of 26
(1,223 Views)
Solution
Accepted by topic author kurabiye

The PID functions on the palette are the ones from the toolkit, so you probably have the Gain Schedule VI already.  Search the PID palette.

0 Kudos
Message 20 of 26
(1,216 Views)