You are on page 1of 46

Process

Control
10. Digital Process Control
Laboratory

10.1 Basic principle of digital control


10.2 Digital PID controllers
10.2.1 A 2DOF continuous-time PID controller
10.2.2 Discretisation of PID controllers
10.2.3 Implementation and tuning
10.3 Sampling of time-delay models
10.3.1 State-space model with a time delay
10.3.2 Second-order model with real poles and zero
10.3.3 First-order model
10.4 Controller synthesis using discrete-time model
10.4.1 PID controller
10.4.2 Time-delay compensation
10.4.3 Dead-beat control
10.4.4 Improving intersample behaviour
10.5 Example: comparison of various controllers
KEH Process Dynamics and Control 10–1
10. Digital Process Control

Process
Control
10.1 Basic principle of digital control
Laboratory
The block “Sample” receives
the continuous-time signals
𝑦𝑦(𝑡𝑡) and 𝑟𝑟(𝑡𝑡), and discre-
tises them to sequences of
numbers, 𝑦𝑦(𝑡𝑡𝑖𝑖 ) and 𝑟𝑟(𝑡𝑡𝑖𝑖 ),
defined at the time instants
𝑡𝑡𝑖𝑖 , 𝑖𝑖 = 1,2, …
In practice, this is an A/D
converter.
The block “Hold” receives
the sequence of numbers
𝑢𝑢(𝑡𝑡𝑖𝑖 ), 𝑖𝑖 = 1,2, …, from the
control algorithm and sends
out a piecewise continuous
signal, 𝑢𝑢 𝑡𝑡 = 𝑢𝑢(𝑡𝑡𝑖𝑖 ),
𝑡𝑡𝑖𝑖 ≤ 𝑡𝑡 < 𝑡𝑡𝑖𝑖+1 .
In practice, this is a D/A
converter.

KEH Process Dynamics and Control 10–2


10. Digital Process Control

Process
Control
10.2 Digital PID controllers
Laboratory
10.2.1 A 2DOF continuous-time PID controller
Many variants of continuous-time PID controllers were introduced in Section 7.1.
A flexible form of the PID controller is
1 𝑡𝑡 d𝑒𝑒f (𝑡𝑡)
𝑢𝑢 𝑡𝑡 = 𝐾𝐾c 𝑒𝑒p 𝑡𝑡 + ∫ 𝑒𝑒 𝜏𝜏 d𝜏𝜏 + 𝑇𝑇d + 𝑢𝑢0 (10.1)
𝑇𝑇i 0 d𝑡𝑡

𝑒𝑒p (𝑡𝑡) ≡ 𝑏𝑏𝑏𝑏(𝑡𝑡) − 𝑦𝑦(𝑡𝑡), 𝑒𝑒(𝑡𝑡) ≡ 𝑟𝑟(𝑡𝑡) − 𝑦𝑦(𝑡𝑡), 𝑒𝑒f (𝑡𝑡) ≡ 𝑐𝑐𝑐𝑐(𝑡𝑡) − 𝑦𝑦f (𝑡𝑡) (10.2)
d𝑦𝑦f (𝑡𝑡)
𝑇𝑇f + 𝑦𝑦f 𝑡𝑡 = 𝑦𝑦(𝑡𝑡) (10.3)
d𝑡𝑡

Here 𝑏𝑏 and 𝑐𝑐 are setpoint weights yielding a 2DOF PID controller. The control
law (10.1) can also be written
𝑢𝑢 𝑡𝑡 = 𝑢𝑢p 𝑡𝑡 + 𝑢𝑢i 𝑡𝑡 + 𝑢𝑢d 𝑡𝑡 + 𝑢𝑢0 (10.4)
𝑢𝑢p 𝑡𝑡 = 𝐾𝐾c 𝑒𝑒p 𝑡𝑡 (10.5)
𝐾𝐾c 𝑡𝑡 d𝑢𝑢i (𝑡𝑡) 𝐾𝐾c
𝑢𝑢i 𝑡𝑡 = ∫ 𝑒𝑒 𝜏𝜏 d𝜏𝜏 ⇔ = 𝑒𝑒(𝑡𝑡) (10.6)
𝑇𝑇i 0 d𝑡𝑡 𝑇𝑇i
d𝑒𝑒f (𝑡𝑡)
𝑢𝑢d 𝑡𝑡 = 𝐾𝐾c 𝑇𝑇d (10.7)
d𝑡𝑡

KEH Process Dynamics and Control 10–3


10. Digital Process Control 10.2 Digital PID controllers

Process 10.2.2 Discretisation of PID controllers


Control
Laboratory
A discrete-time PID controller can be obtained by using a discrete-time
approximation of the derivatives in (10.3), (10.6) and (10.7). There are many
methods for discretization of a derivative.
Forward-difference approximation
According to the definition of a derivative,
d𝑥𝑥 𝑡𝑡 𝑥𝑥 𝑡𝑡+ℎ −𝑥𝑥 𝑡𝑡
= lim (10.8)
d𝑡𝑡 ℎ→0 ℎ
A natural approximation of the derivative is then
d𝑥𝑥(𝑡𝑡) 𝑥𝑥 𝑡𝑡+ℎ −𝑥𝑥(𝑡𝑡)
≈ (10.9)
d𝑡𝑡 ℎ
However, this is not a suitable approximation of the derivative term in (10.1) or
(10.7), because it requires a future value at time 𝑡𝑡 + ℎ to be known when the
control signal 𝑢𝑢(𝑡𝑡) is calculated. It is possible to avoid this causality problem by
including a derivative filter. However, even then the derivative part becomes
unstable if
𝑇𝑇f ≤ ℎ/2 (10.10)
where ℎ is the sampling interval.
KEH Process Dynamics and Control 10–4
10.2 Digital PID controllers 10.2.2 Discretisation of PID controllers

Backward-difference approximation
Process
Control
Laboratory
By a slight modification of (10.9), the derivative can be approximated by
d𝑥𝑥(𝑡𝑡) 𝑥𝑥 𝑡𝑡 −𝑥𝑥(𝑡𝑡−ℎ)
≈ (10.11)
d𝑡𝑡 ℎ
This results in a stable controller for all non-negative values of 𝑇𝑇d and 𝑇𝑇f .
The proportional part of the controller becomes (without approximation)
𝑢𝑢p 𝑡𝑡𝑘𝑘 = 𝐾𝐾c 𝑒𝑒p 𝑡𝑡𝑘𝑘 (10.12)
where 𝑡𝑡𝑘𝑘 is the time instant of the 𝑘𝑘th sample.
Applying (10.11) to the integral part (10.6) gives
𝑢𝑢i 𝑡𝑡𝑘𝑘 −𝑢𝑢i 𝑡𝑡𝑘𝑘−1 𝐾𝐾c ℎ𝐾𝐾c
= 𝑒𝑒(𝑡𝑡𝑘𝑘 ) ⇒ 𝑢𝑢i 𝑡𝑡𝑘𝑘 = 𝑢𝑢i 𝑡𝑡𝑘𝑘−1 + 𝑒𝑒(𝑡𝑡𝑘𝑘 )   (10.13)
ℎ 𝑇𝑇i 𝑇𝑇i

Because the setpoint 𝑟𝑟(𝑡𝑡𝑘𝑘 ) has not yet affected the integral at time 𝑡𝑡𝑘𝑘 it
appears that a better approximation than ℎ𝑒𝑒 𝑡𝑡𝑘𝑘 = ℎ 𝑟𝑟 𝑡𝑡𝑘𝑘 − 𝑦𝑦 𝑡𝑡𝑘𝑘 for the
increase of the integral between time instants 𝑡𝑡𝑘𝑘−1 and 𝑡𝑡𝑘𝑘 would be
ℎ 𝑟𝑟 𝑡𝑡𝑘𝑘−1 − 𝑦𝑦 𝑡𝑡𝑘𝑘 . However, that would delay the effect of 𝑟𝑟(𝑡𝑡𝑘𝑘 ) by one
sample, which does not happen in a continuous-time controller. Therefore,
𝑒𝑒(𝑡𝑡𝑘𝑘 ) is used in (10.13).
KEH Process Dynamics and Control 10–5
10.2.2 Discretisation of PID controllers Backward difference

It is convenient to derive the derivative part via the Laplace domain.


Process
Control Combination of (10.3) and (10.7) in the Laplace domain yields
Laboratory
𝑇𝑇f 𝑠𝑠𝑈𝑈d 𝑠𝑠 + 𝑈𝑈d 𝑠𝑠 = 𝐾𝐾c 𝑇𝑇d 𝑠𝑠𝐸𝐸d (𝑠𝑠) (10.14)
where 𝐸𝐸d (𝑠𝑠) is the Laplace transform of
𝑒𝑒d 𝑡𝑡 ≡ 𝑐𝑐𝑐𝑐 𝑡𝑡 − 𝑦𝑦(𝑡𝑡) (10.15)
The inverse Laplace transform of (10.14) gives
d𝑢𝑢d (𝑡𝑡) d𝑒𝑒d (𝑡𝑡)
𝑇𝑇f + 𝑢𝑢d 𝑡𝑡 = 𝐾𝐾c 𝑇𝑇d (10.16)
d𝑡𝑡 d𝑡𝑡

Application of (10.11) to both sides of (10.16) at time 𝑡𝑡 = 𝑡𝑡𝑘𝑘 now yields


𝑢𝑢d 𝑡𝑡𝑘𝑘 −𝑢𝑢d (𝑡𝑡𝑘𝑘−1 ) 𝑒𝑒d 𝑡𝑡𝑘𝑘 −𝑒𝑒d (𝑡𝑡𝑘𝑘−1 )
𝑇𝑇f + 𝑢𝑢d 𝑡𝑡𝑘𝑘 = 𝐾𝐾c 𝑇𝑇d
ℎ ℎ

or after rearrangement
𝑇𝑇f 𝐾𝐾c 𝑇𝑇d
𝑢𝑢d 𝑡𝑡𝑘𝑘 = 𝑢𝑢 𝑡𝑡𝑘𝑘−1 + 𝑒𝑒d 𝑡𝑡𝑘𝑘 − 𝑒𝑒d (𝑡𝑡𝑘𝑘−1 ) (10.17)
𝑇𝑇f +ℎ d 𝑇𝑇f +ℎ

The signals 𝑢𝑢i (𝑡𝑡𝑘𝑘 ) in (10.13) and 𝑢𝑢d 𝑡𝑡𝑘𝑘 in (10.17) are calculated recursively for
𝑘𝑘 = 1, 2, … and substituted into (10.4).

