# PID spotlight, part 2: Know these 13 terms, interactions

## Learning proportional-integral-derivative (PID) controller tuning begins with the basics: Definition of terms, the PID equation (multiple forms) and seeing how each of the PID terms functions independently from each other and separated from a process.

March 12, 2024
Courtesy: Ed Bullerdiek, process control engineer, retired

#### Learning Objectives

• Understand proportional-integral-derivative (PID) controller terms and definitions.
• Learn PID controller equation classical and parallel forms.
• See PID examples of how gain, integral, and derivative function independently and separate from a process. In short, what do they do?

## PID controller basics insights

• Gain responds proportionally to error; it responds to how the process is currently acting.
• Integral continues to respond to error as long as the error persists; it responds to how the process has acted in the immediate past.
• Derivative responds to the slope of the process variable; it attempts to guess where the process is going.
• Proper PID controller tuning requires blending Gain, Integral and (sometimes) Derivative together to get the response you need. This is a blend of responding to the present, past and, if appropriate, the best guess of the future.

With this proportional-integral-derivative (PID) controller refresher course, getting on the same page with PID definitions is important.

## PID: 10 critical definitions

Controller basics:

• ### Output (OP) – The knob used to affect the process variable, commonly a valve position, much less frequently, a motor speed.

Controller modes:

• ### Cascade – The control logic is turned on and the setpoint comes from another controller.

Proportional-integral-derivative (PID) controller terms:

• ### d(Error)/dt

Note 1: Not to be confused with Process Gain.

Note 2: Most control systems PID controllers use % of range internally, however, some control systems work in engineering units. Consult the manual before tuning a controller you are not familiar with.

Note 3: Derivative on change in PV is preferred and will be assumed in these articles. Derivative on Error is available and is often the default. Avoid it as it will produce large OP spikes on SP changes.

## Advice for a prospective loop tuner

Read the manual before tuning a controller on any system you have not used before. Better yet, set up a simulated loop and test all the PID controller settings.

Three common implementations of the PID algorithm are classical, parallel and series. The most common is classical, followed by parallel and the least common is series. Each control system has its own implementation of its chosen PID algorithm, and some allow you to select among multiple algorithms. Each system also has its own implementation quirks.

I have worked on multiple systems using the Classical and Parallel PID algorithms. Each system was a little different, and each new system made me feel a little stupid all over again. (Note: If you are on a new system, the PID controller is acting strange, and you feel a little confused; don’t worry, it’s happened to everybody.)

These articles focus on the classical PID algorithm because it is far more common and is the algorithm generally referenced in textbooks, articles and tuning guides. I will use and reference the parallel algorithm occasionally to illustrate important points.

## Proportional, integral and derivative contributions:

To develop a feel for how a PID controller works, you need to have a feel for how each element of the PID controller contributes to the controller response.

The Classical PID control algorithm is:

OP = K *(Error + 1/Ti * ∫Error + Td * d(PV)/dt) + OP(t=0)

Where:

K = Controller Gain (ΔOP/ ΔError %/%)

Ti = Integral (Minutes/Repeat)

Td = Derivative (Minutes)

OP(t=0) = Controller output when the controller first gets placed in Auto. (Some call this a bias.)

One thing that can confuse people when tuning a classical PID algorithm is a bigger gain = faster control response, a bigger derivative = faster control response, but a bigger Integral = slower control response.

Following is a discussion of how proportional, integral, and derivative contribute to the overall controller response. These are for a PID controller that is disconnected from the process. Types of processes are discussed in the next article. After that we will connect the PID controller to the different types of processes to see how it all works together.

## Gain (proportional) contribution in PID control

Figure 1 illustrates how the Gain element of a PID controller works.

Figure 1: The response of controller Gain to changes in SP and PV (Gain = 1), showing how the Gain element of a PID controller works. Courtesy: Ed Bullerdiek, process control engineer, retired

Gain is also called Proportional because it moves in proportion to the error between the SP (orange in the figure) and PV (blue). In this controller the Gain is 1.0 (and Integral and Derivative are turned off), which means that the OP (gray) of the controller will move in a 1:1 proportion to the change in the error between the SP and the PV (as seen in Figure 1). The Gain contribution (gold) moves up 10% when the SP is moved up 10% @ the 1-minute mark. Since the Integral and Derivative are turned off the Gain is the only action moving the controller OP, therefore the OP also moves 10% up from 70 to 80%.

