10. digital process control - Åbo akademi · process control laboratory 10. digital process...

46
Process Control Laboratory 10. Digital Process Control 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

Upload: hoangnhi

Post on 07-Apr-2018

219 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10. Digital Process Control10.1 Basic principle of digital control10.2 Digital PID controllers

10.2.1 A 2DOF continuous-time PID controller10.2.2 Discretisation of PID controllers10.2.3 Implementation and tuning

10.3 Sampling of time-delay models10.3.1 State-space model with a time delay10.3.2 Second-order model with real poles and zero10.3.3 First-order model

10.4 Controller synthesis using discrete-time model10.4.1 PID controller10.4.2 Time-delay compensation10.4.3 Dead-beat control10.4.4 Improving intersample behaviour

10.5 Example: comparison of various controllers

KEH Process Dynamics and Control 10–1

Page 2: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10. Digital Process Control

10.1 Basic principle of digital controlThe block “Sample” receivesthe continuous-time signals𝑦𝑦(𝑡𝑡) and 𝑟𝑟(𝑡𝑡), and discre-tises them to sequences ofnumbers, 𝑦𝑦(𝑡𝑡𝑖𝑖) and 𝑟𝑟(𝑡𝑡𝑖𝑖),defined at the time instants𝑡𝑡𝑖𝑖, 𝑖𝑖 = 1,2, …In practice, this is an A/Dconverter.

The block “Hold” receivesthe sequence of numbers𝑢𝑢(𝑡𝑡𝑖𝑖), 𝑖𝑖 = 1,2, …, from thecontrol algorithm and sendsout a piecewise continuoussignal, 𝑢𝑢 𝑡𝑡 = 𝑢𝑢(𝑡𝑡𝑖𝑖),𝑡𝑡𝑖𝑖 ≤ 𝑡𝑡 < 𝑡𝑡𝑖𝑖+1.In practice, this is a D/Aconverter.

KEH Process Dynamics and Control 10–2

Page 3: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10. Digital Process Control

10.2 Digital PID controllers

Many variants of continuous-time PID controllers were introduced in Section 7.1. A flexible form of the PID controller is

𝑢𝑢 𝑡𝑡 = 𝐾𝐾c 𝑒𝑒p 𝑡𝑡 + 1𝑇𝑇i∫0𝑡𝑡 𝑒𝑒 𝜏𝜏 d𝜏𝜏 + 𝑇𝑇d

d𝑒𝑒f(𝑡𝑡)d𝑡𝑡

+ 𝑢𝑢0 (10.1)

𝑒𝑒p(𝑡𝑡) ≡ 𝑏𝑏𝑟𝑟(𝑡𝑡) − 𝑦𝑦(𝑡𝑡), 𝑒𝑒(𝑡𝑡) ≡ 𝑟𝑟(𝑡𝑡) − 𝑦𝑦(𝑡𝑡), 𝑒𝑒f(𝑡𝑡) ≡ 𝑐𝑐𝑟𝑟(𝑡𝑡) − 𝑦𝑦f(𝑡𝑡) (10.2)

𝑇𝑇fd𝑦𝑦f(𝑡𝑡)d𝑡𝑡

+ 𝑦𝑦f 𝑡𝑡 = 𝑦𝑦(𝑡𝑡) (10.3)

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)

𝑢𝑢i 𝑡𝑡 = 𝐾𝐾c𝑇𝑇i∫0𝑡𝑡 𝑒𝑒 𝜏𝜏 d𝜏𝜏 ⇔ d𝑢𝑢i(𝑡𝑡)

d𝑡𝑡= 𝐾𝐾c

𝑇𝑇i𝑒𝑒(𝑡𝑡) (10.6)

𝑢𝑢d 𝑡𝑡 = 𝐾𝐾c𝑇𝑇dd𝑒𝑒f(𝑡𝑡)d𝑡𝑡

(10.7)

KEH Process Dynamics and Control 10–3

10.2.1 A 2DOF continuous-time PID controller

Page 4: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10. Digital Process Control

10.2.2 Discretisation of PID controllersA 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 approximationAccording to the definition of a derivative,

d𝑥𝑥 𝑡𝑡d𝑡𝑡

= limℎ→0

𝑥𝑥 𝑡𝑡+ℎ −𝑥𝑥 𝑡𝑡ℎ

(10.8)

A natural approximation of the derivative is thend𝑥𝑥(𝑡𝑡)d𝑡𝑡

≈ 𝑥𝑥 𝑡𝑡+ℎ −𝑥𝑥(𝑡𝑡)ℎ

(10.9)

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

Page 5: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.2 Digital PID controllers

Backward-difference approximationBy a slight modification of (10.9), the derivative can be approximated by

d𝑥𝑥(𝑡𝑡)d𝑡𝑡

≈ 𝑥𝑥 𝑡𝑡 −𝑥𝑥(𝑡𝑡−ℎ)ℎ

(10.11)

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

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

𝑇𝑇i𝑒𝑒(𝑡𝑡𝑘𝑘)   (10.13)

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

Page 6: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.2.2 Discretisation of PID controllers

It is convenient to derive the derivative part via the Laplace domain. Combination of (10.3) and (10.7) in the Laplace domain yields

𝑇𝑇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

𝑇𝑇fd𝑢𝑢d(𝑡𝑡)d𝑡𝑡

+ 𝑢𝑢d 𝑡𝑡 = 𝐾𝐾c𝑇𝑇dd𝑒𝑒d(𝑡𝑡)d𝑡𝑡

(10.16)

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

