Sunteți pe pagina 1din 72

Why State Space Models

• The state space model represents a physical


system as n first order differential
equations. This form is better suited for
computer simulation than an nth order
input-output differential equation.

1
Basics
• Vector matrix format generally is given by:

where y is the output equation, and x is the


state vector

2
PARTS OF A STATE SPACE
REPRESENTATION
• State Variables: a subset of system variables which if
known at an initial time t0 along with subsequent inputs are
determined for all time t>t0+
• State Equations: n linearly independent first order
differential equations relating the first derivatives of the
state variables to functions of the state variables and the
inputs.
• Output equations: algebraic equations relating the state
variables to the system outputs.

3
d
x(t )  Ax (t )  Bu (t ) State equation
Dynamic equation dt
y (t )  Cx(t )  Du(t ) Output equation
State variable
 x1 (t )   u1 (t )   y1 (t )   x1 (0) 
 x (t )  u (t )  y (t )   x (0) 
x(t )   2  u (t )   2  y (t )    x(0)   2 
2

           
       
 x n (t ) n1 ur (t )  r1  p  p1
y (t )  n  n1
x ( 0 )

State space r- input p- output

       
A   nn 
 B   nr 
 C   pn 
 D   pr 

       
u1 (t ) y1 (t )
u2 (t ) Inner state variables y2 (t )
 x1 , x2 , xn 
ur (t ) y p (t )

u (t ) + x (t ) 1 x(t ) + y (t )
B C
s +
-

A
Motivation of state space approach
Example 1
u (t ) e(t ) s 1 y (t )
+ - ( s  1)

2
s 1 +
n(t ) noise
Y ( s) s  1
Transfer function 
U ( s) s  3 BIBO stable
E ( s)  2( s  1)
u 0 
N ( s) ( s  1)( s  3)
unstable
Example 2

u (t ) s 1 1 y (t )
s 1 s 1

y 1
 BIBO stable, pole-zero cancellation
u s 1

+
+ x1 1 x1 + v(t ) x 2 1 x2
-2
u (t ) - s + s y (t )
+
v s 1 2
  1
u s 1 s 1
2
vu u
s 1 7
x1   x1  2u x1 (0)  x10
x2  x1  x2  u x 2 (0)  x 20
y  x2
x(t )  L1[(sI  A) 1 ]x(0)  L1[(sI  A) 1 BU (s)]

x1 (t )  e t x10 2e t  u (t )
1 1 t
y (t )  x 2 (t )  ( x 20  x10 )e  e x10 e t  u (t )
t

2 2

1. if x10  x 20  0
2. if x10  2 x 20 then system stable

State-space description Internal behavior description

8
Example : Capacitor electric
energy
1 t0 1 t
v(t )   i ( )d   i ( )d
c  c t0 i[, t0 ] Input
1 t
 v(t 0 )   i ( )d

c t0

Example : Inductor

1 t0 1 t
i (t )   v( )d   v( )d
L  L t0
1 t
 i(t 0 )   v( )d

L t0 Magnetic
energy
9
Example y2 y1
K
M2 M1 f (t )

B3 B2 B1

M 1 y1  B1 y1  B2 ( y1  y 2 )  K ( y1  y 2 )  f (t )


M 2 y2  B3 y 2  B2 ( y 2  y1 )  K ( y 2  y1 )  0

 
 
x1  y1  y 2  x1   0
 1 1   x1   0 
 x    K ( B  B2 ) B2   x    1  f (t )
x 2  y1  2  M  1
let M1 M1   2   M1 
 x3    
( B2  B3 )   x3   0 
1
x3  y 2 
K B2
 
 M 2 M2 M 2 

10
Example La Rf
Ra
  
ea t  ia e t  Lf e f t 

b
 
Armature circuit  m Field circuit
TL
Jm
di Tm  k i ia
ea (t )  Raia  eb  La a
dt d 2 m d m
 Jm  B  TL
eb  kbm dt 2 m
dt

dia  Ra kb 1 d m k B d m 1
 ia   m  ea  i ia  m  TL
dt La La La dt Jm J m dt Jm
d m
 m
dt

11
 Ra  Kb   1 
 L La
0  L 0 
 ia   a   ia   a  e
   Ki  Bm     1  a 
 m    J Jm
0  m   0 
    
J m TL 
m   m
0   m   0 0 
 
0 1
   
   
 ia 
 y1 (t )   m (t )  0 0 1  
 y (t )   (t )  0 1 0  m 
 2   m     
 m

