Chap 3
Chap 3
Chapter 23
23.1 Single Loop Controller
23.2 Proportional Action
23.3 Integral Action
23.4 Derivative Action
23.5 Bumpless Transfer
23.6 Derivative Feedback
23.7 Integral Windup
23.8 Worked Example
23.9 Other Analogue Forms of PID Controller
23.10 Discretised Form of PID
23.11 Incremental Form of PID
23.12 Mnemonics and Nomenclature
23.13 Summary of Control Actions
Proportional, integral and derivative (PID) control 23.1 Single Loop Controller
is often referred to as 3-term control. P action was
The 3-term controller, often referred to as a sin-
introduced in Chapter 22. It provides the basis for
PID control, any I and/or D action is always su- gle loop controller (SLC), is a standard sized unit
perimposed on the P action. This chapter is con- for panel mounting alongside recorders and other
cerned with the functionality of PID control and its control room displays and switches. Multiple SLCs
open and closed loop behaviour. An equation for are typically rack mounted. It is a single unit which
PID control is first developed in analogue form, as contains both the comparator and the controller
used in pneumatic and electronic controllers. This proper. Thus it has two input signals, the measured
is then translated into a discrete form for imple- value and the set point, and one output signal. It
mentation as an algorithm in a digital controller. would also have its own power and/or air supply.
The principles discussed in this chapter and The facia of a typical SLC is depicted in Fig-
the equations developed are essentially the same ure 23.1. Often referred to as a faceplate, it has a
whether the PID controller is a dedicated single scale for reading values of the measured value and
loop controller, a function provided within some set point. The range of the scale normally corre-
other control loop element such as a dp cell, or is sponds to the calibration of the measuring element,
a configurable function within a distributed con- or else is 0–100% by default. With pneumatic con-
trol system capable of supporting multiple loops trollers the signals would be indicated by pointers.
With electronic controllers liquid crystal displays
simultaneously.
(LCD) or light emitting diode (LED) bar displays
are used whereas with digital controllers a VDU
representation of the faceplate is common prac-
tice. Faceplates also show relevant alarm limits. A
156 23 PID Control
qR e
MV SP OP KC
+
150 100 –
q1
Equation 23.3. This is clearly a source of confu- a so-called over-damped response. The change in
sion: it is best to avoid using the term bandwidth set point causes a step increase in error and, be-
and to consistently work with gain. cause the controller is reverse acting, produces a
sudden closing of the valve. Thereafter the valve
125°C [0–100 %] slowly opens as the error reduces and the level
5 gently rises towards the new set point with a steady
+
– state offset.Increasing KC produces a faster asymp-
totic approach towards a smaller offset.
[100–150 °C]
However, there is some critical value beyond
which increasing KC causes the response to be-
Fig. 23.3 Temperature controller for explaining bandwidth come oscillatory, as depicted in the second trace.
In effect, the controller is so sensitive that it has
Note that outside the range of 115 < !1 < 135◦C over-compensated for the increase in set point by
the controller output is constrained by the limits closing the valve too much. This causes the level
of the output signal range. Thus !0 would be ei- to rise quickly and overshoot the set point. As the
ther 100% for all values of !1 < 115◦C or 0% for level crosses the set point the error becomes neg-
!1 > 135◦ C. When a signal is so constrained it is ative so the controller increases its output. The re-
said to be saturated. sultant valve opening is more than that required
In Chapter 22 the steady state response of a to compensate for the overshoot so the level falls
closed loop system was considered. In particular, below the set point. And so on. Provided the value
the way in which increasing KC reduces offset was of KC is not too high these oscillations decay away
analysed. Also of importance is an understanding fairly quickly and the under-damped response set-
of how varying KC affects the dynamic response. tles out with a reduced steady state offset. Increas-
It is convenient to consider this in relation to the ing KC further causes the response to become even
same level control system of Figure 22.1.The closed more oscillatory and, eventually, causes the system
loop response to step increases in set point hR and to become unstable.
inlet flowrate F1 are as shown in Figures 23.4 and A similar sort of analysis can be applied to Fig-
23.5, respectively. ure 23.5. The principal effects of P action are sum-
Two traces are shown on Figure 23.4. The expo- marised in Table 23.1 on page 163.
nential one corresponds to a low gain and depicts
t t
0 KC
Fig. 23.4 Closed loop response to step change in set point Fig. 23.5 Closed loop response to step change in inlet flow
158 23 PID Control
Dh
DhR
PID
P
PI
t
0
Fig. 23.7 Closed loop P, PI and PID response to a step change in set point
than for P action alone. The oscillations are larger the addition of a derivative term to Equation 23.4
in magnitude and have a lower frequency. In effect as follows:
the I action, which is working in the same direc- ! " t #
1 de
tion as the P action, accentuates any overshooting !0 = !B ± KC e + edt + TD (23.6)
that occurs. It is evident that I action has a desta- TR 0 dt
bilising effect which is obviously undesirable. The
TD is known as the rate time and characterises the
principal effects of I action are also summarised in
D action. Adjusting TD varies the amount of D ac-
Table 23.1.
tion, setting it to zero turns off the D action alto-
Equation 23.4 is the classical form of PI con-
gether. TD has the dimensions of time: for process
troller. This is historic, due to the feedback inher-
control purposes it is normal for TD to have units
ent in the design of pneumatic and electronic con-
of minutes.
trollers. Note the interaction between the P and I
The open loop response of a PID controller to a
terms: varying KC affects the amount of integral
sawtooth change in error is depicted in Figure 23.8.
action because KC lies outside the bracket. An al-
Again assume that the controller is forward acting,
ternative non-interacting form is as follows:
is in its AUTO mode and has a 4–20-mA output
range. Suppose that the error is zero for t < 0 and
! " #
1 t for t > t# , and that the error is a ramp of slope m
!0 = !B ± KC e + edt (23.5) for 0 < t < t# .
TI 0
Substituting e = mt into Equation 23.6 gives:
TI is known as the integral time. It can be seen by KC mt2
inspection that TI = TR /KC . !0 = !B + KC mt + + K C TD m
TR 2
The response shows an initial step change in out-
put of magnitude KC TD m due to the D action. This
23.4 Derivative Action is followed by a quadratic which is due to the P
The purpose of D action is to stabilise and speed up and I actions. At t = t# there is another step change
the response of a PI controller. This is realised by as the contribution to the output of the P and D
160 23 PID Control
e slope m Dh PID
e’
Dh r
t
0 t
0
q0 e
20
t
K C m t’ + K C TD m 0
t
K C TD m Ú0 e dt
qB
K C . mt’2
4 TR 2
t
t 0
0 t’
de
dt
Fig. 23.8 Open loop response of PID controller to a sawtooth t
change in error 0
plant can suffer damage from sudden changes. For 23.6 Derivative Feedback
example, suddenly turning off the flow of cooling
water to a jacket may cause a vessel’s glass linings Another source of step change in error occurs
to crack. Suddenly applying a vacuum to a packed when the controller is in its AUTO mode and the set
column will cause flashing which leads to the pack- point is suddenly changed.Of particular concern is
ings breaking up. Such sudden changes in output the D action which will initially respond to a large
value of de/dt and may cause the output to jump
are invariably caused by the controller being forced
to respond to step changes in error. to saturation. To counter this derivative feedback
One source of step change in error occurs when may be specified, as follows:
! " t #
a controller is transferred from its MAN mode of 1 d!1
operation into AUTO. If the measured value is not !0 = !B ± KC e + e.dt − TD (23.7)
TR 0 dt
at its set point, depending on the settings, the con-
Note that the D action responds to changes in the
troller output may well jump to saturation. A sim-
measured value rather than to the error. Also note
ple way round this problem is to adjust the output
the minus sign which allows for the fact that the
in MAN mode until the measured value and set
measured value moves in the opposite direction to
point coincide prior to switching into AUTO.
the error signal. Whilst the set point is constant
Alternatively,a bumpless transfer function may
the controller behaves in exactly the same way as
be specified. In effect, on transfer into its AUTO
the classical controller of Equation 23.6. However,
mode, the set point is adjusted to coincide with
when the set point changes, only the P & I actions
the measured value and hence zero error. This re-
respond. This form of 3-term control is common
sults in the controller being started off in AUTO
in modern digital controllers.
mode with the wrong set point, but that may then
be ramped up or down to its correct value at an ap-
propriate rate. The integral action is also initialised
by setting it to zero and whatever was the output
signal in MAN mode at the time of transfer nor-
23.7 Integral Windup
mally becomes the value of the bias in AUTO. Another commonly encountered problem is in-
Thus, tegral windup. If the controller output saturates
whilst an error exists, the I action will continue to
!R = !1 |t=0 integrate the error and, potentially, can become a
"0 very large quantity. When eventually the error re-
e.dt = 0 duces to zero, the controller output should be able
−∞ to respond to the new situation. However, it will be
!B = !0 |t=0 unable to do so until the error has changed sign
and existed long enough for the effect of the inte-
Set point tracking is an alternative means of re- gration prior to the change of sign to be cancelled
alising bumpless transfer. Thus, whilst the con- out. The output remains saturated throughout this
troller is in MAN mode, the set point is continu- period and the controller is effectively inoperative.
ously adjusted to whatever is the value of the mea- A simple way round this problem is to switch the
sured value. This means that when the controller is controller into its MAN mode when the saturation
switched into AUTO mode, there is zero error and occurs. Switching it back into AUTO when the sit-
transfer is bumpless. Again, the integral action is uation permits causes the I action to be initialised
initialised by setting it to zero. at zero.
For transfers from AUTO into MAN mode the A more satisfactory way of addressing the is-
output is normally frozen at whatever was its value sue is to specify an integral desaturation facility. In
in AUTO at the time of transfer. effect, whilst saturation of the output occurs, the I
162 23 PID Control
action is suspended. This may be achieved by the i.e. when t ≈ 15.4 min. Note that this must be an
I action considering the error to be zero during open loop test: the input signal is ramping down at
saturation. Alternatively, in digital controllers, the a constant rate and appears to be independent of
instructions used for calculating the I action may the controller output.
be by-passed during periods of saturation, as illus-
trated later on.
23.9 Other Analogue Forms
of PID Controller
23.8 Worked Example Equation 23.6 is the classical form of PID controller
and Equation 23.7 is the most common form used
A classical 3-term controller which is forward act- in digital controllers. There are, however, many
ing has the following settings: variations on the theme which are supported by
40% bandwidth, 5 min reset time, 1 min rate time. most modern controllers. For example, to make
the controller more sensitive to large errors the P
Also it is known that an output of 10 mA in MAN- action may operate on the square of the error:
UAL is required for bumpless transfer to AUTO.
! " #
This information is sufficient to deduce the pa- 2 1 t d!1
!0 = !B ± KC Sign(e).e + e.dt − TD
rameters of Equation 23.6: TR 0 dt
! " #
1 t de To make the controller penalise errors that persist
!0 = 10 + 2.5 e + e.dt +
5 0 dt the I action may be time weighted, with some fa-
Suppose the controller is at steady state in AUTO cility for reinitialising the I action:
when the measured value starts to decrease at the ! " t #
1 d!1
rate of 0.1 mA/min. !0 = !B ± KC e + e.t.dt − TD
TR 0 dt
Thus, if t < 0 then e = 0 and !0 = 10 mA, and
if t ≥ 0 then: It is important to be aware of exactly what form
d!1 of 3-term control has been specified and what is
= −0.1.
dt being implemented.
However,e = !R −!1 .Assuming !R is constant then:
de
=−
d!1
= +0.1, 23.10 Discretised Form of PID
dt dt
Equation 23.7 is an analogue form of PID control
whence e = +0.1 t.
and has to be translated into a discretised form for
Substituting for e into the PID equation gives:
implementation in a digital controller. It may be
! " #
1 t d(0.1 t) discretised as follows:
!0 = 10 + 2.5 0.1 t + (0.1 t) dt +
5 0 dt j ' (
1 & !1,j − !1,j−1
!0,j ≈ !B ± KC ej + T ek ."t − TD
= 10.25 + 0.25 t + 0.025 t2 R
k=1
"t
j
Inspection reveals a small jump in output at t = 0 of = !B ± KC .ej + KC ."t
&
ek −
KC .TD ' (
!1,j − !1,j−1
0.25 mA followed by a quadratic increase in output TR
k=1
"t
with time. The controller output saturates when it &j
' (
reaches 20 mA, i.e. when: = !B ± KC .ej + KI. ek − KD . !1,j − !1,j−1 (23.8)
k=1
Chapter 24
24.1 Stability
24.2 Marginal Stability
24.3 Continuous Cycling Method
24.4 Reaction Curve Method
The sort of closed loop response that can be ob- tion can seldom be justified. There is therefore a
tained from a PID controller with appropriate set- need for a practical approach.
tings was seen in Chapter 23. This gives rise to two This chapter outlines two practical methodolo-
issues. First, what is the best sort of response? This gies; one is empirically based and the other theo-
is normally characterised in terms of the response retical, for establishing the so called optimum set-
to a step input, the ideal being a fast response with tings. An informed account of these methods is
no overshoot or offset. This is not physically pos- given by Coughanowr (1991) and a comprehensive
sible because of a plant’s dynamics. There is there- coverage of both these and many other methods of
fore a need to compromise between the speed of tuning is given by Astrom (1995). However, first, an
response and the amount of overshoot. For certain insight into the nature of stability is required.
critical applications an overdamped response with
no overshoot is essential, the penalty being a slow
response. However, for most purposes, an under-
damped response with a decay ratio of 1/4 and no
24.1 Stability
offset is good enough, as depicted in Figure 24.1. Stability is a fundamental consideration in the de-
Often referred to as the optimal response, this has sign of control systems. Many open loop systems
no mathematical justification: it is just accepted are stable. For example, the level control system of
good practice. Figure 22.1 is open loop stable. Suppose the con-
Second, what are the appropriate settings and troller is in its manual mode and the valve opening
how do you find them? The process of finding the is fixed at its normal value. Following a step in-
optimum settings is generally referred to as loop crease in inlet flow, the level will rise until a new
tuning. They may be found by trial and error. How- equilibrium is established at which there is suffi-
ever, given that each of the settings for KC , TR and cient head for the flow out to balance the flow in.
TD can typically be varied from 0.01 to 100,and that Such a system is said to be self regulating and is
the various lags and delays associated with process relatively easy to control. However, with inappro-
plant are often large, this could be rather tedious. priate controller settings, a system which is open
The settings may be predicted theoretically. How- loop stable can become closed loop unstable.
ever, this requires a model of the system that is Some systems are open loop unstable. The clas-
reasonably accurate, and any realistic model usu- sic example of an item of plant that is inherently
ally needs simulation to provide the settings. The unstable is the exothermic reactor.A slight increase
cost and time involved in modelling and simula- in temperature will make the reaction go faster.
166 24 Controller Tuning
y
Decayratio = x
x y
x
y
q0 3 1 3 << 0
Exponential
0 t
Oscillatory
This produces more heat which increases the tem- ure 24.2.An important point to appreciate is that it
perature further, and so on. However, by applying is the system that is stable or otherwise, not its sig-
feedback, such an open loop unstable system can nals. Also, stability is a function of the system as a
be made closed loop stable. whole, not just of some parts of it. It follows that all
From a control engineering point of view, sta- the signals of a system must be of the same form.
bility manifests itself in the form of a system’s It is not possible, for example, for the controller
signals. These may be categorised, depending on output of the level control system of Figure 22.1 to
whether the system is stable or unstable, as be- be stable but for the level to be unstable. Similarly,
ing exponential or oscillatory as depicted in Fig- it is not possible for the response of the level to
24.2 Marginal Stability 167
Open loop gain = 1.0 nals. The procedure for carrying out the method is
Open loop phase shift = −180◦ shown in flow chart form in Figure 24.5.
In essence the process consists of changing the
These are known as the Bode stability criteria and controller’s gain KC incrementally and observing
will be considered in more detail in Chapter 73. the loop’s response to small step changes in set
point. If the oscillations decay then KC is too low
and if the oscillations grow then KC is too high.
24.3 Continuous Cycling The value of the marginal gain KCM that forces the
loop into self sustained oscillation of constant am-
Method plitude is noted. So too is the period PU of that
The continuous cycling method is a simple practi- oscillation, sometimes referred to as the ultimate
cal method that tunes a control loop as installed, period. The critical frequency is given by
rather than as designed. The method is carried out
at the controller, in its automatic mode, and takes 2$
!C =
advantage of the faceplate for observing the sig- PU
Reduce KC
Knowing the values of KCM and !C , the optimum output. This may saturate at either the top and/or
settings can be determined from the Zeigler and the bottom of its range, resulting in the valve open-
Nichols formulae given in Table 24.2. ing being more square than sinusoidal in form.The
process will filter out this squareness resulting in a
Table 24.2 The Zeigler and Nichols formulae measured value that may appear to be sinusoidal.
KC TR TD
Reducing the controller gain should stop the satu-
ration and prevent limit cycles from occurring.
P KCM /2.0 – – The optimum settings for a control loop will
PI KCM /2.2 PU /1.2 – vary across the range of its measured value if there
PID KCM /1.7 PU /2.0 PU /8.0 are any non-linearities present. It follows that a
loop must be tuned for its normal operating con-
The amplitude of the oscillations under conditions ditions. The oscillations should therefore be estab-
of marginal stability is a function of the system lished about the normal value of each signal. In
and cannot be controlled. Therefore, before carry- particular, the normal set point should be used,
ing out the continuous cycling method on a plant, and the step changes applied in alternate direc-
it should be established whether it is acceptable to tions about it to ensure that the system stays close
do so. Whilst it may well be acceptable to force the to normal.
plant into oscillation during commissioning or pe- The nature of the Zeigler and Nichols formulae
riods of shut-down, approval to do so is unlikely to needs some explanation. First published in 1941,
be forthcoming during production! they are used extensively in industry and have
Care should be taken to protect the system from stood the test of time. The formulae are empirical,
external disturbances whilst the tests are being car- although they do have a rational theoretical expla-
ried out so as not to distort the results. The most nation. They predict settings that are optimum on
common source of disturbance is due to changes in the basis of a decay ratio of 1/4. However, because
the supply pressure of utilities such as steam and the formulae are empirical, they do not predict the
cooling water. Also, the control loop being tuned optimum settings precisely, and further tuning of a
may interact with other loops as, for example, in trial and error nature may be required. This might
cascade control. In such cases it is usually neces- not seem to be very satisfactory but, noting that
sary to put the other loops into their manual mode each of the settings typically has a range of 0.01
to prevent them from trying to compensate for the to 100, i.e. a rangeability of some 104 , a method
oscillations in the loop being tuned. that predicts settings to within even 50% of the
Whether the controller has P, P&I or P, I&D ac- optimum as a first estimate is extremely useful. In
tions, the continuous cycling method must be car- practice the predictions are often to within 10% of
ried out with the controller set for P action only. the optimum.
The I and D actions are switched off by setting
TR = max and TD = min respectively. Once the
procedure has been completed, the optimum set-
tings for the P, I and D actions can then be set as
appropriate.
24.4 Reaction Curve Method
It is important to establish oscillations of con- Whereas forcing a plant into oscillation with no
stant amplitude that are sinusoidal. These can eas- control over amplitude may be unacceptable,intro-
ily be confused with limit cycles which are of con- ducing a small step change of known size, which is
stant amplitude but non-sinusoidal. Limit cycles the basis of the reaction curve method of predict-
occur when a system is in oscillation and at least ing optimum settings, is another matter altogether.
one signal is saturated. The most likely signal to This is an open loop method of controller tun-
saturate,and the easiest to observe,is the controller ing and is depicted in Figure 24.6. With the con-
170 24 Controller Tuning
+
+
KC Valve Process
+
–
Measure’t
qM
Recorder
troller in its manual mode, the output is adjusted Second, by drawing a tangent to the reaction curve
to its normal value and the system allowed to reach at the point of inflexion,and finding its intersection
equilibrium. Then a small step change of known with the asymptote and the time axis as shown, the
magnitude A is applied to the controller output. values of T and L are found. Knowing the values
The system is allowed to respond and the mea- of K, T and L, the optimum settings can be deter-
sured value recorded for an appropriate period, as mined from the Cohen and Coon formulae given
shown in deviation form in Figure 24.7. in Table 24.3.
These formulae are theoretically derived on the
DqM assumption that the plant consists solely of a gain
K, time constant T and time delay L. They predict
B settings that are optimum on the basis of a decay
ratio of 1/4.
There are a number of important precautions.
Care should be taken to protect the system from
t
external disturbances whilst the tests are being car-
0 L L+T ried out so as not to distort the results.The reaction
curve method is much more susceptible to distor-
Fig. 24.7 Characteristic "S-shaped" reaction curve tion by disturbances than the continuous cycling
method. The step input A applied should be small
The reaction curve shown, often referred to as be- enough for the response to stay within the bounds
ing “S shaped” for some unknown reason, is char- of linearity. The response of the recording system
acteristic of most process control systems. Indeed, must be fast enough not to distort the reaction
as will be seen in Chapter 72 in relation to higher curve. It is normal to apply the step change at the
order systems, many systems can be approximated controller output. However, it may be applied any-
by a combination of a steady state gain K, a first- where in the loop, provided that the reaction curve
order system with a time constant of T min and a is the open loop response of all the elements of the
time delay of L min. The values of K, T and L can loop. If the controller is included then it must have
be estimated from the reaction curve. no effect, i.e. set KC = 1, TR = max and TD = min.
First, the steady state asymptote B of #M is es- There are two major problems in using the re-
tablished. Since B is simply the steady state effect action curve method. First, it is often difficult to
of the open loop elements operating on the step insulate the plant from disturbances long enough
A, the gain can be obtained from the ratio K=B/A. to obtain a true reaction curve. And second, given
24.4 Reaction Curve Method 171
the constraints on linearity, it is difficult to obtain confidence the value of the asymptote B and the
a large enough change in output to predict with position of the point of inflexion.