𝑇𝑇f𝑢𝑢d 𝑡𝑡𝑘𝑘 −𝑢𝑢d(𝑡𝑡𝑘𝑘−1)

ℎ+ 𝑢𝑢d 𝑡𝑡𝑘𝑘 = 𝐾𝐾c𝑇𝑇d

𝑒𝑒d 𝑡𝑡𝑘𝑘 −𝑒𝑒d(𝑡𝑡𝑘𝑘−1)ℎ

or after rearrangement

𝑢𝑢d 𝑡𝑡𝑘𝑘 = 𝑇𝑇f𝑇𝑇f+ℎ

𝑢𝑢d 𝑡𝑡𝑘𝑘−1 + 𝐾𝐾c𝑇𝑇d𝑇𝑇f+ℎ

𝑒𝑒d 𝑡𝑡𝑘𝑘 − 𝑒𝑒d(𝑡𝑡𝑘𝑘−1) (10.17)

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

Backward difference

Page 7: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.2 Digital PID controllers

Tustin’s bilinear approximationThe 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 by12

d𝑥𝑥(𝑡𝑡)d𝑡𝑡

+ d𝑥𝑥(𝑡𝑡−ℎ)d𝑡𝑡

≈ 𝑥𝑥 𝑡𝑡 −𝑥𝑥 𝑡𝑡−ℎℎ

(10.18)

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.2 Discretisation of PID controllers

Page 8: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.2 Digital PID controllers

Trapezoidal approximationIn 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-differenceand 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

Page 9: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.2.2 Discretisation of PID controllers

Using the trapezoidal approximation, (10.6) gives for the integral part

𝑢𝑢i 𝑡𝑡𝑘𝑘 = ℎ𝐾𝐾c𝑇𝑇i∑𝑗𝑗=1𝑘𝑘 0.5 𝑒𝑒(𝑡𝑡𝑗𝑗−1) + 𝑒𝑒(𝑡𝑡𝑗𝑗) (10.19)

which can be rewritten as

𝑢𝑢i 𝑡𝑡𝑘𝑘 = 𝑢𝑢i 𝑡𝑡𝑘𝑘−1 + ℎ𝐾𝐾c2𝑇𝑇i

𝑒𝑒 𝑡𝑡𝑘𝑘 + 𝑒𝑒(𝑡𝑡𝑘𝑘−1) (10.20)

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 𝑠𝑠 = 𝑠𝑠𝑇𝑇f𝑠𝑠+1

𝐸𝐸d(𝑠𝑠) (10.21)

KEH Process Dynamics and Control 10–9

Trapezoidal approximation

Page 10: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.2.2 Discretisation of PID controllers

According to the trapezoidal approximation, 𝑒𝑒d(𝑡𝑡) changes linearly between sampling points. The Laplace transform of these changes up to time 𝑡𝑡 = 𝑡𝑡𝑘𝑘 is (note that 𝑗𝑗 is an integer, not the imaginary unit j = −1)

𝐸𝐸d 𝑠𝑠 = 𝑒𝑒d(𝑡𝑡0)𝑠𝑠

+ 𝑒𝑒d 𝑡𝑡1 −𝑒𝑒d(𝑡𝑡0)ℎ𝑠𝑠2

+∑𝑗𝑗=1𝑘𝑘−1 𝑒𝑒d(𝑡𝑡𝑗𝑗+1)−2𝑒𝑒d(𝑡𝑡𝑗𝑗)+𝑒𝑒d(𝑡𝑡𝑗𝑗−1)ℎ𝑠𝑠2

e−𝑗𝑗ℎ𝑠𝑠 (10.22)

Substitution into (10.21) and taking the inverse Laplace transform yieldsd𝑒𝑒f(𝑡𝑡𝑘𝑘)d𝑡𝑡

= 𝑒𝑒d(𝑡𝑡0)𝑇𝑇f

e−𝑡𝑡𝑘𝑘/𝑇𝑇f + 𝑒𝑒d 𝑡𝑡1 −𝑒𝑒d 𝑡𝑡0ℎ

(1 − e−(𝑡𝑡𝑘𝑘−𝑗𝑗ℎ)/𝑇𝑇f)

+∑𝑗𝑗=1𝑘𝑘−1 𝑒𝑒d(𝑡𝑡𝑗𝑗+1)−2𝑒𝑒d(𝑡𝑡𝑗𝑗)+𝑒𝑒d(𝑡𝑡𝑗𝑗−1)ℎ

(1 − e−(𝑡𝑡𝑘𝑘−𝑗𝑗ℎ)/𝑇𝑇f)

Combination with the corresponding expression for d𝑒𝑒f(𝑡𝑡𝑘𝑘−1)/d𝑡𝑡 yields

d𝑦𝑦f(𝑡𝑡𝑘𝑘)d𝑡𝑡

= d𝑦𝑦f(𝑡𝑡𝑘𝑘−1)d𝑡𝑡

e−ℎ/𝑇𝑇f + 𝑒𝑒d 𝑡𝑡𝑘𝑘 −𝑒𝑒d 𝑡𝑡𝑘𝑘−1ℎ

(1 − e−ℎ/𝑇𝑇f) (10.23)

Combination with (10.7) finally gives

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

𝑒𝑒d 𝑡𝑡𝑘𝑘 − 𝑒𝑒d(𝑡𝑡𝑘𝑘−1) (10.24)

KEH Process Dynamics and Control 10–10

Trapezoidal approximation

Page 11: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10. Digital Process Control

10.2.3 Implementation and tuningUnification of methodsThe 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.

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