KEH Process Dynamics and Control 10–6


10.2 Digital PID controllers 10.2.2 Discretisation of PID controllers

Tustin’s bilinear approximation


Process
Control
Laboratory
The forward- and backward-differences are asymmetrical in the sense that
the difference 𝑥𝑥 𝑡𝑡 − 𝑥𝑥(𝑡𝑡 − ℎ) /ℎ does not approximate the derivative in
the middle of the range, i.e., at time 𝑡𝑡 − 0.5ℎ, but at 𝑡𝑡 − ℎ (forward) or 𝑡𝑡
(backward).
A symmetrical approximation is obtained by
1 d𝑥𝑥(𝑡𝑡) d𝑥𝑥(𝑡𝑡−ℎ) 𝑥𝑥 𝑡𝑡 −𝑥𝑥 𝑡𝑡−ℎ
+ ≈ (10.18)
2 d𝑡𝑡 d𝑡𝑡 ℎ

In general, this approximation is better than the previous ones and for well
chosen controller parameters, the resulting discrete-time PID controller
approximates the continuous-time PID controller better than the previous ones.
However, if the filtering time constant is so small that (10.10) applies, the PID
controller will cause intersample ripple, also called ringing. As a result of this, the
inputs and the outputs will oscillate between sampling points, which is a very
undesirable feature.
Thus, Tustin’s approximation is not suitable (without some modification) if no
derivative filter is used or if the sampling interval is “too large”.

KEH Process Dynamics and Control 10–7


10.2 Digital PID controllers 10.2.2 Discretisation of PID controllers

Trapezoidal approximation
Process
Control
Laboratory
In the forward- and backward-difference approximations, the signal to be
approximated is assumed to be constant in the sampling interval.
It appears better to assume that a changing signal changes linearly in the
sampling interval. This assumption yields the trapezoidal approximation.
The figure to the left illustrates the forward-difference, the backward-difference
and the trapezoidal approximation of a signal 𝑦𝑦.
If the signal is a control error 𝑒𝑒 = 𝑟𝑟 − 𝑦𝑦, the signal and the approximation is
discontinuous when a setpoint change is made, as shown to the right.

KEH Process Dynamics and Control 10–8


10.2.2 Discretisation of PID controllers Trapezoidal approximation

Using the trapezoidal approximation, (10.6) gives for the integral part
Process
Control ℎ𝐾𝐾c 𝑘𝑘
Laboratory 𝑢𝑢i 𝑡𝑡𝑘𝑘 = ∑𝑗𝑗=1 0.5 𝑒𝑒(𝑡𝑡𝑗𝑗−1 ) + 𝑒𝑒(𝑡𝑡𝑗𝑗 ) (10.19)
𝑇𝑇i

which can be rewritten as


ℎ𝐾𝐾c
𝑢𝑢i 𝑡𝑡𝑘𝑘 = 𝑢𝑢i 𝑡𝑡𝑘𝑘−1 + 𝑒𝑒 𝑡𝑡𝑘𝑘 + 𝑒𝑒(𝑡𝑡𝑘𝑘−1 ) (10.20)
2𝑇𝑇i

Also here, 𝑟𝑟(𝑡𝑡𝑘𝑘 ) has not affected the true integral at time 𝑡𝑡𝑘𝑘 , but use of
𝑟𝑟 𝑡𝑡𝑘𝑘−1 − 𝑦𝑦(𝑡𝑡𝑘𝑘 ) instead of 𝑒𝑒(𝑡𝑡𝑘𝑘 ) would again delay the control effect of 𝑟𝑟(𝑡𝑡𝑘𝑘 )
by one sample, which does not happen in a continuous-time controller.
Therefore, 𝑒𝑒(𝑡𝑡𝑘𝑘 ) is used in (10.20). This is also consistent with formal use of the
trapezoidal approximation when the fact that 𝑟𝑟(𝑡𝑡𝑘𝑘 ) is constant in the sampling
interval is neglected.
Again, the derivative part is most easily derived via the Laplace domain. From
(10.7) it follows that d𝑒𝑒f /d𝑡𝑡 is needed. Because the setpoint is constant in the
sampling intervals, d𝑒𝑒f ⁄d𝑡𝑡 = − d𝑦𝑦f ⁄d𝑡𝑡. From the Laplace transform of (10.3) it
then follows that
𝑠𝑠
𝑠𝑠𝐸𝐸f 𝑠𝑠 = 𝐸𝐸d (𝑠𝑠) (10.21)
𝑇𝑇f 𝑠𝑠+1

KEH Process Dynamics and Control 10–9


10.2.2 Discretisation of PID controllers Trapezoidal approximation

According to the trapezoidal approximation, 𝑒𝑒d (𝑡𝑡) changes linearly between


Process
Control sampling points. The Laplace transform of these changes up to time 𝑡𝑡 = 𝑡𝑡𝑘𝑘 is
Laboratory
(note that 𝑗𝑗 is an integer, not the imaginary unit j = −1)
𝑒𝑒d (𝑡𝑡0 ) 𝑒𝑒 𝑡𝑡 −𝑒𝑒 (𝑡𝑡 )
𝐸𝐸d 𝑠𝑠 = + d 1 2d 0
𝑠𝑠 ℎ𝑠𝑠
𝑒𝑒d (𝑡𝑡𝑗𝑗+1 )−2𝑒𝑒d (𝑡𝑡𝑗𝑗 )+𝑒𝑒d (𝑡𝑡𝑗𝑗−1 ) −𝑗𝑗𝑗𝑗𝑗
+ ∑𝑘𝑘−1𝑗𝑗=1 e (10.22)
ℎ𝑠𝑠 2

Substitution into (10.21) and taking the inverse Laplace transform yields
d𝑒𝑒f (𝑡𝑡𝑘𝑘 ) 𝑒𝑒d (𝑡𝑡0 ) −𝑡𝑡 /𝑇𝑇 𝑒𝑒 𝑡𝑡 −𝑒𝑒 𝑡𝑡
= e 𝑘𝑘 f + d 1 d 0 (1 − e−(𝑡𝑡𝑘𝑘 −𝑗𝑗𝑗)/𝑇𝑇f )
d𝑡𝑡 𝑇𝑇f ℎ
𝑒𝑒d (𝑡𝑡𝑗𝑗+1 )−2𝑒𝑒d (𝑡𝑡𝑗𝑗 )+𝑒𝑒d (𝑡𝑡𝑗𝑗−1 )
+ ∑𝑘𝑘−1𝑗𝑗=1 (1 − e−(𝑡𝑡𝑘𝑘 −𝑗𝑗𝑗)/𝑇𝑇f )

Combination with the corresponding expression for d𝑒𝑒f (𝑡𝑡𝑘𝑘−1 )/d𝑡𝑡 yields
d𝑦𝑦f (𝑡𝑡𝑘𝑘 ) d𝑦𝑦f (𝑡𝑡𝑘𝑘−1 ) −ℎ/𝑇𝑇 𝑒𝑒d 𝑡𝑡𝑘𝑘 −𝑒𝑒d 𝑡𝑡𝑘𝑘−1
= e f + (1 − e−ℎ/𝑇𝑇f ) (10.23)
d𝑡𝑡 d𝑡𝑡 ℎ

Combination with (10.7) finally gives


−ℎ/𝑇𝑇f 𝐾𝐾c 𝑇𝑇d (1−e−ℎ/𝑇𝑇f )
𝑢𝑢d 𝑡𝑡𝑘𝑘 = e 𝑢𝑢d 𝑡𝑡𝑘𝑘−1 + 𝑒𝑒d 𝑡𝑡𝑘𝑘 − 𝑒𝑒d (𝑡𝑡𝑘𝑘−1 ) (10.24)

KEH Process Dynamics and Control 10–10


10. Digital Process Control 10.2 Digital PID controllers

Process 10.2.3 Implementation and tuning


Control
Laboratory
Unification of methods
The control laws according to the backward-difference and the trapezoidal
approximation can both be expressed in the form
𝑢𝑢i 𝑡𝑡𝑘𝑘 = 𝑢𝑢i 𝑡𝑡𝑘𝑘−1 + 𝑏𝑏i1 𝑒𝑒 𝑡𝑡𝑘𝑘 + 𝑏𝑏i2 𝑒𝑒 𝑡𝑡𝑘𝑘−1 (10.25)
𝑢𝑢d 𝑡𝑡𝑘𝑘 = 𝑎𝑎d 𝑢𝑢d 𝑡𝑡𝑘𝑘−1 + 𝑏𝑏d 𝑒𝑒d 𝑡𝑡𝑘𝑘 − 𝑒𝑒d 𝑡𝑡𝑘𝑘−1 (10.26)
where 𝑢𝑢i 𝑡𝑡0 = 𝑢𝑢d 𝑡𝑡0 = 0 can be used as starting values for the iterative
calculation. The control errors 𝑒𝑒 𝑡𝑡𝑘𝑘 and 𝑒𝑒d (𝑡𝑡𝑘𝑘 ) are defined in (10.2b) and
(10.15), respectively, and the parameters are given below.
Method 𝒃𝒃𝐢𝐢𝟏𝟏 𝒃𝒃𝐢𝐢𝟐𝟐 𝒂𝒂𝐝𝐝 𝒃𝒃𝐝𝐝
𝐾𝐾c ℎ 𝑇𝑇f 𝐾𝐾c 𝑇𝑇d
Backward 0
𝑇𝑇i 𝑇𝑇f + ℎ 𝑇𝑇f + ℎ
𝐾𝐾c ℎ 𝐾𝐾c ℎ 𝐾𝐾c 𝑇𝑇d
Trapezoid e−ℎ/𝑇𝑇f 1 − e−ℎ/𝑇𝑇f
2𝑇𝑇i 2𝑇𝑇i ℎ

In general, the trapezoidal approximation is more accurate than the backward-


difference approximation, but both tend to be good choices.
KEH Process Dynamics and Control 10–11
10.2 Digital PID controllers 10.2.3 Implementation and tuning

Preventing integrator windup


Process
Control
Laboratory
If the control signal reaches a process constraint (e.g., a control valve fully open)
when there is a control error, and the controller contains standard integral
action, the absolute value of the integral will continue to increase as long as the
sign of the control error is unchanged. This will result in integrator windup, which
is illustrated in the figure.
Here a setpoint change y
is made at 𝑡𝑡 = 0 (upper).
The control signal 𝑢𝑢 im-
mediately reaches its maxi- r
mum value 0.1 (middle).
The integral 𝑢𝑢i continues
to increase as long as
𝑦𝑦 < 𝑟𝑟 (lower). u
The control signal will
remain at the maximum
value until the integral
decreases sufficiently even
though 𝑦𝑦 > 𝑟𝑟. After this, ui
the control signal might
reach its minimum value
and oscillations follow.