When the PV moves up 5% at the 5-minute mark, the error dropped to 5%, the Gain contribution, and thus the OP, also dropped 5% (the OP dropping from 80 to 75%).

Finally, when the SP is dropped 10% at the 10-minute mark the error dropped to -5%, and the Gain contribution dropped 10% to -5%, and the OP dropped 10% from 75 to 65%.

If we change the gain of the controller to 0.5, we will see the OP of the controller move in a 0.5:1 proportion to the error (Figure 2).

Figure 2, Commented Gain: The response of a lower controller Gain to changes in SP and PV (Gain = 0.5) is shown. Courtesy: Ed Bullerdiek, process control engineer, retired

Relative to Figure 1 we see that the Gain contribution (gold) moves up 5% when the SP is moved up 10% @ the 1-minute mark, reflecting the new gain of 0.5. As expected, the OP moves 5% up from 70 to 75%. When the PV moves up 5% at the 5-minute mark, the error dropped to 5%, the Gain contribution, and thus the OP, dropped 2.5% (the OP dropping from 75 to 72.5%). Finally, when the SP is dropped 10% at the 10-minute mark the error dropped to -5%, and the Gain contribution dropped 5% to -2.5%, and the OP dropped 5% from 72.5 to 67.5%.

Each change was proportional to the change in the controller error.

Another thing to realize about Gain is it is only concerned with the present. It knows nothing of the past and makes no predictions about the future.

## Integral (Reset) contribution in PID control

Figure 3 illustrates how the Integral element of a PID controller works. This uses the Parallel PID equation to separate the Integral contribution from Gain.

Figure 3, Commented Integral Parallel: The response of controller Integral to a change in SP (Parallel algorithm, Integral = 1 Minute/Repeat) is shown. Courtesy: Ed Bullerdiek, process control engineer, retired

Integral works by adding up the error between the SP and the PV over time (it “integrates” the error). Integral keeps working and moving the controller OP until the error drops to zero. It is also called “Reset” because it resets the controller OP to eliminate error, which Gain cannot do.

In Figure 3, the SP is moved 10% up at 1 minute. As soon as the Integral part of the controller sees the error it starts ramping and continues to ramp until the SP is dropped back to 50% at the 3-minute mark. If the SP hadn’t been dropped the Integral would have continued to ramp forever (this is called windup).

Another thing to realize about Integral is it is only concerned with the past. It is indifferent to the present and makes no predictions about the future.

## What are “Repeats” exactly in PID? Classical PID Repeats

When we talk about Integral, we give the units as minutes per repeat. One of the things I am going to talk about incessantly in this series is developing an intuitive feel for how the PID algorithm works. One of the questions we need to answer is “what is a Repeat?”

In the Classical PID algorithm minutes/repeat means it takes X minutes to repeat the gain action (Figure 4).

Figure 4, Commented Integral Classical: Explanation of “repeats” for a Classical PID algorithm (Gain = 1, Integral = 1 Minute/Repeat). Courtesy: Ed Bullerdiek, process control engineer, retired

In Figure 4 when the SP is changed 10% at the 1-minute mark, we can see that the Gain contribution (and the OP) jumps 10%, tracking the 10% error. The Integral, because it is set to 1-minute/repeat, then repeats that same 10% change once every minute. Note that the controller OP is the sum of the Gain and Integral contributions; they work together to drive the OP.

To provide more explanation, Figures 5 and 6 display:

• ### Figure 6: Changing the Integral to 2 minutes/repeat

Figure 5 shows that when the Gain is changed the effective Integral action is also changed (the ratio between Gain and Integral is locked). You should expect this based on the form of the PID equation, but it is easy to forget. From a practical standpoint if you were to (for example) reduce Gain, you may find that you have to increase Integral to restore proper control action (the ratio between the two needed to be changed).

Figure 5: Explanation of “repeats” for a Classical PID algorithm at lower Gain (Gain = 0.5, Integral = 1 Minute/Repeat). Courtesy: Ed Bullerdiek, process control engineer, retired

Figure 6 shows that for Integral bigger is slower.

Figure 6, for integral, bigger is slower: Explanation of “repeats” for a Classical PID algorithm at slower Integral (Gain = 1, Integral = 2 Minute/Repeat). Courtesy: Ed Bullerdiek, process control engineer, retired

## Parallel PID repeats

The Parallel PID control algorithm is:

