# ControlLogix PID tuning

## 10 posts in this topic

Can you please explain the ControlLogix PID with respect to tuning a loop?

To speed up the control response should KI be increased or decreased, and same question for KP?

Thanks.

##### Share on other sites

Ki - integral,  It depends on which equation type you use. If you choose Dependent, my preferred Equation Type, then units are Minutes per Repeat (min/repeat) and a larger number is slower (longer time between repeats). If you choose Independent then the units are 1/min (old school repeats per minute which is the inverse of minutes per repeat) and a larger number is faster (less time between repeats). Personally I prefer to think of integral as minutes not 1/minutes)

Kp - Gain. A larger number is faster. If you're used to the old school term of proportional band in %, where then a gain of 10 = 1/10 (the inverse of proportional band) or .10 = 10%. A gain of 1 = 1/2 = 1.00 = 100% proportional band

If you're tuning the old school way, choose Dependent, set Ki to 15 minutes (to get it out of the way). Set the gain at 2 (SWAG, set it where you want to), bump the process, observe the recovery. If all looks good but you want a faster response, try 4, bump, observe. If that's too fast, go 1/2 way back, in this example that would be 3, bump, observe. Once you see approximately 1/4 wave dampening then start to bring in Integral. May go from 15 to 7, bump, observe. Still too slow,  cut in half and test. Too fast, go back about 1/2 way (11). Ki interacts with Kp so you may find yourself tweaking the gain again.

##### Share on other sites

Super.

In determining which equation is used, I was and am unable to determine if it is using dependent or independent equation, so where could I find that parameter?

##### Share on other sites

Looks like I found it  ...it is the PE parameter, which in my case is set to 0 (independent)

.PE = 0

So that means that the smaller KP value and the smaller KI value work to speed up the controller response...correct?

Thanks.

Edited by gromit

##### Share on other sites

Depending on how they implemented the PID block (ladder or Function Block) you can click the ellipsis (...) in the upper corner of the block to open the menu. I've changed it on the fly before but it may be best not to do that.

##### Share on other sites

Michael, I'm not sure you saw my last reply ...as inserted below.
"Looks like I found it  ...it is the PE parameter, which in my case is set to 0 (independent)

.PE = 0

So that means that the smaller KP value and the smaller KI value work to speed up the controller response...correct?

Thanks."

Edited by gromit

##### Share on other sites

I did and correct. I think Independant is the default and I usually change it. There's no reason to change it if you don't mind the units

##### Share on other sites
On 2/27/2020 at 8:27 AM, Michael Lloyd said:

I did and correct. I think Independant is the default and I usually change it. There's no reason to change it if you don't mind the units

Michael,

Thanks for responding to my post; however, I am following up with you again to better convey my level of understanding and confusion associated with the PID instruction in a ControlLogix ladder diagram.

The PID routine is placed in a 1000 msec periodic task.

The PID equation type is INDEPENDENT, as confirmed by .PE = 0.

Since the PIDs use the independent equation…

…this means that KI is in repeats per minute rather than minutes per repeat…so the bigger the value the faster the integral  response…is this correct?

…so now I’m trying to understand KP…is it actually gain, or is it proportional band.

If it is gain then the larger number would give larger response for given error.

If it is proportional band then the larger number would give smaller response for given error.

The current tuning parameters are as follows.

PD[].KP and PD[].KI are the proportional and integral tuning parameters, currently set at 0.25 and 0.05 respectively.

Thanks

##### Share on other sites

The PID routine is placed in a 1000 msec periodic task.

Correct, you always want to call a loop with a periodic task. However, I've seen loops called every 10ms, and I think that's needlessly fast for most loops that I deal with. It eats up processor time but has no net benefit. I usually set the task at 250ms. 1s is slow. The time between calls affects how the loop parameters affect the output. There's a lot going on inside the equations that make up a PID loop. It calculates the rate of change between the PV and the SP for instance.

The PID equation type is INDEPENDENT, as confirmed by .PE = 0.

I don't see the .PE tag in list of loop tags. Mine says "PIC2001.DependIndepend" and the value for Dependant = 1. Are you sure that the program uses the PIDE loop? Scratch that, you never said it did and you are using the old PID loop. It works for most simple loops but I like the PIDE loop much more. To answer your question - Yes Independant is .PE = 0

…this means that KI is in repeats per minute rather than minutes per repeat…so the bigger the value the faster the integral  response…is this correct?

Correct.

PD[].KP and PD[].KI are the proportional and integral tuning parameters, currently set at 0.25 and 0.05 respectively.

Gain (Proportional) = 25% and Integral = .05 repeats per min, which is slow. In simplest terms the integral term is adding or subtracting (depends on if SP-PV is positive or negative) a very small value to/from the output every minute. That's not necessarily bad. All Integral is doing is "integrating" the SP/PV difference and trying to bring them together by increasing or decreasing the output. You can literally set Integral to a very, very small number and effectively turn it off, creating a straight proportional controller. A Proportional or Gain only controller is almost always going to operate with an offset between SP and PV.  On the other hand, you can set Integral too fast and end up with I being the dominating portion of the equation. Some loops need that (I'm told, never seen it). I think integral is one of the most abused settings vs derivative being the most hated :) I prefer to put the integral term "out of the way" (as in low repeats or high time depending on which equation you chose), tune Gain such that the loop exhibits 1/4 wave damping when disturbed and then start bringing in Integral until it destabilizes the loop, then slow Integral down until you see 1/4 wave damping (or some version of that).

Edited by Michael Lloyd

##### Share on other sites

Thanks for the clarification and additional details Michael.

So the takeaway for PID with the INDEPENDENT equation (.PE=0), is/are as follows...

1)  KI is in repeats per minute rather than minutes per repeat…so the bigger the value speeds up the controller response

2) KP is proportional band rather than gain...so the bigger value slows down the controller response.

1 person likes this