KEH Process Dynamics and Control 10–12


10.2.3 Implementation and tuning Preventing integrator windup

Integrator windup can be prevented in many ways. One way is to adjust the
Process
Control value of the integrator so that the calculated control signal with the adjusted
Laboratory
integrator exactly reaches the constraint. This is achieved with
𝐾𝐾c 𝑡𝑡 1 𝑡𝑡
𝑢𝑢i 𝑡𝑡 = ∫ 𝑒𝑒 𝜏𝜏 d𝜏𝜏 + ∫ 𝑒𝑒 𝜏𝜏 d𝜏𝜏 (10.27)
𝑇𝑇i 0 𝑇𝑇t 0 s

where 𝑒𝑒s 𝑡𝑡 ≡ min 𝑢𝑢max , max 𝑢𝑢min , 𝑢𝑢 𝑡𝑡 − 𝑢𝑢(𝑡𝑡) (10.28)


This function has the r
property that 𝑒𝑒s = 0 if
𝑢𝑢min ≤ 𝑢𝑢 ≤ 𝑢𝑢max , y
otherwise
𝑒𝑒s = 𝑢𝑢max/min − 𝑢𝑢 .
𝑇𝑇t is the tracking time
constant, which should u
be chosen as
𝑇𝑇d < 𝑇𝑇t < 𝑇𝑇i .
A reasonable value is
𝑇𝑇t = 𝑇𝑇i 𝑇𝑇d . If 𝑇𝑇d = 0,
𝑇𝑇t = 0.1𝑇𝑇i can be used. ui
The figure illustrates how
this anti-windup works.
(Note different time scale.)
KEH Process Dynamics and Control 10–13
10.2.3 Implementation and tuning Preventing integrator windup

Discrete-time control
Process
Control
Laboratory
For discrete-time control, (10.27) can be discretised similarly to (10.6). Because
d𝑢𝑢i (𝑡𝑡) 𝐾𝐾c 1
= 𝑒𝑒 𝑡𝑡 + 𝑒𝑒 (𝑡𝑡) (10.30)
d𝑡𝑡 𝑇𝑇i 𝑇𝑇t s

the backward-difference approximation yields


ℎ𝐾𝐾c ℎ
𝑢𝑢i 𝑡𝑡𝑘𝑘 = 𝑢𝑢i 𝑡𝑡𝑘𝑘−1 + 𝑒𝑒 𝑡𝑡𝑘𝑘 + 𝑒𝑒 (𝑡𝑡 ) (10.31)
𝑇𝑇i 𝑇𝑇t s 𝑘𝑘

and the trapezoidal approximation yields


ℎ𝐾𝐾c
𝑢𝑢i 𝑡𝑡𝑘𝑘 = 𝑢𝑢i 𝑡𝑡𝑘𝑘−1 + 𝑒𝑒 𝑡𝑡𝑘𝑘 + 𝑒𝑒(𝑡𝑡𝑘𝑘−1 )
2𝑇𝑇i

+ 𝑒𝑒s 𝑡𝑡𝑘𝑘 + 𝑒𝑒s (𝑡𝑡𝑘𝑘−1 ) (10.32)
2𝑇𝑇t

KEH Process Dynamics and Control 10–14


10.2 Digital PID controllers 10.2.3 Implementation and tuning

Incremental control algorithms


Process
Control
Laboratory
The control algorithms where the control signal is calculated by (10.4) are called
positional algorithms.
Sometimes it is more convenient to calculate the control signal as an addition to
its previous value, i.e.,
𝑢𝑢 𝑡𝑡𝑘𝑘 = 𝑢𝑢 𝑡𝑡𝑘𝑘−1 + ∆𝑢𝑢p 𝑡𝑡𝑘𝑘 + ∆𝑢𝑢i 𝑡𝑡𝑘𝑘 + ∆𝑢𝑢d 𝑡𝑡𝑘𝑘 (10.33)
where
∆𝑢𝑢 𝑡𝑡𝑘𝑘 ≡ 𝑢𝑢 𝑡𝑡𝑘𝑘 − 𝑢𝑢(𝑡𝑡𝑘𝑘−1 ) (10.34)
Such an algorithm is called an incremental algorithm. It should only be used with
integral action.
The given algorithms for the integral part are essentially in incremental form, but
the other parts have to be determined by (10.34). The result is
∆𝑢𝑢p 𝑡𝑡𝑘𝑘 = 𝐾𝐾c 𝑒𝑒p 𝑡𝑡𝑘𝑘 − 𝑒𝑒p (𝑡𝑡𝑘𝑘−1 ) (10.35)
∆𝑢𝑢i 𝑡𝑡𝑘𝑘 = 𝑏𝑏i1 𝑒𝑒 𝑡𝑡𝑘𝑘 + 𝑏𝑏i2 𝑒𝑒 𝑡𝑡𝑘𝑘−1 (10.36)
∆𝑢𝑢d 𝑡𝑡𝑘𝑘 = 𝑎𝑎d ∆𝑢𝑢d 𝑡𝑡𝑘𝑘−1
+𝑏𝑏d 𝑒𝑒d 𝑡𝑡𝑘𝑘 − 2𝑒𝑒d 𝑡𝑡𝑘𝑘−1 + 𝑒𝑒d 𝑡𝑡𝑘𝑘−2    (10.37)
If anti-windup is desired, (10.36) should be modified as (10.31) or (10.32).
KEH Process Dynamics and Control 10–15
10.2 Digital PID controllers 10.2.3 Implementation and tuning

Choice of sampling interval


Process
Control
Laboratory
There are no firm rules on how to choose the sampling interval. A long sampling
interval (low sampling rate) has many drawbacks such as
 longer apparent time delay ℎ/2
 the aliasing effect — no frequency above the Nyquist frequency 𝜋𝜋/ℎ can be
detected
An unnecessarily short sampling interval (high sampling rate) means more
measurements, calculations and control actions with almost no new information
at sampling instants.
The following are some guidelines on the choice of sampling rate:
 Use 10 times the rate suggested by Shannon’s sampling theorem.
 Use 4–10 samples per rise time of the closed-loop system.
 Use 15–45 samples per period of oscillation of the closed-loop system.
 The sampling frequency should be 10–30 times the bandwidth.
 Choose 𝜔𝜔g ℎ = 0.15 … 0.5, where 𝜔𝜔g is the gain crossover frequency, i.e.,
the frequency where the amplitude ratio of the open-loop system is 1.
Note that we have not defined all above terms in this course.
KEH Process Dynamics and Control 10–16
10.2 Digital PID controllers 10.2.3 Implementation and tuning

Tuning
Process
Control
Laboratory
Because the controller parameters in (10.12), (10.25) and (10.26) are functions of
the parameters of a continuous-time PID controller, any tuning method for
continuous-time PID controllers can be used.
Because the sampling increases the average time delay by half a sampling
interval, it is advisable to increase the time delay of the system by ℎ/2 before
calculating the continuous-time controller parameters.
In the derivation of (10.17) and (10.24), it was not taken into account that the
setpoint changes stepwise, and only at sampling instants. This kind of setpoint
changes can be handled exactly. The correct handling is achieved if the derivative
setpoint weight 𝑐𝑐̃ in the continuous case is changed to
ℎ 𝑐𝑐̃
 𝑐𝑐 = for the trapezoidal approximation
𝑇𝑇f 1−e−ℎ/𝑇𝑇f
(𝑇𝑇f +ℎ)𝑐𝑐̃
 𝑐𝑐 = for the backward-difference approximation (this is approximate)
𝑇𝑇f

KEH Process Dynamics and Control 10–17


10.2 Digital PID controllers 10.2.3 Implementation and tuning

Implementation in SIMULINK
Process
Control
Laboratory
Mathwork’s SIMULINK software provides two discrete PID controller blocks, one
of which is a 2DOF controller. The type of discretization can be chosen, e.g.,
backward Euler or trapezoidal.
The controller parameters are
 𝑃𝑃 = 𝐾𝐾c
 𝐼𝐼 = 𝐾𝐾c ⁄𝑇𝑇i
 𝐷𝐷 = 𝐾𝐾c 𝑇𝑇d
 𝑇𝑇s = ℎ (not adjustable here)
If the trapezoid approximation
is used both for the integrator
and the filter
2 1−e−ℎ/𝑇𝑇f
 𝑁𝑁 =
ℎ 1+e−ℎ/𝑇𝑇f
If the backward approximation
is used
 𝑁𝑁 = 1/𝑇𝑇f
SIMULINK’s derivative implemen-
tation requires 𝑁𝑁 > 0 !
KEH Process Dynamics and Control 10–18
10. Digital Process Control

Process
Control
10.3 Sampling of time-delay models
Laboratory
10.3.1 State-space model with a time delay
Sampling
A continuous-time system with the same time delay 𝜃𝜃 for all inputs has the
state-space representation
𝐱𝐱̇ 𝑡𝑡 = 𝐀𝐀𝐀𝐀 𝑡𝑡 + 𝐁𝐁𝐁𝐁(𝑡𝑡 − 𝜃𝜃) (10.38)
If the system is sampled with the sampling interval ℎ, the solution is
𝑡𝑡
𝐱𝐱 𝑡𝑡𝑘𝑘+1 = e𝐀𝐀ℎ 𝐱𝐱 𝑡𝑡𝑘𝑘 + e𝐀𝐀𝑡𝑡𝒌𝒌+𝟏𝟏 ∫𝑡𝑡 𝑘𝑘+1 e−𝐀𝐀𝜏𝜏 𝐁𝐁𝐁𝐁(𝜏𝜏 − 𝜃𝜃)d𝜏𝜏 (10.39)
𝑘𝑘

