You are on page 1of 10

Exam in Automatic Control II

Reglerteknik II 5hp

Date: January 12, 2016

Venue: Bergsbrunnagatan 15, room 2

Responsible teacher: Hans Norlander.

Aiding material: Calculator, mathematical handbooks, textbooks by Glad


& Ljung (Reglerteori/Control theory & Reglerteknik). Additional notes in
the textbooks are allowed.

Preliminary grades: 23p for grade 3, 33p for grade 4, 43p for grade 5.

Use separate sheets for each problem, i.e. no more than one problem per
sheet. Write your exam code on every sheet.

Important: Your solutions should be well motivated unless else is stated


in the problem formulation! Vague or lacking motivations may lead to a
reduced number of points.

Problem 6 is an alternative to the homework assignments. (In case you


choose to hand in a solution to Problem 6 you will be accounted for the best
performance of the homework assignments and Problem 6.)

Good luck!
Problem 1 The velocity of a moving object is modelled as
1
Y (s) = U (s). (1)
s+1
The system is to be controlled by a zero-order-hold (ZOH) sampling con-
troller. That is, the input is piece-wise constant between the sampling in-
stants, so
u(t) = u(kh) for kh ≤ t < kh + h,
where h is the sampling interval.
(a) In order to analyze the closed loop system a dicrete-time model of the
system is needed. Show that the ZOH sampled model of (1) is

β
y(kh) = u(kh),
q−α

and give the values of α and β (expressed in h). (2p)


(b) The proportional feedback

u(kh) = 3(r(kh) − y(kh))

is used, where r is the reference signal. Determine for which sampling inter-
vals h > 0 the closed loop system is stable. (4p)
(c) Assume that the proportional control in (b) is used, and that the sam-
pling interval is chosen so that the closed loop system is stable. Determine
the final value of the output, lim y(kh), when r(kh) is a unit step. (2p)
k→∞

Problem 2 Specify for each of the following statements whether it is true or


false. No motivations required — only answers “true”/“false” are considered!

(a) A Kalman filter is always stable.


(b) For a Kalman filter the innovation, ν = y − C x̂ − Du, is white noise if
the model and the noise intensities are correct.
0.25
(c) The discrete-time system y(k) = q+0.25 u(k) has unit static gain.
(d) The scalar system x(k + 1) = 0.5x(k) + u(k) + ν(k), y(k) = x(k) + ν(k),
(ν(k) is white noise) is on innovations form.
(e) The scalar system x(k + 1) = −0.5x(k) + u(k) + ν(k), y(k) = x(k) + ν(k),
(ν(k) is white noise) is on innovations form.
Each correct answer scores +1, each incorrect answer scores −1, and
omitted answers score 0 points. (Minimal total score is 0 points.) (5p)

1
Problem 3 A continuous-time system has the state space representation
   
−1 1 0
ẋ(t) = x(t) + v (t),
0 −1 1 1
 
y(t) = 1 0 x(t) + v2 (t),
where v1 and v2 are uncorrelated, zero mean white noise processes with in-
tensities Φv1 (ω) = R1 = 48 and Φv2 (ω) = R2 = 1.
(a) In order to estimate the state vector, the observer
   
˙x̂(t) = −1 1 x̂(t) + 2 (y(t) − 1 0 x̂(t))
 
0 −1 5
is used. What are the observer poles? (1p)
T
(b) Determine the covariance matrix, Πx̃ = E x̃(t)x̃ (t), of the estimation
error, x̃(t) = x(t) − x̂(t), for the observer in (a). (3p)
(c) Determine the spectrum, Φν (ω), for the output innovations,
   
ν(t) = y(t) − 1 0 x̂(t) = 1 0 x̃(t) + v2 (t),
of the observer in (a).
Hint: First derive the transfer operators/functions from v1 and v2 to ν.(3p)
(d) The optimal observer is the Kalman filter. What is the covariance ma-
trix of the estimation error x̃(t) for the Kalman filter of the system?
Hint: In the solution of the associated Riccati equation the lower right diag-
onal element is p2 = 16. (4p)
(e) What is the spectrum, Φν (ω), for the output innovations of the Kalman
filter? (2p)