Method 𝒃𝒃𝐢𝐢𝟏𝟏 𝒃𝒃𝐢𝐢𝟐𝟐 𝒂𝒂𝐝𝐝 𝒃𝒃𝐝𝐝

Backward𝐾𝐾cℎ𝑇𝑇i

0𝑇𝑇f

𝑇𝑇f + ℎ𝐾𝐾c𝑇𝑇d𝑇𝑇f + ℎ

Trapezoid𝐾𝐾cℎ2𝑇𝑇i

𝐾𝐾cℎ2𝑇𝑇i

e−ℎ/𝑇𝑇f 𝐾𝐾c𝑇𝑇dℎ

1 − e−ℎ/𝑇𝑇f

Page 12: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.2 Digital PID controllers

Preventing integrator windupIf 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 changeis made at 𝑡𝑡 = 0 (upper).The control signal 𝑢𝑢 im-mediately reaches its maxi-mum value 0.1 (middle).The integral 𝑢𝑢i continuesto increase as long as𝑦𝑦 < 𝑟𝑟 (lower). The control signal willremain at the maximumvalue until the integraldecreases sufficiently eventhough 𝑦𝑦 > 𝑟𝑟. After this,the control signal mightreach its minimum valueand oscillations follow.

KEH Process Dynamics and Control 10–12

10.2.3 Implementation and tuning

iu

u

y

r

Page 13: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.2.3 Implementation and tuning

Integrator windup can be prevented in many ways. One way is to adjust the value of the integrator so that the calculated control signal with the adjusted integrator exactly reaches the constraint. This is achieved with

𝑢𝑢i 𝑡𝑡 = 𝐾𝐾c𝑇𝑇i∫0𝑡𝑡 𝑒𝑒 𝜏𝜏 d𝜏𝜏 + 1

𝑇𝑇t∫0𝑡𝑡 𝑒𝑒s 𝜏𝜏 d𝜏𝜏 (10.27)

where 𝑒𝑒s 𝑡𝑡 ≡ min 𝑢𝑢max, max 𝑢𝑢min,𝑢𝑢 𝑡𝑡 − 𝑢𝑢(𝑡𝑡) (10.28)This function has theproperty that 𝑒𝑒s = 0 if𝑢𝑢min ≤ 𝑢𝑢 ≤ 𝑢𝑢max ,

otherwise𝑒𝑒s = 𝑢𝑢max/min − 𝑢𝑢 .

𝑇𝑇t is the tracking timeconstant, which shouldbe chosen as𝑇𝑇d < 𝑇𝑇t < 𝑇𝑇i .

A reasonable value is𝑇𝑇t = 𝑇𝑇i𝑇𝑇d. If 𝑇𝑇d = 0,𝑇𝑇t = 0.1𝑇𝑇i can be used.

The figure illustrates howthis anti-windup works.(Note different time scale.)KEH Process Dynamics and Control 10–13

Preventing integrator windup

iu

u

y

r

Page 14: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.2.3 Implementation and tuning

Discrete-time controlFor discrete-time control, (10.27) can be discretised similarly to (10.6). Because

d𝑢𝑢i(𝑡𝑡)d𝑡𝑡

= 𝐾𝐾c𝑇𝑇i𝑒𝑒 𝑡𝑡 + 1

𝑇𝑇t𝑒𝑒s(𝑡𝑡) (10.30)

the backward-difference approximation yields

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

𝑇𝑇t𝑒𝑒s(𝑡𝑡𝑘𝑘) (10.31)

and the trapezoidal approximation yields

𝑢𝑢i 𝑡𝑡𝑘𝑘 = 𝑢𝑢i 𝑡𝑡𝑘𝑘−1 + ℎ𝐾𝐾c2𝑇𝑇i

𝑒𝑒 𝑡𝑡𝑘𝑘 + 𝑒𝑒(𝑡𝑡𝑘𝑘−1)

+ ℎ2𝑇𝑇t

𝑒𝑒s 𝑡𝑡𝑘𝑘 + 𝑒𝑒s(𝑡𝑡𝑘𝑘−1) (10.32)

KEH Process Dynamics and Control 10–14

Preventing integrator windup

Page 15: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.2 Digital PID controllers

Incremental control algorithmsThe 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.3 Implementation and tuning

Page 16: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.2 Digital PID controllers

Choice of sampling intervalThere 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 informationat 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.3 Implementation and tuning

Page 17: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.2 Digital PID controllers

TuningBecause 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 setpointchanges can be handled exactly. The correct handling is achieved if the derivative setpoint weight �̃�𝑐 in the continuous case is changed to

𝑐𝑐 = ℎ ̃𝑐𝑐𝑇𝑇f 1−e−ℎ/𝑇𝑇f

for the trapezoidal approximation

𝑐𝑐 = (𝑇𝑇f+ℎ) ̃𝑐𝑐𝑇𝑇f

for the backward-difference approximation (this is approximate)

KEH Process Dynamics and Control 10–17

10.2.3 Implementation and tuning

Page 18: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.2 Digital PID controllers

Implementation in SIMULINK

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 approximationis used both for the integratorand the filter

𝑁𝑁 = 2ℎ1−e−ℎ/𝑇𝑇f

1+e−ℎ/𝑇𝑇f

If the backward approximationis used 𝑁𝑁 = 1/𝑇𝑇f

SIMULINK’s derivative implemen-tation requires 𝑁𝑁 > 0 !

KEH Process Dynamics and Control 10–18

10.2.3 Implementation and tuning

Page 19: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10. Digital Process Control

10.3 Sampling of time-delay models

SamplingA 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

Page 20: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.3.1 State-space model with a time delay