where 𝑡𝑡𝑘𝑘 and 𝑡𝑡𝑘𝑘+1 are two adjacent sampling points, 𝑡𝑡𝑘𝑘+1 = 𝑡𝑡𝑘𝑘 + ℎ.
Assume that the time delay is smaller than the sampling interval, i.e., 0 ≤ 𝜃𝜃 < ℎ.
If the input 𝐮𝐮(𝑡𝑡) is constant in the sampling interval 𝑡𝑡𝑘𝑘 ≤ 𝑡𝑡 < 𝑡𝑡𝑘𝑘+1 , 𝐮𝐮(𝑡𝑡 − 𝜃𝜃) is
not constant over the same interval if 𝜃𝜃 > 0; the value of 𝐮𝐮(𝑡𝑡 − 𝜃𝜃) changes
from 𝐮𝐮(𝑡𝑡𝑘𝑘−1 ) to 𝐮𝐮(𝑡𝑡𝑘𝑘 ) at the time 𝑡𝑡 = 𝑡𝑡𝑘𝑘 + 𝜃𝜃.
Because of this, it is useful to split the integral into two parts so that the input is
constant in each part.

KEH Process Dynamics and Control 10–19


10.3.1 State-space model with a time delay Sampling

Splitting the integral in the indicated way yields


Process
Control 𝑡𝑡 +𝜃𝜃 −𝐀𝐀𝜏𝜏
Laboratory 𝐱𝐱 𝑡𝑡𝑘𝑘+1 = e𝐀𝐀ℎ 𝐱𝐱 𝑡𝑡𝑘𝑘 + e𝐀𝐀𝑡𝑡𝒌𝒌+𝟏𝟏 ∫𝑡𝑡 𝑘𝑘 e d𝜏𝜏 𝐁𝐁𝐁𝐁(𝑡𝑡𝑘𝑘−1 )
𝑘𝑘
𝑡𝑡
+ e𝐀𝐀𝑡𝑡𝒌𝒌+𝟏𝟏 ∫𝑡𝑡 𝑘𝑘+1
+𝜃𝜃
e−𝐀𝐀𝜏𝜏
d𝜏𝜏 𝐁𝐁𝐁𝐁(𝑡𝑡𝑘𝑘 ) (10.40)
𝑘𝑘
The solution can be written
𝐱𝐱 𝑡𝑡𝑘𝑘+1 = 𝐅𝐅𝐱𝐱 𝑡𝑡𝑘𝑘 + 𝐆𝐆0 𝐮𝐮(𝑡𝑡𝑘𝑘 ) + 𝐆𝐆1 𝐮𝐮(𝑡𝑡𝑘𝑘−1 ) (10.41)
where
ℎ−𝜃𝜃 𝐀𝐀𝜏𝜏 𝜃𝜃
𝐅𝐅 = e𝐀𝐀ℎ , 𝐆𝐆0 = ∫0 e d𝜏𝜏 𝐁𝐁 , 𝐆𝐆1 = e𝐀𝐀(ℎ−𝜃𝜃) ∫0 e𝐀𝐀𝜏𝜏 d𝜏𝜏 𝐁𝐁 (10.42)
The integrals can be calculated numerically according to
𝑡𝑡 1 1 2 2 1 3 3
𝐒𝐒𝑡𝑡 ≡ ∫0 e𝐀𝐀𝜏𝜏 d𝜏𝜏 = 𝐈𝐈 + 𝐀𝐀𝑡𝑡 + 𝐀𝐀 𝑡𝑡 + 𝐀𝐀 𝑡𝑡 + ⋯ 𝑡𝑡 (10.43)
2! 3! 4!
from which
𝐅𝐅 = 𝐈𝐈 + 𝐀𝐀𝐒𝐒ℎ , 𝐆𝐆0 = 𝐒𝐒ℎ−𝜃𝜃 𝐁𝐁 , 𝐆𝐆1 = 𝐒𝐒𝜃𝜃 𝐁𝐁 (10.44)
If the time delay 𝐿𝐿 is such that
𝐿𝐿 = 𝑁𝑁𝑁 + 𝜃𝜃 , 𝑁𝑁 is a non-negative integer (10.45)
𝐮𝐮(𝑡𝑡𝑘𝑘 ) is replaced by 𝐮𝐮(𝑡𝑡𝑘𝑘−𝑁𝑁 ) and 𝐮𝐮(𝑡𝑡𝑘𝑘−1 ) is replaced by 𝐮𝐮(𝑡𝑡𝑘𝑘−1−𝑁𝑁 ).
KEH Process Dynamics and Control 10–20
10.3 Sampling of time-delay models 10.3.1 State-space model

Pulse transfer operator


Process
Control
Laboratory
Generally, a state-space model with a time delay 𝐿𝐿 = 𝑁𝑁𝑁 + 𝜃𝜃, 0 ≤ 𝜃𝜃 < ℎ, for all
inputs has the form
𝐱𝐱 𝑡𝑡𝑘𝑘+1 = 𝐅𝐅𝐅𝐅 𝑡𝑡𝑘𝑘 + 𝐆𝐆0 𝐮𝐮(𝑡𝑡𝑘𝑘−𝑁𝑁 ) + 𝐆𝐆1 𝐮𝐮(𝑡𝑡𝑘𝑘−1−𝑁𝑁 )
(10.46)
𝐲𝐲 𝑡𝑡𝑘𝑘 = 𝐂𝐂𝐱𝐱 𝑡𝑡𝑘𝑘 + 𝐃𝐃0 𝐮𝐮(𝑡𝑡𝑘𝑘−𝑁𝑁 ) + 𝐃𝐃1 𝐮𝐮(𝑡𝑡𝑘𝑘−1−𝑁𝑁 )
The shift operator q operating on a signal 𝑓𝑓(𝑡𝑡𝑘𝑘 ) is defined
q𝑓𝑓 𝑡𝑡𝑘𝑘 = 𝑓𝑓(𝑡𝑡𝑘𝑘+1 ) ⇔ q−1 𝑓𝑓 𝑡𝑡𝑘𝑘+1 = 𝑓𝑓(𝑡𝑡𝑘𝑘 ) (10.47)
Application of the shift operator to (10.46) yields
q𝐱𝐱 𝑡𝑡𝑘𝑘 = 𝐅𝐅𝐅𝐅 𝑡𝑡𝑘𝑘 + 𝐆𝐆0 q−𝑁𝑁 𝐮𝐮(𝑡𝑡𝑘𝑘 ) + 𝐆𝐆1 q−1−𝑁𝑁 𝐮𝐮(𝑡𝑡𝑘𝑘 )
(10.48)
𝐲𝐲 𝑡𝑡𝑘𝑘 = 𝐂𝐂𝐱𝐱 𝑡𝑡𝑘𝑘 + 𝐃𝐃0 q−𝑁𝑁 𝐮𝐮(𝑡𝑡𝑘𝑘 ) + 𝐃𝐃1 q−1−𝑁𝑁 𝐮𝐮(𝑡𝑡𝑘𝑘 )
from which
𝐱𝐱 𝑡𝑡𝑘𝑘 = q𝐈𝐈 − 𝐅𝐅 −1 𝐆𝐆0 + 𝐆𝐆1 q−1 q−𝑁𝑁 𝐮𝐮(𝑡𝑡𝑘𝑘 )
(10.49)
𝐲𝐲 𝑡𝑡𝑘𝑘 = 𝐂𝐂 q𝐈𝐈 − 𝐅𝐅 −1 𝐆𝐆0 + 𝐆𝐆1 q−1 + 𝐃𝐃0 + 𝐃𝐃1 q−1 q−𝑁𝑁 𝐮𝐮(𝑡𝑡𝑘𝑘 )
Since the pulse transfer operator is defined by 𝐲𝐲 𝑡𝑡𝑘𝑘 = 𝐇𝐇(q−1 )𝐮𝐮(𝑡𝑡𝑘𝑘 ), the
sampled state-space model has the pulse transfer operator
𝐇𝐇 q−1 = 𝐂𝐂 q𝐈𝐈 − 𝐅𝐅 −1
𝐆𝐆0 + 𝐆𝐆1 q−1 + 𝐃𝐃0 + 𝐃𝐃1 q−1 q−𝑁𝑁 (10.50)

KEH Process Dynamics and Control 10–21


10. Digital Process Control 10.3 Sampling of time-delay models

Process 10.3.2 Second-order model with real poles and zero


Control
Laboratory
Diagonal state-space form
A second-order time-delay system with two distinct real poles and a possible
zero has the transfer function
𝐾𝐾(𝑇𝑇3 𝑠𝑠+1)e−𝐿𝐿𝐿𝐿 𝑘𝑘1 𝑘𝑘2
𝐺𝐺 𝑠𝑠 = = − e−𝐿𝐿𝐿𝐿 (10.51)
(𝑇𝑇1 𝑠𝑠+1)(𝑇𝑇2 𝑠𝑠+1) 𝑠𝑠−𝜆𝜆1 𝑠𝑠−𝜆𝜆2
where
𝜆𝜆1 = −1/𝑇𝑇1 , 𝜆𝜆2 = −1/𝑇𝑇2 (10.52a)
𝐾𝐾(𝑇𝑇1 −𝑇𝑇3 ) 𝐾𝐾(𝑇𝑇3 −𝑇𝑇2 )
𝑘𝑘1 = , 𝑘𝑘2 = (10.52b)
𝑇𝑇1 (𝑇𝑇1 −𝑇𝑇2 ) 𝑇𝑇2 (𝑇𝑇1 −𝑇𝑇2 )

The system can be written on diagonal state-space form as


𝐱𝐱̇ 𝑡𝑡 = 𝚲𝚲𝐱𝐱 𝑡𝑡 + 𝐛𝐛𝑢𝑢(𝑡𝑡 − 𝐿𝐿)
(10.53)
𝑦𝑦 𝑡𝑡 = 𝐜𝐜 T 𝐱𝐱(𝑡𝑡)
𝜆𝜆1 0 𝑘𝑘 1
𝚲𝚲 = , 𝐛𝐛 = 1 , 𝐜𝐜 = (10.54)
0 𝜆𝜆2 𝑘𝑘2 1

KEH Process Dynamics and Control 10–22


10.3 Sampling of time-delay models 10.3.2 Second-order model

