Control Notes
Control Notes
https://docs.google.com/document/d/1MF801M78D8tGq5r0PPp8SeLkfPJemhx0khpWyY1qMIU/edit 1/1
Fall 2010 16.30/31 5–2
SS Introduction
Basic Definitions
Equilibrium Points
Linearization
• Typically assume that the system is operating about some nominal
state solution xe (possibly requires a nominal input ue)
• Then write the actual state as x(t) = xe + δx(t)
and the actual inputs as u(t) = ue + δu(t)
• The “δ” is included to denote the fact that we expect the variations
about the nominal to be “small”
• Can then develop the linearized equations by using the Taylor series
expansion of f (·, ·) about xe and ue.
d
• Since dt xe i = fi(xe, ue), we thus have that
� �
d ∂fi �� ∂fi ��
(δxi) ≈ δx + δu
dt ∂x �0 ∂u �0
• Combining for all n state equations, gives (note that we also set “≈”
→ “=”) that
⎡ � ⎤ ⎡ � ⎤
∂f1 �
� ∂f1 ��
⎢ ∂x � ⎥ ⎢ ∂u � ⎥
⎢ 0
� ⎥ ⎥ ⎢ �0 ⎥
⎢ ∂f2 �� ⎥ ⎢ ∂f2 �� ⎥
⎢ ⎢ ⎥
d ⎢
⎢ ∂x �0 ⎥
⎥ ⎢
⎢ ∂u �0 ⎥
⎥
δx = ⎢ ⎥ δx + ⎢ ⎥ δu
dt ⎢ ... ⎥ ⎢ ... ⎥
⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥
⎢ � ⎥ ⎢ � ⎥
⎣ ∂fn � ⎦ ⎣ ∂fn � ⎦
� �
∂x 0� ∂u �0
= A(t)δx + B(t)δu
where
⎡ ∂f1 ∂f1 ∂f1
⎤ ⎡ ∂f1 ∂f1 ∂f1
⎤
∂x1 ∂x2 ··· ∂xn ∂u1 ∂u2 ··· ∂um
⎢ ⎥ ⎢ ⎥
⎢ ∂f2 ∂f2 ∂f2 ⎥ ⎢ ∂f2 ∂f2 ∂f2 ⎥
⎢
∂x1 ∂x2 ··· ∂xn
⎥ ⎢
∂u1 ∂u2 ··· ∂um
⎥
A(t) ≡ ⎢
⎢
⎥
⎥ and B(t) ≡ ⎢
⎢
⎥
⎥
⎢ ... ⎥ ⎢ ... ⎥
⎣ ⎦ ⎣ ⎦
∂fn ∂fn ∂fn ∂fn ∂fn ∂fn
∂x1 ∂x2 ··· ∂xn ∂u1 ∂u2 ··· ∂um
0 0
• Typically drop the “δ” as they are rather cumbersome, and (abusing
notation) we write the state equations as:
ẋ(t) = A(t)x(t) + B(t)u(t)
y(t) = C(t)x(t) + D(t)u(t)
which is of the same form as the previous linear models
• If the system is operating around just one set point then the partial
fractions in the expressions for A–D are all constant → LTI lin
earized model.
Linearization Example
• Find the equilibrium points and then make a state space model
Fig. 3: Nonlinear response (k1 = −1, k2 = 0.5). The figure on the right shows the
oscillation about the equilibrium point.
Time Response
• Can develop a lot of insight into the system response and how it is
modeled by computing the time response x(t)
• Homogeneous part
• Forced solution
• Homogeneous Part
ẋ = Ax, x(0) known
• Take Laplace transform
X(s) = (sI − A)−1x(0)
so that
−1 −1
� �
x(t) = L (sI − A) x(0)
• But can show
−1 I A A2
(sI − A) = + 2 + 3 + ...
s s s
1
so L−1 (sI − A)−1 = I + At + (At)2 + . . .
� �
2!
At
= e
⇒ x(t) = eAtx(0)
• eAt is a special matrix that we will use many times in this course
• Transition matrix or Matrix Exponential
1
• Calculate in MATLAB using expm.m and not exp.m
• Note that e(A+B)t = eAteBt iff AB = BA
• Forced Solution
• Consider a scalar case:
ẋ = ax + bu, x(0) given
� t
⇒ x(t) = eatx(0) + ea(t−τ )bu(τ )dτ
0
where did this come from?
1. ẋ − ax = bu
• Have seen the key role of eAt in the solution for x(t)
• Determines the system time response
• But would like to get more insight!
• Consider what happens if the matrix A is diagonalizable, i.e. there
exists a T such that
⎡ ⎤
λ1
T −1AT = Λ which is diagonal Λ = ⎣ ... ⎦
λn
Then
eAt = T eΛtT −1
where
eλ1t
⎡ ⎤
eΛt = ⎣ ... ⎦
e λn t
• This is a simpler way to get the matrix exponential, but how find T
and λ?
• Eigenvalues and Eigenvectors
Dynamic Interpretation
T −1 =⎣ ... ⎦
− wnT −
which is a column of rows.
• Multiply this expression out and we get that
n
�
eAt = eλitviwiT
i=1
• Note that the vi give the relative sizing of the response of each part
of the state vector to the response.
� �
1 −t
v1(t) = e mode 1
0
� �
0.5 −3t
v2(t) = e mode 2
0.5
• Clearly eλit gives the time modulation
• λi real – growing/decaying exponential response
• λi complex – growing/decaying exponential damped sinusoidal
EV Mechanics
� �
−1 1
• Consider A =
−8 5
� �
s+1 −1
(sI − A) =
8 s−5
det(sI − A) = (s + 1)(s − 5) + 8 = s2 − 4s + 3 = 0
so the eigenvalues are s1 = 1 and s2 = 3
• Eigenvectors (sI − A)v = 0
� �
−1
� �
s+1 v11
(s1I − A)v1 = =0
8 s−5 v21
s=1
� ��
2 −1
�
v11
=0 2v11 − v21 = 0, ⇒ v21 = 2v11
8 −4 v21
� 0), so set v11 = 1
v11 is then arbitrary (=
� �
1
v1 =
2
� ��
4 −1
�
v12
(s2I−A)v2 = =0 4v12−v22 = 0, ⇒ v22 = 4v12
8 −2 v22
� �
1
v2 =
4
• Confirm that Avi = λivi
1 more on Jordan blocks on 6–??, but this basically means that these eigenvalues are not repeated.
• Note that this doesn’t say anything about the stability of the nonlinear
system if the linear system is neutrally stable.
• A very powerful result that is the basis of all linear control theory.
¯ = [x x2]T
• But now consider the new state space model x
� �
−2 0
� �
2
Model # 2 x̄˙ = ¯+
x u
0 −1 1
� �
y = 3 0 x̄
which is clearly different than the first model, and larger.
• For this system we say that the dynamics associated with the second
state are unobservable using this sensor (defines C matrix).
• There could be a lot “motion” associated with x2, but we would
be unaware of it using this sensor.
� �
• So in this case we can “see” the state x2 in the output C = 3 2 ,
but we cannot “influence” that state with the input since
� �
2
B=
0
• So we say that the dynamics associated with the second state are
uncontrollable using this actuator (defines the B matrix).
• So now we have
� � ��−1 �
−2
�
� =
� � 0 2
G(s) 3 0 sI −
0 −1 0
� �
� 3 0
� 2 6
= s+2 s+1 = !!
0 s+2
• Get same result for the transfer function, but now the dynamics as
sociated with x2 are both unobservable and uncontrollable.
• Would like to develop models that only have dynamics that are both
controllable and observable
� called a minimal realization
• A state space model that has the lowest possible order for the
given transfer function.
• But first need to develop tests to determine if the models are observ
able and/or controllable
Observability
• For the problem we were just looking at, consider Model #2 with
x� = [ 0 1 ]T �= 0, then
� �
−2 0
� �
2
x̄˙ = x̄ + u
0 −1 1
� �
y = 3 0 x̄
so
� −2t �� �
e 0 0
CeAtx� = 3 0
��
0 e−t 1
� �
� −2t � 0
= 3e 0 =0∀t
1
�
d At ���
= 0 ⇒ CAeAtx��t=0 = CAx� = 0
�
Ce x �
dt t=0
d2
�
At � � 2 At � � 2 �
� �
Ce x = 0 ⇒ CA e x t=0
= CA x =0
dt2 �
t=0
...
dk
�
At � � k At � � k �
� �
Ce x = 0 ⇒ CA e x t=0
= CA x =0
dtk �
t=0
Controllability
Further Examples
• With Model # 2:
� �
−2
� �
0 2
¯˙ =
x x̄ + u
0 −1 1
� �
y = 3 0 x ¯
� � � �
C 3 0
M0 = =
CA −6 0
� �
� � 2 −4
Mc = B AB =
1 −1
• rank M0 = 1 and rank Mc = 2
• So this model of the system is controllable, but not observable.
• With Model # 3:
� �
−2
� �
0 2
¯˙ =
x ¯+
x u
0 −1 0
�
�
y = 3 2 x̄
� � � �
C 3 2
M0 = =
CA −6 −2
� �
� � 2 −4
Mc = B AB =
0 0
• rank M0 = 2 and rank Mc = 1
• So this model of the system is observable, but not controllable.
Weaker Conditions
• Often it is too much to assume that we will have full observability
and controllability. Often have to make do with the following. System
called:
• Detectable if all unstable modes are observable
• Stabilizable if all unstable modes are controllable
• That is enough information on the system model for now – will assume
minimal models from here on and start looking at the control issues.
r u(t) y(t)
A, B, C
−
x(t)
� �
• Define u = − k1 k2 x(t) = −Kx(t), then
� � � �
1 1 1 � �
Acl = A − BK = − k1 k2
1 2 0
� �
1 − k1 1 − k2
=
1 2
which gives
det(sI − Acl ) = s2 + (k1 − 3)s + (1 − 2k1 + k2) = 0
• With this zero in the modal B-matrix, can easily see that the mode
associated with the z2 state is uncontrollable.
• Must assume that the pair (A, B) are controllable.
Ackermann’s Formula
• The previous outlined a design procedure and showed how to do it by
hand for second-order systems.
• Extends to higher order (controllable) systems, but tedious.
Reference Inputs
• Started with
ẋ(t) = Ax(t) + Bu y = Cx(t)
u = r − Kx(t)
• So, for good performance, the transfer function from R(s) to Y (s)
should be approximately 1 at DC.
October 17, 2010
Fall 2010 16.30/31 11–9
• Now we have
ẋ(t) = (A − BK)x(t) + BN r
y = Cx(t)
so that
Y (s)
= C (sI − (A − BK))−1 BN = Gcl (s)N
R(s)
• Note that this development assumed that r was constant, but it could
also be used if r is a slowly time-varying command.
1 + 1.1ζ + 1.4ζ 2
10-90% rise time tr = ωn
• Key difference in this case: since all poles are being placed, the
assumption of dominant 2nd order behavior is pretty much guaranteed
to be valid.
• Note: state cost written using output xT Qx, but could define a
system output of interest z = Cz x that is not based on a physical
sensor measurement and use cost ftn:
� ∞
T ˜
� T T
�
⇒ JLQR = x (t)Cz QCz x(t) + ρ u(t) u(t) dt
0
˜ z)
• Then effectively have state penalty Q = (CzT QC
• Selection of z used to isolate system states of particular interest
that you would like to be regulated to “zero”.
• R = ρI effectively sets the controller bandwidth
• Good ROT (typically called Bryson’s Rules) when selecting the weight
ing matrices Q and R is to normalize the signals:
α12
⎡ ⎤
⎢ (x1)2 ⎥
max
2
⎢ ⎥
⎢
⎢ α 2
⎥
⎥
Q = ⎢ (x2)2max ⎥
⎢
⎢ ... ⎥
⎥
⎢ ⎥
⎣ αn2 ⎦
(xn)2max
β12
⎡ ⎤
⎢ (u1)2 ⎥
max
β22
⎢ ⎥
⎢ ⎥
⎢ ⎥
R = ρ⎢ (u2)2max ⎥
⎢
⎢ ... ⎥
⎥
⎢ 2
⎥
⎣ βm ⎦
(um)2max
2
� � 2
• α
i i = 1 and i βi = 1 are used to add an additional relative
weighting on the various components of the state/control
• ρ is used as the last relative weighting between the control and state
penalties ⇒ gives a relatively concrete way to discuss the relative size
of Q and R and their ratio Q/R
Regulator Summary
• LQR selects closed-loop poles that balance between state errors and
control effort.
• Easy design iteration using R
• Sometimes difficult to relate the desired transient response to the
LQR cost function.
• Key thing is that the designer is focused on system performance
issues rather than the mechanics of the design process
Regulator/Estimator Comparison
• Regulator Problem:
• Concerned with controllability of (A, B)
• Estimator Problem:
• For estimation, were concerned with observability of pair (A, C).
• These problems are obviously very similar – in fact they are called
dual problems.