Splitting the integral in the indicated way yields

𝐱𝐱 𝑡𝑡𝑘𝑘+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

𝐒𝐒𝑡𝑡 ≡ ∫0𝑡𝑡 e𝐀𝐀𝜏𝜏d𝜏𝜏 = 𝐈𝐈 + 1

2!𝐀𝐀𝑡𝑡 + 1

3!𝐀𝐀2𝑡𝑡2 + 1

4!𝐀𝐀3𝑡𝑡3 + ⋯ 𝑡𝑡 (10.43)

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

Sampling

Page 21: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.3 Sampling of time-delay models

Pulse transfer operatorGenerally, a state-space model with a time delay 𝐿𝐿 = 𝑁𝑁ℎ + 𝜃𝜃, 0 ≤ 𝜃𝜃 < ℎ, for all inputs has the form

𝐱𝐱 𝑡𝑡𝑘𝑘+1 = 𝐅𝐅𝐱𝐱 𝑡𝑡𝑘𝑘 + 𝐆𝐆0𝐁𝐁(𝑡𝑡𝑘𝑘−𝑁𝑁) + 𝐆𝐆1𝐁𝐁(𝑡𝑡𝑘𝑘−1−𝑁𝑁)𝐲𝐲 𝑡𝑡𝑘𝑘 = 𝐂𝐂𝐱𝐱 𝑡𝑡𝑘𝑘 + 𝐃𝐃0𝐁𝐁(𝑡𝑡𝑘𝑘−𝑁𝑁) + 𝐃𝐃1𝐁𝐁(𝑡𝑡𝑘𝑘−1−𝑁𝑁) (10.46)

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𝐱𝐱 𝑡𝑡𝑘𝑘 = 𝐅𝐅𝐱𝐱 𝑡𝑡𝑘𝑘 + 𝐆𝐆0q−𝑁𝑁𝐁𝐁(𝑡𝑡𝑘𝑘) + 𝐆𝐆1q−1−𝑁𝑁𝐁𝐁(𝑡𝑡𝑘𝑘)𝐲𝐲 𝑡𝑡𝑘𝑘 = 𝐂𝐂𝐱𝐱 𝑡𝑡𝑘𝑘 + 𝐃𝐃0q−𝑁𝑁𝐁𝐁(𝑡𝑡𝑘𝑘) + 𝐃𝐃1q−1−𝑁𝑁𝐁𝐁(𝑡𝑡𝑘𝑘)

(10.48)

from which𝐱𝐱 𝑡𝑡𝑘𝑘 = q𝐈𝐈 − 𝐅𝐅 −1 𝐆𝐆0 + 𝐆𝐆1q−1 q−𝑁𝑁𝐁𝐁(𝑡𝑡𝑘𝑘)

𝐲𝐲 𝑡𝑡𝑘𝑘 = 𝐂𝐂 q𝐈𝐈 − 𝐅𝐅 −1 𝐆𝐆0 + 𝐆𝐆1q−1 + 𝐃𝐃0 + 𝐃𝐃1q−1 q−𝑁𝑁𝐁𝐁(𝑡𝑡𝑘𝑘)(10.49)

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 + 𝐆𝐆1q−1 + 𝐃𝐃0 + 𝐃𝐃1q−1 q−𝑁𝑁 (10.50)

KEH Process Dynamics and Control 10–21

10.3.1 State-space model

Page 22: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10. Digital Process Control

10.3.2 Second-order model with real poles and zeroDiagonal state-space formA second-order time-delay system with two distinct real poles and a possible zero has the transfer function

𝐺𝐺 𝑠𝑠 = 𝐾𝐾(𝑇𝑇3𝑠𝑠+1)e−𝐿𝐿𝐿𝐿

(𝑇𝑇1𝑠𝑠+1)(𝑇𝑇2𝑠𝑠+1)= 𝑘𝑘1

𝑠𝑠−𝜆𝜆1− 𝑘𝑘2

𝑠𝑠−𝜆𝜆2e−𝐿𝐿𝑠𝑠 (10.51)

where𝜆𝜆1 = −1/𝑇𝑇1 , 𝜆𝜆2 = −1/𝑇𝑇2 (10.52a)

𝑘𝑘1 = 𝐾𝐾(𝑇𝑇1−𝑇𝑇3)𝑇𝑇1(𝑇𝑇1−𝑇𝑇2)

, 𝑘𝑘2 = 𝐾𝐾(𝑇𝑇3−𝑇𝑇2)𝑇𝑇2(𝑇𝑇1−𝑇𝑇2)

(10.52b)

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

�̇�𝐱 𝑡𝑡 = 𝚲𝚲𝐱𝐱 𝑡𝑡 + 𝐛𝐛𝑢𝑢(𝑡𝑡 − 𝐿𝐿)𝑦𝑦 𝑡𝑡 = 𝐜𝐜T𝐱𝐱(𝑡𝑡)

(10.53)

𝚲𝚲 = 𝜆𝜆1 00 𝜆𝜆2

, 𝐛𝐛 = 𝑘𝑘1𝑘𝑘2

, 𝐜𝐜 = 11 (10.54)

KEH Process Dynamics and Control 10–22

10.3 Sampling of time-delay models

Page 23: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.3 Sampling of time-delay models

SamplingBecause 𝚲𝚲 is diagonal, sampling and calculation of e𝐀𝐀ℎ is easy. With 𝐿𝐿 = 𝑁𝑁ℎ + 𝜃𝜃, the result is

