Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
Systems Engineering/Process control L9
The PID controller
◮ The algorithm
◮ Frequency analysis
◮ Practical modifications
◮ Tuning methods
Reading: Systems Engineering and Process Control: 9.1–9.6
1 / 31
The PID controller
“Based on a survey of over eleven thousand controllers in
the refining, chemicals and pulp and paper industries, 97%of regulatory controllers utilize PID feedback.”
[Desborough and Miller, 2002]
“School-book form”:
u(t) = K(
e(t) + 1Ti
∫ t
0
e(τ )dτ + Tdde(t)dt
)
Transfer function:
Gc(s) = K(
1+ 1
sTi+ sTd
)
2 / 31
The P part
◮ P controller:
u = K (r − y) + u0 = K e+ u0
umax
umin
u
e
0e– e
0
u0
Proportionalband
◮ u0 can be chosen to eliminate stationary error at setpoint
3 / 31
Example: P control of Gp(s) = (s+ 1)−3
0 10 200
1
Ou
tpu
t
0 10 20−2
0
2
4
6
Inp
ut
Time
K = 5
K = 2K = 1
K = 5
K = 2K = 1
4 / 31
The I part
◮ Introduce automatic/online/dynamic selection of u0:
replacements
K e
u0
u∑
1
1+ sTi
U (s) = K E(s) + 1
1+ sTiU (s)
U (s) = K(
1+ 1
sTi
)
E(s)
◮ Assume stationarity: How does u and u0 relate? What is e?
5 / 31
Example: PI control of Gp(s) = (s+ 1)−3 (K = 1)
0 10 200
1
Ou
tpu
t
0 10 200
2
Inp
ut
Time
Ti = ∞
Ti = 5
Ti = 2Ti = 1
Ti = ∞Ti = 5
Ti = 2Ti = 1
6 / 31
The D part
◮ A P controller gives the same control in both these cases:
B
Areplacements
Control error
Time
e
ep
ep
t t+ Td◮ Predicted error:
ep(t+ Td) ( e(t) + Tdde(t)dt
◮ PD controller:
u(t) = K(
e(t) + Tdde(t)dt
)
7 / 31
Example: PD control of Gp(s) = (s+ 1)−3 (K = 5)
0 10 200
1
Ou
tpu
t
0 10 20
−2
0
2
4
6
Inp
ut
Time
Td = 0.1Td = 0.5
Td = 2
Td = 0.1Td = 0.5
Td = 2
8 / 31
Parallel and serial form
◮ PID controller on standard form (parallel form):
Gc(s) = K +K
sTi+ sKTd
e u
K
KTis
KTds
Σ
◮ PID controller on serial form (common in industry):
G′c(s) = K ′(1+ 1
sT ′i
)(1+ sT ′d)
e uK ′ 1+ 1
T ′is 1+ T ′ds
9 / 31
Parallel and serial form
Transformation parallel form Q serial form:
K = K ′ T′i+T ′d
T ′i
K ′ = K2
(
1+√
1− 4TdTi
)
Ti = T ′i + T ′d T ′i = Ti2
(
1+√
1− 4TdTi
)
Td = T ′iT′d
T ′i+T ′d
T ′d = Ti2
(
1−√
1− 4TdTi
)
◮ Identical parameters for PI and PD controller
◮ Parallel → serial only possible if Ti ≥ 4Td◮ Parallel form more general
10 / 31
Frequency analysis of PID controller
Frequency function for PID controller on serial form:
G′c(iω ) =K ′
iωT ′i(1+ iωT ′i )(1+ iωT ′d)
◮ For low frequencies (small ω ):
pG′c(iω )p (K ′
ωT ′iargG′c(iω ) ( −90○
◮ Zero at s = −1/T ′i bends amplitude curve up and increases
phase with 90○ around ω = 1/T ′i◮ The same holds for the zero at s = −1/T ′d
11 / 31
Frequency analysis of PID controller
10-2
10-1
100
101
100
101
10-2
10-1
100
101
-100
-50
0
50
100
1/T ′i 1/T ′d
K ′
Frequency [rad/s]
Ga
inP
ha
se
12 / 31
Repetition: Amplitude and phase margin
10-1
100
10-2
10-1
100
101
10-1
100
-250
-200
-150
-100
-50
1/Am
ϕm
ω c
ω o
Frekvens [rad/s]
Fö
rstä
rkn
ing
Fa
s
13 / 31
Frequency analysis of PID controller
The P part:
◮ Affects gain at all frequencies
◮ Higher gain [ faster system but worse margins
The I part:
◮ Increases gain and reduces phase for low frequencies
◮ Eliminates low frequency (constant) control errors but gives
worse phase margin
The D part:
◮ Increases gain and phase at high frequencies
◮ Gives better phase margin (to a limit) but amplifies noise
14 / 31
Practical modifications of PID controllers
School-book form:
e(t) = r(t) − y(t)
u(t) = K e(t)︸ ︷︷ ︸
P(t)
+ KTi
∫ t
0
e(τ )dτ︸ ︷︷ ︸
I(t)
+ KTdde(t)dt
︸ ︷︷ ︸
D(t)
Modifications:
◮ The P part: reference weighting
◮ The I part: anti-windup
◮ The D part: reference weighting and limited gain
15 / 31
Modification of P part
◮ Introduce reference weighting β :
P(t) = K(β r(t) − y(t)
), 0 ≤ β ≤ 1
◮ Can be used to limit overshoot after reference changes
(moves a zero in closed-loop system)
◮ Note! Works only if also I part used
16 / 31
Example: Reference weighting with PI control
(reference change at t = 0, load disturbance at t = 25):
0 500
1
0 500
2
β = 0β = 0.5
β = 1
β = 0β = 0.5
β = 1
Time
Input
Output
17 / 31
Modification of I part
Input is always limited in practice (umin ≤ u ≤ umax)
◮ Let v be the input the controller wants to use
◮ Let u be the input the controller can use
umax
umin
u
v
Integrator windup: I part keeps growing when signal saturated
18 / 31
Example: PI control with integrator windup
Gp(s) = 1/s, K = Ti = 1, −0.3 ≤ u ≤ 0.3:
0 10 20
Out
put
0
1
2
Time0 10 20
Inpu
t
0
1
2v
u
I
19 / 31
Anti-windup
I(t) =∫ t
0
(K
Tie(τ ) + 1
Tt
(u(τ ) − v(τ )
))
dτ
PI controller with anti-windup:
K
K
Ti
1
s
1
Tt
∑ ∑
∑e v u
I − +
Actuator(or model)
Rule of thumb for constant Tt:
◮ PI controller: Tt = 0.5Ti◮ PID controller: Tt =
√TiTd
20 / 31
Example: PI control with anti-windup
Same example as before, but with anti-windup (Tt = 0.5):
0 10 20
Out
put
0
1
2
Time0 10 20
Inpu
t
0
1v
u
I
21 / 31
Modification of D part
◮ Reference weighting: derivate only measurement, not
reference
D(t) = −KTddy(t)dt
◮ Limit gain with low-pass filter (extra pole):
D(s) = − sKTd
1+ sTd/NY(s)
(“fuskderivata”)
Maximal derivative gain N typically chosen in interval 5–20
22 / 31
Example: Limited derivative gain
y(t) = sin t+ 0.01 sin 100t, Td = 1, N = 5
0 5 10 15
-2
2Brusfri signal
0 5 10 15
-2
2Brusig signal y
0 5 10 15
-2
2Brusig signal y
0 5 10 15
-2
2Brusfri derivata
0 5 10 15
-2
2Derivatan av y
0 5 10 15
-2
2Fuskderivatan av y
23 / 31
Summary: Practical modifications
−1sKTd
1+ sTd/N
β K
K
Ti
1
s
1
Tt
∑
∑
∑
∑
∑
y
r
v u
− +
Actuator(or model)
(More to think about: bumpless transfer between manual/automatic
control, bumpless parameter changes, sampling filters, sampling,
. . . )
24 / 31
Tuning methods for PID controllers
◮ Manual tuning (lab 1)
◮ Ziegler–Nichols methods
◮ The Lambda method
◮ Arresttidstrimning (project)
◮ Model-based tuning (lab 2)
◮ Relay methods
◮ Optimization-based methods
◮ . . .
25 / 31
Ziegler–Nichols step response method
Experiment on open-loop system, read a and b in step response:
a
b
y
t
Controller K Ti TdP 1/aPI 0.9/a 3b
PID 1.2/a 2b 0.5b
26 / 31
Ziegler–Nichols frequency method
(Ziegler–Nichols’ ultimate-sensitivity method)
Experiment on closed-loop system
1. Disconnect I and D parts in PID controller
2. Increase K until oscillations with constant amplitude. This
K = K0.3. Measure period time T0 for oscillations.
Controller K Ti TdP 0.5K0PI 0.45K0 T0/1.2PID 0.6K0 T0/2 T0/8
(Note that T0 = 2π /ω 0, where ω 0 is frequency that gives
−180○ phase shift)
27 / 31
Ziegler–Nichols methods – warning
◮ Ziegler–Nichols’ methods give aggressive control with bad damping
◮ Recommendation: K lowered with 30–50 % for better robustness
◮ Example: PID control of Gp(s) = 1/(s+ 1)4:
0 25 50
Out
put
0
1
Step response methodUltimate sensitivity methodUltimate sensitivity, 40% lower gain
Time0 25 50
Inpu
t
0
2
28 / 31
Lambda method
1. Read deadtime L, time constant T and static gain Kp = ∆y∆u
:
∆y
∆u
Process output
Control signal
63%
L T
29 / 31
Lambda-method
2. Choose λ = desired time constant for closed-loop system
◮ λ = T common choice◮ λ = 2T a bit slower for more robustness
3. PI controller:
K = 1
Kp
T
L + λ, Ti = T
PID controller (in serial form):
K ′ = 1
Kp
T
L/2+ λ, T ′i = T , T ′d =
L
2
30 / 31
Model based tuning (Lab 2)
1. Find process transfer function Gp(s)2. Choose controller type Gc(s)3. Compute closed-loop system transfer function:
G(s) = Gp(s)Gc(s)1+ Gp(s)Gc(s)
4. Choose controller parameters to place poles for G(s) to
achieve desired behavior (pole placement)
31 / 31