Elements of Feedback Control

State space model
State eq : x  f ( x, u )

Output eq : y  h( x, u )
 x  Ax  Bu

 y  Cx  Du
State space model:
linear:
where: u: input
y: output
x: state vector
A,B,C,D, or F,G,H,J are const matrices
If dim(x) = n, we say system order = n
A is nxn matrix, called system matrix
System property largely determined by properies of A.
State transition matrix: eAt
• eAt is an nxn matrix
• eAt =ℒ-1((sI-A)-1), or ℒ (eAt)=(sI-A)-1
d At
• e = AeAt= eAtA
dt
• eAt
1
1
= Inxn+At+ 2!A2t2+ 3!A3t3 +
def
• eAt is invertible: (eAt)-1= e(-A)t
• eA0=I
• eAt1 eAt2= eA(t1+t2)

Example
0 0 
A
,

0 0 
 s 0

( sI  A)  
0 s 
1
1
1

0


s


1
0



s


 1 1

1
 L ( ) L (0)   u (t ) 0 
s
  

e At  L1 (( sI  A) 1 )  
 L1 (0) L1 ( 1 )   0 u (t ) 


s 

 1
1

s

a
0


1
1
 s  a1
a1 0 


(
sI

A
)


 0

A
,


s

a
2

0
a
2

 0

 1

0 

a1t

e
u (t )
0 
At
1  s  a1



e L

a
t

2
1   0

e
u
(
t
)

 0

s  a2 


0 

1 
s  a2 
Example
 1 1 
A
,

 0  1
 s 0   1 1 
  

sI  A  
 0 s   0  1
 s 1 1 

( sI  A) 1  
 0 s  1
1
1 
 1


1  s  1 1   s  1 ( s  1) 2 

 

2 
1 
( s  1)  0 s  1 
0


s 1 

1 
 1

2 
 e t u (t ) tet u (t ) 
At
1  s  1
(
s

1
)


e L
t


1   0

e
u
(
t
)

 0

s 1 

I/O model to state space
• Infinite many solutions, all equivalent.
• Controller canonical form:
dn
d n 1
d
d n 1
d
y  an 1 n 1 y    a1 y  a0 y  bn 1 n 1 u    b1 u  b0u
n
dt
dt
dt
dt
dt
1
0  
0  0 
 0
 0
 0 
0
1


0

  
 
   
  0 
 x  
 x   u

 
0  0 
 
 0
0   0
1  0 

  
 a0  a1     an 1  1
y  b0
b1    bn 1 x  [0]u
Example
t
d3y
d 2 y dy
 5 2  3  y  2 yd  r (t )
3
0
dt
dt
dt
d d4y
d3y
d 2 y dy
dr
:

5

3


2
y

dt dt 4
dt 3
dt 2 dt
dt
n=4





a3
a2
a1
a0
b1

0

0
 x  

0



 2

 y  0 1
0  0 
0
1
0  0
x
u
0
0
1  0 
  
 1  3  5 1
0 0x
1
0
b0=b2=b3=0
>> n=[1 2 3];d=[1 4 5 6];
>> [A,B,C,D]=tf2ss(n,d)
A=
-4
1
0
B=
1
0
0
C=
1
D=
0
-5
0
1
-6
0
0
2
3
>> tf(n,d)
Transfer function:
s^2 + 2 s + 3
--------------------s^3 + 4 s^2 + 5 s + 6
 x  Ax  Bu

 y  Cx  Du
d3y
d2y
dy
 4 2  5  6y
3
dt
dt
dt
d 2u
du
 2  2  3u
dt
dt
Characteristic values
• Char. eq of a system is
det(sI-A)=0
the polynomial det(sI-A) is called char. pol.
the roots of char. eq. are char. values
they are also the eigen-values of A
e.g.
 1 0 0  0
x   0  2 1  x  1u
 0 0  2 0
0 
 s 1 0


det( sI  A)  det 0 s  2  1   ( s  1)( s  2) 2
 0
0
s  2 

∴ (s+1)(s+2)2 is the char. pol.
(s+1)(s+2)2=0 is the char. eq.
s1=-1,s2=-2,s3=-2 are char. values or eigenvalues


s 1
( s  1)( s  2)

( s  1)( s  2) 
0
 ( s  2) 2

1
1
0
( sI  A) 
2 
( s  1)( s  2) 
 0
 1

 s 1
 0


 0

1
e L (
At
0
1
s2
0
0

0 

1 
( s  2) 2 
1 

s2 

)
 e t u (t )
0
0 


 2t
 2t
 0
e u (t ) te u (t ) 
 0

 2t
0
e u (t ) 

0
  e t
0 


 0 1  e t 


can
set t=0
can
 1 0 

  I 22
 0 0
 e t
 t
 te

yes,

0

t 
e 
1 0

0 1
at t=0: 

d

dt
? e At
∴No
? e At
√
  e t
0 


   t t
t 
e 
 e  te
0 
  1 0  e t

? 
 t

t 
e 
 1  1 te
 1 0 

A  
 1  1
√
Solution of state space model
 x  Ax  Bu

 y  Cx  Du