𝐱𝐱 𝑡𝑡𝑘𝑘+1 = 𝐅𝐅𝐱𝐱 𝑡𝑡𝑘𝑘 + 𝐆𝐆0𝑢𝑢(𝑡𝑡𝑘𝑘) + 𝐆𝐆1𝑢𝑢(𝑡𝑡𝑘𝑘−1)𝑦𝑦 𝑡𝑡𝑘𝑘 = 𝐜𝐜T𝐱𝐱(𝑡𝑡𝑘𝑘)

(10.55)

where

𝐅𝐅 = e𝚲𝚲ℎ = e𝜆𝜆1ℎ 00 e𝜆𝜆2ℎ

(10.56)

𝐆𝐆0 = ∫0ℎ−𝜃𝜃 e𝚲𝚲𝜏𝜏d𝜏𝜏 𝐛𝐛 = 𝜆𝜆1−1(e𝜆𝜆1 ℎ−𝜃𝜃 − 1) 0

0 𝜆𝜆2−1(e𝜆𝜆2 ℎ−𝜃𝜃 − 1)𝑘𝑘1𝑘𝑘2

=𝑘𝑘1𝜆𝜆1−1(e𝜆𝜆1 ℎ−𝜃𝜃 − 1)𝑘𝑘2𝜆𝜆2−1(e𝜆𝜆2 ℎ−𝜃𝜃 − 1)

(10.57)

𝐆𝐆1 = e𝚲𝚲(ℎ−𝜃𝜃) ∫0𝜃𝜃 e𝚲𝚲𝜏𝜏d𝜏𝜏 𝐛𝐛

= e𝜆𝜆1(ℎ−𝜃𝜃) 00 e𝜆𝜆2(ℎ−𝜃𝜃)

𝜆𝜆1−1(e𝜆𝜆1𝜃𝜃 − 1) 00 𝜆𝜆2−1(e𝜆𝜆2𝜃𝜃 − 1)

𝑘𝑘1𝑘𝑘2

=𝑘𝑘1𝜆𝜆1−1𝑒𝑒𝜆𝜆1ℎ(1 − 𝑒𝑒−𝜆𝜆1𝜃𝜃)𝑘𝑘2𝜆𝜆2−1𝑒𝑒𝜆𝜆2ℎ(1 − 𝑒𝑒−𝜆𝜆2𝜃𝜃)

(10.58)

KEH Process Dynamics and Control 10–23

10.3.2 Second-order model

Page 24: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.3 Sampling of time-delay models

Pulse transfer operatorAccording to (10.50), the pulse transfer operator is

𝐻𝐻 q−1 = 𝐜𝐜T q𝐈𝐈 − 𝐅𝐅 −1 𝐆𝐆0 + 𝐆𝐆1q−1 q−𝑁𝑁 (10.59)

Substitution of (10.57–58) into (10.59) gives a pulse transfer operator of the form

𝐻𝐻 q−1 = 𝑏𝑏1+𝑏𝑏2q−1+𝑏𝑏3q−2

1+𝑎𝑎1q−1+𝑎𝑎2q−2𝑞𝑞−1−𝑁𝑁 (10.60)

Using the parameters

𝑏𝑏11 = 𝑘𝑘1𝜆𝜆1−1 e𝜆𝜆1 ℎ−𝜃𝜃 − 1 , 𝑏𝑏12 = 𝑘𝑘2𝜆𝜆2−1 e𝜆𝜆2 ℎ−𝜃𝜃 − 1𝑏𝑏21 = 𝑘𝑘1𝜆𝜆1−1𝑒𝑒𝜆𝜆1ℎ 1 − 𝑒𝑒−𝜆𝜆1𝜃𝜃 , 𝑏𝑏22= 𝑘𝑘2𝜆𝜆2−1𝑒𝑒𝜆𝜆2ℎ 1 − 𝑒𝑒−𝜆𝜆2𝜃𝜃

(10.61)

the parameters of (10.60) are given by

𝑎𝑎1 = − 𝑒𝑒𝜆𝜆1ℎ + 𝑒𝑒𝜆𝜆2ℎ , 𝑎𝑎2= 𝑒𝑒(𝜆𝜆1+𝜆𝜆2)ℎ , 𝑏𝑏1= 𝑏𝑏11 + 𝑏𝑏12𝑏𝑏2 = − 𝑒𝑒𝜆𝜆2ℎ𝑏𝑏11 + 𝑒𝑒𝜆𝜆1ℎ𝑏𝑏12 + 𝑏𝑏21 + 𝑏𝑏22

𝑏𝑏3 = − 𝑒𝑒𝜆𝜆2ℎ𝑏𝑏21 + 𝑒𝑒𝜆𝜆1ℎ𝑏𝑏22

(10.62)

KEH Process Dynamics and Control 10–24

10.3.2 Second-order model

Page 25: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.3.2 Second-order model

The case 𝜃𝜃 = 0If 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

𝐻𝐻 q−1 = 𝑏𝑏1+𝑏𝑏2q−1

1+𝑎𝑎1q−1+𝑎𝑎2q−2q−1−𝑁𝑁 (10.63)

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

𝑏𝑏11 = 𝑘𝑘1𝜆𝜆1−1 e𝜆𝜆1ℎ − 1 , 𝑏𝑏12 = 𝑘𝑘2𝜆𝜆2−1 e𝜆𝜆2ℎ − 1 (10.64)

The parameters of (10.63) are then given by

𝑎𝑎1 = − 𝑒𝑒𝜆𝜆1ℎ + 𝑒𝑒𝜆𝜆2ℎ , 𝑎𝑎2= 𝑒𝑒(𝜆𝜆1+𝜆𝜆2)ℎ

