Exercise Set 8 - Control Systems (5ESD0) Oct 2021
Note: The following Matlab functions are useful for dealing with systems in state-space
representation:
ss, tf2ss, ss2tf, zp2ss, ctrb, ctrbf, obsv, obsvf, canon, residue, ssdata, rank, step,
impulse, initial, place, acker
Type help function name in Matlab to see more details on the description of the func-
tions. If a function does not exist, then you have to install the Control System Toolbox.
1. State-Space Models, State Feedback:
Consider a system described by the state-space equations
0 1 1
ẋ = x+ u
7 −4 2
y= 1 3 x
(a) Determine if the system is observable and/or controllable.
(b) Find the closed-loop characteristic equation if the feedback control law is
i. u = −[K1 , K2 ]x,
ii. u = −K3 y.
(c) Design a state-feedback control law (u = −Kx√= −[K1 , K2 ]x) such that the closed-
√
loop poles have a damping coefficient of ζ = 1/ 2 and natural frequency ωn = 2.
Investigate whether this is possible via output feedback (u = −K3 y).
Solution:
(a) The system is both controllable and observable, since
C 1 3
rank (O) = rank = rank = 2,
CA 21 −11
1 2
rank(C) = rank B AB = rank = 2.
2 −1
(b) Two types of feedback control laws are considered:
(i.) State-feedback case:
Plugging in the control law gives
ẋ = Ax − BKx = (A − BK) x
Hence we can compute the characteristic equation by
λ + K1 −1 + K2
det(λI − A + BK) = det
−7 + 2K1 λ + 4 + 2K2
= λ2 + λ(4 + 2K2 + K1 ) + (6K1 + 7K2 − 7) = 0.
1
Exercise Set 8 - Control Systems (5ESD0) Oct 2021
(ii.) Output-feedback case:
First we write the control law as function of x using
u = −K3 y = −K3 Cx = −K3 [1 3] x = −[K3 3K3 ] x,
which then leads to the characteristic equation
λ2 + λ(7K3 + 4) + (27K3 − 7) = 0.
(c) By taking into account the closed-loop specifications, the roots of the closed-loop
system will be s2 + 2ζωn s + ωn2 = 0, hence s2 + 2s + 2 = 0.
By equating the coefficients of the closed-loop roots when employing a state-feedback
control law, we have
4 + 2K2 + K1 = 2
6K1 + 7K2 − 7 = 2,
hence K1 = 6.4, K2 = −4.2.
This is not possible for the output-feedback case, since there does not exist K3 ∈ R
that satisfies both the equations 7K3 + 4 = 2 and 27K3 − 7 = 2.
2. State-Space Reference Tracking:
The normalized equations of motion for an inverted pendulum at angle θ on a cart are
θ̈ = θ + u, ẍ = −βθ − u,
where x is the cart position and the control input is a force acting on the cart. The
measured state variable is x.
(a) With the state defined as x = [θ θ̇ x ẋ]⊤ , find the feedback gain K for the state
feedback control law (u = −Kx), that places the closed-loop poles at
s = −1, −1, −1 ± j.
(b) Assume that β = 0.5. Plot the responses of the closed- and open-loop system with
initial condition [θ θ̇ x ẋ]⊤ = [10◦ 0 0 0]⊤ , by using Matlab.
(c) Compute control law of the form u(x, r) = −Kx + N̄ r such that the plant output y
tracks a constant command input r, which denotes the desired cart position. Assume
that β = 0.5.
Solution:
(a) The state space equations of motion are
θ̇ 0 1 0 0 θ 0
θ̈ 1 0 0 0 θ̇ 1
ẋ = 0 0 0 1 x
+
0 u.
ẍ −β 0 0 0 ẋ −1
2
Exercise Set 8 - Control Systems (5ESD0) Oct 2021
We require the closed-loop characteristic equation to be
αc (s) = (s + 1)2 (s2 + 2s + 2) = s4 + 4s3 + 7s2 + 6s + 2.
From the above state equations, we obtain
det(sI − A + BK) = s4 + (k2 − k4 )s3 + (k1 − k3 − 1)s2 + k4 (1 − β)s + k3 (1 − β).
Comparing coefficients we have
10 − 8β 10 − 4β
k1 = , k2 =
1−β 1−β
2 6
k3 = , k4 = .
1−β 1−β
(b) By setting β = 0.5, we have
K = [12 16 4 12].
The time response to the indicated initial condition is shown in Figure 1.
Response to Initial Conditions
20
15
10
Amplitude
−5
0 1 2 3 4 5 6 7 8 9 10
Time (seconds)
Figure 1: Problem 3: Time response of the closed-loop system
(c) We have that N̄ = Nu + K Nx with
−1
Nx A B 0
= .
Nu C 0 I
Since the output y tracks the cart position x we have C = 0 0 1 0 and hence
N̄ = 4.
3
Exercise Set 8 - Control Systems (5ESD0) Oct 2021
Different solution:
If we have u = −Kx + N̄ r then we can write our state space equations as
(
ẋ = (A − BK)x + B N̄ r
y = (C − DK)x + DN̄ r
We want to have zero steady state error. Steady state means that ẋ = 0 and hence
ẋ = (A − BK)x + B N̄ r
0 = (A − BK)x + B N̄ r
(A − BK)x = −B N̄ r
x = −(A − BK)−1 B N̄ r
Substituting x in the output equation then gives
y = (C − DK)x + DN̄ r
= −(C − DK)(A − BK)−1 B N̄ r + DN̄ r
= D − (C − DK)(A − BK)−1 B N̄ r
Note that we want zero offset, which means r = y and hence
y = D − (C − DK)(A − BK)−1 B N̄ r = r
1 = D − (C − DK)(A − BK)−1 B N̄
−1
N̄ = D − (C − DK)(A − BK)−1 B
which for D = 0 also equals to 4.
3. Observer Design:
The equations of motion for a station-keeping satellite (such as a weather satellite), as
shown in Figure 2, are
ẍ − 2ω ẏ − 3ω 2 x = 0
ÿ + 2ω ẋ = u,
where x is the radial perturbation, y is the longitudinal position perturbation, and u is the
engine thrust in the y-direction.
2π
If the orbit is synchronous with the Earth’s rotation, then ω = 3600·24 rad/s. Define
x = [x ẋ y ẏ]⊤ as the state vector and output y as the longitudinal position perturba-
tion. Design a full-order observer with poles placed at s = −2ω, −3ω and −3ω ± 3ωj.
Solution:
The state-space equations are
ẋ1 0 1 0 0 x1 0
ẋ2 3ω 2 0 0 2ω x2 0
ẋ3 =
+ u
0 0 0 1 x3 0
ẋ4 0 −2ω 0 0 x4 1
z = 0 0 1 0 x
4
Exercise Set 8 - Control Systems (5ESD0) Oct 2021
Figure 2: A station-keeping satellite in orbit.
First, we check the observability to verify that we can arbitrarily place the estimator poles.
The observability matrix is
0 0 1 0
0 0 0 1
O= ,
0 −2ω 0 0
−6ω 3 0 0 −4ω 2
hence the system is observable since O is full rank. The desired estimator characteristic
equation is
αdes (s) = s4 + 11ωs3 + 54ω 2 s2 + 126ω 3 s + 108ω 4 ,
while the estimator characteristic equation is
αest (s) = s4 + l3 s3 + (l4 + ω 2 )s2 + (−2ωl2 + ωl32 )s + (−3ω 2 l4 − 6ω 3 l1 ).
By equating the coefficients, we obtain
l1 = −44.5ω
l2 = −57.5ω 2
l3 = 11ω
l4 = 53ω 2 .
4. Dynamic Output Feedback:
A certain process has the transfer function
4
G(s) =
s2 −4
(a) Find the matrices A, B and C for this system in observer canonical form (see page
493, 7th Edition).
(b) If u = −Kx, compute K such that the closed-loop control poles are located at s =
−2 ± 2j.
(c) Compute L such that the estimator poles are located at s = −10 ± 10j.
5
Exercise Set 8 - Control Systems (5ESD0) Oct 2021
(d) Determine the transfer function of the resulting controller, i.e., the transfer function
from y(t) to u(t), when
x̂˙ = (A − BK − LC)x̂ + Ly
u = −K x̂.
Solution:
(a) We can construct the state space matrices directly from the transfer function in ob-
servability cannonical form:
0 1 0
A= ,B = ,C = 1 0 .
4 0 4
Note that there is duality between the controlability and observability canonical form
meaning
Ao = A⊤ c Bo = Cc⊤ Co = Bc⊤ Do = Dc⊤
(b) By setting u = − k1 k2 x, we can write the characteristic equation as
det (λI − A + BK) =
λ2 + 4k2 λ − 4 + 4k1 = (s + 2 + 2j) (s + 2 − 2j)
= s2 + 4s + 8
Equating the coefficients then gives k1 = 3 and k2 = 1.
(c) The estimator roots are determined by the characteristic equation of the closed-loop
⊤
system. By taking L = l1 l2 we get
det (λI − A + LC) =
λ2 + l1 λ − 4 + l2 = (s + 10 + 10j)(s + 10 − 10j)
= s2 + 20s + 200
Again, equating the coefficients, we obtain l1 = 20, l2 = 204.
(d) We have (
x̂˙ = (A − BK − LC) x̂ + Ly
u = −K x̂
Applying Laplace we can rewrite this as
sx̂ = (A − BK − LC) x̂ + Ly
(sI − A + BK + LC) x̂ = Ly
−
x̂ = (sI − A + BK + LC) 1Ly
and thus
u = −K x̂
−
= −K (sI − A + BK + LC) 1Ly
and hence the transfer function from y to u is given by
6
Exercise Set 8 - Control Systems (5ESD0) Oct 2021
U (s)
D(s) = = −K(sI − A + BK + LC)−1 L
Y (s)
s + 20 −1 −1 20
=− 3 1
212 s+4 204
−264s − 692
= 2 .
s + 24s + 292
This can be verified using the ss2tf command in Matlab.