Sampling
Process
Control Because 𝚲𝚲 is diagonal, sampling and calculation of e𝐀𝐀ℎ is easy. With
Laboratory
𝐿𝐿 = 𝑁𝑁𝑁 + 𝜃𝜃, the result is
𝐱𝐱 𝑡𝑡𝑘𝑘+1 = 𝐅𝐅𝐅𝐅 𝑡𝑡𝑘𝑘 + 𝐆𝐆0 𝑢𝑢(𝑡𝑡𝑘𝑘 ) + 𝐆𝐆1 𝑢𝑢(𝑡𝑡𝑘𝑘−1 )
(10.55)
𝑦𝑦 𝑡𝑡𝑘𝑘 = 𝐜𝐜 T 𝐱𝐱(𝑡𝑡𝑘𝑘 )
where
𝜆𝜆1 ℎ
𝐅𝐅 = e = 𝚲𝚲ℎ e 0 (10.56)
0 e𝜆𝜆2 ℎ
ℎ−𝜃𝜃 𝚲𝚲𝜏𝜏 𝜆𝜆1−1 (e𝜆𝜆1 ℎ−𝜃𝜃 − 1) 0 𝑘𝑘1
𝐆𝐆0 = ∫0 e d𝜏𝜏 𝐛𝐛 =
0 𝜆𝜆−1
2 (e
𝜆𝜆2 ℎ−𝜃𝜃
− 1) 𝑘𝑘2
𝑘𝑘1 𝜆𝜆1−1 (e𝜆𝜆1 ℎ−𝜃𝜃 − 1)
= (10.57)
𝑘𝑘2 𝜆𝜆−1
2 (e
𝜆𝜆2 ℎ−𝜃𝜃
− 1)
𝜃𝜃
𝐆𝐆1 = e𝚲𝚲(ℎ−𝜃𝜃) ∫0 e𝚲𝚲𝜏𝜏 d𝜏𝜏 𝐛𝐛
e 𝜆𝜆1 (ℎ−𝜃𝜃)
0 𝜆𝜆1−1 (e𝜆𝜆1 𝜃𝜃 − 1) 0 𝑘𝑘1
=
0 e𝜆𝜆2 (ℎ−𝜃𝜃) 0 𝜆𝜆−1
2 (e
𝜆𝜆2 𝜃𝜃
− 1) 𝑘𝑘2
𝑘𝑘1 𝜆𝜆1−1 𝑒𝑒 𝜆𝜆1 ℎ (1 − 𝑒𝑒 −𝜆𝜆1 𝜃𝜃 )
= (10.58)
𝑘𝑘2 𝜆𝜆−1
2 𝑒𝑒
𝜆𝜆2 ℎ
(1 − 𝑒𝑒 −𝜆𝜆2 𝜃𝜃 )
KEH Process Dynamics and Control 10–23
10.3 Sampling of time-delay models 10.3.2 Second-order model

Pulse transfer operator


Process
Control
Laboratory
According to (10.50), the pulse transfer operator is
𝐻𝐻 q−1 = 𝐜𝐜 T q𝐈𝐈 − 𝐅𝐅 −1
𝐆𝐆0 + 𝐆𝐆1 q−1 q−𝑁𝑁 (10.59)
Substitution of (10.57–58) into (10.59) gives a pulse transfer operator of the form
−1 𝑏𝑏1 +𝑏𝑏2 q−1 +𝑏𝑏3 q−2 −1−𝑁𝑁
𝐻𝐻 q = 𝑞𝑞 (10.60)
1+𝑎𝑎1 q−1 +𝑎𝑎2 q−2

Using the parameters


𝑏𝑏11 = 𝑘𝑘1 𝜆𝜆1−1 e𝜆𝜆1 ℎ−𝜃𝜃
− 1 , 𝑏𝑏12 = 𝑘𝑘2 𝜆𝜆−1
2 e
𝜆𝜆2 ℎ−𝜃𝜃
−1
(10.61)
𝑏𝑏21 = 𝑘𝑘1 𝜆𝜆1−1 𝑒𝑒 𝜆𝜆1 ℎ 1 − 𝑒𝑒 −𝜆𝜆1 𝜃𝜃 , 𝑏𝑏22 = 𝑘𝑘2 𝜆𝜆−1
2 𝑒𝑒
𝜆𝜆2 ℎ
1 − 𝑒𝑒 −𝜆𝜆2 𝜃𝜃
the parameters of (10.60) are given by
𝑎𝑎1 = − 𝑒𝑒 𝜆𝜆1 ℎ + 𝑒𝑒 𝜆𝜆2 ℎ , 𝑎𝑎2 = 𝑒𝑒 (𝜆𝜆1 +𝜆𝜆2 )ℎ , 𝑏𝑏1 = 𝑏𝑏11 + 𝑏𝑏12
𝑏𝑏2 = − 𝑒𝑒 𝜆𝜆2 ℎ 𝑏𝑏11 + 𝑒𝑒 𝜆𝜆1 ℎ 𝑏𝑏12 + 𝑏𝑏21 + 𝑏𝑏22 (10.62)
𝑏𝑏3 = − 𝑒𝑒 𝜆𝜆2 ℎ 𝑏𝑏21 + 𝑒𝑒 𝜆𝜆1 ℎ 𝑏𝑏22

KEH Process Dynamics and Control 10–24


10.3.2 Second-order model Pulse transfer operator

The case 𝜃𝜃 = 0
Process
Control
Laboratory
If the time delay is an integer multiple the sampling interval, i.e., 𝐿𝐿 = 𝑁𝑁𝑁, 𝜃𝜃 = 0,
the expressions for the second-order pulse transfer operator are simplified. In
this case
−1 𝑏𝑏1 +𝑏𝑏2 q−1 −1−𝑁𝑁
𝐻𝐻 q = q (10.63)
1+𝑎𝑎1 q−1 +𝑎𝑎2 q−2

In (10.61), 𝑏𝑏21 = 𝑏𝑏22 = 0 and


𝑏𝑏11 = 𝑘𝑘1 𝜆𝜆1−1 e𝜆𝜆1 ℎ − 1 , 𝑏𝑏12 = 𝑘𝑘2 𝜆𝜆−1
2 e
𝜆𝜆2 ℎ
−1 (10.64)
The parameters of (10.63) are then given by
𝑎𝑎1 = − 𝑒𝑒 𝜆𝜆1 ℎ + 𝑒𝑒 𝜆𝜆2 ℎ , 𝑎𝑎2 = 𝑒𝑒 (𝜆𝜆1 +𝜆𝜆2 )ℎ
(10.65)
𝑏𝑏1 = 𝑏𝑏11 + 𝑏𝑏12 , 𝑏𝑏2 = − 𝑒𝑒 𝜆𝜆2 ℎ 𝑏𝑏11 + 𝑒𝑒 𝜆𝜆1 ℎ 𝑏𝑏12

Exercise 10.3.2
Determine the pulse transfer operator 𝐻𝐻(q−1 ) for the system
𝐾𝐾e−𝐿𝐿𝐿𝐿
𝐺𝐺 𝑠𝑠 =
(𝑇𝑇1 𝑠𝑠+1)(𝑇𝑇2 𝑠𝑠+1)

when 𝐾𝐾 = 1, 𝐿𝐿 = 1 min, 𝑇𝑇1 = 1 min, 𝑇𝑇2 = 0.5 min, ℎ = 0.1 min.


KEH Process Dynamics and Control 10–25
10. Digital Process Control 10.3 Sampling of time-delay models

Process 10.3.3 First-order model


Control
Laboratory
For a strictly proper first-order system with a time delay, the transfer function is
𝐾𝐾e−𝐿𝐿𝐿𝐿
𝐺𝐺 𝑠𝑠 = (10.66)
𝑇𝑇𝑠𝑠+1

The sampling result and the pulse transfer operator can be directly obtained
from the solution for the second-order system using
𝑘𝑘1 = 𝐾𝐾/𝑇𝑇 , 𝜆𝜆1 = −1/𝑇𝑇 , 𝜆𝜆2 = −∞

For the general time-delay case (i.e., arbitrary 𝜃𝜃), (10.61) and (10.62) yield the
pulse transfer operator
−1 𝑏𝑏1 +𝑏𝑏2 q−1 −1−𝑁𝑁
𝐻𝐻 q = q (10.67)
1+𝑎𝑎1 q−1
with
𝑎𝑎1 = −e−ℎ/𝑇𝑇 , 𝑏𝑏1 = 𝐾𝐾(1 + 𝑎𝑎1 e𝜃𝜃/𝑇𝑇 ) , 𝑏𝑏2 = 𝐾𝐾𝐾𝐾1 (1 − e𝜃𝜃/𝑇𝑇 ) (10.68)

KEH Process Dynamics and Control 10–26


10. Digital Process Control

Process
Control
10.4 Controller synthesis using discrete-time model
Laboratory
10.4.1 PID controller
Loop-transfer specification
If the controller and the system have the pulse transfer operators 𝐻𝐻c (q−1 ) and
𝐻𝐻(q−1 ), respectively, the loop transfer operator is
𝐻𝐻ℓ q−1 = 𝐻𝐻(q−1 )𝐻𝐻c (q−1 ) (10.69)
resulting in the closed-loop pulse transfer operator
−1 𝐻𝐻ℓ q−1
𝐻𝐻r q = (10.70)
1+𝐻𝐻ℓ q−1

For a system with the time delay 𝐿𝐿 = 𝑁𝑁𝑁 + 𝜃𝜃, 0 ≤ 𝜃𝜃 < ℎ, the loop transfer
−1 q−1−𝑁𝑁
𝐻𝐻ℓ q = (10.71)
(2𝑁𝑁+1)(1−q−1 )

gives a closed-loop system having approximately a 4 % overshoot and a rise time


equal to 3 … 4 time delays. Such a control performance can be considered good.

KEH Process Dynamics and Control 10–27


10.4 Controller synthesis using discrete model 10.4.1 PID controller

First-order model with 𝐿𝐿 = 𝑁𝑁𝑁


Process
Control
Laboratory
According to (10.67–68), a first-order system with a time delay being an integer
multiple of the sampling interval has the pulse transfer operator
𝑏𝑏1
𝐻𝐻 q−1 = −1 q−1−𝑁𝑁   (10.72)
1+𝑎𝑎1 q

The loop transfer operator (10.71) is achieved with the controller


𝐻𝐻c q−1 = 𝐻𝐻 q−1 −1
𝐻𝐻ℓ q−1 (10.73)
1+𝑎𝑎1 q−1 q−1−𝑁𝑁 1 1+𝑎𝑎1 q−1
= ⋅ = ⋅ (10.74)
𝑏𝑏1 q−1−𝑁𝑁 2𝑁𝑁+1 1−q−1 (2𝑁𝑁+1)𝑏𝑏1 1−q−1

Since 𝐻𝐻c q−1 = 𝑈𝑈(q−1 )/𝐸𝐸(q−1 ), this is a controller implementing the


incremental control law
1
𝑢𝑢 𝑡𝑡𝑘𝑘 = 𝑢𝑢 𝑡𝑡𝑘𝑘−1 + 𝑒𝑒 𝑡𝑡𝑘𝑘 + 𝑎𝑎1 𝑒𝑒(𝑡𝑡𝑘𝑘−1 ) (10.75)
(2𝑁𝑁+1)𝑏𝑏1

