Tuning PID - how to do it properly

5 posts in this topic

I need some advice how to tune PID properly.

The PID is only PI type (two mode) and its overshooting frequently. Assuming I need to tune P with starting incrementing by very small steps till PID oscillates. 

Once the P is established then will be tuning I , again with small increments till PV follows SP. 

So this is my assumption below but would like someone to comment on it as I haven’t had to do it before , been learning PLC for 4 months now. 

Do I need to start a machine and then start tuning PID or can this be done in more friendly way , offline ?

Edited by MRPLC82

Share this post

Link to post
Share on other sites

The process needs to be running before you can tune the controller.

There a lot of ways to tune. Ziegler-Nichols calculations as well as others. I prefer the method I learned when controls were mostly pneumatic <--- :/ I feel like I need to get a cane..

Sometimes the integral units are in repeats per min. It's just he inverse of time. 1/Ts =  Repeats or 1/ repeats = time in seconds

Sometimes the controllers don't use gain. They use percent proportional band instead. Same drill, one is the inverse of the other.

For two mode controllers, set Integral time out of the way, like 10m - 20m in the Logix PLC (units are in minutes). Then increase gain (1 = 100% PB, 2 = 50% PB, etc) until the process starts to oscillate. Lets say you started at 1 and at 3 it started oscillating, set it back to 2. BTW - each gain change should be followed by a "bump". Like change the setpoint slightly. If you want to to tighten it up further, increase until it oscillates (after a bump). Then back off to 1/2 way between 2 and 3. Once you get that where you like it, speed up (lower) integral time until the process oscillates after a bump, rinse repeat. Integral time adjustment will affect gain so you may find yourself reducing gain at some point.

These are a good start. For speed you can use flow for an initial starting point.

PID Default Startup Values

Process Variable K
(Integral Time, min.)
 T(Derivative Time, min.)
Flow 0.8 0.2 0.0
Level 1.0 10 0.0
Pressure 2.0 0.5 0.0
Temperature 1.0 3.0 0.2


1 person likes this

Share this post

Link to post
Share on other sites

I think the whole article that the numbers above came from would have some use to others so I attached it.

Level: Just to qualify things a little, level can be a little tricky. If the transmitter measures actual level then Gain = 1.0 works, sort of. If it's an old displacer type device and the specific gravity of the fluid is anything but 1 then the starting value of 1 is going to be too high. If the S.G. = 0.6 then about 60% is a good start. Too many times I've seen (and done it actually) where a level controller is tuned to hold an exact level. In the gas processing industry, that's not what you want to do. A little swing in the level with a fairly steady flow out is fine. The idea is to let the vessel take the surge (up or down) and to tune the level controller such that it shuts off at the appropriate low level point and has 100% output at the appropriate high level point, preferably below the LSHH (High level shutdown). I've seen quite a few plants go from unstable to stabilized just by tuning the level controls on various vessels correctly.



Initial Settings For PID Controllers.pdf

Share this post

Link to post
Share on other sites


Many many thanks, you helped me a lot. After playing with PID yesterday I understand a lot more. 

Share this post

Link to post
Share on other sites

You're very welcome. I finally got to practice what I preach today. They made me a mangler some years ago and basically ruined my life :doh::-2 but every now and then I get to have some fun and write a program or tune a controller. Today we tuned a still reflux accumulator level that was doing a great job at holding level but the flow out was a long period sine wave. Not good for process stability. During the process I was reminded of something that I planned to come here and share with you so I'm glad that you replied.

In the PIDE setup you get to choose the equation type, Dependent vs Independent. Either works but Choosing Dependent makes the Integral units minutes/repeat (minutes per repeat) and that, to me, is a much simpler term to tune with. They basically mean the same thing but thinking in terms of time vs 1/T (repeats per minute) is just more intuitive (again, to me).

I did some training today and when we switched our troublesome loop to Dependent it made more sense to the people involved.



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now