𝑏𝑏1= 𝑏𝑏11 + 𝑏𝑏12 , 𝑏𝑏2 = − 𝑒𝑒𝜆𝜆2ℎ𝑏𝑏11 + 𝑒𝑒𝜆𝜆1ℎ𝑏𝑏12(10.65)

Exercise 10.3.2Determine 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

Pulse transfer operator

Page 26: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10. Digital Process Control

10.3.3 First-order modelFor a strictly proper first-order system with a time delay, the transfer function is

𝐺𝐺 𝑠𝑠 = 𝐾𝐾e−𝐿𝐿𝐿𝐿

𝑇𝑇𝑠𝑠+1(10.66)

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

𝐻𝐻 q−1 = 𝑏𝑏1+𝑏𝑏2q−1

1+𝑎𝑎1q−1q−1−𝑁𝑁 (10.67)

with

𝑎𝑎1 = −e−ℎ/𝑇𝑇, 𝑏𝑏1 = 𝐾𝐾(1 + 𝑎𝑎1e𝜃𝜃/𝑇𝑇) , 𝑏𝑏2 = 𝐾𝐾𝑎𝑎1(1 − e𝜃𝜃/𝑇𝑇) (10.68)

KEH Process Dynamics and Control 10–26

10.3 Sampling of time-delay models

Page 27: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10. Digital Process Control

10.4 Controller synthesis using discrete-time model

Loop-transfer specificationIf 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

𝐻𝐻r q−1 = 𝐻𝐻ℓ q−1

1+𝐻𝐻ℓ q−1(10.70)

For a system with the time delay 𝐿𝐿 = 𝑁𝑁ℎ + 𝜃𝜃, 0 ≤ 𝜃𝜃 < ℎ, the loop transfer

𝐻𝐻ℓ q−1 = q−1−𝑁𝑁

(2𝑁𝑁+1)(1−q−1)(10.71)

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.1 PID controller

Page 28: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.4 Controller synthesis using discrete model

First-order model with 𝐿𝐿 = 𝑁𝑁ℎ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

𝐻𝐻 q−1 = 𝑏𝑏11+𝑎𝑎1q−1

q−1−𝑁𝑁   (10.72)

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

𝐻𝐻c q−1 = 𝐻𝐻 q−1 −1𝐻𝐻ℓ q−1 (10.73)

= 1+𝑎𝑎1q−1

𝑏𝑏1q−1−𝑁𝑁⋅ q−1−𝑁𝑁

2𝑁𝑁+1 1−q−1= 1

(2𝑁𝑁+1)𝑏𝑏1⋅ 1+𝑎𝑎1q

−1

1−q−1(10.74)

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

𝑢𝑢 𝑡𝑡𝑘𝑘 = 𝑢𝑢 𝑡𝑡𝑘𝑘−1 + 1(2𝑁𝑁+1)𝑏𝑏1

𝑒𝑒 𝑡𝑡𝑘𝑘 + 𝑎𝑎1𝑒𝑒(𝑡𝑡𝑘𝑘−1) (10.75)

where 𝑒𝑒 𝑡𝑡𝑘𝑘 = 𝑟𝑟 𝑡𝑡𝑘𝑘 − 𝑦𝑦(𝑡𝑡𝑘𝑘) is the standard control error. Comparison with (10.33–37) shows that this is a PI controller with

𝑏𝑏i1 + 𝐾𝐾c = 1(2𝑁𝑁+1)𝑏𝑏1

, 𝑏𝑏i2 − 𝐾𝐾c = 𝑎𝑎1(2𝑁𝑁+1)𝑏𝑏1

KEH Process Dynamics and Control 10–28

10.4.1 PID controller

Page 29: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.4.1 PID controller

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

𝐾𝐾c = 1−𝑎𝑎12(2𝑁𝑁+1)𝑏𝑏1

, 𝑏𝑏i1 = 𝑏𝑏i2 = 1+𝑎𝑎12(2𝑁𝑁+1)𝑏𝑏1

⇒ 𝑇𝑇i = ℎ2⋅ 1−𝑎𝑎11+𝑎𝑎1

(10.76)

ImplementationThe 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

𝐻𝐻c q−1 = 1(2𝑁𝑁+1)𝑏𝑏1

⋅ 1+𝑎𝑎1q−1

1−q−1⇔ 𝐻𝐻c 𝑧𝑧 = 1

(2𝑁𝑁+1)𝑏𝑏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

First-order model with 𝐿𝐿 = 𝑁𝑁ℎ

Page 30: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.4 Controller synthesis using discrete model

Second-order model with 𝐿𝐿 = 𝑁𝑁ℎ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

𝐻𝐻c q−1 = 1+𝑎𝑎1q−1+𝑎𝑎2q−2

(𝑏𝑏1+𝑏𝑏2q−1)q−1−𝑁𝑁⋅ q−1−𝑁𝑁

2𝑁𝑁+1 1−q−1

= 1(2𝑁𝑁+1)𝑏𝑏1

⋅ 1+𝑎𝑎1q−1+𝑎𝑎2q−2

(1−q−1)(1+𝑑𝑑q−1)  (10.77)

where𝑑𝑑 = ⁄𝑏𝑏2 𝑏𝑏1 (10.78)

This is a controller implementing the incremental control law

𝑢𝑢 𝑡𝑡𝑘𝑘 = 𝑢𝑢 𝑡𝑡𝑘𝑘−1 + 1(2𝑁𝑁+1)𝑏𝑏1