where 𝑒𝑒 𝑡𝑡𝑘𝑘 = 𝑟𝑟 𝑡𝑡𝑘𝑘 − 𝑦𝑦(𝑡𝑡𝑘𝑘 ) is the standard control error. Comparison with
(10.33–37) shows that this is a PI controller with
1 𝑎𝑎1
𝑏𝑏i1 + 𝐾𝐾c = , 𝑏𝑏i2 − 𝐾𝐾c =
(2𝑁𝑁+1)𝑏𝑏1 (2𝑁𝑁+1)𝑏𝑏1

KEH Process Dynamics and Control 10–28


10.4.1 PID controller First-order model with 𝐿𝐿 = 𝑁𝑁𝑁

If the trapezoidal approximation is used, this yields a controller with


Process
Control 1−𝑎𝑎1 1+𝑎𝑎1 ℎ 1−𝑎𝑎1
Laboratory 𝐾𝐾c = , 𝑏𝑏i1 = 𝑏𝑏i2 = ⇒ 𝑇𝑇i = ⋅ (10.76)
2(2𝑁𝑁+1)𝑏𝑏1 2(2𝑁𝑁+1)𝑏𝑏1 2 1+𝑎𝑎1

Implementation
The controller can be implemented in various ways using SIMULINK.
 One way is to implement the positional controller as explained in Section
10.2.3. As this is a PI controller, 𝐷𝐷 = 0 should then be used.
 Another way is to implement the incremental form using the Discrete Zero-
Pole block. The variable 𝑧𝑧 used in the block definition is obtained by
replacing the operator q by 𝑧𝑧. Since
−1 1 1+𝑎𝑎1 q−1 1 𝑧𝑧+𝑎𝑎1
𝐻𝐻c q = ⋅ ⇔ 𝐻𝐻c 𝑧𝑧 = ⋅
(2𝑁𝑁+1)𝑏𝑏1 1−q−1 (2𝑁𝑁+1)𝑏𝑏1 𝑧𝑧−1

the pole is +1, the zero is −𝑎𝑎1 and the gain is 1⁄(2𝑁𝑁 + 1)𝑏𝑏1 for this block.
 The Discrete Transfer Fcn block can also be used. In this block, the
numerator and denominator polynomials are defined. In this case, the
numerator parameters are 1 𝑎𝑎1 and the denominator parameters are
1 −1 .

KEH Process Dynamics and Control 10–29


10.4 Controller synthesis using discrete model 10.4.1 PID controller

Second-order model with 𝐿𝐿 = 𝑁𝑁𝑁


Process
Control
Laboratory
A second-order system with a time delay equal to an integer multiple of the
sampling interval has the pulse transfer operator (10.63). Substitution into
(10.73) yields
−1 1+𝑎𝑎1 q−1 +𝑎𝑎2 q−2 q−1−𝑁𝑁
𝐻𝐻c q = ⋅
(𝑏𝑏1 +𝑏𝑏2 q−1 )q−1−𝑁𝑁 2𝑁𝑁+1 1−q−1
1 1+𝑎𝑎1 q−1 +𝑎𝑎2 q−2
= ⋅   (10.77)
(2𝑁𝑁+1)𝑏𝑏1 (1−q−1 )(1+𝑑𝑑q−1 )
where
𝑑𝑑 = 𝑏𝑏2 ⁄𝑏𝑏1 (10.78)
This is a controller implementing the incremental control law
1
𝑢𝑢 𝑡𝑡𝑘𝑘 = 𝑢𝑢 𝑡𝑡𝑘𝑘−1 + 𝑒𝑒 𝑡𝑡𝑘𝑘 + 𝑎𝑎1 𝑒𝑒 𝑡𝑡𝑘𝑘−1 + 𝑎𝑎2 𝑒𝑒 𝑡𝑡𝑘𝑘−2
(2𝑁𝑁+1)𝑏𝑏1

−𝑑𝑑 𝑢𝑢 𝑡𝑡𝑘𝑘−1 − 𝑢𝑢 𝑡𝑡𝑘𝑘−2 (10.79)


Comparison with (10.33–37) shows that this is a PID controller with a derivative
filter.

KEH Process Dynamics and Control 10–30


10.4.1 PID controller Second-order model with 𝐿𝐿 = 𝑁𝑁𝑁

Implementation
Process
Control
Laboratory
Using SIMULINK there are again various implementation options
 Easiest is to use the Discrete Transfer Fcn block. In this case the numerator
parameters are 1 𝑎𝑎1 𝑎𝑎2 , the denominator parameters are
1 (𝑑𝑑 − 1) −𝑑𝑑 , and the gain is 1⁄(2𝑁𝑁 + 1)𝑏𝑏1 .
 It is also possible to determine the controller parameters 𝐾𝐾c , 𝑇𝑇i , 𝑇𝑇d and 𝑇𝑇f
and to use the Discrete PID Controller block as explained in Section 10.2.3. If
the trapezoidal approximation is used
𝑎𝑎d = 𝑑𝑑 ⇒ 𝑇𝑇f = −ℎ/ ln 𝑑𝑑 (10.80a)
1−𝑎𝑎2 1−𝑑𝑑
𝑇𝑇i = ℎ − (10.80b)
1+𝑎𝑎1 +𝑎𝑎2 2(1+𝑑𝑑)
𝑇𝑇i 1+𝑎𝑎1 +𝑎𝑎2
𝐾𝐾c = ⋅ (10.80c)
ℎ (1+𝑑𝑑)(2𝑁𝑁+1)𝑏𝑏1
ℎ 1 1
𝑇𝑇d = ℎ − (10.80d)
𝑇𝑇i 1+𝑎𝑎1 +𝑎𝑎2 2(1+𝑑𝑑)

KEH Process Dynamics and Control 10–31


10. Digital Process Control 10.4 Controller synthesis using discrete model

Process 10.4.2 Time-delay compensation


Control
Laboratory
Closed-loop specification
A more direct way of specifying the desired control performance is to specify the
desired closed-loop performance instead of the loop transfer. Eq. (10.69) and
(10.70) yield the closed-loop pulse transfer operator
−1 𝐻𝐻(q−1 )𝐻𝐻c (q−1 )
𝐻𝐻r q = (10.81)
1+𝐻𝐻(q−1 )𝐻𝐻c (q−1 )

where 𝐻𝐻(q−1 ) and 𝐻𝐻c (q−1 ) are the pulse transfer operators of the process
and the controller. From (10.81) the controller needed to achieve 𝐻𝐻r q−1 can
be derived as done in “direct synthesis”, i.e.,
−1 1 𝐻𝐻r (q−1 )
𝐻𝐻c q = ⋅ (10.82)
𝐻𝐻(q−1 ) 1−𝐻𝐻r (q−1 )

The closed-loop system cannot have a smaller time delay than the open loop
system. Assume that the open-loop system has the time delay 𝐿𝐿 = 𝑁𝑁𝑁 + 𝜃𝜃,
0 ≤ 𝜃𝜃 < ℎ. According to (10.67), a first-order closed-loop system with this time
delay and the gain 𝐾𝐾 = 1 , which is desired for setpoint tracking, has a pulse
transfer operator of the form

KEH Process Dynamics and Control 10–32


10.4.2 Time-delay compensation Closed-loop specification

−1 1−𝛽𝛽+(𝛽𝛽−𝛼𝛼)q−1 −1−𝑁𝑁
𝐻𝐻r q = q (10.83)
Process 1−𝛼𝛼q−1
Control
Laboratory
where 𝛼𝛼 = e−ℎ/𝑇𝑇r , 𝛽𝛽 = 𝛼𝛼e𝜃𝜃/𝑇𝑇r , and 𝑇𝑇r is the desired closed-loop time constant.
Note that 𝛽𝛽 = 𝛼𝛼 if 𝜃𝜃 = 0, i.e., if the time delay is an integer multiple of the
sampling interval, 𝐿𝐿 = 𝑁𝑁𝑁. This choice of 𝐻𝐻r q−1 yields
𝐻𝐻r q−1 1−𝛽𝛽+(𝛽𝛽−𝛼𝛼)q−1
= q−1−𝑁𝑁 (10.84)
1−𝐻𝐻r q−1 −1 −1
1−𝛼𝛼q − 1−𝛽𝛽+(𝛽𝛽−𝛼𝛼)q q −1−𝑁𝑁

First-order time-delay system


A first-order time-delay system has the pulse transfer operator given in (10.67).
Substitution of (10.67) and (10.84) into (10.82) gives
−1 1+𝑎𝑎1 q−1 1−𝛽𝛽+(𝛽𝛽−𝛼𝛼)q−1
𝐻𝐻c q = ⋅ (10.85)
𝑏𝑏1 +𝑏𝑏2 q−1 1−𝛼𝛼q−1 − 1−𝛽𝛽+(𝛽𝛽−𝛼𝛼)q−1 q−1−𝑁𝑁

𝑐𝑐0 (1+𝑎𝑎1 q−1 )(1+𝑑𝑑2 q−1 )


= (10.86)
1+𝑑𝑑1 q−1 [1−𝛼𝛼q−1 − 1−𝛽𝛽 1+𝑑𝑑2 q−1 q−1−𝑁𝑁 ]
where
1−𝛽𝛽 𝑏𝑏2 𝛽𝛽−𝛼𝛼
𝑐𝑐0 = , 𝑑𝑑1 = , 𝑑𝑑2 = (10.87)
𝑏𝑏1 𝑏𝑏1 1−𝛽𝛽

KEH Process Dynamics and Control 10–33


Closed-loop specification First-order time-delay system

Eq. (10.86) gives a control law in difference form as


