APC-Tutorial-5-Hints

Advanced Process Control
Tutorial Problem Set 5: Hints and Solutions to Selected Problems
State Feedback Controller Design
1. Is the following system
"
#
" #
0:5
0:5
6
x(k + 1) =
x(k) +
u(k)
0 0:25
4
h
i
y(k) =
2
4 x(k)
(a) Observable? (b) Reachable?
2. Is the following system reachable?
"
x(k + 1) =
1 0
0 0:5
#
x(k) +
"
1 1
1 0
#
"
1
1
#
Assume that a scalar input u
e(k) such that u(k) =
system reachable from u
e(k)?
u(k)
u
e(k) is introduced. Is the
3. Consider unforced component , i.e. x(k + 1) = x(k), of the discrete time systems given
in problems (1) and (2). Construct a Lyapunov function
V [x(k)] = x(k)T Px(k)
such that
T
P=
P
I
Hint: Matrix P is symmetric and positive de…nite. Thus, choose it as
"
#
a b
P=
b c
and derive 3 linear equations in three unknowns ( a; b; c) by equating elements of the
resulting matrix on LHS to elements of the matrix on RHS, which can be solved simultaneously.
4. Consider a discrete time system
x(k + 1) =
"
1
0:8 0:3
0:2 0:5
#
x(k)
(a) Determine which of the following functions below quali…es to be Lyapunov function
(i) x1 (k)+[x1 (k)]2 (ii) [x2 (k)]2 (iii)3 [x1 (k)]2 +[x2 (k)]2 (iv) [x2 (k)]2 +[x1 (k) + x2 (k)]2
Hint: A scalar function to qualify as a Lyapunov function, it must be a positive
function. Is x1 (k) + [x1 (k)]2 guaranteed to be positive for all x(k)? The remaining
three functions are +ve functions for all x(k) as these are expressed as sum of
squares. Now, express each of this function V (x(k)) = x(k)Px(k) where matrix P
turns out to be symmetric and +ve de…nite. For example,
"
#
1
1
[x2 (k)]2 + [x1 (k) + x2 (k)]2 = x(k)T
x(k)
1 2
Then, de…ne
V (x) = V (x(k + 1))
V (x(k))
= x(k + 1)Px(k + 1)
= x(k)T
and examine whether
T
P
0 (stable) or
V (x)
x(k)Px(k)
P x(k)
V (x) < 0 (asymptotically stable).
(b) Select an appropriate Lyapunov function and show that the above system is globally
asymptotically stable.
Hint: Follow the approach given in Problem 3.
5. Given system
3 2 3
32
3 2
0
x1 (k)
0 1 2
x1 (k + 1)
7 6 7
76
7 6
6
4 x2 (k + 1) 5 = 4 0 0 3 5 4 x2 (k) 5 + 4 1 5 u(k)
0
x3 (k)
0 0 0
x3 (k + 1)
2
(a) Determine a control sequence such that system is taken from initial state x(0) =
h
iT
to origin.
1 1 1
h
iT
(b) Explain why it is not possible to …nd a sequence such that the state xf = 1 1 1
cannot be reached from origin.
Hint: Use following expression to answer this question
x(3) =
3
=
3
2
x(0) +
x(0) +
2
h
u(0) +
2
u(1) + u(2)
3
2
i u(0)
6
7
4 u(1) 5
u(2)
(1)
This is an interesting example. The rank of the reachability matrix
h
i
2
Wc =
is two and the system is not reachable. However, in the case of part (a), we have
3
x(0) = 0
h
iT
and since we want to take system from 1 1 1
to the origin, x(3) = 0: Thus,
equation (1) reduces to
2
3
h
i u(0)
6
7
2
4 u(1) 5 = 0
u(2)
Since Wc is rank de…cient, any vector in the null space of Wc will take the system
h
iT
from 1 1 1
to origin. In the case of part (b), however, we have to solve for
h
3 2 3
1
u(0)
i
7 6 7
6
4 u(1) 5 = 4 1 5
1
u(2)
2
2
Since Wc is rank de…cient, it is not possible to …nd an input that will take the
system to the desired …nal point. If xf speci…ed happens to lie in the column space
of Wc ; then alone the system can be moved from origin to that xf :
6. Design state feedback control law for the plant
"
# "
#"
# "
#
1
x1 (k + 1)
1
x
(k)
1
1
= 2 1
+
u(k)
x2 (k + 1)
0
x
(k)
2
2
2
(a) By placing eigen values of the closed loop are placed at
= 0:1
0:1j :
Note: Desired closed loop characteristic polynomial can be found as follows
(
0:1 + 0:1j)(
0:1
0:1j) = 0
(b) By solving steady state (algebraic) Riccati equation when Wx = I and Wu = 1=2:
Determine poles of closed loop system.
Hint: Algebraic Riccati Equations are as follows
S1 =
G1 =
T
S1 + Wx
Wu +
T
S1
3
GT1 Wu +
1
T
S1
T
S1
G1
Matrix S1 is symmetric and positive de…nite. Thus, choose it as
"
#
a b
S1 =
b c
and express L1 in terms of ( a; b; c). Substitute L1 in the expression for S1 and
derive 3 equations in three unknowns ( a; b; c) by equating elements of the resulting
matrix on LHS to elements of the matrix on RHS. The resulting equations are
likely to be nonlinear functions of ( a; b; c) and may require iterative procedure (on
a computer) for solving them simultaneously. Thus, just formulate these equations.
7. Design a state feed back control
2
3
x1 (k + 1)
6
7
4 x2 (k + 1) 5 =
x3 (k + 1)
law for the open loop unstable plant
2
32
3 2 3
3 1 0
x1 (k)
2
6
76
7 6 7
4 -3 0 1 5 4 x2 (k) 5 + 4 1 5 u(k)
1 0 0
x3 (k)
3
h
i
y(k) =
1 0 0 x(k)
Choose the closed loop eigen values to be
= 0:5:
Hint: The model is in the observable canonical form and it is straightforward to derive controllable canonical form for this system starting from the observable canonical
form. However, if you derive a control law for the transformed model (i.e. controllable
canonical form), then you have to …nd transformation that expresses the control law in
the original state space form (i.e. observable canonical form)! Can this transformation matrix, say T, be found using observability / controllability matrices of the two
system?
8. Design a deadbeat state feedback control law for the plant
"
# "
#"
# " #
x1 (k + 1)
1 3
x1 (k)
1
=
+
u(k)
x2 (k + 1)
3
1
x2 (k)
3
Note: The dead beat control law has all closed loop poles at the origin and the desired
closed loop characteristic equation is 2 = 0:
9. For the plant
"
#"
# " #
1 0
x1 (k)
2
=
+
u(k)
1
1
x2 (k)
1
h
i
y(k) =
1 1 x(k)
x1 (k + 1)
x2 (k + 1)
#
"
(Note: C matrix is now changed so that the system becomes observable.)
4
(a) Design a full order state feedback Luenberger observer and regulator arrangement
so that the feedback system has the eigen values = 0; 0; 21 ; 14 :
Hint: Design deadbeat observer (i.e. = 0; 0 for estimation error dynamics) and
regulator with closed loop poles at = 12 ; 14 :
(b) Determine the steady state LQ controller of the form u(k) = G1 x(k); when
Wx = C T C and Wu = : Determine poles of closed loop system (assuming that
states are known exactly) and discuss the e¤ect of changing weight on the control
input, ; on the poles of the closed loop.
Note: This problem would require a computer program to be written. You can only
setup the equations but not solve them by hand.
10. For the system given in the above problem, design a state feedback control laws of the
form
u(k) = us (k) G [x(k) xs (k)]
assuming
(a) Input bias observer:
2
3
2
32
3 2 3
x1 (k + 1)
-1 0 2
x1 (k)
2
6
7
6
76
7 6 7
4 x2 (k + 1) 5 = 4 1 1 1 5 4 x2 (k) 5 + 4 1 5 u(k)
(k + 1)
0 0 1
(k)
0
3
2
h
i x1 (k)
7
6
y(k) =
1 2 0 4 x2 (k) 5
(k)
(b) Output bias observer:
2
3
2
32
3 2 3
x1 (k + 1)
-1 0 0
x1 (k)
2
6
7
6
76
7 6 7
4 x2 (k + 1) 5 = 4 1 1 0 5 4 x2 (k) 5 + 4 1 5 u(k)
(k + 1)
0 0 1
(k)
0
2
3
h
i x1 (k)
6
7
y(k) =
1 2 1 4 x2 (k) 5
(k)
In other words, derive expression for us (k) and xs (k) as function of setpoint r(k)
and estimated arti…cial state (k) or (k) in each case.
Note: This part was not covered in the class. Ignore this question.
5
11. The double integrator with process noise can be described by
"
#
"
#
" #
1 1
0:5
0
x(k + 1) =
x(k) +
u(k) +
v(k)
0 1
1
1
h
i
y(k) =
1 0 x(k)
where v(k) is sequence of independent, normal, zero mean and random variables with
unit variance. Design a state feedback control law such that closed loop poles are placed
at = 0:2 j 0:1:
12. Given a system
x(k + 1) = ax(k) + bu(k)
with loss function
J=
N
P
[x(k)]2
k=0
Let the admissible control strategy be such that u(k) is a linear function of x(k).
Determine the strategy that minimizes the loss function.
Hint: Assume
u(k) =
and minimize J with respect to
x(k)
:
13. For the plant
"
x1 (k + 1)
x2 (k + 1)
#
=
y(k) =
"
h
1 1
0 0
1 0
#"
i
x1 (k)
x2 (k)
#
+
"
0
1
#
u(k)
x(k)
(a) Determine steady state LQ controller when Wx = C T C and Wu =
(b) Determine poles of the closed loop system and investigate how they depend on the
weight on the control signal (i.e. on ):
14. Show that a deadbeat control law, a control law such that matrix
G has all
eigenvalues at the origin, can be obtained from discrete time optimization with WN = I
and Wu = Wx = [0] where N is chosen equal to order of state vector.
Soln.: LQ objective function is given as
J=
N
X1
x(k)T Wx x(k) + u(k)T Wu u(k) + x(N )T WN x(N )
k=0
6
For the given set of parameters
J = x(n)T x(n)
= [ x(n
1)]T [ x(n
1) + u(n
1) + u(n
1)]
and minimum of J is obtained when partial derivative of J w.r.t. u(n
to zero. The minimum is attained at
1
T
1) =
u(n
T
1) is set equal
1)
x(n
Thus, the controller assumes form
1
T
u(k) =
1
T
G =
T
x(k)
T
and the closed loop equation becomes
h
1
T
G = I
T
i
h
i
1 T
T
Now, I
is a projection matrix that projects any vector into the space
orthogonal to column space of : Moreover
h
i
1 T
T
dim I
= n rank( )
Now, using following result from the linear algebra
rank(AB)
it follows that
rank
h
min(rank(A); rank(B))
T
I
at least m (=rank( )) eigenvalues of
1
T
i
<n
G are zero.
(Only partial result is proved here. I will look for the complete solution and
post it later).
15. Consider system
x(k + 1) =
"
1 1
0 1
#
x(k) +
"
0:5
1
#
u(k)
It is desired to …nd optimal regulator gains G(k) for this system, which minimize objective function
J = x(5)T WN x(5) +
4
P
k=0
7
x(5)T Wx x(5) + u(k)2
when
WN =
"
100 0
0
100
#
; Wx =
"
10 0
0 20
#
;
=2
Hint: Use Riccati equations starting from N = 5.
G(k) =
Wu +
T
1
S(k + 1)
T
S(k + 1)
T
S(k) = [
G(k)] + Wx + G(k)T Wu G(k)
G(k)] S(k + 1) [
Hint: The solution involves straightforward calculations starting from N = 5. Thus,
start with S(5) =WN and …nd G(4);which can then be used to compute S(4) and so on.
16. Consider the following MIMO system
"
#
"
#
0:75
0:25
1 2
x(k + 1) =
x(k) +
u(k)
0:25 0:5
1
0:5
"
#
1
1
y(k) =
x(k)
0 1
(a) Determine the steady state LQ controller of the form u(k) =
Wx = 4I and Wu = I:
(b) Find poles of closed loop system, i.e. eigenvalues of (
G1 x(k); when
G1 ):
Note: This problem would require a computer program to be written. You can only
setup the equations but not solve them by hand.
17. It is desired to develop a DMC (conventional MPC type) predictive controller using a
model of form
x(k + 1) =
x(k) + u(k)
y(k) = Cx(k) + e(k)
and open loop observer
b(kjk
x
1) =
b(k
x
e(k) = y(k)
1jk
2) + u(k
Cb
x(kjk
1)
1)
using three step ahead predictions (prediction horizon of 3). It is further assumed that
control horizon is one, i.e.
u(k + 1jk) = u(k + 2jk) = u(kjk)
8
(a) Show that three step ahead future predictions under the above constraint on future
input moves can be expressed as follows
b(kjk 1) + Su u(kjk) + SI e(k)
Yk = Sx x
2
3
2
3
b(k + 1jk)
y
C
6
7
6
7
Yk = 4 y
b(k + 2jk) 5 ; Sx = 4 C 2 5
b(k + 3jk)
y
C 3
2
3
2 3
C
I
6
7
6 7
Su = 4
C
+C
5; S = 4 I 5
2
C
+C
+C
I
I
Soln.: In the conventional MPC formulation, to carry out predictions given future
inputs
{u(kjk); u(k + 1jk); u(k + 2jk)g
, the model equations are used as follows
b(k + 1jk) =
x
b(kjk
x
b(k + 3jk) =
x
3
b(k + 2jk) =
x
=
1) + u(kjk)
b(k + 1jk) + u(k + 1jk)
x
2
+
b(kjk
x
b(jkjk
x
1) +
u(kjk) + u(k + 1jk)
2
1) +
u(kjk)
u(k + 1jk) + u(k + 2jk)
Using model residue e(k) for compensating model plant mismatch, output predictions become
b(k + 1jk) = C x
b(kjk
y
b(k + 2jk) = C
y
b(k + 3jk) = C
y
2
3
+C
b(kjk
x
b(kjk
x
1) + C u(kjk) + e(k)
1) + C
1) + C
u(kjk) + C u(k + 1jk) + e(k)
2
u(kjk)
u(k + 1jk) + C u(k + 2jk) + e(k)
Using the constraint
u(k + 1jk) = u(k + 2jk) = u(kjk)
the prediction equations get modi…ed as
b(k + 1jk) = C x
b(kjk
y
b(k + 2jk) = C
y
b(k + 3jk) = C
y
2
3
b(kjk
x
b(kjk
x
1) + C u(kjk) + e(k)
1) + [C
1) + C
9
+ C ] u(kjk) + e(k)
2
+C
+C
u(kjk) + e(k)
These equations can be stacked and
as follows
2
3
2
b(k + 1jk)
y
6
7
6
b(k + 2jk) 5 = 4
4 y
b(k + 3jk)
y
rearranged as a single vector-matrix equation
C
C
C
2
6
+4
2
3
3
7
b(kjk
5x
2
3
I
6 7
1) + 4 I 5 e(k)
I
3
C
7
[C
+C ]
5 u(kjk)
[C 2 + C
+C ]
(b) Let r(k) represent the setpoint vectors. De…ning future controller error vector
Ef as
2
3
"(k + 1jk)
6
7
Ef (k) = 4 "(k + 2jk) 5 = SI r(k) Yk
"(k + 3jk)
3
2
b(k + 1jk)
r(k) y
7
6
= 4 r(k) y
b(k + 2jk) 5 = (k) Su u(kjk)
b(k + 3jk)
r(k) y
b(kjk
(k) = [SI r(k) Sx x
1)
SI e(k)]
show that the u(kjk) input that minimizes sum of the square of future errors, i.e.
[Ef (k)]T Ef (k) =
3
X
["(k + ijk)]T "(k + ijk)
i=1
is given by
uopt (kjk) = STu Su
1
STu (k)
Soln.: The objective function is given as
J = [Ef (k)]T Ef (k) = [ (k)
Su u(kjk)]T [ (k)
Su u(kjk)]
Using the necessary condition for optimality
@J
=
@u(kjk)
[Su ]T [ (k)
Su u(kjk)] = 0
or
1
uopt (kjk) = STu Su
STu (k)
h 2 i
@ J
It is straightforward to show that matrix @ 2 u(kjk)
is positive de…nite and the optimum solution corresponds to a minimum.
10
(c) Show that the state feedback control law obtained by setting u(k) = uopt (kjk) after
rearrangement, becomes
u(k) =
Gx =
Gy =
b(kjk
Gx x
1) + Gy [r(k) y(k)]
STu Su
1
STu [Sx
STu Su
1
STu SI
SI C]
Note that [r(k) y(k)] represents conventional controller error.
(d) In particular, …nd matrices Gx and Gy for the discrete time dynamic system given
in the above example (Problem 16).
(e) Under the assumption that the states are perfectly known, the above state feedback
law reduces to
u(k) =
Gx x(k) + Gy [r(k) Cx(k)] = Gy r(k)
[Gx + Gy C] x(k)
and closed loop dynamics is governed by
x(k + 1) = [
Find eigenvalues of matrix [
computations for part (d).
(Gx + Gy C)] x(k) + Gy r(k)
(Gx + Gy C)] and comment upon stability for
(f) When open loop observer given above is used for state estimation, show that closed
loop dynamics is given by
"
#
"
#"
#
x(k + 1)
[
(Gx + Gy C)]
(Gx + Gy C)
x(k)
=
"(k + 1jk)
0
"(kjk 1)
"
#
Gy
+
r(k)
[0]
b(kjk 1) represents estimation and error. Also, show
where "(kjk 1) = x(k) x
that the closed loop system is stable if process is open loop stable (i.e. [ ] < 1)
and
[
(Gx + Gy C)] < 1
Note: Parts (d), (e) and (f) involve straight forward (by lengthy!) calculations
using the matrices speci…ed in Problem (16).
(g) If the objective function to be minimized is further changed as
T
T
[Ek ] Ek + [ u(kjk)]
u(kjk) =
T
[ u(kjk)]
u(kjk) +
3
X
i=1
u(kjk) = u(kjk)
11
u(k
1)
[e(k + ijk)]T e(k + ijk)
the optimum is obtained at
uopt (kjk) = STu Su + I
1
STu (k)
u(k
1)
Here > 0 is called move suppression parameter Increasing
more and more sluggish.
12
makes controller