Lecture 12 - State Feedback
Introduction
K. J. strm
The simple design method becomes very cumbersome for
systems of high order
1. Introduction
The PID controller predicts based on linear extrapolation
2. An Example
Can we do something better
3. The General Case
Where to look for inspiration?
4. Integral Action
State a number of variables that summarizes the past that
is useful for prediction
5. Summary
The future behavior can be predicted from the state
Theme: Using the state for control.
Can we find a general controller?
The state is an ideal basis for control
We will focus on the predictive part, reference values and
integral action will be dealt with later
State Feedback
The Mathematical Tool - Matrices
Assume that the process is described by
Please refresh your knowledge of matrices.
What is a matrix
dx
= Ax + Bu
dt
y = Cx
Matrix algebra: addition, multiplication, notice AB = B A (a
very useful property), transpose
The general linear controller is: u = Lx + lr r
Matlab
The closed loop system then becomes
Linear equations and inverses Ax = B , x = A1 B
dx
= Ax + Bu = Ax + B ( Lx + lr r) = ( A B L) x + Blr r
dt
Eigenvalues and eigenvectors
The closed loop system has the characteristic equation
Ae = e
( A I)e = 0
det A I = 0
det(sI A + B L) = 0
Can we choose L so that this equation has specified poles?
c K. J. strm August, 2001
&
Simple Examples
Example - The Car
Consider the following matrices and their transpose
a11 a12
b11 b12
c11 c12 c13
, B=
, C=
A=
a21
a22
b21
b22
c21
c22
c23
Which matrices can be added?
dx
=
dt
Choosing
y = Cx = ( 1
x+
0
1
0)x
u = l1 x1 l2 x2 + lr r
Closed loop system
0 1
0
dx
=
x+
r
l1 l2
lr
dt
det A = a11 a22 a12 a21
a22 a12
1
A1 =
det A a21 a11
Characteristic polynomial det (sI A)
s a11
a12
= s2 (a11 + a22 )s + a11 a22 a12 a21
det
l1 = 2 0, l2 = 02
Control law
Which matrices can be multiplied?
a21
Process model
gives the characteristic polynomial s2 + 2 0 s + 02 .
The closed loop system is
Y ( s) =
Choosing lr = 02 gives the
correct steady state value.
Characteristic equation
s 2 + l1 s + l2 = 0
lr
R( s )
s2 + 2 0 s + 02
Y ( s) =
02
R( s )
s2 + 2 0 s + 02
s a22
Example
Controllability
dx
= Ax + Bu
dt
Find control signal that moves the system from x(0) = a to
x(t) = b. Hence
Z t
At
b = x(t) = e a +
eA(ts) Bu(s)ds
Try to do same thing for
dx
=
dt
y = Cx = ( 1
x+
1
0
0) x
Control law u = l1 x1 l2 x2 + lr r. Closed loop system
l 1 l
l
dx
r
1
2
= 0
x
+
r
0
0
dt
This implies
Characteristic equation
s ( s + l1 ) = s 2 + l1 s = 0
e As Bu(s)ds = a + be At
We cannot obtain a desired characteristic polynomial. Why? The
control signal does not influence the second state! Some conditions
are required!
c K. J. strm August, 2001
&
Examples
Controllability ...
Z
As
dx
=
dt
At
Bu(s)ds = a + be
It follows from Cayley-Hamiltons theorem (a matrix satisfies it
own characteristic equation) that
Z t
n
X
k1
A B
k (s)u(s)ds = a + be At
Left side a combination of vectors B , AB , . . ., A
can be solved if the matrix
n1
B . Equation
Wc = ( B , AB ) =
dx
=
dt
we have
x+
Wc = ( B , AB ) =
Wc = ( B AB . . . An1 B )
we have
k=1
, Controllable!
x+
1
0
Not Controllable!
can be inverted. Controllability!
A Special Case
The Characteristic Equation
The system
a1 a2 . . . an1 an
1
1
0
0
0
0
dz
0
1
0
0
0
=
z
+
dt
..
..
.
.
is controllable
1 a1 a21 a2 . . .
0
1
a1
...
0
0
1
...
Wc =
.
0
...
The system
a1 a2 . . . an1 an
1
1
0
0
0
0
dz
0
1
0
0
0
=
z
+
dt
..
..
.
.
has the characteristic polynomial
s n + a1 s n 1 + a2 s n 2 + . . . + a n
c K. J. strm August, 2001
&
A Special Case which is Easy
A Special Case
a1 a2 . . . an1 an
1
1
0
0
0
0
dz
0
1
0
0
0
=
z
+
u
dt
.
.
.
.
.
.
a1 a2 . . . an1 an
1
1
0
0
0
0
dz
0
1
0
0
0
=
z
+
u
dt
.
.
.
.
.
.
The feedback u = l1 z1 l2 z2 . . . ln zn + lr r gives
a1 l1 a2 l2 . . . an ln
lr
1
0
0
0
dz
0
1
0
0
=
z
+
r
dt
.
.
.
.
.
0
u = l1 z1 l2 z2 . . . ln z n + lr r
l1 = p1 a1 ,
l2 = p2 a2 , . . . , ln = pn an
gives the characteristic polynomial
sn + p1 sn1 + p2 sn2 + . . . + pn
The General Case
Problem solved for special case. Can we transform a given
system to this case? Start with
dx
= Ax + Bu
dt
A system
dx
= Ax + Bu
dt
which is controllable can be transformed to
a1
dz
0
=
dt
with controllability matrix
Wc = ( B AB . . . A
The feedback
The General Case
n1
B)
Change coordinates z = T x
dz
dx
+ Bu
=T
= T Ax + T Bu = T AT 1 z + T Bu = Az
dt
dt
a2
. . . an
...
...
...
z
+
u
.
0
for this system which
It is easy to find a state feedback u = Lz
gives a specified characteristic equation.
= ( p1 a1
L
This system has the controllability matrix
p2 a2
...
pn an )
c = ( B A B . . . A n1 B ) = T ( B AB . . . An1 B ) = T Wc
W
c K. J. strm August, 2001
&
An Algorithm
How to Compute the Feedback Gain
dx
= Ax + Bu to controllable canonical
dt
dz
+ Bu
using the transformation z = T x = W
c W 1 x .
form
= Az
c
dt
Feedback for transformed system u = z where
Transform the system
For simple problems we just write the characteristic
equation, compute the characteristic polynomial and match
coefficients. (Typical exam problem)
Ackermanns formula summarizes the derivation given
above
= ( p1 a1 p2 a2 . . . pn an )
L
We have u = Lx = LT
L = (0
...
1)( B
AB
...
An1 B )1 P( A)
... 0 1)
Wc = ( B AB . . . An1 B )
en = ( 0
, hence
z = Lz
L = en Wc1 P( A)
=L
W
c W 1
L = LT
c
where P(s) is the desired characteristic polynomial This
formula does not have good numerical properties
There are efficient numerical routines acker and place in
Matlab
The Inverted Pendulum
dx
0 1
= Ax + Bu =
x+
1 0
dt
The system is controllable. The control law
Using Matlab
0
1
There are several command is Matlab for design of state
feedback. The command help toolbox/control tells you what
command are available
u = l1 x1 l2 x2
gives the closed loop system
dx
= ( A B L) x =
dt
The characteristic polynomial is
s
det (sI A + B L) = det
l1 1
1 l1
l2
1
s + l2
ACKER Pole placement using Ackermanns formula.
K = ACKER(A,B,P) calculates the feedback gain
matrix K such that the single input system
.
x = Ax + Bu
x
= s2 + l2 s + l1 1
with a feedback law of u = -Kx has closed loop
poles at the values specified in vector P,
i.e., P = eig(A-B*K). See also PLACE.
c K. J. strm August, 2001
&
Integral Action - A Fix
Integral Action - A Fix ...
d
dt
Control law
Process model
dx
= Ax + Bu
dt
y = Cx
x
I
=
+
Form the augmented system
d x
A 0
x
B
0
=
+
u+
r
C 0
I
0
1
dt I
u+
0
1
u = ( L lI )
Introduce the integral of the error as an extra state
Z
dI
I = (r y)dt,
= r y = r Cx
dt
x
I
+ lr r
Closed loop system
d x
A B L B Li
x
B lr
=
+
r
C
0
1
I
dt I
If closed loop system stable there is no steady state error
Cx0 = r
Looks as original system with one extra state!
Is the Augmented System Controllable?
d x
A 0
x
B
0
=
+
u+
r
C 0
I
0
1
dt I
Controllability matrix
B
AB
...
An B
Wc =
n1
0
CB
...
CA
The system is controllable if the original system is controllable
and if C An1 B = 0. Controllability of cascaded systems.
Summary
A nice way to use process dynamics to predict
A nice alternative to pole placement
Actually works for systems with many inputs and outputs
Nice computational methods matrix calculations
Works for high order systems
The idea of augmentation
Integral action still ad hoc will be dealt with later
Reference values will be done later
The control problem is thus easy if all state variables are
measured
What to do if all states are not measured? (Stay tuned for
next lecture!)
c K. J. strm August, 2001
&