OP = K *Error + Ti * ∫Error + Td * d(PV)/dt + OP(t=0)

Where:

K = Controller Gain (Δ OP/ Δ Error %/%)

Ti = Integral (Repeats/Minute)

Td = Derivative (Minutes)

OP(t=0) = Controller Output when the controller first gets placed in Auto. (Some call this a bias.)

## Small change, large effect on Parallel PID algorithm

All that has really changed is we’ve removed the parenthesis that group the error, Integral, and Derivative terms for multiplication by Gain. This seems like a small change, but it has a profound effect on how the Parallel PID algorithm functions and is tuned relative to the Classical PID algorithm.

Unlike the Classical algorithm the Parallel PID algorithm features a bigger Gain = faster control response, a bigger Derivative = faster control response and a bigger Integral = faster control response.

Because Integral is not tied to Gain and the units are reversed, we need to think about Integral differently. In a Parallel PID controller Integral action is repeating a fraction of the Error every minute.

Figure 7: Explanation of “repeats” for a Parallel PID algorithm (Integral = 1 Repeat/Minute). Courtesy: Ed Bullerdiek, process control engineer, retired

In Figure 7 an Integral of 1 is repeating the error from a 10% SP change every minute.

To repeat for emphasis, Figures 8 and 9 display:

• ### Figure 9: Changing the Integral to 0.25 repeats/minute

Figure 8 shows that when the SP change is halved the Integral action is also halved.

Figure 8: Explanation of “repeats” for a Parallel PID algorithm with a smaller SP change (Integral = 1 Repeat/Minute). Courtesy: Ed Bullerdiek, process control engineer, retired

Figure 9 shows that for Integral smaller is slower (and by extension bigger is faster).

Figure 9: Explanation of “repeats” for a Parallel PID algorithm at slower Integral (Integral = 0.25 Repeat/Minute). Courtesy: Ed Bullerdiek, process control engineer, retired

Unlike the Classical PID algorithm changing Gain does not affect Integral (there is no relationship between Gain and Integral). The problem you can experience here is when you lower Gain you may end up with a controller that has too much Integral for the provided Gain (a mismatch between Gain and Integral can promote instability).

People who switch from a system that uses one algorithm to the other often find that they lose their intuitive feel for how a change in tuning constants should behave. This is expected (and I certainly experienced this.)

## Derivative (Pre-act) contribution in PID control

Figure 10: The response of controller Derivative to SP and PV changes (Parallel algorithm, Derivative = 1 Minute). Courtesy: Ed Bullerdiek, process control engineer, retired

Derivative is also sometimes referred to as “Pre-act” because, by looking at the slope of the PV curve it gives a look ahead at what the process is doing. In Figure 10 Derivative does not respond to the SP change at 1 minute; Derivative is looking only at changes in the PV. Shortly after the 5-minute mark a disturbance comes through; the Derivative responds to the inverse of the slope of the PV, jumping up to about 13% at the steepest part of the PV slope.

Derivative is trying to guess the future. It is indifferent to the past or the present.

## Putting it all together: Gain, Integral and Derivative in PID control

Figure 11: A tuned PID controller showing how Gain, Integral, and Derivative work together to keep the PV on SP after a SP change and process disturbance. Courtesy: Ed Bullerdiek, process control engineer, retired

In Figure 11 we can see Gain, Integral and Derivative working together to keep a self-limiting process on SP through a SP change and a process disturbance; the OP is the sum of the Gain, Integral and Derivative contributions. I will discuss this in much more detail when we talk about tuning self-limiting processes, but it doesn’t hurt to take a little look ahead. The key takeaway here is that good loop tuning requires blending Gain, Integral, and (sometimes) Derivative together to get the response you need. Understanding how each works individually and also how they complement each other is key to the control practitioners art. And no, two out of three is not good enough.

Ed Bullerdiek is a retired control engineer with 37 years of process control experience in petroleum refining and oil production; Edited by Mark T. Hoske, content manager, Control Engineering, CFE Media and Technology, mhoske@cfemedia.com.

KEYWORDS: Proportional-integral-derivative, PID tutorial

CONSIDER THIS

Do you understand how a PID controller works?

ONLINE

PID series from Ed Bullerdiek, retired control engineer

Part 1: Three reasons to tune control loops: Safety, profit, energy efficiency

https://www.controleng.com/articles/three-reasons-to-tune-control-loops-safety-profit-energy-efficiency/