12
Dynamical equation Transfer function

x (t )  Ax (t )  Bu (t )
y (t )  Cx(t )  Du(t )
Laplace transform
sX ( s)  x(0)  AX ( s)  BU ( s)
Y ( s)  CX ( s)  DU ( s)

assume x(0)  0
X ( s)  ( sI  A) 1 BU ( s)
Y ( s)  [C ( sI  A) 1 B  D]U ( s)
matrix
Transfer function
13
Example By Newton’s Law
F  My  My  by  ky  r
r  ky  by  My let x1  y, x2  y
k

b
x1  y  x2
M 
b k 1
x2  y   y  y r
y (t ), y (t ) M M M
r (t ) b
  x2 
k 1
x1  u u  r 
M M M
x1  x 2
 k b 1
x 2   x1  x2  u
M M M

 x1   0 1  x   0 
x 
  k b  1    1   u y  1 0 1   0  u
 x2   M    x2   
M M   x2 
C
A B

14
State Space Equation
 x1   0 1  x   0 
x  Ax  Bu For example :     k b   1    1 u
 x2   M    x2   
M M 
y  Cx  Du
 x1 
y  1 0   0  u
 x2 
Transfer Function
Y ( s) b1s  b0
G( s)  For example : G( s) 
U ( s) a2 s 2  a1s  a0

Example: Transfer function of the Mass-damper-spring system


d2y dy
M 2  b  ky  u (t ) x  x1 x2 
T
dt dt
Ms 2Y ( s )  bsY ( s )  kY ( s )  U ( s )
Y ( s) 1
 G ( s) 
U ( s) Ms 2  bs  k

15
 x1   0 1 0   x1  0 0
Example  x    0  4 3   x   1 0   u1 
 2   2    u 
 x3   1  1  2  x3   0 1  2 
MIMO system  x1 
 y1 (t )  1 0 0  
 y (t )  0 0 1  x2 
 2   x 
 3

adj ( sI  A)
( sI  A) 1 
sI  A
 s 2  6s  11 s  2 3 
1  
  3 s 2
 2 3s
s ( s  4)( s  2)  3  3s  
 s4  s  1 s  4s 
2

G ( s)  [C ( sI  A) 1 B  D]
1  s2 3 
Transfer function

s 3  6s 2  11s  3  ( s  1) s( s  4)

16
Remark : the choice of states is not unique.

+ R L +
di(t ) 1 t
ei (t ) c ec (t ) Ri (t )  L   i(t )dt  ei (t )
i (t )
dt c 0
- -

x1 (t )  i (t )  x1   R 
1  x   1 
 x    L LC      L  ei (t )
1
let  2   1 0   x2   0 
x2 (t )   i (t )dt
x 
y(t )  i(t ) y (t )  1 0 1 
 x2 
 R R
xˆ1 (t )  i (t )  xˆ1   L
    ˆ
x  1
  ˆ    L  ei (t )
L
    1
1
let  xˆ2   0   x2   0 
xˆ2 (t )  ec (t )  L 
exist a mapping
y(t )  i(t )  xˆ1 
y (t )  1 0 
 xˆ2 
17
Question
The transition matrix
For a given continuous system,
d
X (t )  AX (t )  Bu (t )
dt
y  CX (t )
we can obtain the solution as the follow.
First, we can re-write the equation as:
d
X (t )  AX (t )  Bu (t )
dt
35
The transition matrix
Pre-multiplying both sides of the above equation by
e-At, we obtain
 At d d  At  At
e ( X (t )  AX (t ))  (e X (t ))  e Bu (t )
dt dt
Integrating the preceding equation between 0 and t
gives t d
0 dt
 At  At
( e 1
X (t1 )) dt1  e 1
X (t )
1 0|t

t
 e  At X (t )  X (0)   e  At1 Bu (t1 )dt1
0
36
The transition matrix
t
e  At
X (t )  X (0)   e  At1 Bu (t1 )dt1
Or 0
t
e  At X (t )  X (0)   e  At1 Bu (t1 )dt1
0
Pre-multiplying both sides by eAt, we have
t
X (t )  e At X (0)  e At  e  At1 Bu (t1 )dt1
0
t
 e X (0)   e At e  At1 Bu (t1 )dt1
At

0
t
 e At X (0)   e A(t t1 ) Bu (t1 )dt1
0

37
The transition matrix

That is X (t )  e At X (0)   e A(t t1 ) Bu (t1 )dt1


0

Suppose the input is zero, at time t0 we have


t0