Problem 4 For a certain choice of sampling interval the ZOH sampled


model of the system in Problem 1 is

 z(k) = 0.2 (u(k) + v (k)),
1
q − 0.8 (2)

y(k) = z(k) + v2 (k).
v1 and v2 are uncorrelated, zero mean white noise processes with variances
Ev12 = 1.8 and Ev22 = 0.2. The system should be controlled by the control
law u(k) = −Fy (q)y(k), where Fy (q) should be strictly proper, meaning that
u(k) depends on y(k −1), y(k −2), . . . , but not on y(k). The controller should
minimize the criterion
  1
V = E z 2 (k) + ρu2 (k) , ρ= .
9

(a) Give a state space representation for the system described by (2). (2p)
(b) Determine the controller Fy (q) that minimizes V . (5p)
(c) Determine the closed loop poles when Fy (q) in (b) is used. (3p)

2
Problem 5 Consider the continuous-time system1
 
4 1
y(t) = u1 (t) + u2 (t) + w(t) .
p+4 p

Here w(t) is a stochastic process that can be modeled as


p+2
w(t) = v(t),
p2 + 3p + 5

where v(t) is zero mean white noise with intensity Φv (ω) = Rv .


(a) Give a state space representation for the system with y as output, u =
 T
u1 u2 as input and v as system noise. Let x1 = y.
Hint: First determine one state space representation with y as output and
u and w as inputs, and another with w as output and v as input. Then
combine these two into one total state space representation. (5p)
(b) Is your state space representation in (a) controllable from u? (2p)

Problem 6 The HW bonus points are exchangeable for this problem.


A stationary discrete-time stochastic process w(k) has the spectrum
5 + 4 cos ω 5 + 4 cos ω
Φw (ω) = 2
= .
2.25 − 2(cos ω) 1.25 − cos 2ω

Find a transfer operator G(q) that is stable, minimum phase and has positive
static gain, and is such that

w(k) = G(q)v(k), Φv (ω) = 1,

is a model of w(k).
Hint: Note that (q − z1 )(q − z2 ) = q 2 − (z1 + z2 )q + z1 z2 = q 2 + a1 q + a2 , and
that |z1 | < 1 and |z2 | < 1 ⇒ |a2 | = |z1 z2 | = |z1 | · |z2 | < 1. Thus |a2 | < 1 is a
necessary condition for the polynomial q 2 + a1 q + a2 to have both its zeros
inside the unit circle. (7p)

1 d
Here p denotes the differentiation operator, i.e. p = dt .

3
Solutions to the exam in Automatic Control II, 2016-01-12:

1. (a) Set up a state space representation and use Theorem 4.1:


