Lecture 13 H
Lecture 13 H
Paweł Malczyk
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 1 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
Outline
1 Three-term controller
3 Summary
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 2 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
Three-term controller
1 Three-term controller
Introduction
Basic control functions
P controller
PI controller
PD controller
PID controller
3 Summary
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 3 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
Introduction
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 4 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
Fig. 2: Block diagram of feedback control system with ideal PID controller
*
The input/output relation for an ideal PID controller :
[ ∫ ]
1 t de(t)
u(t) = kp e(t) + e(τ )dτ + Td =
Ti 0 dt
∫ t (1)
de(t)
= kp e(t) + ki e(τ )dτ + kd
0 dt
e(t) = r(t) − y(t) – error signal, u(t) – control signal,
kp – proportional gain, Ti – integral time, Td – derivative time,
kp
ki = Ti – integral gain, kd = kp Td – derivative gain.
* Modified versions of the PID controller are used in practical applications.
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 5 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
[ ∫ t ]
1 de(t)
u(t) = kp e(t) + e(τ )dτ + Td
Ti 0
dt
( ) (2)
U(s) 1
→ C(s) = = kp 1 + + Td s
E(s) Ti s
• PI controller (Td = 0)
( )
1
C(s) = kp 1 + (4)
Ti s
• PD controller (Ti = ∞)
C(s) = kp (1 + Td s) (5)
Fig. 4: PID interpretation
→ Gentle introduction to PID controllers: https://www.youtube.com/watch?v=4Y7zG48uHRo.
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 6 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
Mechanical system
Ns N
Fig. 5: Układ mechaniczny. Stałe fizyczne: m = 1 kg, b = 2 m,k =5 m
Goal: choose a control force f(t) (in N) such that the mass will stop at the
desired position (say 1 m from equilibrium).
Y(s) 1
Plant tranfer function G(s) = F(s) = ms2 +bs+k .
Reference signal (desired position): r(t) = yd · 1(t) (yd = 1 m).
In steady-state the force f(t) need to balance the spring force, i.e.:
f = k · yd · 1(t), then
1
yss = lim y(t) = lim sY(s) = lim sG(s)F(s) = lim sG(s)kyd = G(0)kyd = yd
t→∞ s→0 s→0 s→0 s
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 7 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
Ns N m
Fig. 6: Mechanical system. Physical constants: m = 1 kg, b = 2 m,k =5 m , and g = 10
s2
Y(s) 1
Plant transfer function G(s) = F(s) = ms2 +bs+k .
Disturbance – gravity force: d(t) = −mg · 1(t).
Reference signal (desired position): r(t) = yd · 1(t) (yd = 1 m).
In steady-state the force f(t) need to balance the sum of spring force and
the gravity force, i.e.: u = (k · yd + mg) · 1(t).
Assumption: perfect knowledge of parameters and disturbance...
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 8 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
Proportional control
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 10 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
Proportional control
Proportional control
kp
If kp → ∞, then k+kp → 1 and 1
k+kp → 0. In consequence: yss = yd .
Conclusion:
→ disturbance rejection (even unknown) and trajectory tracking.
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 12 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
P controller
Effects of P controller
Proportional term, P, causes a corrective control actuation proportional
to the error.
The system with P controller will usually have nonzero steady-state errors.
As kp increases, then the static position error decreases.
As kp increases, the stability margins decrease and the system may
become unstable.
As kp increases, the BW (as well as overshoot and settling time) increases.
It is difficult to ensure both good transient response accuracy and steady-
state performance.
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 13 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
P controller
kp=30
40 1.4
30
1.2
20
Magnitude (dB) 10 1 r(t)
0 0.8
y(t)
-10
-20 0.6 kp=30
kp=25
-30 0.4 kp=20
-40 kp=15
0.2
-50
-60 0
10-2 10-1 100 101 102 0 1 2 3 4 5 6 7 8 9 10
Frequency (rad/sec) t
kp=30
0 30
25
-30
20
Phase (deg)
-60 15
10
u(t)
-90 G
C 5 kp=15
-120 L 0 kp=20
S -5 kp=25
-150 T kp=30
-10
-180 -15
10-2 10-1 100 101 102 0 1 2 3 4 5 6 7 8 9 10
Frequency (rad/sec) t
P controller
kp=30
40 1.4
30
1.2
20
10 1 r(t)
Magnitude (dB)
0
0.8
y(t)
-10
0.6 kp=30
-20
kp=25
-30 G
0.4 kp=20
C
-40 L kp=15
S 0.2
-50 T
-60 0
10-2 10-1 100 101 102 0 1 2 3 4 5 6 7 8 9 10
Frequency (rad/sec) t
Fig. 13: P controller characteristics
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 15 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
PI controller
( 1
)
Fig. 14: PI controller, C(s) = kp 1 + Ti s
Effects of PI controller
The integral term, I, gives a correction proportional to the integral of the
error.
PI largely reduces the steady-state errors (compared to P controller).
It may cause the closed loop system less stable (or even unstable).
PI may slow down the transient response.
Filtering out high-frequency noise.
Windup - interaction of integral action and saturations.
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 16 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
PI controller
kp=30, Ti=1 kp=30
80 1.6
60 1.4
1.2
Magnitude (dB)
40 1
20 0.8
0.6
y(t)
0
0.4 Ti=1
-20 0.2 Ti=5
-40 0 Ti=10
-0.2
-60 G C L S T Ti=100
-0.4
-80 -0.6
10-2 10-1 100 101 102 0 1 2 3 4 5 6 7 8 9 10
Frequency (rad/sec) t
kp=30, Ti=1 kp=30
0 30
25
-30 20
Phase (deg)
-60 15
10
u(t)
-90 G 5
C 0 Ti=1
-120 L -5 Ti=5
S -10 Ti=10
-150 T Ti=100
-15
-180 -20
10-2 10-1 100 101 102 0 1 2 3 4 5 6 7 8 9 10
Frequency (rad/sec) t
PI controller
20 0.8
0.6
y(t)
0
0.4
-20 0.2
-40 0 Ti=1
-0.2 Ti=5
-60 Ti=10
-0.4 Ti=100
-80 -0.6
10-2 10-1 100 101 102 0 1 2 3 4 5 6 7 8 9 10
Frequency (rad/sec) t
Fig. 16: PI controller characteristics
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 18 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
PD controller
PD controller
kp=30, Td=0.1 kp=30
80 1.4
G C L S T 1.2
60
1
Magnitude (dB) 40 0.8
20 0.6
y(t)
0.4
0 0.2 Td=0
0 Td=0.01
-20
-0.2 Td=0.05
-40 Td=0.1
-0.4
-60 -0.6
10-2 10-1 100 101 102 103 0 1 2 3 4 5 6 7 8 9 10
Frequency (rad/sec) t
kp=30, Td=0.1 kp=30
120 30
90 25
60 20
Phase (deg)
30 15
0
10
u(t)
-30 G
C 5 Td=0
-60
-90 L 0 Td=0.01
-120 S -5 Td=0.05
-150 T -10 Td=0.1
-180 -15
10-2 10-1 100 101 102 0 1 2 3 4 5 6 7 8 9 10
Frequency (rad/sec) t
PD controller
0.6
20
y(t)
0.4
0
0.2
-20 0
Td=0
-0.2 Td=0.01
-40 Td=0.05
-0.4 Td=0.1
-60 -0.6
10-2 10-1 100 101 102 103 0 1 2 3 4 5 6 7 8 9 10
Frequency (rad/sec) t
Fig. 19: PD controller characteristics
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 21 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
PID controller
( 1
)
Fig. 20: PID controller, C(s) = kp 1 + Ti s + Td s
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 22 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
PID controller
kp=30, Td=0.1, Ti=1 kp=30, Td=0.1, Ti=1
80 1.4
60 1.2
Magnitude (dB)
40 1
20
0.8
y(t)
0
0.6
-20
-40 0.4
y(t)
-60 G C L S T 0.2 r(t)
-80 0
10-3 10-2 10-1 100 101 102 103 0 1 2 3 4 5 6 7 8 9 10
Frequency (rad/sec) t
kp=30, Td=0.1, Ti=1 kp=30, Td=0.1, Ti=1
120 50
90
60 40
Phase (deg)
30 30
0
-30 u(t) 20
-60
-90 10
-120 0
-150 G C L S T u(t)
-180 -10
10-3 10-2 10-1 10 0
10 1
10 2
10 3 0 1 2 3 4 5 6 7 8 9 10
Frequency (rad/sec) t
PID controller
60 1.2
40
1
Magnitude (dB)
20
0.8
y(t)
0
0.6
-20
0.4
-40
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 24 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
PID controllers
1 Three-term controller
3 Summary
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 26 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
Introduction
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 27 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
First method
Experimental response of the plant due to
Y(s)
a unit-step input. The transfer function U(s)
may be approximated by
Y(s) Ke−τ s
G(s) =
= (6)
U(s) Ts + 1
T – time constant, τ – delay, K – gain.
Comment 4
The controller parameters are designed to
result in 25% amplitude decay ratio in one Fig. 25: S-shaped response of a closed-loop
system due to a unit-step input. The plant
period. involves neither integrators nor dominant
complex conjugate closed-loop poles
Ziegler-Nichols tuning rule based on a step response of a plant
Type kp Ti Td
P T
Kτ ∞ 0
T τ
PI 0.9 Kτ 0.3 0
T
PID 1.2 Kτ 2τ 0.5τ
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 28 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
Second method
Fig. 26: Closed-loop system with P controller and sustained oscillation with period Tcr
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 29 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
Comments
1 Ziegler-Nichols tuning rules (and other tuning rules) have been widely
used in process control systems.
2 The plant dynamics may be known or may be not precisely known.
3 Experience has shown that the Z-N rules provide acceptable closed-loop
response for many systems.
4 The empirical PID tuning strategies are only starting points in the process
to obtain the right controller.
5 Tuning method (by Astrom & Hagglund) based on relay feedback is
available.
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 30 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
Example
Example 1 Consider the control system shown in the Fig. 27. The process
Y(s) 1
has transfer function G(s) = U(s) = (Ts+1) 2 . Apply the Ziegler-Nichols tuning
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 31 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
Example
Ke−τ s
Process model G(s) = Ts+1 .
1.2
K=1 1.1
1
τ = t1 = 12.72sec 0.9
T = t3 − t1 = 122.737sec 0.8
0.7
0.6
Type kp Ti Td 0.5
P T
Kτ ∞ 0 0.4
T τ 0.3
PI 0.9 Kτ 0.3 0
0.2
T
PID 1.2 Kτ 2τ 0.5τ 0.1
0
Type kp Ti Td
−0.1
P 9.6491 ∞ 0 −0.2
0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300
PI 8.6842 42.3576 0
PID 11.579 25.44 6.36 Fig. 28: Process reaction curve
( )
1
CP (s) = 9.6491, CPI (s) = 8.6842 1 + ,
42.3576s
( )
1
CPID (s) = 11.579 1 + + 6.36s
25.44s
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 32 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
Example
1.8 20
1.6 P 18 P
PI 16 PI
1.4 14
1.2 PID 12 PID
10
1 8
0.8 6
4
0.6 2
0.4 0
0.2 −2
−4
0 −6
0 50 100 150 200 250 300 0 50 100 150 200 250 300
0.2 0.1
P P
0.15 PI PI
PID 0.075 PID
0.1
0.05
0.05
0.025
0
−0.05 0
0 50 100 150 200 250 300 0 50 100 150 200 250 300
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 33 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
Review questions
1 What is the main objective of introducing proportional control, integral control or derivative
control?
2 What is a P, PI, PD, PID controller? Write the input-output relation, unit-step response and
Bode plots.
3 Give the effects of P, PI, PD and PID controllers on the feedback control system performance.
4 Formulate and comment on the two Ziegler-Nichols tuning rules for a PID controller. Discuss
the range of applicability of both methods.
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 34 / 35
Three-term controller Ziegler-Nichols tuning rules Summary
Summary
1 Three-term controller
3 Summary
© Paweł Malczyk. Basics of Automation and Control I Lecture 13: PID controllers 35 / 35