X (t 0 )  e At 0 X (0)   e A(t t1 ) Bu (t1 )dt1


0

 e At 0 X (0)
X (0)  e  At 0 X (t 0 )
38
The transition matrix

The solution of the state equation starting with the


initial condition X(t
t 0) is
X (t )  e At X (0)   e A( t t1 ) Bu (t1 )dt1
0
t0 t
 e At e  At 0 X (t 0 )   e A(t t1 ) Bu (t1 )dt1   e A(t t1 ) Bu (t1 )dt1
0 t0
t
 e A(t -t 0 ) X (t 0 )   e A( t t1 ) Bu (t1 )dt1
t0
t
X (t )  e A(t - t 0 ) X (t 0 )   e A( t t1 ) Bu (t1 )dt1
t0
39
The transition matrix

The output of the system is


t
y (t )  CX (t )  C (e A(t - t 0 ) X (t0 )   e A(t t1 ) Bu (t1 )dt1 )
t0
t
 C ( (t  t0 ) X (t0 )    (t  t1 ) Bu (t1 )dt1
t0

The matrix eAt=(t) is called as Transition


Matrix.
40
Properties of the transition matrix

Given the transition matrix (t)= eAt, then


At 1  At
• e At
|t 0  I , [e ]  e

• e A(t1 t2 )  e At1 e At 2  e At 2 e At1

• e A(t t )  e At e  At  e  At e At  I
N
Ak t k
•  (t )  e At  lim 
N  k!
k 0

41
Calculation of the transition matrix
N
Ak t k
As  (t )  e
At
 lim 
N  k!
k 0
apply Laplace transform to the above equations, we
have L[ (t )]  L[ I  At  21! A 2 t 2   k1! A k t k  ]
I A A2 Ak
  2  3  k 
s s s s
1 A A2 Ak 
  I   2    k  
s s s s 
1 I I
   ( sI  A) 1
s A sI  A
I
s
42
Calculation of the transition matrix

Finally we have

 (t )  L (sI  A)
1 1

That means we can use inverse Laplace
transform to calculate the transition matrix.

43
Examples of the transition matrix
calculation

Example 1: Given the transfer function of a


system as the follow,
Y (s) s3
G( s)   2
U ( s) s  6s  109
find its transition matrix(t).

44
Examples of the transition matrix
calculation

First, find its state equations,


d  x1 (t )   0 1  x1 (t )   0 
        u (t )
dt  x 2 (t )   - 109 - 6  x 2 (t )  1 
 x1 (t ) 
y (t )  3 1 
 x 2 (t ) 
s 0 0 1
then, sI  A      
 0 s    109 - 6 
s -1 
  
109 s  6  45
Examples of the transition matrix
calculation

Next, find the inverse,


1
1 s -1  1  s  6 1
( sI  A)      
109 s  6  s ( s  6)  109   109 s 
 s9 1 
 2 
s  6s  109 s  6s  109 
2

  106 s 
 2 
 s  6s  109 s  6s  109 
2

46
Examples of the transition matrix
calculation (cont’)
Finally, calculate the transition matrix,
 s6 1 
 2 
  2
 
 (t )  L1[( sI  A) 1 ]  L1  s 6 s 109 s 6 s 109 
  109 s 
 2 
 s  6s  109 s 2  6s  109 
 s 33 1 
 2 
-1  (s  3)  10
2 2
(s  3)  10   11(t ) 2 (t ) 
2
L     

 109 s  3-3
  21(t ) 22 (t ) 
 (s  3)  10 (s  3) 2  10 2 
2 2

  3t 3  3t 1  3t 
 e cos 10t  e sin 10t e sin 10t 
 
10 10
 109 3t 3 
 e sin 10t e 3t cos 10t  e 3t sin 10t 
 10 10  47
General State Representation
x  Ax  Bu State equation
y  Cx  Du output equation

x = state vector
x = derivative of the state vector with
y = output vectorrespect to time
u= input or control vector
A = system matrix
B
= input matrix
C = output matrix

D = feedforward matrix
48
Some definitions
• System variable : any variable that responds to an input or initial
conditions in a system
• State variables : the smallest set of linearly independent system
variables such that the values of the members of the set at time t0
along with known forcing functions completely determine the
value of all system variables for all t ≥ t0
• State vector : a vector whose elements are the state variables
• State space : the n-dimensional space whose axes are the state
variables
• State equations : a set of first-order differential equations with b
variables, where the n variables to be solved are the state variables
• Output equation : the algebraic equation that expresses the output
variables of a system as linear combination of the state variables
and the inputs.

49
Graphic
representation
of state space
and a state
vector
Application

Electrical network

51
1. Select state variablesvC iL
dvC diL
C  iC L  vL (1)
dt dt
Express (1) using vC iL vt 

2. iC  iR  iL vL  vC  vt  (2)


1
  vC  iL
R

3. dvC   1 vc  1 iL
dt RC C

  vC  vt 
diL 1 1 (3)
dt L L

4. 1
Output iR  vC
equation R
Convert a transfer function
dny d n 1 y dy
n
 a n 1 n 1
   a1  a0 y  b0u
dt dt dt

choose
d n 1 y
x1  y x2 
dy
dt
d2y
x3  2
dt  xn  n 1
dt

diferensiasikan
dy
x1  x1  x2
dt
d2y
x2  2
x 2  x3
dt

d3y
x3  3 x n 1  xn
dt
 n
xn  a0 x1  a1 x2   an1 xn  b0u
d y
xn 
dt n
53
 x1   0 1 0 0 0 0  0   x1  0 
 x   0 0 1 0 0 0  0   x2  0 
 2  
 x3   0 0 0 1 0 0  0   x3  0 
      u
          
 xn 1   0 0 0 0 0 0  1   xn 1  0 
      
 xn   a0  a1  a2  a3  a4  a5   an 1   xn  b0 

 x1 
x 
 2 
 x3 
y  1 0 0  0 
  
 xn 1 
 
 xn 
Example : TF to State Space

1. Inverse Laplace
c  9c  26c  24c  24r

2 Select state variables


. x1  c x2  c x3  c

x1  x2
x2  x3
N s 
G s  
x3  24 x1  26 x2  9 x3  24r Ds 

N s  numerator
y  c  x1 Ds  denominator

55
 x1   0 1 0   x1   0 
 x    0   x    0 r  x1 
y  1 0 0 x2 
  2 0 1  2   
 x3   24  26  9  x3  24
 x3 

56
Decomposing a transfer function

57
 
Y s   C s   b2 s 2  b1s  b0 X1 s 

d 2 x1
yt   b2 2  b1 1  b0 x1
dx
dt dt

yt   b0 x1  b1 x2  b2 x3

58
Example

59
yt   2 x1  7 x2  x3

 x1 
y  2 7 1 x2 
 x3 

60
State Space to TF
x  Ax  Bu
y  Cx  Du
Laplace Transform
sX s   AX s   BU s 
Y s   CX s   DU s 

X s   sI  A BU s 
1


Y s   C sI  A B  D U s 
1

Y s 
T s    C sI  A B  D
1

U s 

61
0 1 0  10
x   0 0 1  x   0 u
 1  2  3  0 
y  1 0 0x
s 1 0 
sI  A  0 s  1 
1 2 s  3

sI  A1  adj (sI  A)


det(sI  A)

( s 2  3s  2) s3 1
 
  1 s ( s  3) s 
 s  (2s  1) s 
2

 
s 3  3s 2  2s  1
T s   C sI  A B  D
1

10( s 2  3s  2)
T s   3
s  3s 2  2s  1
Design of state observer
State Observer , or pole placement, is a method employed in feedback control system
theory to place the closed-loop poles of a plant in pre-determined locations in the s-
plane.
Placing poles is desirable because the location of the poles corresponds directly to the
eigenvalues of the system, which control the characteristics of the response of the
system. The system must be considered controllable in order to implement this method.
If the closed-loop input-output transfer function can be represented by a state space
equation,

then the poles of the system are the roots of the characteristic equation given by

Full state feedback is utilized by commanding the input vector . Consider


an input proportional (in the matrix sense) to the state vector,
69
Substituting into the state space equations above, The roots of the State
Feedback system are given by the characteristic equation, .

Comparing the terms of this equation with those of the desired

characteristic equation yields the values of the feedback matrix which


force the closed-loop eigenvalues to the pole locations specified by the
desired characteristic equation.

70
Example
Consider a control system given by the following state space
equations

The uncontrolled system has closed-loop poles at


Suppose, for considerations of the response, we wish the controlled
system eigenvalues to be located at The desired
characteristic equation is then

Following the procedure given above, , and the State


Feedback controlled system characteristic equation is

71
Upon setting this characteristic equation equal to the desired
characteristic equation, we find

Therefore, setting forces the closed-loop poles to the


desired locations, affecting the response as desired.

72

S-ar putea să vă placă și