PID tuning - Is there an easy way??

Cryogen

Member
Join Date
Oct 2005
Location
NH
Posts
151
Dear Friends,

I am about to tune a Level control on a micrologix PLC.I have learnt so much about PIDs now through my reading(Ron's posts were very helpful!). I understand what Gain, Intergral and Derivative actions does to the output. I read some articles on PID tuning too.. including Ziegler Nichols method and AB documentation etc...

I still cannot understand an easy way to tune the system. Some months back when i tried to tune a PID (again, level) I never got the oscillations as I increased the gain..SO I couldn't find the ultimate gain and natural period.. Is there an easier way to tune the PLCs? or should I just follow WAG (Wild *** Guess)!

Please help me understand..
Thanks..
 
WAG works for simple systems.

I you have read Ron B's documents then you have a good start and the easiest/quickest way should be the WAG method. A level control should be relatively easy. Give WAG a try.

There are easier ways to tune. One is to get an auto tuning program or an expert to do it for you. Learning how to use an autotuning program may take longer than the WAG method on your application. An expert would probably not be challenged and cost too much.

One could study control theory and become an expert but that is a huge investment in time ( years ) but afterwards you will not needs to WAG.

If one were to tune a lot of systems then it pays to have a more scientific/mathematical approach. I prefer to use the scientific/mathematical approach. When that doesn't work I use the SWAG ( scientific wild a$$ guess )method.

GO for it! Use the trend feature. You can save the trends and post them on the forum where we can give advice. I don't think the RSlogix trends are used enough on this forum.
 
I have done the PID control in a Micrologix 1500. The biggest problem I found was that this can only be done with scaled increments of 100. Even though the PID function is set to have a Scaled Input and output value of 0-16383 you can only use 100 steps( 16383/100 = 163.83). If you do not scale the input to the PLC so that it has 100 increments(of you full scale) your PID will always oscillate.
 
????

Allan Barnes said:
I have done the PID control in a Micrologix 1500. The biggest problem I found was that this can only be done with scaled increments of 100. Even though the PID function is set to have a Scaled Input and output value of 0-16383 you can only use 100 steps( 16383/100 = 163.83). If you do not scale the input to the PLC so that it has 100 increments(of you full scale) your PID will always oscillate.

Why is the PID limited to 100 steps? I think you should read Ron B's threads on scaling. The PID should have 16384 steps and percentages should not be quantized to the nearest percent.

You do make a good point. Resolution play a VERY important part in how well your system will work.

BTW, I liked you motivation or de-motivation thread.

"The early worm is for the birds." It made me laugh.
 
2 things

You don't need to be an expert at this to get yourself in the ballpark with your WAG. You do need 2 things. #1, you need to understand how the proportional, integral, and derivative gains work to modify the output of the PID. Once you know this, you need to at least make an educated guess on what kind of lag you have in the process you are controlling. Typically, your lag times are going to be fairly short. For example, if your loop PV is a pressure transducer in a plenum, and your fan is 500 yards away, you may have a little larger lag time. What you need to do, is try to figure out how long it takes for a change in output to affect the process variable. If you know these 2 things, and it sounds like you've gotten a good start on the first, then your WAG should be an educated guess, and your educated guess should put you in the ballpark. At least, this has always been my method. Good luck.

Russ
 
I use this method for fast reacting loops.
Set I & D to zero, start bringing up "P" till it your output reaches around 60% and at this point you should have a nice occilating loop. Then start adding in the "I" value till your loop stabilizes.
I usually have loop update set to 50 milliseonds and use no "D". This should get your loop somewhat stable and then from there you can start tweaking it in. I think this is called the Ziegler Nichols method.

As for as auto tuning software. I have seen some that work good for certain types of loops and for other types they don't work.
 
Assume Nothing.

Mark Buskell said:
I use this method for fast reacting loops.
The objection I have to these PID tuning 'hints' is that every one says how they tune their system but not the other guys systems. Each system is different. That is why I ask for the trend. That way I know how their system works before I give advice.

We don't even know if we are controling the inlet or outlet!
 
Originally Posted by Peter Nachtwey
Why is the PID limited to 100 steps? I think you should read Ron B's threads on scaling. The PID should have 16384 steps and percentages should not be quantized to the nearest percent.
I do not know why this was designed with a resolution of 100. Hopefully in the next revision they will fix the resolution problem.
 
Many simple level applications are dominated by the size of the tank relative to the filling/emptying rate. In this situation, you may have effectively a first order system, which is unconditionally stable.

If you have tried the Ziegler-Nichols closed loop method and couldn't get the system to oscillate, this may be what you have. Consequently, you may find that gain-only control is good enough, as the gain can be increased to reduce the static error to an acceptable level. In this situation, I would normally try gain-only to start with, but usually end up with a small amount of integral action so the customer can't moan about the (insignificant) static error.
 
Thanks for all your useful replies..I am confident with my approach now. I understand how the P, I and D terms work on the AB equation.

Only question I have left is about the 'RG' term. I use Micrologix 1200, do I need to set the RG bit? I understand all it does it change the actual gain, integral range. But why does it exist? Can anyone explain the significance of this term?
 
AutomaticLeigh said:
Many simple level applications are dominated by the size of the tank relative to the filling/emptying rate. In this situation, you may have effectively a first order system, which is unconditionally stable.
Yes, that is why I advised to 'go-for-it'. This should work well with just a PI and be easy to tune if the level doesn't change too much. The proportional gain Kc may need to change depending on the level in the tank. If the valve is on the output, the gain will be affected by the level of fluid in the tank. ( head across the valve ). However, we haven't been told where the control valve is yet even though I hinted it may be nice to know.
 
It is the inlet valve that controls the liquid level on the tank not a valve on the output. So with more error (PV less than SP), the output is increased [E=SP-PV].

When used the system might have huge load fluctuations based on the unpredictable requirement of the liquid(Should I consider derivative action?). Due to high demand certain times, the system has to act quick. But the desire is not to have a high gain control that would make it more similar to ON/OFF and open/close the valve more agressively. I am thinking a moderate gain with a small intergral function..
 
Last edited:
A lot depends how quickly and accurately you need to maintain the level and which is the worst scenario - underfilling or overfilling

If overfilling is a problem you may be better off with proportional only control (basically an electronic ballcock). There is a possibility that if the fill rate is much higher than the emptying rate or the outflow can sometimes stop completely you will overfill, especially if the integral term is not tuned correcly or if there is any noise on the level transmitter signal.
 
Cryogen said:
It is the inlet valve that controls the liquid level on the tank not a valve on the output. So with more error (PV less than SP), the output is increased [E=SP-PV].
This makes tuning very easy because the gain will be constant as long as the pressure across the control valve is constant.

Cryogen said:
When used the system might have huge load fluctuations based on the unpredictable requirement of the liquid(Should I consider derivative action?).
Simple first order systems do NOT require a derivatice gain.

Cryogen said:
Due to high demand certain times, the system has to act quick. But the desire is not to have a high gain control that would make it more similar to ON/OFF and open/close the valve more agressively. I am thinking a moderate gain with a small intergral function..
The ON/OFF action you fear shouldn't happen when tuned right and valve is sized to flow a little more than the peak demand.
Well, is it? If the valve is sized incorrectly it will adversely affect your tuning.

AutomaticLeigh said:
Many simple level applications are dominated by the size of the tank relative to the filling/emptying rate.
This was a hint that this is important. Your system is analogous to a RC circuit where the resistor that charges the capacitor is controlled by you and the PLC. There is also a resistor that discharges the capactio. Decreasing the size of the resistor is analogous to increasing the demand from the tank. A clever person could design a RC circuit that would simulate your level control application. It is more difficult than you think because you need to control the rate at which the capacitor ( tank ) is being charged or discharged by controlling the current ( flow ). This means some op-amps are required. At Delta we have used RC circuits for years to simulate motion systems.

One can see the level can be maintained as long as the rate at which you are filling is equal to the rate of flow out of the tank. If you want to respond quickly you should know the flow out of the tank. If you know the out flow is 50 GPM then you can instantly add a bias to the PID so the flow will be 50 GPM without waiting for error to build up.

Don't use a derivative gain. Use feed forward/bias.
 

Similar Topics

Hello, I am attempting to tune a PID loop on a process. The process involves a valve with electronic actuator that has quite a high deadband...
Replies
10
Views
2,076
so i have 4 25gpm wells feeding a 1000gal tank (T-1), with an additional 15gpm from a decant tank for 3hrs every 12hrs. P1 and P2 both controlled...
Replies
154
Views
35,522
Hi everyone, yet another PID problem. I'm hoping I understand enough of the process I'm controlling that my request for help is reasonable. If a...
Replies
113
Views
27,626
A few months ago, I started to look into PID controllers and the tuning of first order processes. This has, partly thanks to you, resulted in a...
Replies
162
Views
61,733
I haven't had to tune a PID loop in a very long time. It's actually a PI loop for a pulse width modulation s.v. What was the name of that tuning...
Replies
16
Views
4,073
Back
Top Bottom