Lecture 18
Lecture 18
K. J. Åström 1. Dynamics
• Most problems require knowledge about dynamical systems
1. Dynamics • Problem 6 - Physical modeling and observability
2. PID Control • Problem 5 - Linearization
3. The Simple Feedback Loop • Problem 3 - Stability
2. PID Control
4. Feedforward
• Problem 1, Problem 2, Problem 3
5. State Feedback and Observers
3. The Simple Feedback Loop
6. Summary
• Problem 4, Problem 1, Problem 2
Theme: Reviewing what we learned and filling some gaps. 4. Feedforward
• Problem 10, Problem 1, Problem 2
5. State Feedback and Observers
• Problem 7, Problem 8, Problem 9
dx
= Ax + Bu
Input Output
dt System
y = Cx + Du
t
x( t) = e x(0) +
At
e A( t− s) Bu( s) ds
0
t • Table over all input-output pairs
y( t) = Ce x(0) + C
At
e A( t− s) Bu( s) ds + Du( t) • Superposition: if (u 1, y1) and (u2 , y2) are i-o pairs so is
0
(au1 + bu2, a y1 + b y2)
Think in scalars interpret as vectors and matrices! • Table can be simplified drastically if initial conditions
If the matrix A can be diagonalized A = T Λ T −1 we have neglected
t
eAt = TeΛt T −1 . The elements of e At is a sum of terms eλ i t . In – Impulse response y(t) = 0 g(t − s)u(s)ds
general when the
matrix has multiple eigenvalues the elements – Transfer function Y (s) = G (s) U (s)
λit
have the form ki Pi (t) e where λ i is an eigenvalue and P(t)
– Frequency response
is a polynomial
c K. J. Åström December, 2000 2
Laplace Transforms Some Properties of the Laplace Transform
Consider a function f defined on 0 ≤ t < ∞ and a real number ∞
σ > 0. Assume that f grows slower than eσ t for large t. The L f = F ( s) = e− st f ( t) dt
Laplace transform F = L f of f is defined as 0
−1 B ( s) 1
G ( s) = C( sI − A) B= = n 8
A( s ) s + a1 sn−1 + a2 sn−2 + . . . + an 0.8
6
0.6
y
The denominator polynomial A(s) = det(sI − A) is the
4
0.4
0.2 2
λt λt
0 1 2 3 4 0 0.5 1 1.5 2
notational conflict!)
Poles are the zeros of the polynomial A(s), they are also the Complex λ = σ + iω
eigenvalues of the matrix A. A pole λ means that the response σ = −0.25ω σ = 0.25ω
of the system has the component e λ t .
40
0.6
30
0.4 20
y
0.2 10
all matrices in the state description and reflect how the states 0 0
−0.4 −20
c K. J. Åström December, 2000 3
Frequency Response Frequency Response ...
0.1 The steady state transmission of sinusoids is given by G (iω )
0 • G (iω ) gain, amplitude ratio
0 5 10 15
• arg G (iω ), phase
1
0 5 10 15 • Nyquist plot
An LTI system is completely characterized by its steady state • Bode plots
response to sinusoidal signals.
u( t) = u0 sin ω t
y( t) = u0 G ( iω ) sin ω t + arg G ( iω )
• Critical point
−1
• Asymptotes
10
−1 ϕ Re G(iω ) −2
• Positive feedback
10
a
• Minimum phase 10
−3
−1 0 1 2 3
• Negative feedback
10 10 10 10 10
ω
• Relation between curves
w
Phase
0
• Stability −50
−100
π d log G ( iω )
arg G ( iω ) −150
2 d log ω 10
−1 0
10 10
w
1 2
10
3
10
c K. J. Åström December, 2000 4
Non-minimum Phase Controllability and Observability
Right half plane zero
a−s dx
= Ax + Bu
Transfer function G (s) = , G (iω ) = 1 and dt
a+s y = C x + Du
ω
arg G (iω ) = −2 arctan
a The system can be steered from one point to another if the control-
lability matrix Wc has full rank
Time delay
Transfer function G (s) = e−sT , G (iω ) = 1 and Wc = B AB ... An−1 B
arg G (iω ) = −ω T The state can be computed from the output if the observability
matrix Wo has full rank
Right half plane pole
C
s+b
CA
Transfer function G (s) = , G (iω ) = 1 and
s−b Wo =
.
.
.
b ω n −1
arg G (iω ) = −2 arctan = −π + 2 arctan CA
ω b
c K. J. Åström December, 2000 5
Relations ... Coordinate Changes
dx dx
= Ax + Bu = Ax + Bu
dt dt
y = Cx + Du y = Cx + Du
Transfer function
The transfer function is
b1 sn−1 + b2 sn−2 + . . . + bn
G ( s) = D +
β 1γ 1 β 2γ 2 β nγ n sn + a1 sn−1 + a2 sn−2 + . . . + an
G ( s) = D + + + ... +
s − λ1 s − λ2 s − λn
The characteristic polynomial is
The mode zi is observable if γ i = 0 and controllable if β i = 0 sn + a1 sn−1 + a2 sn−2 + . . . + an
c K. J. Åström December, 2000 6
Observable Canonical Form From Transfer Functions to State Equations
−a1 1 0 ... 0 b1 Y ( s) 1 1
= = 4
b2
−a2
0 1 0
U ( s) ( s + 1) 4 s + 4s3 + 6s2 + 4s + 1
dz
.
.
=
..
z +
.
.
u
dt
Hence
− a n− 1 0 0 1
−an 0 0 0 bn ( s4 + 4s3 + 6s2 + 4s + 1) Y ( s) = U ( s)
y = 1 0 0... 0 z + Du
Switch to time domain
Transfer function d4 y d3 y d2 y dy
4
+ 4 3
+ 6 2
+4 +y=u
dt dt dt dt
b1 sn−1 + b2 sn−2 + . . . + bn
G ( s) = D +
sn + a1 sn−1 + a2 sn−2 + . . . + an
Characteristic polynomial
sn + a1 sn−1 + a2 sn−2 + . . . + an
From Transfer Functions to State Equations ... From Transfer Functions to State Equations
d4 y d3 y d2 y dy Y ( s) b1 s2 + b2 s + b3
+ 4 + 6 +4 + y=u = 3
dt4 dt3 dt2 dt U ( s) s + a1 s2 + a2 s + a3
s2
Introduce X1 = U
s3 + a1 s2 + a2 s + a3
d3 y d2 y dy s 1
x1 = , x2 = , x3 = , x4 = y X2 = 3 U = X1
dt3 dt2 dt s + a1 s + a2 s + a3
2 s
1 1 1
X3 = 3 U = X2 = 2 X1
s + a1 s2 + a2 s + a3 s s
dx1 1 1
= −4x1 − 6x2 − 4x3 − x4 + u sX 1 = −a1 X 1 − a2 X 1 − a3 2 X 1 + U
dt s s
dx2
= x1 = −a1 X 1 − a2 X 2 − a3 X 3 + U
dt
dx3 sX 2 = X 1
= x2 sX 3 = X 2
dt
dx4 Y = b1 X 1 + b2 X 2 + b3 X 3
= x3
dt
c K. J. Åström December, 2000 7
From Transfer Functions to State Equations ... From Transfer Functions to State Equations
1 1 Y ( s) b1 s2 + b2 s + b3
sX 1 = −a1 X 1 − a2 X 1 − a3 2 X 1 + U = 3
s s U ( s) s + a1 s2 + a2 s + a3
= −a1 X 1 − a2 X 2 − a3 X 3 + U s3 X 1 + a1 s2 X 1 + a2 sX 1 + a3 X 1 = b1 s2 U + b2 sU + b3 U
sX 2 = X 1 1 1 1
sX 3 = X 2 sX 1 = −a1 X 1 + b1 U + −a2 X 1 − a3 X 1 + b2 U + b3 U
s s s
Y = b1 X 1 + b2 X 2 + b3 X 3 1 1 1
X 2 = 2 −a2 X 1 − a3 X 1 + b2 U + b3 U
s s s
Back to time domain sX 1 = −a1 X 1 + b1 U + X 2 = −a1 X 1 + X 2 + b1 U
1
dx1 sX 2 = −a2 X 1 + b2 U + −a3 X 1 + b3 U
= −a1 x1 − a2 x − a3 x3 + u s
dt 1
dx2 X3 = −a2 X 1 − a3 X 1 + b3 U
= x1 s
dt sX 2 = −a2 X 1 + b2 U + X 3 = −a2 X 1 + X 3 + b2 U
dx3
= x2 sX 3 = −a3 X 1 + b3 U
dt
y = b1 x1 + b2 x2 + b3 x3
3
the critical point in different ways. Two classical measures: gain
2 margin gm and phase margin ϕ m. An alternative is the shortest
1
distance to the critical point −1 which is 1/ M s , where Ms is the
0
−1
maximum sensitivity.
−2
−3
−4
−5
−5 −4 −3 −2 −1 0 1 2 3 4 5
c K. J. Åström December, 2000 9
2. PID Control PI Control of First Order System
b
Process: P(s) =
s+a
ki
Controller: C(s) = k +
s
Closed loop transfer function from reference r to output y
Y ( s) PC b( ks + ki )
= = 2
1 sTd R( s ) 1 + PC s + ( a + bk) s + bki
U ( s) = k β R( s) − Y ( s)) + R( s) − Y ( s) + γ R( s) − Y ( s)
sTi 1 + sTd/ N
All poles can be assigned. A good characteristic polynomial is
s2 + 2ζ ω 0 s + ω 20
Notice
• Set point weighting β and γ (Cheap 2 DOF) Identification of coefficients of equal powers of s gives
• Filtering of derivative k = (2ζ ω 0 − a)/ b, ki = ω 20 / b
k = (ω 20 − a2 )/ b, kd = (2ζ ω 0 − a1 )/ b
c K. J. Åström December, 2000 10
PI Control of Second Order System PID Control of Second Order System
A compromise b
Process: P(s) =
s2 + a1 s + a 2
Y ( s) b( ks + ki )
= 3 ki
R( s ) s + a1 s + ( a2 + bk) s + bki
2
Controller: C(s) = k + + kds
s
Make characteristic polynomial equal to
Closed loop transfer function from reference r to output y
s3 + 2ω 0 s2 + 2ω 20 s + ω 30
Y ( s) PC b( kd s2 + ks + ki )
= =
R( s) 1 + PC s( s2 + a1 s + a2 ) + b( kd s2 + ks + ki )
and also choose ω 0 (response speed). Hence
b( kd s2 + ks + ki )
=
a1 2ω 20 − a2 a2 /2 − a2 ω 30 a31 s3 + ( a1 + bkd ) s2 + ( a2 + bk) s + bki
ω0 = , k= = 1 , ki = =
2 b b b 8b
All poles can be assigned.
Pole pattern can be chosen but the response speed is given by
process parameter a 1 .
PID Control of Second Order System ... Controllers with Error Feedback
Error feedback
Y ( s) PC b( kd s2 + ks + ki )
= = 3 ki
R( s) 1 + PC s + ( a1 + bkd ) s2 + ( a2 + bk) s + bki U ( s) = C( s)( R( s) − Y ( s)) = ( k + + kd s)( R( s) − Y ( s))
s
A good characteristic polynomial is
gives the closed loop transfer function from reference r to
s + 2s ω 0 +
3 2
2ω 20 s + ω 30 output y
c K. J. Åström December, 2000 11
Controllers with Set Point Weighting Saturation Windup and Windup Protection
Controller with set point weighting (a kind of feedforward) The feedback loop is broken if signals saturates. Problem
with unstable modes in the process and the controller. The
ki
U ( s) = k( β R( s) − C( s)) + ( R( s) − Y ( s)) + kd s(γ R( s) − Y ( s)) integrator in a PI is a typical example.
s
ki ki –y
= (β k + + γ kd s) R( s) − ( k + + kd s) Y ( s) KT d s
s s Actuator
= Cr ( s) R( s) − C( s) Y ( s) model Actuator
e = r− y
K Σ
gives the closed loop transfer function
K 1 – +
Σ Σ
Y ( s) Cr ( s) P( s) b(γ kd s + β ks + ki )
2 Ti s
= = 3
R( s ) 1 + P( s) C( s) s + ( a1 + bkd ) s2 + ( a2 + bk) s + bki es
1
Tt
The numerator can be modified by choosing the parameters β
and γ .
Look for the error. Assume system works.
L
PID 2L
c K. J. Åström December, 2000 12
Ziegler-Nichols’ Frequency Response Method Properties of Ziegler and Nichols Rules
• Switch the controller to pure proportional. Properties
• Adjust the gain so that the closed loop system is at the + Easy to explain and use
stability boundary.
+ Very common
• Determine the gain k u (the ultimate gain) and the period
- The closed loop system obtained too oscillatory ζ 0.2.
Tu (the ultimate period) of the oscillation.
Part of the criterion (quarter amplitude damping)
• Suitable controller parameters are obtained from a table.
- Too large overshoot
Im G(iω )
ω PI 0.4ku 0.8Tu 1.4Tu A good idea to base tuning on simple process experiments.
PID 0.6ku 0.5Tu 0.125Tu 0.85Tu Large scope for improvements.
More process information needed.
c K. J. Åström December, 2000 13
3. The Basic Feedback Loop Some Observations
d n
• A system based on error feedback is characterized by four
r u x y transfer functions (The Gang of Four)
F ∑ C ∑ P ∑
• The basic feedback system with two degrees of freedom is
characterized by six transfer function (The Gang of Six)
−1 • To fully understand a system it is necessary to look at all
systems
Six transfer functions are required to describe the system • It may be strongly misleading to only show properties of
a few systems for example the response of the output to
P PC PCF command signals. This is a common error in the literature.
X = D− N+ R
1 + PC 1 + PC 1 + PC
P 1 PCF • The properties of the different transfer functions can be
Y= D+ N+ R illustrated by transient or frequency responses.
1 + PC 1 + PC 1 + PC
PC C CF
U =− D− N+ R
1 + PC 1 + PC 1 + PC
1 1 L PC 1 L Ycl ( s) ∆ P 1
S= = , T= = S= , T= , = S, <
1+ L 1 + PC 1+ L 1 + PC 1+ L 1+ L Yol ( s) P T
Maximum sensitivities A compromise: Good disturbance rejection |S| small! Good
Ms = max S( iω ), Mt = max T ( iω ) robustness T small, but S + T = 1 and
Bode’s integrals: sL(s) goes to zero as s → ∞
The value 1/ Ms is the shortest distance from the Nyquist curve
of the loop transfer function L(iω ) to the critical point −1. ∞ ∞
1
log S( iω )dω = log dω = π pi
0 0 1 + L( iω )
The condition ∞ ∞ 1
L(1/ iω )
log T (1/ iω )dω = log dω = π
∆ P( iω ) 1 0 0 1 + L(1/ iω ) zi
<
P( iω ) M t
The water bed effect.
guarantees that the perturbation ∆ P does not give instability.
r x y Mu um
F ∑ C
u
∑ P ∑ r
ym uf b y
−1 My Σ C Σ P
Mu um
r −1
ym uf b y
My Σ C Σ P
Notice that Mu and M y can be viewed as generators of the
−1 desired output y m and the inputs u m which corresponds to y m.
Assume that process P, controller C and desired response M y
Horowitz: "Some structures have been presented as funda-
are given are given. Then M u = M y / P. Does not depend on C!
mentally different from the others ... all 2DOF configurations
have basically the same properties and potentials."
FC = Mu + Mu C
Gd =
Y ( s)
=
P2 (1 − P1 G f f )
= P2 (1 − P1 G f f ) S
• A nice structuring of the control problem
D ( s) 1 + PC
dx dx
= Ax + Bu = ( A − B L) x + B Lx̃ + B lr r
dt dt
y = Cx d x̃
= ( A − K C) x̃
u = − L x̂ + lr r dt
d x̂ Characteristic equation
= A x̂ + Bu + K ( y − C x̂)
dt
det ( sI − A + B L) det ( sI − A + K C) = 0
Introduce the state x̃ = x − x̂ instead of x̂ .
dx Transfer function from reference r to output y
= Ax + Bu = Ax − B Lx̂ + B lr r
dt
= Ax − B L( x − x̃) + B lr r = ( A − B L) x + B Lx̃ + B lr r Y ( s)
= C( sI − A + B L)−1 B lr
R( s )
d x̃
= ( A − K C) x̃
dt
Integral Action
Meaning of the model An alternative
dx dx
= Ax + Bu = Ax + B (u + v)
dt dt
dv dv
=0 =0
dt dt
Feedback from estimated states x̂ and v̂
d x̂ A B x̂ B K
= + u+ ε
dt v̂ 0 0 v̂ 0 Kv
ε = ( y − C x̂)
u = − L x̂ − v̂
c K. J. Åström December, 2000 19