𝑒𝑒 𝑡𝑡𝑘𝑘 + 𝑎𝑎1𝑒𝑒 𝑡𝑡𝑘𝑘−1 + 𝑎𝑎2𝑒𝑒 𝑡𝑡𝑘𝑘−2

−𝑑𝑑 𝑢𝑢 𝑡𝑡𝑘𝑘−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

Page 31: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.4.1 PID controller

ImplementationUsing 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 𝑇𝑇fand 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)

𝑇𝑇i = ℎ 1−𝑎𝑎21+𝑎𝑎1+𝑎𝑎2

− 1−𝑑𝑑2(1+𝑑𝑑)

(10.80b)

𝐾𝐾c = 𝑇𝑇iℎ⋅ 1+𝑎𝑎1+𝑎𝑎2

(1+𝑑𝑑)(2𝑁𝑁+1)𝑏𝑏1(10.80c)

𝑇𝑇d = ℎ ℎ𝑇𝑇i

11+𝑎𝑎1+𝑎𝑎2

− 12(1+𝑑𝑑)

(10.80d)

KEH Process Dynamics and Control 10–31

Second-order model with 𝐿𝐿 = 𝑁𝑁ℎ

Page 32: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10. Digital Process Control

10.4.2 Time-delay compensationClosed-loop specificationA 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

𝐻𝐻r q−1 = 𝐻𝐻(q−1)𝐻𝐻c(q−1)1+𝐻𝐻(q−1)𝐻𝐻c(q−1)

(10.81)

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.,

𝐻𝐻c q−1 = 1𝐻𝐻(q−1)

⋅ 𝐻𝐻r(q−1)1−𝐻𝐻r(q−1)

(10.82)

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 Controller synthesis using discrete model

Page 33: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.4.2 Time-delay compensation

𝐻𝐻r q−1 = 1−𝛽𝛽+(𝛽𝛽−𝛼𝛼)q−1

1−𝛼𝛼q−1q−1−𝑁𝑁 (10.83)

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−𝐻𝐻r q−1= 1−𝛽𝛽+(𝛽𝛽−𝛼𝛼)q−1

1−𝛼𝛼q−1− 1−𝛽𝛽+(𝛽𝛽−𝛼𝛼)q−1 q−1−𝑁𝑁q−1−𝑁𝑁 (10.84)

First-order time-delay systemA 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

𝐻𝐻c q−1 = 1+𝑎𝑎1q−1

𝑏𝑏1+𝑏𝑏2q−1⋅ 1−𝛽𝛽+(𝛽𝛽−𝛼𝛼)q−1

1−𝛼𝛼q−1− 1−𝛽𝛽+(𝛽𝛽−𝛼𝛼)q−1 q−1−𝑁𝑁(10.85)

= 𝑐𝑐0(1+𝑎𝑎1q−1)(1+𝑑𝑑2q−1)1+𝑑𝑑1q−1 [1−𝛼𝛼q−1− 1−𝛽𝛽 1+𝑑𝑑2q−1 q−1−𝑁𝑁]

(10.86)where

𝑐𝑐0 = 1−𝛽𝛽𝑏𝑏1

, 𝑑𝑑1 = 𝑏𝑏2𝑏𝑏1

, 𝑑𝑑2 = 𝛽𝛽−𝛼𝛼1−𝛽𝛽

(10.87)

KEH Process Dynamics and Control 10–33

Closed-loop specification

Page 34: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

Closed-loop specification

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

𝑢𝑢 𝑡𝑡𝑘𝑘 = 𝑐𝑐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 signalsto 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

First-order time-delay system

Page 35: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.4.2 Time-delay compensation

Second-order time-delay system with 𝐿𝐿 = 𝑁𝑁ℎ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

𝐻𝐻c q−1 = 1+𝑎𝑎1q−1+𝑎𝑎2q−2

𝑏𝑏1+𝑏𝑏2q−1⋅ 1−𝛼𝛼1−𝛼𝛼q−1−(1−𝛼𝛼)q−1−𝑁𝑁

(10.90)

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 𝐿𝐿 > 𝑁𝑁ℎ.

ImplementationIn 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

Closed-loop specification

Page 36: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10. Digital Process Control

10.4.3 Dead-beat controlIn 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

𝐻𝐻c q−1 = 1𝐻𝐻(q−1)

⋅ q−1−𝑁𝑁

1−q−1−𝑁𝑁(10.93)

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

Page 37: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.4 Controller synthesis using discrete model

First-order time-delay modelA first-order time-delay system has the pulse transfer operator given in (10.67). Substitution of (10.67) into (10.93) gives

𝐻𝐻c q−1 = 1+𝑎𝑎1q−1

𝑏𝑏1+𝑏𝑏2q−1⋅ 11−q−1−𝑁𝑁

= 𝑏𝑏1−1 (1+𝑎𝑎1q−1)1+𝑑𝑑1q−1 (1−q−1−𝑁𝑁)

(10.94)

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.4.3 Dead-beat control

Page 38: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10. Digital Process Control

10.4.4 Improving intersample behaviourIntersample rippleA 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 Controller synthesis using discrete model

Page 39: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.4.4 Improving intersample behaviour

In particular, intersample ripple can occur when a discrete-time controller has been designed based on the inverse of a discrete-time (sampled) model.

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.g. 𝐺𝐺 𝑠𝑠 = 𝐾𝐾e−𝐿𝐿𝐿𝐿

(𝑇𝑇1𝑠𝑠+1)(𝑇𝑇2𝑠𝑠+1)⇒ 𝐻𝐻 q−1 = 𝑏𝑏0+𝑏𝑏1q−1