Recall: sX(s)-x(0)=AX(s)+BU(s)
(sI-A)X(s)=BU(s)+x(0)
X(s)=(sI-A)-1BU(s)+(sI-A)-1x(0)
x(t)=(ℒ-1(sI-A)-1))*Bu(t)+ ℒ-1(sI-A)-1) x(0)
x(t)=
y(t)=
t
A(t-τ)Bu(τ)d τ+eAtx(0)
e

0
t
A(t-τ)Bu(τ)d τ+CeAtx(0)+Du(t)
Ce

0
S.S to T.F.
X(s)=(sI-A)-1BU(s)
Y(s)=C(sI-A)-1BU(s)+DU(s)
=(D+ C(sI-A)-1B)U(s)
∴ T.F. H(s)= D+ C(sI-A)-1B
In matlab: ss2tf
eig
roots
poly
use help to find out how to use these
• In Matlab:
>> A=[0 1;-2 -3];
>> B=[0;1];
>> C=[1 3];
>> D=[0];
>> [n,d]=ss2tf(A,B,C,D)
n=
0
d=
1 3
>>tf(n,d)
3.0000
2
1.0000
0s 2  3s  1
H ( s)  2
s  3s  2
But don’t use those for hand calculation
use:X(s)=(sI-A)-1BU(s)+(sI-A)-1x(0)
x(t)=ℒ-1{(sI-A)-1BU(s)}+{ℒ-1 (sI-A)-1} x(0)
& Y(s)=C(sI-A)-1BU(s)+DU(s)+C(sI-A)-1x(0)
 y(t)= ℒ-1{C(sI-A)-1BU(s)+DU(s)}+C{ℒ-1 (sI-A)-1} x(0)
e.g.
  1 0  1
u= unit step
x   u ,
 x  

  0  2  0 
0
x(0)   
 y  1 0x

1
 1

 1

0  1  1 
0  0 

    s  1
 
X ( s)   s  1
1
1
0
 0
  s  0
 1 




s2
s2


 1 1 1 1 
   


s

1
s
s
s

1



1
1

 


 

 s2   s2 
 u (t )  e t u (t ) 

x(t )  
 2t

 e u(t ) 
Y ( s )  CX ( s )  DU ( s )
1 
1



1
s
s

1
  0
 1 0
s
 1 


 s2 
1
1
 
s s 1
y(t )  u (t )  e t u (t )
Note: T.F.=D+ C(sI-A)-1B
 1

 0  1 0 s  1
 0



0  1 
1
  
1  0  s  1

s2
Eigenvalues, eigenvectors
Given a nxn square matrix A, p is an eigenvector of A if
Ap∝p
i.e. λ s.t. Ap= λp
λis an eigenvalue of A
1 0 
Example: A  0  2 ,


1 0  1 1
1
Ap1  
    p1



Let p1  0 ,
0  2 0 0
∴p1 is an e-vector, & the e-value=1
1 0  0  0 
0
0 
Ap2  
    2 
p2   



0  2 1  2
1
1  ,
Let
∴p2 is also an e-vector, assoc. with the λ =-2
In Matlab
>> A=[2 0 1; 0 2 1; 1 1 4];
>> [P,D]=eig(A)
P = 0.6280
0.7071 0.3251
0.6280 -0.7071 0.3251
-0.4597 -0.0000 0.8881



p1
p2
p3
λ1
D =1.2679
0
0
λ2
0
2.0000
0
λ3
0
0
4.7321
If we use [P,D]=eig(A)
 get approximate but wrong answer
Should use:
>>[P,J]=jordan(A)
P=
0.3750
0
-0.375
0
0
8
0
16
1
4
0
9
0.625
0
0.375
0
-8
0
0
0
0
-16
0
0
0
1
-16
0
0
0
1
-16
J=

a 3x3 Jordan block assoc. w/. λ=-16
• In general, if λ, P is an e-pair for A,
AP= λP
λP-AP=0
λIP-AP=0
(λI-A)P=0
∵ P≠0 ∴ det(λI-A)=0
∴ λ is a sol. of char. eq of A
• char. pol. of nxn A has deg=n
∴ A has n eigen-values.
e.g. A= 1 0  , det(λI-A)=(λ-1)(λ+2)=0
0  2


⇒ λ1=1, λ2=-2
• If λ1 ≠λ2 ≠λ3⋯
then the corresponding P1, P2, ⋯ will be linearly
independent, i.e., the matrix
P=[P1⋮P2 ⋮ ⋯Pn] will be invertible.
AP1= λ1P1
AP2= λ2P2
⋮
A[P1⋮P2 ⋮ ⋯]=[AP1⋮AP2 ⋮ ⋯]
=[λ P1⋮ λ P2 ⋮ ⋯]
1 0

0 

=[P1 P2  ⋯] 2

 0 



0




• ∴ AP=PΛ
P-1AP= Λ=diag(λ1, λ2, ⋯)
∴If A has n lin. ind. Eigenvectors then A can be
diagonalized.
Note: Not all square matrices can be
diagonalized.
If A does not have n lin. ind. e-vectors
(some of the eigenvalues are identical),
then A can not be diagonalized
E.g. A=
 4  4
 12 8
 4  24 4

4


  3  6  11 3 


9

14
9

9


det(λI-A)= λ4+56λ3+1152λ2+10240λ+32768
λ1=-8
λ2=-16
λ3=-16
λ4=-16
1
0 
p1   ,
1
 
0 
0 
1 
p2   
0 
 
 2
by solving (λI-A)P=0