M2 1 After Class
M2 1 After Class
Ding Zhao
Associate Professor
College of Engineering
School of Computer Science
4 Separation Principle
5 MIMO Systems
4 Separation Principle
5 MIMO Systems
Take the example of lateral control of a car. Define Cross Track Error (CTE) as the distance
of the car from trajectory.
Root-locus method
due to Evans
was fully developed
Nyquist/Bode (Bell Lab) developed Machine learning controls
methods for analyzing nolinear model-free
the stability of genetic algorithm, neural network
controlled systems reinforcement learning control
4 Separation Principle
5 MIMO Systems
Benefits of feedback
1 Stabilize unstable systems
2 Improve transient response (speed)
3 Reject disturbances
4 Increase robustness to modeling errors
We will consider “state feedback” ⇒ u = Kx
For systems that do not output all the states, we will estimate unmeasured states with an
observer
Without loss of generalization, we will assume the desired state is at the origin.
ẋ = Ax + bu
y = cx + du
bn sn + · · · + b0
Given a SISO system: G(s) =
sn + an−1 sn−1 + · · · + a0
0 1 0 ··· 0 0
0
0 1 ··· 0
0
ẋ = ... .. .. . . ..
x + . u
. . .
0 0 0 ··· 1 0
−a0 −a1 · · · · · · −an−1 1
y = b0 − bn a0 b1 − bn a1 · · · bn−1 − bn an−1 x + bn u
We can get here via a similarity transformation and an observable state space model.
Let Mc = P Pc−1 , with Pc the controllability matrix for the system in controllable
canonical form, calculated by Ac and Bc
Let Mo = Q−1 Qo , with Qo the observability matrix for the system in observable
canonical form, calculated by Ao and Co
Q−1
o and
−1
Pc have special forms:
a1 a2 · · · an−1 1
1 0 ··· 0 0
a2 a3 · · · 1 0
an−1 1 ··· 0 0
.. .. . . .. −1 . .. .. ..
..
Pc−1 = . . . . 0 ..
, Qo = . . . .
..
. .
a a ··· 1 0
an−1 1 · · · . . 2 3
1 0 ··· ··· 0 a 1 a 2 · · · an−1 1
These can be written by inspection!
The easiest way to design SISO feedback controllers is to start with controllable canonical
form (of course, given the system is controllable).
Let
0 1 0 ··· 0 0
0
0 1 ··· 0
0
..
x̃˙ = Ãx̃ + B̃u = .. .. .. .. .
x̃ + .. u
.
. . . .
0 0 0 ··· 1 0
−a0 −a1 −a2 · · · −an−1 1
Let u = K̃ x̃ = k̃0 k̃1 · · · k̃n−1 x̃
T
⇒ B̃ K̃ = 0 0 · · · 0 1 k̃0 k̃1 · · · k̃n−1
0 1 0 ··· 0
0 0 1 ··· 0
.. .. .. ..
⇒Ã + B̃ K̃ =
..
. . . . .
0 0 0 ··· 1
−a0 + k̃0 −a1 + k̃1 −a2 + k̃2 · · · −an−1 + k̃n−1
We still need to convert K̃ to K to work with the original system form (similarity
transformation)
Let the original system be x and the Controllable Canonical Form system be x̃. Then
x = M x̃ with M = P Pc−1 . Given K̃ designed for Ã, we can calculate K.
u = Kx = K̃ x̃ = KM x̃
K = K̃M −1
It’s not hard to verify that the closed loop system has the desired eigenvalues.
Clearly if the system is controllable, we can place the poles... what if it’s not?
−2 0 1
ẋ = x+ u
0 −2 3
Controllable? No - by observing the Jordan blocks.
Solution:
−2 + k0 3k1
Let K = k0 k1 and u = Kx ⇒ A + bK =
k0 −2 + 3k1
λ + 2 − k0 −3k1
⇒ |λI − (A + bK)| = | |
−k0 λ + 2 − 3k1
= (λ + 2 − k0 )(λ + 2 − 3k1 ) − 3k0 k1 = (λ + 2)2 − (k0 + 3k1 )(λ + 2)
= (λ + 2)(λ + (2 − k0 − 3k1 ))
In general, one or more eigenvalues of an uncontrollable system will be unaffected by
state feedback.
Ding Zhao (CMU) M2-1: Pole Placement 20 / 46
Table of Contents
4 Separation Principle
5 MIMO Systems
We have used the full state vector in feedback, but really only measure y.
An observer takes as inputs u and y returns an estimator of x.
Why not just use x̃˙ = Ax̃ + Bu, ỹ = C x̃ + Du, x̃(t0 ) = x(t0 )?
We have used the full state vector in feedback, but really only measure y.
An observer takes as inputs u and y returns an estimator of x.
Why not just use x̃˙ = Ax̃ + Bu, ỹ = C x̃ + Du, x̃(t0 ) = x(t0 )?
This only relies on model-based prediction, it can be used in a short period of time, but we
also need to correction to deal with modeling errors/disturbance.
Only replying on prediction is akin to running with eyes closed.
−an−1 1 0 ··· 0
.. bn−1 − bn an−1
. 0 1 · · · 0
..
ẋ = . .. .. .. x + . u
.. . . .
b1 − bn a1
−a1 0 0 · · · 1 b0 − bn a0
−a0 0 ··· ··· 0
y= 1 0 · · · 0 x + bn u
Similarly: we could arrive at the observable canonical via similarity transformation:
Mo = Q−1 Qo
Can achieve arbitrary pole placement via choice of L̃! To solve original eigenvalue problem,
convert via L = M L̃ with M = Q−1 Qo .
Ding Zhao (CMU) M2-1: Pole Placement 25 / 46
Example
1 3
Design an observer for A = , C = 1 0 with poles at -10, -20
4 2
Solution:
∆(s) = (s − 1)(s − 2) − 12 = s2 − 3s − 10
∆f b (s) = (s + 10)(s + 20) = s2 + 30s + 200
= s2 + (−3 + ˜l1 )s + (−10 + ˜l0 )
33
⇒L̃ =
210
Now convert back to original variables
−1
3 1 −1 1 0 1 0 1 0
à = , M = Q Qo = = 2 1
10 0 1 3 3 1 3 3
33
L = M L̃ =
92
Ding Zhao (CMU) M2-1: Pole Placement 26 / 46
Observer Structure
For SISO, the observer can be expressed as a 2-input ([u, y − ỹ]) and (n+1)-output system
([x̃, ỹ])
4 Separation Principle
5 MIMO Systems
By using an observer and performing state feedback on x̃, we can build an output feedback
controller.
I 0
Transfom via Me = . Me−1 = Me
I −I
x(t) I 0 x
=
e(t) I −I x̃
ẋ I O A BK I O x
⇒ =
ė I −I LC A − LC + BK I −I e
A + BK −BK x
=
0 A − LC e
Can show through properties of the determinant that the characteristic equations is:
⇒ The eigenvalues of the augmented system are the same as the separate controller/observer.
-This is called the separation principle. Observers & controllers can be designed separately.
-However, we should be careful to make the observer faster (3-5 times to the left on complex
plane) than the controller.
+ ey
y
u x̃
x̃˙ = Ax̃ + [B L] u
- ey ỹ u = K x̃
x̃ I 0 0 u
= x̃ +
ỹ C D 0 ey
⇒ C(s) = YU (s)
(s) = K(sI − (A + BK − LC − LDK)) L
−1
4 Separation Principle
5 MIMO Systems
MIMO systems
For multi-input controllers and multi-output observers, the pole placement problem does
not have a unique solution.
Fundamentally, need to solve the eigenvalue problem to set eigenvalue of A + BK
Note that the observer design problem can be written in the same form by placing
eigenvalue of AT − C T LT
MIMO systems
For multi-input controllers and multi-output observers, the pole placement problem does
not have a unique solution.
Fundamentally, need to solve the eigenvalue problem to set eigenvalue of A + BK
Note that the observer design problem can be written in the same form by placing
eigenvalue of AT − C T LT
(Dual Problem)
ẋ = AT x + C T u
ẋ = Ax + Bu
The observability of ⇔ Controllability of
y = Cx + Du y = B T x + Du
The python scipy.signal.place poles command solves the MIMO problem as well
2 1 0 0 0 2
λd = −4 ± 3j, −5 ± 4j
Write F in Controllable Canonical Form
K
1 0 0 0 KF
Let K = (can check rank KF 2 = 4 Now use Python
0 1 0 0
KF 3
(scipy.linalg.solve
sylvester) to solve the Sylvester equation
−1 −0.2256 0.0641 0.008 0.5027
⇒ K = KT = Can check ...
−146.73 −40.66 −9.61 −0.39
numpy.linalg.eig(A + BK) = −4 ± 3j, −5 ± 4j
1 0 0 1
Control is not unique! with K = get
0 1 1 0
−267.98 −237.25 −22.50 44.44
K= , same eigenvalues!
−13.73 −5.12 0.91 0.33
4 Separation Principle
5 MIMO Systems
-In some cases, the output contains direct measurement of a subset of the state variables - no
need to estimate those.
−1 q linearly independent rows of C
-The transformation M = transforms any system into
n − q additional ind. rows
the form
ẋ1 A11 A12 x1 B1
= + u
ẋ2 A21 A22 x2 B2
x1
y = Iq×q 0 + Du = x1 + Du
x2
where ȳ˜ = A12 x̃2 and ȳ can be obtained from direct measurement ȳ = ẋ1 − A11 x1 − B1 u
Ding Zhao (CMU) M2-1: Pole Placement 43 / 46
Reduced Order Observer
ė = ẋ2 − x̃˙ 2
= A22 x2 + u − (A22 x̃2 + u + L(A12 x2 − A12 x̃2 ))
= A22 (x2 − x̃2 ) − LA12 (x2 − x̃2 )
= (A22 − LA12 )e
Check e-values of A22 − LA12 for convergence. If (A, C) observable, we could always find L
to stablize the system.
ż = x̃˙ 2 − Lẋ1
= (A22 − LA12 )x̃2 + u + Ly − Lẋ1
= (A22 − LA12 )x̃2 + u − L(A11 x1 + B1 u)
ż = (A22 − LA12 )z + [(A22 − LA12 )L + A21 − LA11 ]x1 + (B2 − LB1 )u