Prof. Bart de Moor (KUL) Chapter 13: PID Controllers
Prof. Bart de Moor (KUL) Chapter 13: PID Controllers
Prof. Bart de Moor (KUL) Chapter 13: PID Controllers
May 8, 2017
Outline
1 Introduction
3 Implementations
Analog Implementation
Digital Implementation
4 PID Tuning
Manual Tuning
Heuristic Methods
Numerical Optimization Methods
Definition
A Proportional-Integral-Deriviative (PID) controller is a control-loop feedback
mechanism (controller) widely used in process industry.
Outline
1 Introduction
3 Implementations
Analog Implementation
Digital Implementation
4 PID Tuning
Manual Tuning
Heuristic Methods
Numerical Optimization Methods
Proportional Control
Derivative Control
de(t) Ud (s)
ud (t) = Kd = Kd s
dt E(s)
Integral Control
Ui (z) zTs
ui [k] = ui [k 1] + Ki Ts e[k] = Ki
E(z) z1
In the Z-domain:
U (z) z Kd z 1
= Kp + Ki Ts +
E(z) z1 Ts z
Kd
where Ki Ts and Ts are the new derivative and gains.
U (z) Ki Ts (z + 1) 2Kd (z 1)
= Kp + +
E(z) 2(z 1) Ts (z + 1)
2
2 z + 1 z + 0
=
(z 1)(z + 1)
https://www.youtube.com/watch?v=JEpWlTl95Tw
Prof. Bart De Moor (KUL) Chapter 13: PID Controllers 11 / 36
Analog and Digital formulations
r(t)
Ud (s) Kd s
=
E(s) 1 + s
Ud (s) Kd s
=
E(s) 1 + s
Further e(t) is replaced by c r(t) y(t) with c the setpoint weighting,
which is often set to zero to further reduce immediate influence of a
sudden set-point jump.
In the time-domain:
dud d
ud (t) = + Kd (c r(t) y(t))
dt dt
Outline
1 Introduction
3 Implementations
Analog Implementation
Digital Implementation
4 PID Tuning
Manual Tuning
Heuristic Methods
Numerical Optimization Methods
Analog Implementation
The key building block is the operational amplifier (op-amp).
Analog Implementation
https://youtu.be/6W3PLiVIcmE
Prof. Bart De Moor (KUL) Chapter 13: PID Controllers 17 / 36
Implementations Digital Implementation
Digital Implementation
The difference equations are typically implemented in a microcontroller or in an
FPGA (field-programmable gate array) device:
Kd
u[k] = Kp e[k] + (e[k] e[k 1]) + ui [k]
Ts
with ui [k] = ui [k 1] + Ki Ts e[k]
Pseudocode
previous error = 0
integral = 0
Start :
e r r o r = setpoint measured value
p r o p o r t i o n a l = KP e r r o r
i n t e g r a l = i n t e g r a l + Ki s a m p l i n g t i m e e r r o r
d e r i v a t i v e = Kd ( e r r o r p r e v i o u s e r r o r ) / s a m p l i n g t i m e
output = p r o p o r t i o n a l + i n t e g r a l + d e r i v a t i v e
previous error = error
wait ( s a m p l i n g t i m e )
goto S t a r t
Digital Implementation
PLC with a digital PID module: Digital PID:
PLC
https://youtu.be/iWgHqqunsyE
Outline
1 Introduction
3 Implementations
Analog Implementation
Digital Implementation
4 PID Tuning
Manual Tuning
Heuristic Methods
Numerical Optimization Methods
Manual Tuning
Closed-loop response
PID gains
Rise Time Overshoot Settling time Steady-State error
Kp Decrease Increase Small Change Decrease
Ki Decrease Increase Increase Eliminate
Kd Small change Decrease Decrease No change
Important note
Changing one parameter can influence the effect of the other two.
Therefore, use this table only as a reference.
Manual Tuning
Heuristic Methods
In this method, the response of the plant to a unit-step input is obtained ex-
perimentally. If the plant involves neither integrators nor dominant complex-
conjugate poles, then such a unit-step response curve may look S-shaped
as shown in the figure on the next slide. This S-shaped curve may be char-
acterized by two constants: delay time L and time constant T . The delay
time and the time constant are determined by drawing a tangent line at the
inflection point of the S-shaped curve and determining the intersections of
the tangent line with the time axis and a horizontal line crossing the y-axis
at point (0,K).
If the response to a step input does not exhibit an S-shaped curve, the
first method does not apply.
K
Amplitude
L T
0
0
Time (seconds)
Control Type Kp Ki Kd
P T /L 0 0
PI 0.9 TL Kp 0.3
L 0
Kp
PID 1.2 TL 2L 0.5LKp
Control Type Kp Ki Kd
P 0.5Ku - -
PI 0.45Ku 1.2Kp /Tu -
PD 0.8Ku - Kp Tu /8
PID 0.6Ku 2Kp /Tu Kp Tu /8
Pessen Integral Rule 0.7Ku 2.5Kp /Tu 3Kp Tu /20
Some overshoot 0.33Ku 2Kp /Tu Kp Tu /3
No overshoot 0.2Ku 2Kp /Tu Kp Tu /3
If the output does not exhibit sustained oscillations for whatever value Kp
may take, then the second method does not apply.
Keep in mind that we are working with heuristic tuning rules, and therefore some
additional fine tuning might be necessary.
Ku P (ju ) = 1
Ku = (ju + 1)3
= (3u2 1) + j(u3 3u )
u3 3u = 0 u = 3
2
Ku = 8, Tu = = 3.628
u
Kp = 4.8, Ki = 2.6448, Kd = 2.16
Optimizer
, , Performance Index
Simulation
pidtool/pidTuner - Demo
https://www.youtube.com/watch?v=2tKe0caUv1I
https://www.youtube.com/watch?v=XH2bkq1URSg
Prof. Bart De Moor (KUL) Chapter 13: PID Controllers 36 / 36