The beauty of the proportional, integral, derivative (PID) algorithm for feedback control is its simplicity. The controller need only compute the current error between the measured process variable and the desired setpoint, then calculate how much and how fast that difference has been changing over time. The controller then can combine the resulting proportional, integral, and derivative terms to generate a suitable control effort.
The trick is in deciding how to best combine those three terms or modes to achieve the most efficient regulation of the process variable. The most obvious way is to use a simple weighted sum where each term is multiplied by a tuning constant or gain, and the results then are added together (see Figure 1). The relative contributions of each term then can be adjusted by choosing appropriate values for the proportional gain (P), integral gain (I) and derivative gain (D).
But that's not how most PID controllers actually work in industrial applications. Commercial PID controllers do compute the error signal, its integral, and its derivative, but they typically combine those three quantities using a slightly rearranged formula with a different set of tuning parameters: controller gain (Kp), integral time (Ti), and derivative time (Td), as shown in Figure 2.
Advantages of the standard algorithm
The weighting factors for the proportional, integral, and derivative terms in the standard PID algorithm are Kp, Kp/Ti, and Kp x Td, respectively. That may seem complicated unnecessarily, but there is a method to that madness. Configuring Kp to affect all three terms equally gives the control engineer a single knob to turn to make the overall controller more aggressive or more conservative.
Furthermore, the format of the standard PID algorithm gives physical significance to Ti and Td that can be illustrated best by a conceptual experiment. Imagine opening the feedback loop, resetting the controller to a zero output, and inputting a constant error into the controller. The output of the proportional term (the proportional action) immediately will assume a constant value while the output of the integral term (the integral action) will start ramping up from zero. The magnitude of the integral action will catch up to the proportional action in exactly Ti seconds.
The integral time therefore describes the relative strengths of the proportional and integral actions in terms of the time each requires to achieve the same contribution to the overall control effort. A relatively weak integral action corresponds to a longer value of Ti and vice-versa. Similarly, a relatively weak derivative action corresponds to a longer value of Td and vice-versa (though the conceptual experiment that demonstrates this correlation involves inputting a ramp into the offline controller rather than a constant error.)
Potential for confusion
Fortunately, it's easy enough to compare the theoretical and standard PID algorithms and relate P, I, and D to Kp, Ti, and Td as follows:
P = Kp
I = Kp / Ti
D = Kp x Td
The proportional gain P is the same as the controller gain Kp, so a control engineer unaware of the difference between the theoretical and standard PID algorithms might also assume that "integral gain" is synonymous with "integral time," and "derivative gain" is synonymous with "derivative time." Unfortunately, that mistake makes tuning the loop virtually impossible.
Suppose, for example, that an inexperienced control engineer has determined that a particular feedback loop requires a theoretical controller with a proportional gain of 3, an integral gain of 2, and a derivative gain of 1. Entering those three values into a standard commercial controller under the headings of controller gain, integral time, and derivative time would be akin to setting:
P = 3
I = 3/2 = 1.5
D = 3 x 1 = 3
The controller would end up with the desired degree of proportional action but 25% less integral action (with a gain of 1.5 rather than 2) and three times as much derivative action as the engineer had intended.
Which is which?
A third PID algorithm adds to the confusion. Some commercial controllers use the series or serial form as shown in Figure 3. A control engineer trying to tune three controllers in otherwise identical loops will get different results if one controller happens to use the theoretical algorithm, the second uses the standard algorithm, and the third uses the series algorithm.
Worse still, both the theoretical and standard algorithms sometimes are described as the ideal algorithm, even though they're different. Consequently, some techniques for tuning ideal controllers won't work on some ideal controllers.
On the other hand, the phrases parallel, ideal parallel, and independent seem to refer exclusively to the theoretical algorithm in which the proportional, integral, and derivative terms operate independently and in parallel rather than in series. Ironically, the three terms in the standard algorithm also operate in parallel, but standard and parallel are almost never used synonymously.
The tuning parameters themselves also have different labels depending on who's describing them. When PID controllers were first developed, the derivative term was known as the pre-act mode because it seemed to act preemptively, accelerating the controller's corrective efforts beyond what the proportional term could manage on its own. Early control engineers increased or decreased the degree of preemptive (derivative) action by selecting a larger or smaller pre-act time. Today's PID vendors typically describe a controller's derivative action as its rate.
Integral action was known originally as automatic reset because the integral term seemed to automatically adjust the setpoint to the exact value required to eliminate the steady-state offset caused by the proportional term (see "The Three Faces of PID," Control Engineering, March 2007). Some control engineers still specify the reset time when tuning a controller's integral term, but a higher reset time corresponds to less integral action, not more.
Alternately, the degree of integral action is sometimes specified in terms of the reset rate, which is the inverse of the reset time and entirely unrelated to the derivative rate. Confusing "reset" and "reset rate" leads to increased integral action when the control engineer wants less, and vice-versa.
Likewise, the proportional gain in some PID controllers is specified in terms of its inverse known as the proportional band. More precisely, the proportional band is 100 divided by the proportional gain so that it represents the percent change in the error signal necessary to cause a full-scale change in the proportional action. Confusing "proportional band" with "proportional gain" leads to decreased proportional action when the control engineer wants more, and vice-versa.
Compounding the confusion are the various ad hoc enhancements that have been developed over the years to improve a PID controller's performance (see "Fixing PID," Control Engineering, November 2012, May 2014, December 2015).
Fortunately, all these fixes work no matter which PID algorithm a particular controller uses, and most are available at least as options on most commercial controllers. On the other hand, it's not always obvious which options have been selected for a particular controller that is already in operation.
For example, the process variable signal often is filtered before it enters the PID calculation so as to remove measurement noise that would otherwise cause the control effort to fluctuate unnecessarily (see "The Basics of Numerical Filtering," Control Engineering, October 2008).
Unfortunately, filtering the process variable also tends to make the controller look sluggish. A control engineer, unaware that a filter is in place, might try to make the controller more responsive by turning up the controller's gains. The desired closed-loop performance might be achievable, but the filter and the PID algorithm will end up working against each other.
With so many variations on the PID algorithm in use today, the first step when retuning or otherwise modifying an existing controller has to be determining exactly which kind of PID controller it is.
- See other articles from the supplement below.