Exam RT2 2018 Winter
Exam RT2 2018 Winter
Consider a person, who is driving an electric unicycle as depicted in Figure 1. The person
might be thinking about the way the unicyle works and how a state space model could
help to explain it.
l mp
mw
τ r
s s
a) Assume that
mp = 100, mw = 10, l = 1, r = 0.5, g = 10
and bring the differential equations into following form
s̈(t) ṡ(t) s(t)
M0 + D0 + K0 = F0 τ (t).
α̈(t) α̇(t) α(t)
1
c) Is the linearised state space model stable? Give reasons.
2
Problem 2 (25 Marks)
d1
G1 (s) G2 (s)
u y
G4 (s)
G3 (s)
d2
b) i) Write down a state space model of the dynamics from u1 to y2 for the intercon-
nection in Figure 3 in terms of Ai , Bi , Ci , Di . Use the state vector [xT1 xT2 ]T .
x1 x2
u1 y1 = u2 y2
(A1 , B1 , C1 , D1 ) (A2 , B2 , C2 , D2 )
3
x3
r y3
(A3 , B3 , C3 )
−
(A4 , B4 , C4 )
y4 u4 = y3
x4
u1 y1 u1 y1 u1 y1 u1 y1
u2 y2 u2 y2 u2 y2 u2 y2
a b c d
ii) Is the state space model (2) controllable? Explain. Hint: No calculation is
required, consider the structure of the system (from (c.i)) and each subsystem
4
Problem 3 (25 Marks)
ẋ = Ax + Bu
(3)
y = Cx + Du
2000
1500
abs
1000
500
0
2 4 6 8 348
Order
a) i) What number of states would be a reasonable choice for a reduced order model?
Explain. Hint: There is more than one possibility.
ii) Introducing the partition according to significant/negligible Hankel singular
values
A11 A12 B1
A= B= C = C1 C2 (4)
A21 A22 B2
what are the dimensions of each block-partition (Aij , Bi , Cj ) in (4)? Relate
this answer to your choice in (a.i).
iii) Give expressions for Atrunc , Btrunc , Ctrunc , Dtrunc in terms of the block-partitions
in (4), for the model matrices of a reduced order model using balanced trun-
cation.
iv) Give expressions for Ares , Bres , Cres , Dres in terms of the block-partitions in (4),
for the model matrices of a reduced order model using balanced residualization.
v) Figure 6 shows the Bode magnitude plot of the full-order model and the
reduced-order models using balanced truncation and residualization. Which
curve corresponds to which method? Explain.
5
Bode Diagram
Full-order
Reduced 1
Reduced 2
40
Magnitude (dB)
0
-40
10 -2 10 -1 10 0 10 1 10 2
Frequency (rad/s)
u − y+n
BP y l
× Gf ull (s)
u
Bred 1 Cred
f s
x̂ Ared
Observer n
x̂
Figure 7: Closed-loop system
Figure 8: Observer schematic
i) Assume the loop in Figure 7 is cut open at point BP (plant’s input). Give
MATLAB code to compute a state space model from n to u. Assume Ared ,
Bred , Cred , f , l are already in the workspace.
ii) Given are two possible sets of values for the observer tuning parameters Qe
and Re . Match each design (1 and 2) with its corresponding
– controller Bode magnitude plot (a and b) in Figure 9
– initial value response (c and d) in Figure 10
Give reasons for your answer.
design 1 Qe = I, Re = 100
design 2 Qe = I, Re = 0.1
6
0 a 20
c
b
d
|K(s)| (dB)
-40
10
y(t)
-80
0
iii) How should the Bode magnitude plot of K(s) look like in the low-frequency
range if good tracking is desired?
iv) The full-order model in (3) corresponds to a flexible beam. The goal of the
controller developed in part (b) is to damp vibrations. Give an interpretation
of the low frequency behavior of K(s) seen in Figure 9; relate your answer to
(b.iii).
7
Problem 4 (25 Marks)
where
−1 −2 0
A= , B= , C= 1 1 , D = 0. (7)
0 −2 1
a) Find a discrete-time state space representation of the plant that describes the be-
haviour of the plant in the sampling instants exactly. Assume T = 1.
b) How many zeros does the discretised system in part (a) have? Give reasons.
c) Give an expression for the zeros of the discretised system if G(s) is sampled at high
sampling rates (T → 0) with a zero order hold? Give reasons.
d) Consider the unit step responses (I) - (IV) given in Fig. 12. Which step response
corresponds to the response of the discretised system in (a)?
e) Give Matlab code to plot the step response of the discretised system in (a). Assume
that the workspace is empty.
8
(I) (II)
1 1
y(k)
y(k)
0.5 0.5
0 0
0 1 2 3 4 5 0 1 2 3 4 5
k k
(III) (IV)
0.6 0.2
0.4 0
y(k)
y(k)
−0.2
0.2
−0.4
0
0 1 2 3 4 5 0 1 2 3 4 5
k k
9
Formulas
∞ ZT
AT
X (AT )n 1
Φ=e = = I + AT + A2 T 2 + . . . , Γ= eAτ B dτ
n=0
n! 2
0
F = −pTa−1 C −1 with
p = ān−1 − an−1 ān−2 − an−2 . . . ā0 − a0 and
1 an−1 an−2 . . . a1
0 1 an−1 . . . a2
Ta = .. , where ai are the open-loop transfer function coefficients
.. . . . ..
. . .
0 0 0 ... 1
4.6
s1,2 = −σ ± jωd , ts = , ζ = sin(θ), θ = tan−1 (σ/ωd )
σ
−1
−1 a b 1 d −b
A = =
c d det(A) −c a
Controller canonical form
bm sm + bm−1 sm−1 + · · · + b1 s + b0
G(s) =
sn + an−1 sn−1 + · · · + a1 s + a0
ẋ1 0 1 0 ··· 0 x1 0
ẋ2 0 0 1 0 x2 0
.. .. . . .. .. + .. u
. .= . .
. .
ẋn−1 0 0 0 ··· 1 xn−1 0
ẋn −a0 −a1 −a2 · · · −an−1 xn 1
x1
x2
y = b0 b1 · · · bn−1 ..
.
xn
−1
eA = eXΛX = XeΛ X −1
Kirchhoff’s loop rule R
v0 vR L
v0 = vR + vL vL
Current-voltage relation
L iL R iR
diL vR = R iR
vL = L
dt
vL vR
10
Solution to Problem 2
a) i) G1 ∈ R3×2 , G2 ∈ R1×3 , G3 ∈ R1×2 , G4 ∈ R2×1
ii) From the block diagram y = G4 G2 d1 , therefore
Gd1 y = G4 G2
y = G4 (G2 (d1 + G1 y) + G3 y) = G4 G2 d1 + G4 G2 G1 y + G4 G3 y
Solving for y
y = (I − G4 G2 G1 − G4 G3 )−1 G4 G2 d1
therefore
Gyd1,cl = (I − G4 G2 G1 − G4 G3 )−1 G4 G2
ẋ2 = A2 x2 + B2 (C1 x1 + D1 u1 )
y2 = C2 x2 + D2 (C1 x1 + D1 u1 )
ẋ1 A1 0 x1 B1
= + u
ẋ2 B2 C1 A2 x2 B2 D1 1
x1
y2 = D2 C1 C2 + D2 D1 u1
x2
ii) From the triangular structure, the eigenvalues of the interconnection are the
eigenvalues of A1 and A2 . If any of the 2 has unstable eigenvalues, the inter-
connection is unstable, unless there is an unstable pole-zero cancellation. As
the model is minimal, there is no pole-zero cancellation, meaning the intercon-
nection is unstable.
iii) In this case u3 = r − y4 and u4 = y3 proceed similarly to task (b.iii) to get
ẋ3 A3 −B3 C4 x3 B
= + 3 r
ẋ4 B4 C3 A4 x4 0
x3
y 3 = C3 0
x4
1
iv) Nothing can be concluded about this interconnection by knowing only stability
properties of each subsystem.
0 1 0 0 0
u 1
ẋ = −4 −3 0 x+ 1
0
u2
0 0 −3 0 1 (5)
y1 1 3 0 0 1 u1
= x+
y2 0 0 1 0 0 u2
where the dynamics are completely decoupled and the only coupling is between
input u2 and output y1 via a feedthrough, therefore the correct choice is (c).
ii) Considering the fact that we have 2 dynamically decoupled systems we can
look at each independently. The system corresponding to x3 is a first-order
system with input u2 so it is trivial to see that it is controllable. Subsystem
[x1 x2 ] is in controllable canonical form and it is therefore controllable.
2
Solution to Problem 3
a) i) Either 2, 4 or 6 would be a reasonable choice as there is a large gap between
the Hankel singular values. Given that the original system is of order 348, one
could (correctly) argue that a system of order 2 would likely be too simple
to properly represent the original system and looking, e.g. at Bode plots or
exploratory experiments would give a better idea.
ii) Assume we chose to reduce the system to order 6. Then
B1 ∈ R6×1 , B2 ∈ R342×1
C1 ∈ R1×6 , C2 ∈ R1×342
iii) Atrunc = A11 , Btrunc = B1 , Ctrunc = C1 , Dtrunc = D
iv) Recall the assumption made in balanced residualization, ẋ2 ≈ 0, then
0 = A21 x1 + A22 x2 + B2 u
Solve for x2
x2 = −A−1
22 (A21 x1 + B2 u)
or
therefore
Cres = C1 − C2 A−1
22 A21 , Dres = D − C2 A−1
22 B2
3
b) i) The transfer function from n to u corresponds to the controller K(s), a state
space model for it can be constructued in MATLAB with the command
ss(Ared + Bred ∗ f + l ∗ Cred), −l, f, 0)
ii) Design 2 assumes the noise covariance is small (which means it is assumed
that there is little measurement noise) for this reason the observer will be fast
(larger bandwidth, i.e. plot b) and for this reason will also let more noise
through (plot d).
design 1 a c
design 2 b d
iii) For good tracking, K(s) should have a very large gain, ideally infinite (i.e.
integral action) at low frequencies.
iv) As can be seen in the Bode plot, the gain at low frequencies is very small, this
contrasts with the objective for tracking (answer from (b.iii) ). This can be
explained by observing that for a flexible beam it makes no sense to track a
reference, what is desired in that vibrations in a band of frequencies are rejected
which is why the controller has the highest gain in the mid-frequency range.
As always, noise should be rejected so the gain at high frequencies should be
0.