09-10-2012 11:13 AM
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
09-10-2012 12:54 PM
@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.
09-11-2012 02:50 PM - edited 09-11-2012 03:02 PM
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,
09-11-2012 03:37 PM
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).
09-11-2012 10:01 PM
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 ?
09-11-2012 10:22 PM
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.
09-11-2012 10:48 PM
09-11-2012 11:10 PM
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?).
09-12-2012 09:41 AM - edited 09-12-2012 09:53 AM
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?
09-12-2012 10:31 AM
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.