Process
Control
Laboratory 𝑢𝑢 𝑡𝑡𝑘𝑘 = 𝑐𝑐0 𝑒𝑒 𝑡𝑡𝑘𝑘 + (𝑎𝑎1 +𝑑𝑑2 )𝑒𝑒 𝑡𝑡𝑘𝑘−1 + 𝑎𝑎1 𝑑𝑑2 𝑒𝑒 𝑡𝑡𝑘𝑘−2
+ 𝛼𝛼 − 𝑑𝑑1 𝑢𝑢 𝑡𝑡𝑘𝑘−1 + 𝛼𝛼𝑑𝑑1 𝑢𝑢 𝑡𝑡𝑘𝑘−2 (10.88)
+ (1 − 𝛽𝛽) 𝑢𝑢 𝑡𝑡𝑘𝑘−1−𝑁𝑁 + (𝑑𝑑1 +𝑑𝑑2 )𝑢𝑢 𝑡𝑡𝑘𝑘−2−𝑁𝑁 + 𝑑𝑑1 𝑑𝑑2 𝑢𝑢 𝑡𝑡𝑘𝑘−3−𝑁𝑁
This is a PID-like controller (because of the 𝑒𝑒 terms) with delayed control signals
to compensate for the time delay.
If the time delay is an integer multiple of the sampling interval, i.e., if 𝜃𝜃 = 0,
then 𝑏𝑏2 = 0, 𝑑𝑑1 = 𝑑𝑑2 = 0, 𝛽𝛽 = 𝛼𝛼, and the control law reduces to the PI-like
control law
𝑢𝑢 𝑡𝑡𝑘𝑘 = 𝑐𝑐0 𝑒𝑒 𝑡𝑡𝑘𝑘 + 𝑎𝑎1 𝑒𝑒 𝑡𝑡𝑘𝑘−1
+ 𝛼𝛼𝑢𝑢 𝑡𝑡𝑘𝑘−1 + (1 − 𝛼𝛼)𝑢𝑢 𝑡𝑡𝑘𝑘−1−𝑁𝑁 (10.89)
The discrete-time control laws (10.88), (10.89) and (10.91), with explicit
compensation for the time delay, are known as Dahlin controllers (or Dahlin-
Higham’s algorithms). Because quite old information is used in the form of
delayed control signals, they can be expected to be sensitive to model errors,
especially concerning the time delay.

KEH Process Dynamics and Control 10–34


10.4.2 Time-delay compensation Closed-loop specification

Second-order time-delay system with 𝐿𝐿 = 𝑁𝑁𝑁


Process
Control
Laboratory
A second-order time-delay system, where the time delay is an integer multiple of
the time delay, has the pulse transfer operator (10.63). Substitution of (10.63)
and (10.84) into (10.82) yields
−1 1+𝑎𝑎1 q−1 +𝑎𝑎2 q−2 1−𝛼𝛼
𝐻𝐻c q = ⋅ (10.90)
𝑏𝑏1 +𝑏𝑏2 q−1 1−𝛼𝛼q−1 −(1−𝛼𝛼)q−1−𝑁𝑁

This gives the PID-like control law


𝑢𝑢 𝑡𝑡𝑘𝑘 = 𝑐𝑐0 𝑒𝑒 𝑡𝑡𝑘𝑘 + 𝑎𝑎1 𝑒𝑒 𝑡𝑡𝑘𝑘−1 + 𝑎𝑎2 𝑒𝑒 𝑡𝑡𝑘𝑘−2
+ 𝛼𝛼 − 𝑑𝑑1 𝑢𝑢 𝑡𝑡𝑘𝑘−1 + 𝛼𝛼𝑑𝑑1 𝑢𝑢 𝑡𝑡𝑘𝑘−2
+ 1 − 𝛼𝛼 [𝑢𝑢 𝑡𝑡𝑘𝑘−1−𝑁𝑁 + 𝑑𝑑1 𝑢𝑢 𝑡𝑡𝑘𝑘−2−𝑁𝑁 ] (10.91)
with 𝑐𝑐0 and 𝑑𝑑1 as given in (10.87).
Note that the control law (10.91) for a second-order system with 𝐿𝐿 = 𝑁𝑁𝑁 is less
complicated than the control law (10.88) for a first-order system with 𝐿𝐿 > 𝑁𝑁𝑁.
Implementation
In SIMULINK, the control laws (10.88), (10.89) and (10.91) can be implemented by
a Discrete Transfer Fcn block. Note that the denominator polynomial will have
many zeroes for the missing inputs up to 𝑢𝑢 𝑡𝑡𝑘𝑘−1−𝑁𝑁 .
KEH Process Dynamics and Control 10–35
10. Digital Process Control 10.4 Controller synthesis using discrete model

Process 10.4.3 Dead-beat control


Control
Laboratory
In the controller synthesis according to Dahlin-Higham’s method, the time
constant 𝑇𝑇r of a desired first-order closed-loop system is specified. How short
can 𝑇𝑇r be? The theoretical minimum is 𝑇𝑇r = 0, of course. This results in the
closed-loop transfer operator as a pure time delay
𝐻𝐻r q−1 = q−1−𝑁𝑁 (10.92)
Substitution into (10.82) yields the controller as
−1 1 q−1−𝑁𝑁
𝐻𝐻c q = ⋅ (10.93)
𝐻𝐻(q−1 ) 1−q−1−𝑁𝑁

where q−1−𝑁𝑁 can be cancelled against the same operator in the pulse transfer
operator 𝐻𝐻(q−1 ) of the model.

This kind of controller is called a dead-beat controller. There is no corresponding


continuous-time controller since 𝑇𝑇r = 0 would require an infinite controller gain
in the continuous-time case.

KEH Process Dynamics and Control 10–36


10.4 Controller synthesis using discrete model 10.4.3 Dead-beat control

First-order time-delay model


Process
Control
Laboratory
A first-order time-delay system has the pulse transfer operator given in (10.67).
Substitution of (10.67) into (10.93) gives
−1 1+𝑎𝑎1 q−1 1 𝑏𝑏1−1 (1+𝑎𝑎1 q−1 )
𝐻𝐻c q = ⋅ = (10.94)
𝑏𝑏1 +𝑏𝑏2 q−1 1−q−1−𝑁𝑁 1+𝑑𝑑1 q−1 (1−q−1−𝑁𝑁 )

where 𝑑𝑑1 is as defined in (10.87). The control law in difference form is


𝑢𝑢 𝑡𝑡𝑘𝑘 = 𝑏𝑏1−1 𝑒𝑒 𝑡𝑡𝑘𝑘 + 𝑎𝑎1 𝑒𝑒 𝑡𝑡𝑘𝑘−1
+ 𝑢𝑢 𝑡𝑡𝑘𝑘−1−𝑁𝑁 − 𝑑𝑑1 [𝑢𝑢 𝑡𝑡𝑘𝑘−1 − 𝑢𝑢 𝑡𝑡𝑘𝑘−2−𝑁𝑁 ] (10.95)
This is PI-like control law where the dominating old control signal is 𝑢𝑢 𝑡𝑡𝑘𝑘−1−𝑁𝑁
instead of 𝑢𝑢 𝑡𝑡𝑘𝑘−1 . Note that 𝑑𝑑1 = 0 if 𝐿𝐿 = 𝑁𝑁𝑁 (i.e., 𝜃𝜃 = 0).

Second-order time-delay system with 𝐿𝐿 = 𝑁𝑁𝑁


For a second-order time-delay system with 𝐿𝐿 = 𝑁𝑁𝑁, the control law becomes
𝑢𝑢 𝑡𝑡𝑘𝑘 = 𝑏𝑏1−1 𝑒𝑒 𝑡𝑡𝑘𝑘 + 𝑎𝑎1 𝑒𝑒 𝑡𝑡𝑘𝑘−1 + 𝑎𝑎2 𝑒𝑒 𝑡𝑡𝑘𝑘−2
+ 𝑢𝑢 𝑡𝑡𝑘𝑘−1−𝑁𝑁 − 𝑑𝑑1 [𝑢𝑢 𝑡𝑡𝑘𝑘−1 − 𝑢𝑢 𝑡𝑡𝑘𝑘−2−𝑁𝑁 ] (10.96)
which is a PID-like controller.

KEH Process Dynamics and Control 10–37


10. Digital Process Control 10.4 Controller synthesis using discrete model

Process 10.4.4 Improving intersample behaviour


Control
Laboratory
Intersample ripple
A possible problem with discrete-time control of a continuous-time system is the
behaviour between the sample points, as illustrated by the figure.
 If only the sample points of the output 𝑦𝑦 are considered, the step response
looks like the response of a first-order system.
 The true continuous-time value of 𝑦𝑦 oscillates; this is called intersample ripple
(or ringing).
 The input signal oscillates at sample points (and in continuous time).

∘ = sample point, full line = continuous-time value [SEMD]


KEH Process Dynamics and Control 10–38
10.4.4 Improving intersample behaviour Intersample ripple

In particular, intersample ripple can occur when a discrete-time controller has


Process
Control been designed based on the inverse of a discrete-time (sampled) model.
Laboratory

 When a continuous-time model is sampled using standard techniques, the


transfer function of the sampled model often receives a zero close to −1 (but
slightly > −1) even if the continuous-time model has no zero;
𝐾𝐾e−𝐿𝐿𝐿𝐿 −1 𝑏𝑏0 +𝑏𝑏1 q−1 𝑏𝑏1
– e.g. 𝐺𝐺 𝑠𝑠 = ⇒ 𝐻𝐻 q = −1 −2 q−1−𝑁𝑁 , <≈ 1.
(𝑇𝑇1 𝑠𝑠+1)(𝑇𝑇2 𝑠𝑠+1) 1+𝑎𝑎1 q +𝑎𝑎2 q 𝑏𝑏0

 If the controller design is based on the inverse of 𝐻𝐻 q−1 , 𝑏𝑏0 + 𝑏𝑏1 q−1
becomes a pole of the controller, i.e., a controller pole close to −1, which
causes intersample ripple.

KEH Process Dynamics and Control 10–39


10.4 Controller synthesis using discrete model 10.4.4 Intersample behaviour

Elimination of intersample ripple


Process
Control
Laboratory
There are basically two ways to eliminate intersample ripple.
Dahlin’s modification
According to Dahlin’s modification, the denominator 𝑏𝑏1 + 𝑏𝑏2 q−1 of the model
used in the controller synthesis is replaced by 𝑏𝑏1 + 𝑏𝑏2 . Instead of the model
(10.63), for example,
𝑏𝑏1 +𝑏𝑏2
𝐻𝐻 q−1 = −1 −2 q−1−𝑁𝑁 (10.97)
1+𝑎𝑎1 q +𝑎𝑎2 q

is used. The figure illustrates the control performance with such a modification.
There is
 no intersample ripple
 no (extensive) control signal oscillations

KEH Process Dynamics and Control 10–40


10.4.4 Improving intersample behaviour Elimination of intersample ripple