1+𝑎𝑎1q−1+𝑎𝑎2q−2q−1−𝑁𝑁, 𝑏𝑏1

𝑏𝑏0<≈ 1.

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

KEH Process Dynamics and Control 10–39

Intersample ripple

Page 40: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.4 Controller synthesis using discrete model

Elimination of intersample rippleThere are basically two ways to eliminate intersample ripple.

Dahlin’s modificationAccording to Dahlin’s modification, the denominator 𝑏𝑏1 + 𝑏𝑏2q−1 of the model used in the controller synthesis is replaced by 𝑏𝑏1 + 𝑏𝑏2. Instead of the model (10.63), for example,

𝐻𝐻 q−1 = 𝑏𝑏1+𝑏𝑏21+𝑎𝑎1q−1+𝑎𝑎2q−2

q−1−𝑁𝑁 (10.97)

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 Intersample behaviour

Page 41: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10.4.4 Improving intersample behaviour

Vogel-Edgar modificationVogel and Edgar have suggested that 𝑏𝑏1 + 𝑏𝑏2q−1 be included in the numerator of the desired closed-loop model. Instead of, for example, the desired first-order model

𝐻𝐻r q−1 = 1−𝛼𝛼1−𝛼𝛼q−1

q−1−𝑁𝑁 (10.98)

the controller synthesis is done to obtain the closed-loop transfer operator

𝐻𝐻r q−1 = (1−𝛼𝛼)(𝑏𝑏1+𝑏𝑏2q−1)1−𝛼𝛼q−1

q−1−𝑁𝑁  (10.99)

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

Elimination of intersample ripple

Page 42: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10. Digital Process Control

10.5 Example: comparison of various controllers

In Exercise 10.3.2 the pulse transfer operator was determined for the system

𝐺𝐺 𝑠𝑠 = 𝐾𝐾e−𝐿𝐿𝐿𝐿

(𝑇𝑇1𝑠𝑠+1)(𝑇𝑇2𝑠𝑠+1)(10.100)

with 𝐾𝐾 = 1, 𝐿𝐿 = 1 min, 𝑇𝑇1 = 1 min, 𝑇𝑇2 = 0.5 min, ℎ = 0.1 min. The result was

𝐻𝐻 q−1 = 𝑏𝑏1+𝑏𝑏𝑞𝑞q−1

1+𝑎𝑎1q−1+𝑎𝑎2q−2q−1−𝑁𝑁 (10.101)

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.5.1 Example system

Page 43: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10. Digital Process Control

10.5.2 Discretized PID with Ziegler-Nichols tuningThe 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.5094rad/min. The amplitude ratio at this frequency is

𝐺𝐺(𝜔𝜔c) = 𝐾𝐾1+(𝑇𝑇1𝜔𝜔c)2 1+(𝑇𝑇2𝜔𝜔c)2

= 11+1.50942 1+0.25⋅1.50942

= 0.4408

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

𝑢𝑢 𝑡𝑡𝑘𝑘 = 𝐾𝐾c 1 + ℎ𝑇𝑇i

+ 𝑇𝑇dℎ

𝑒𝑒 𝑡𝑡𝑘𝑘 − 1 − 2𝑇𝑇dℎ

𝑒𝑒 𝑡𝑡𝑘𝑘−1 + 𝑇𝑇dℎ𝑒𝑒(𝑡𝑡𝑘𝑘−2) + 𝑢𝑢(𝑡𝑡𝑘𝑘−1)

which here results in

𝑢𝑢 𝑡𝑡𝑘𝑘 = 8.51𝑒𝑒 𝑡𝑡𝑘𝑘 − 15.5𝑒𝑒 𝑡𝑡𝑘𝑘−1 + 7.08𝑒𝑒 𝑡𝑡𝑘𝑘−2 + 𝑢𝑢(𝑡𝑡𝑘𝑘−1)

KEH Process Dynamics and Control 10–43

10.5 Example: comparison of controllers

Page 44: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10. Digital Process Control

10.5.3 Discrete PID tuned for small overshootThe pulse transfer operator (10.101) yields the controller (10.79), i.e.,

𝑢𝑢 𝑡𝑡𝑘𝑘 = 1(2𝑁𝑁+1)𝑏𝑏1

𝑒𝑒 𝑡𝑡𝑘𝑘 + 𝑎𝑎1𝑒𝑒 𝑡𝑡𝑘𝑘−1 + 𝑎𝑎2𝑒𝑒 𝑡𝑡𝑘𝑘−2 + 𝑢𝑢 𝑡𝑡𝑘𝑘−1

+𝑑𝑑 𝑢𝑢 𝑡𝑡𝑘𝑘−1 − 𝑢𝑢 𝑡𝑡𝑘𝑘−2where 𝑑𝑑 = ⁄𝑏𝑏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.5 Example: comparison of controllers

Page 45: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10. Digital Process Control

10.5.4 Dahlin controller and wrong modelAssume 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

𝐻𝐻 q−1 = 𝑏𝑏11+𝑎𝑎1q−1

q−1−𝑁𝑁

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.5 Example: comparison of controllers

Page 46: 10. Digital Process Control - Åbo Akademi · Process Control Laboratory 10. Digital Process Control 10.2.2 Discretisation of PID controllers A discrete-time PID controller can be

ProcessControl

Laboratory

10. Digital Process Control

10.5.5 Dahlin controller and correct modelWith 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 withwrong model (– ⋅ – ⋅)

Dahlin controller withcorrect model (⋅⋅⋅⋅)

KEH Process Dynamics and Control 10–46

10.5 Example: comparison of controllers