( (
ẋ = −x + u, x(kh + h) = e−h x(kh) + (1 − e−h )u(kh),

y = x, y(kh) = x(kh).

Thus,

−1 1 − e−h
y(kh) = H(qI −F ) Gu(kh) = u(kh) ⇒ α = e−h , β = 1−e−h .
q − e−h
(b) The closed loop system is
β
Go (q) 3 q−α 3β
y(kh) = r(kh) = β
r(kh) = r(kh),
1 + Go (q) 1 + 3 q−α q − α + 3β

whose pole is α − 3β = 4e−h − 3. For stability the pole must be inside the
unit circle:
−1 < 4e−h − 3 < 1 ⇔ 2 < 4e−h < 4 ⇔ 0.5 < e−h < 1.
Since e−h < 1 for all h > 0 it is 0.5 < e−h that will restrict h:
0.5 < e−h ⇔ log 0.5 < −h ⇔ h < log 2 ≈ 0.693.
(c) Use the final value theorem:
lim y(kh) = lim (z − 1)Y (z) = lim (z − 1)Gc (z)R(z) = Gc (1),
k→∞ z→1 z→1

z
since R(z) = z−1
(a unit step). From (a) we have that

3β 3β 3 − 3e−h 3
Gc (z) = ⇒ Gc (1) = = = .
z − α + 3β 1 − α + 3β 4 − 4e −h 4
2. (a) True (Lemma 5.1); (b) True (Theorem 5.5); (c) False (static gain is
obtained for q = 1 ⇒ the static gain is here 0.2); (d) True (innovations form
if v1 = v2 = ν and F − N H stable, here F − N H = −0.5) ; (e) False (here
F − N H = −1.5, i.e. unstable);
3. (a) The observer poles are given by
      
s 0 −1 1 2  
0 = det(sI − A + KC) = det − + 1 0
0 s 0 −1 5
 
s + 3 −1
= det = s2 + 4s + 8.
5 s+1
Hence, the observer poles are −2 ± i2.
(b) The estimation error is governed by the state equation
x̃˙ = (A − KC)x̃ + N v1 − Kv2 , (3)

1
and Πx̃ solves the continuous-time Lyapunov equation

0 = (A − KC)Πx̃ + Πx̃ (A − KC)T + N R1 N T + KR2 K T .

By noting that
     
−1 1 2   −3 1
A − KC = − 1 0 =
0 −1 5 −5 −1
    
−3 1 π1 π12 −3π1 + π12 −3π12 + π2
⇒ (A − KC)Πx̃ = =
−5 −1 π12 π2 −5π1 − π12 −5π12 − π2

the Lyapunov equation can be spelled out as


         
0 0 −3π1 + π12 −3π12 + π2 −3π1 + π12 −5π1 − π12 0 0 4 10
= + + + .
0 0 −5π1 − π12 −5π12 − π2 −3π12 + π2 −5π12 − π2 0 48 10 25

Element by element this gives the linear equation system



 129
 
 π1 = = 2.015625,
 0 = −6π1 + 2π12 + 4,
 

 64
259
0 = −5π1 − 4π12 + π2 + 10, ⇔ π12 = = 4.046875,

 0 = −10π − 2π + 73, 
 64
12 2


 1041
 π2 = = 16.265625.
64
(c) We note that ν = y − C + x̂ = C x̃ + v2 , which together with (3) gives
(
x̃˙ = (A − KC)x̃ + N v1 − Kv2 ,
ν = C x̃ + v2 ,

as state space representation for ν. Thus,

ν(t) = C(pI − A + KC)−1 N v1 (t) + [1 − C(pI − A + KC)−1 K] v2 (t)


| {z } | {z }
=G1 (p) =G2 (p)
 
  v1 (t)
= G1 (p) G2 (p) .
v2 (t)

The spectrum of ν then is (in accordance with Eq. (5.15))


  
  R1 0 G1 (−iω)
Φν (ω) = G1 (iω) G2 (iω) = |G1 (iω)|2 R1 +|G2 (iω)|2 R2 .
0 R2 G2 (−iω)

Since C(pI − A + KC)−1 is part of both G1 (p) and G2 (p) we compute that
first:
 
  p + 3 −1 −1 1  
C(pI − A + KC) = 1 0
−1
= 2 p+1 1 .
5 p+1 p + 4p + 8

2
Then
 
1   0 1
G1 (p) = 2 p+1 1 = 2
p + 4p + 8 1 p + 4p + 8
1 1
⇒ |G1 (iω)|2 = = ,
(8 − ω 2 )2 + (4ω)2 ω 4 + 64
and
 
1   2 2p + 7
G2 (p) = 1 − 2 p+1 1 =1− 2
p + 4p + 8 5 p + 4p + 8
2 2
p + 2p + 1 (p + 1) (ω 2 + 1)2
= 2 = 2 ⇒ |G2 (iω)|2 = 4 .
p + 4p + 8 p + 4p + 8 ω + 64
The spectrum is then
48 + (ω 2 + 1)2 2ω 2 − 15
Φν (ω) = 48|G1 (iω)|2 + |G2 (iω)|2 = = 1 + .
ω 4 + 64 ω 4 + 64
(d) The covariance of the estimation error for the Kalman filter, E x̃x̃T = P ,
is the solution of the CARE

0 = AP + P AT + N R1 N T − P C T R2−1 CP.
 
p1 p12
Set P = ⇒ the CARE spells out as
p12 p2
         
0 0 −1 1 p1 p12 p1 p12 −1 0 0  
= + + 48 0 1
0 0 0 −1 p12 p2 p12 p2 1 −1 1
    
p1 p12 1   p1 p12
− 1 0 .
p12 p2 0 p12 p2
Element by element this gives the equation system
 2
 0 = −2p1 + 2p12 − p1 ,

0 = −2p12 + p2 − p1 p12 ,

 0 = −2p + 48 − p2 ,
2 12

Since we know that p2 = 16 we get


 2
 0 = −2p1 + 2p12 − p1 ,

0 = −2p12 + 16 − p1 p12 = 16 − p12 (2 + p1 ),

 0 = −32 + 48 − p2 = 16 − p2 .
12 12

The last equation gives that p12 = ±4, and since p1 ≥ 0 must hold (⇐ P > 0),
the second equation gives that p12 > 0. Thus,

 p1 = 2,
  
2 4
p12 = 4, ⇔ P = .

 4 16
p2 = 16,

3
(e) Theorem 5.5 ⇒ Φν (ω) = R2 = 1.

4. (a) With x = z the state space representation becomes



 x(k + 1) = 0.8x(k) + 0.2u(k) + 0.2v1 (k),

z(k) = x(k),

 y(k) = x(k) + v2 (k).

(b) The minimizing controller is the LQG controller u(k) = −Lx̂(k|k − 1),
where x̂(k|k − 1) is given by the Kalman filter,

x̂(k + 1|k) = F x̂(k|k − 1) + Gu(k) + K(y(k) − H x̂(k|k − 1)).

(With u(k) = −Lx̂(k|k) the input depends on y(k), and then Fy (q) is not
strictly proper.) The Kalman gain K is given by

K = F P H T (HP H T +R2 )−1 , P = F P F T +N R1 N T −F P H T (HP H T +R2 )−1 HP F T .

Here F = 0.8, N = 0.2, R1 = 1.8, H = 1, R2 = 0.2, so the DARE becomes


0.82 P 2
P = 0.82 P + 0.22 · 1.8 − ⇔ P 2 = 0.122 ⇒ P = 0.12,
P + 0.2
and
0.8P 0.8 · 0.12
K= = = 0.3.
P + 0.2 0.32
The feedback gain L is given by

L = (GT SG+Q2 )−1 GT SF, S = F T SF +M T Q1 M −F T SG(GT SG+Q2 )−1 GT SF.

Here we we have F = 0.8, G = 0.2, M = 1, Q1 = 1, Q2 = ρ = 91 , so the


DARE becomes
0.82 · 0.22 P 2 25 5
S = 0.82 S + 1 − ⇔ S2 = ⇒ S= ,
0.22 P + 1/9 9 3
and
0.2 · 0.8S 0.16 · 35
L= = = 1.5.
0.22 S + 1/9 0.04 · 53 + 1
9
The controller then is

qx̂ = F x̂ + Gu + K(y − H x̂) = (F − GL − KH)x̂ + Ky,
u = −Lx̂,

qx̂ = (0.8 − 0.2 · 1.5 − 0.3)x̂ + 0.3y = 0.2x̂ + 0.3y,

u = −1.5x̂.

Then
1.5 · 0.3 0.45
Fy (q) = L(qI − F + GL + KH)−1 K = = .
q − 0.8 + 0.2 · 1.5 + 0.3 q − 0.2

4
(c) The closed loop poles are given by

0 = det(zI−F +GL) det(zI−F +KH) = (z−0.8+0.2·1.5)(z−0.8+0.3) = (z−0.5)2 ,

i.e., a double pole in 0.5. (The closed loop poles can also be determined by
0 = 1 + G(z)Fy (z).)

5. (a) With x1 = y we have (p + 4)x1 = 4( p1 u1 + u2 + w) ⇔ ẋ1 = −4x1 +


4 p1 u1 + 4u2 + 4w. Now set (for example) x2 = p1 u1 ⇒ ẋ2 = u1 . Using e.g. the
controller canonical form for describing w we get


 ẋ1 = −4x1 + 4x2 + 4x3 + 8x4 + 4u2 ,
 

 ẋ3 = −3x3 − 5x4 + v,  ẋ2 = u1 ,
 

ẋ4 = x3 , ⇒ ẋ3 = −3x3 − 5x4 + v,

 w = x + 2x , 

3 4
 ẋ4 = x3 ,



 y=x .
1

In vector form this is


      

 −4 4 4 8 0 4 0

      

 0 0 0 0 1 0 0
 ẋ = 
  x +   u +   v,
0 0 −3 −5 0 0 1



 0 0 1 0 0 0 0

 h i

y = 1 0 0 0 x.

(b) To examine the controllability, compute the controllability matrix:


 
0 4 4 −16 −16 64 64 −256
  1 0 0 0 0 0 0 0 
S = B AB A2 B A3 B =  0 0 0 0
.
0 0 0 0 
0 0 0 0 0 0 0 0

S has rank two, so the system is not controllable.

6. The modelled spectrum is G(eiω )Φv (ω)G(e−iω ) = |G(eiω )|2 (since Φv (ω) =
1). The powers of cos ω in the given spectrum suggest that

b1 q + b2
G(q) = ,
q2 + a1 q + a2
for some a1 , a2 , b1 , b2 ∈ R. Stability and minimum phase mean that the poles
and zeros must be inside the unit circle (zeros on the unit circle are allowed).
This means that |a2 | < 1 and |b2 | < |b1 |. Furthermore, the static gain must
b1 +b2
be positive, meaning that G(1) = 1+a 1 +a2
> 0. The modelled spectrum

5
becomes

(b1 eiω + b2 )(b1 e−iω + b2 )


G(eiω )G(e−iω ) =
(ei2ω + a1 eiω + a2 )(e−i2ω + a1 e−iω + a2 )
b21 + b22 + b1 b2 (eiω + e−iω )
=
1 + a21 + a22 + a1 (1 + a2 )(eiω + e−iω ) + a2 (ei2ω + e−i2ω )
b21 + b22 + 2b1 b2 cos ω
=
1 + a21 + a22 + 2a1 (1 + a2 ) cos ω + 2a2 cos 2ω
(b21 + b22 + 2b1 b2 cos ω)/2a2
= 1+a2 +a2 2a (1+a ) .
1
2a2
2
+ 1
2a2
2
cos ω + cos 2ω

Compare with the given spectrum:

5 + 4 cos ω −(5 + 4 cos ω)


Φw (ω) = = .
1.25 − cos 2ω −1.25 + cos 2ω
The denominator:
1 + a21 + a22 2a1 (1 + a2 )
= −1.25, and =0
2a2 2a2
The second equation gives that a1 = 0 or a2 = −1, but the latter can be
excluded since |a2 | < 1. Thus a1 = 0, which when put into the first equation
gives a22 + 2.5a2 + 1 = 0 ⇔ a2 = −1.25 ± −0.75, and again |a2 | < 1 ⇒
a2 = −0.5. The numerator then is −(b21 + b22 + 2b1 b2 cos ω), which when
compared when the given spectrum gives

b21 + b22 = 5, and 2b1 b2 = 4.

This is solved by b1,2 = ±1.5 ± 0.5. The second equation implies that b1 and
b1 +b2 +b2
b2 have the same sign, and since G(1) = 1+a 1 +a2
= b10.5 > 0 must hold both
b1 and b2 must be positive. Furthermore, |b2 | < |b1 | ⇒ b1 = 2 and b2 = 1.
Hence G(q) = q2q+1
2 −0.5 .

You might also like