Vogel-Edgar modification
Process
Control Vogel and Edgar have suggested that 𝑏𝑏1 + 𝑏𝑏2 q−1 be included in the numerator
Laboratory
of the desired closed-loop model. Instead of, for example, the desired first-order
model
1−𝛼𝛼
𝐻𝐻r q−1 = −1 q
−1−𝑁𝑁
(10.98)
1−𝛼𝛼q
the controller synthesis is done to obtain the closed-loop transfer operator
−1 (1−𝛼𝛼)(𝑏𝑏1 +𝑏𝑏2 q−1 ) −1−𝑁𝑁
𝐻𝐻r q = q  (10.99)
1−𝛼𝛼q−1
The figure shows the control performance with this modification. There is
 no intersample ripple
 no control signal oscillations
 smother but slightly slower response than with Dahlin’s modification

KEH Process Dynamics and Control 10–41


10. Digital Process Control

Process
Control
10.5 Example: comparison of various controllers
Laboratory
10.5.1 Example system
In Exercise 10.3.2 the pulse transfer operator was determined for the system
𝐾𝐾e−𝐿𝐿𝐿𝐿
𝐺𝐺 𝑠𝑠 = (10.100)
(𝑇𝑇1 𝑠𝑠+1)(𝑇𝑇2 𝑠𝑠+1)

with 𝐾𝐾 = 1, 𝐿𝐿 = 1 min, 𝑇𝑇1 = 1 min, 𝑇𝑇2 = 0.5 min, ℎ = 0.1 min. The result was
−1 𝑏𝑏1 +𝑏𝑏𝑞𝑞 q−1 −1−𝑁𝑁
𝐻𝐻 q = q (10.101)
1+𝑎𝑎1 q−1 +𝑎𝑎2 q −2

with
𝑎𝑎1 = −1.7236, 𝑎𝑎2 = 0.7408, 𝑏𝑏1 = 0.009056, 𝑏𝑏2 = 0.008194, 𝑁𝑁 = 10.

Four different discrete-time controllers are to be compared:


 a discretized PID controller tuned by Ziegler-Nichols’s method
 a discrete PID controller tuned for small overshoot (4 %)
 a Dahlin controller with 𝑇𝑇r = 0.5 min and wrong model
 a Dahlin controller with 𝑇𝑇r = 0.5 min and correct model

KEH Process Dynamics and Control 8–42


10. Digital Process Control 10.5 Example: comparison of controllers

Process 10.5.2 Discretized PID with Ziegler-Nichols tuning


Control
Laboratory
The system (10.100) has the phase shift
𝜑𝜑 = −𝐿𝐿𝐿𝐿 − arctan 𝑇𝑇1 𝜔𝜔 − arctan 𝑇𝑇2 𝜔𝜔
= −1𝜔𝜔 − arctan 1𝜔𝜔 − arctan 0.5𝜔𝜔
which for the phase shift 𝜑𝜑 = −𝜋𝜋 yields the critical frequency 𝜔𝜔c = 1.5094
rad/min. The amplitude ratio at this frequency is
𝐾𝐾 1
𝐺𝐺(𝜔𝜔c ) = = = 0.4408
1+(𝑇𝑇1 𝜔𝜔c )2 1+(𝑇𝑇2 𝜔𝜔c )2 1+1.5094 2 1+0.25⋅1.5094 2

from which the ultimate gain 𝐾𝐾c,max = 1/0.4408 ≈ 2.27. According to


Ziegler-Nichols’s recommendations for a PID controller, this yields
𝐾𝐾c = 0.6𝐾𝐾c,max = 1.36, 𝑇𝑇i = 𝜋𝜋⁄𝜔𝜔c = 2.08 min, 𝑇𝑇d = 0.25𝑇𝑇i = 0.52 min.
Combination of (10.33–37) and the parameters for the backward-difference
approximation gives for an ideal PID controller
ℎ 𝑇𝑇d 2𝑇𝑇d 𝑇𝑇d
𝑢𝑢 𝑡𝑡𝑘𝑘 = 𝐾𝐾c 1+ + 𝑒𝑒 𝑡𝑡𝑘𝑘 − 1 − 𝑒𝑒 𝑡𝑡𝑘𝑘−1 + 𝑒𝑒(𝑡𝑡𝑘𝑘−2 ) + 𝑢𝑢(𝑡𝑡𝑘𝑘−1 )
𝑇𝑇i ℎ ℎ ℎ
which here results in
𝑢𝑢 𝑡𝑡𝑘𝑘 = 8.51𝑒𝑒 𝑡𝑡𝑘𝑘 − 15.5𝑒𝑒 𝑡𝑡𝑘𝑘−1 + 7.08𝑒𝑒 𝑡𝑡𝑘𝑘−2 + 𝑢𝑢(𝑡𝑡𝑘𝑘−1 )
KEH Process Dynamics and Control 10–43
10. Digital Process Control 10.5 Example: comparison of controllers

Process 10.5.3 Discrete PID tuned for small overshoot


Control
Laboratory
The pulse transfer operator (10.101) yields the controller (10.79), i.e.,
1
𝑢𝑢 𝑡𝑡𝑘𝑘 = 𝑒𝑒 𝑡𝑡𝑘𝑘 + 𝑎𝑎1 𝑒𝑒 𝑡𝑡𝑘𝑘−1 + 𝑎𝑎2 𝑒𝑒 𝑡𝑡𝑘𝑘−2 + 𝑢𝑢 𝑡𝑡𝑘𝑘−1
(2𝑁𝑁+1)𝑏𝑏1

+𝑑𝑑 𝑢𝑢 𝑡𝑡𝑘𝑘−1 − 𝑢𝑢 𝑡𝑡𝑘𝑘−2


where 𝑑𝑑 = 𝑏𝑏2 ⁄𝑏𝑏1 . Numerically, this results in
𝑢𝑢 𝑡𝑡𝑘𝑘 = 5.26𝑒𝑒 𝑡𝑡𝑘𝑘 − 9.06𝑒𝑒 𝑡𝑡𝑘𝑘−1 + 3.90𝑒𝑒 𝑡𝑡𝑘𝑘−2 + 𝑢𝑢 𝑡𝑡𝑘𝑘−1
− 0.905 𝑢𝑢 𝑡𝑡𝑘𝑘−1 − 𝑢𝑢(𝑡𝑡𝑘𝑘−2 )

KEH Process Dynamics and Control 10–44


10. Digital Process Control 10.5 Example: comparison of controllers

Process 10.5.4 Dahlin controller and wrong model


Control
Laboratory
Assume that
𝐾𝐾e−𝐿𝐿𝐿𝐿
𝐺𝐺 𝑠𝑠 =
𝑇𝑇𝑇𝑇+1

with 𝐾𝐾 = 1, 𝐿𝐿 = 1 min, and 𝑇𝑇 = 1.5 min is thought to be the correct model.


The corresponding pulse transfer operator is then
𝑏𝑏1
𝐻𝐻 q−1 = −1 q−1−𝑁𝑁
1+𝑎𝑎1 q

with 𝑎𝑎1 = e−ℎ/𝑇𝑇 ≈ 0.9355, 𝑏𝑏1 = 𝐾𝐾(1 + 𝑎𝑎1 ) ≈ 0.06449, 𝑁𝑁 = 10. According to
(10.89), the control law is
1−𝛼𝛼
𝑢𝑢 𝑡𝑡𝑘𝑘 = 𝑒𝑒 𝑡𝑡𝑘𝑘 + 𝑎𝑎1 𝑒𝑒 𝑡𝑡𝑘𝑘−1 + 𝑢𝑢 𝑡𝑡𝑘𝑘−1
𝑏𝑏1
+ (1 − 𝛼𝛼) 𝑢𝑢 𝑡𝑡𝑘𝑘−1 − 𝑢𝑢 𝑡𝑡𝑘𝑘−1−𝑁𝑁

With 𝛼𝛼 = e−ℎ/𝑇𝑇r = e−0.1/0.5 ≈ 0.8187, this gives


𝑢𝑢 𝑡𝑡𝑘𝑘 = 2.81𝑒𝑒 𝑡𝑡𝑘𝑘 − 2.63𝑒𝑒 𝑡𝑡𝑘𝑘−1 + 𝑢𝑢 𝑡𝑡𝑘𝑘−1
− 0.181 𝑢𝑢 𝑡𝑡𝑘𝑘−1 − 𝑢𝑢(𝑡𝑡𝑘𝑘−11 )

KEH Process Dynamics and Control 10–45


10. Digital Process Control 10.5 Example: comparison of controllers

Process 10.5.5 Dahlin controller and correct model


Control
Laboratory
With the correct model, the Dahlin controller is given by (10.91):
𝑢𝑢 𝑡𝑡𝑘𝑘 = 𝑐𝑐0 𝑒𝑒 𝑡𝑡𝑘𝑘 + 𝑎𝑎1 𝑒𝑒 𝑡𝑡𝑘𝑘−1 + 𝑎𝑎2 𝑒𝑒 𝑡𝑡𝑘𝑘−2 + 𝛼𝛼 − 𝑑𝑑1 𝑢𝑢 𝑡𝑡𝑘𝑘−1 + 𝛼𝛼𝑑𝑑1 𝑢𝑢 𝑡𝑡𝑘𝑘−2
+ 1 − 𝛼𝛼 [𝑢𝑢 𝑡𝑡𝑘𝑘−1−𝑁𝑁 + 𝑑𝑑1 𝑢𝑢 𝑡𝑡𝑘𝑘−2−𝑁𝑁 ]
where 𝑐𝑐0 = (1 − 𝛼𝛼)⁄𝑏𝑏1 and 𝑑𝑑1 = 𝑏𝑏2 ⁄𝑏𝑏1 . 𝛼𝛼 = e−ℎ/𝑇𝑇r ≈ 0.8187 gives
𝑢𝑢 𝑡𝑡𝑘𝑘 = 20.0𝑒𝑒 𝑡𝑡𝑘𝑘 − 34.5𝑒𝑒 𝑡𝑡𝑘𝑘−1 + 14.8𝑒𝑒 𝑡𝑡𝑘𝑘−2
− 0.086𝑢𝑢 𝑡𝑡𝑘𝑘−1 + 0.741𝑢𝑢 𝑡𝑡𝑘𝑘−2 − 0.181𝑢𝑢 𝑡𝑡𝑘𝑘−11 + 0.164𝑢𝑢(𝑡𝑡𝑘𝑘−12 )

10.5.6 Simulations
 Ziegler-Nichols PID (—)
 Small overshoot PID (– –)
 Dahlin controller with
wrong model (– ⋅ – ⋅)
 Dahlin controller with
correct model (⋅⋅⋅⋅)

KEH Process Dynamics and Control 10–46

You might also like