0% found this document useful (0 votes)
10 views

Topic#7 State Space Analysis and Design

Uploaded by

Ahmed Shafeek
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Topic#7 State Space Analysis and Design

Uploaded by

Ahmed Shafeek
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 56

Faculty of Engineering

Computer and Systems Engineering Department

CSE 371: Control Engineering

Topic#7
State Space Analysis & Design
Prof. Wahied Gharieb Ali
Outline

 State Space Representation


 State Space to Transfer Function
 State Transition Matrix
 Transfer Function to Stat-State Form
 Controllability
 State Feedback Controller Design
 Observability
 Observer design
2
State Space Representation

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.

Sate 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 n simultaneous, first-order differential equations


with n 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 combinations of the state variables and the
inputs.
3
State Space Representation

• Dynamic system must involve elements that memorize


the values of the input

• Integrators in continuous time serve as memory


devices

•Outputs of integrators are considered as internal state


variables of the dynamic system

• Number of state variables to completely define the


dynamics of the system=number of integrators involved

4
State Space Representation

Remarks about the spate space:

 The state space method is a time domain approach to


represent linear systems.
 Unlike the Transfer Function, the state space model is not
unique. It depends on the choice of the state variables.

 The state space representation is meaningful because the


state of the variables are usually system variables.
 The state variable model gives more details about the
internal variables not just the input-output relationship.

5
State Space Representation

The concept of the state of a dynamic system refers to a


minimum set of variables, known as state variables, that fully
describe the system and its response to any given set of inputs.
Consider the following system:

x 1 (t )  f1 ( x, u, t )
x 2 (t )  f 2 ( x, u, t )


x n (t )  f n ( x, u, t )

6
State Space Representation
Linear Time Invariant System

A(t)= State Matrix


B(t)= Input Matrix
C(t)=Output Matrix
D(t)=Direct Transmission Matrix
7
State Space to Transfer Functions
Consider A set of linear state and output equations written in standard
form :
 x  Ax  Bu

 y  Cx  Du
may be rewritten in the Laplace domain. The system equations are then
sX ( s )  x(0)  AX ( s )  BU ( s )

Y ( s )  CX ( s )  DU ( s )
and the state equations may be rewritten:
sX ( s )  AX ( s )  x(0)  BU ( s )
[ SI  A] X ( s )  x(0)  BU ( s )
where the terms I creates an nxn matrix with s on the leading
diagonal and zeros elsewhere.
X ( s )  [ SI  A]1 x(0)  [ SI  A]1 BU ( s )
8
State Space to Transfer Functions

Substituting X(s) in the output equation:

Y  CX  DU

Y ( s )  C[ SI  A]1 x(0)  C[ SI  A]1 BU ( s )  DU ( s )


To get the Transfer function, we neglect x(0) (zero initial conditions)

Y ( s )  C[ SI  A]1 BU ( s )  DU ( s )
 C[ SI  A]1 B  D U ( s )

Y (s)
 C[ SI  A]1 B  D
U (s)

9
Transfer Function to State Space
With Constant Term in the Numerator
Consider the system defined by the following transfer function:
Y (s) b0
G (s)   n
U ( s ) s  an 1s n1  ...  a0
We convert the transfer function into the following nth -order linear
time-invariant differential equation:

d n y(t ) d n -1 y(t ) dy(t )


 a n 1  ...  a1  a0 y(t )  b0 u (t )
dt n dt n -1 dt
Choose the state variables x1  y(t)
as: dy(t)
x2 
dt
d 2 y(t)
x3 
dt 2
....

d n -1 y(t)
xn 
dt n -1

10
Transfer Function to State Space
dy (t ) And differentiating both sides yields
x 1   x2
dt
d 2 y(t)
x 2  2
 x3
dt
3
d y(t)
x 3   x4
dt 3
....

d n -1 y(t)
x n -1   xn
dt n -1
x n  a0 x1 a1 x2  ....  an 1 xn  b0u
 x 1  0 1 0 .... 0 0   x 1  0 
:In vector-matrix for      x  0 
x2 0 0 1 .... 0 0
    2   
x  Ax  Bu              u
      
x
 n -1   0 0 0 .... 0 1   x n -1  0 
 x n  - a0  a1  a2 ....  an  2 an 1   x n  b 0 
   
11
Transfer Function to State Space

The output equation can be expressed as:

 x1 
x 
 2 
y  1 0 0 .... 0 0 
 
 x n -1 
x n 
 
In this case
D  0 

12
Transfer Function to State Space
Example of Transfer function Constant Term in the Numerator
Consider the following control system
R(s) 24 Y(s)
s 3  9s 2  26s  24

Find the state space representation of the given system.

d 3 y(t ) d 2 y(t ) dy(t )


3
 9 2
 ...  26  24 y(t )  24r (t )
dt dt dt

x1  y x 1  x2

x 2  y x 2  x3

x 3  y x 3  24 x1  26 x2  9 x3  24r


y  x1

13
Transfer Function to State Space
Example (contd.)
 x 1  0 1 0   x 1  0 
 x   0 0 1   x 2   0 u
 2 
 x 3   24  26  9   x 3  24
:In vector-matrix for
x  Ax  Bu 0 1 0  0 
A  0 0 1 ;
 B  0 
 24  26  9  24

Note that the third row of the matrix A is has the same coefficients as
the denominator of the transfer function but negative and in reverse
order. yx 1  x1 
y  1 0 0 x 2  where C  1 0 0and D  0
 x 3 

14
Transfer Function to State Space
Consider the system defined by the following transfer function:
Y (s) b2 s 2  b1s  b0
G (s)   n
R ( s ) s  an 1s n1  ...  a0

In order to find the state-space representation of the given system we have


to handle the numerator and the denominator separately.
x1  x1
R(s) b 2s 2  b1s  b 0 Y(s)
dx1 (t) a 3s 3  a 2s 2  a 1s  a 0
x2 
dt
R(s) 1 X1(s) Y(s)
b 2s 2  b1s  b 0
d 2 x1 (t) a 3s  a 2s  a 1s  a 0
3 2

x3 
dt 2

15
Transfer Function to State Space

We convert the first block into a state-space representation using the state
variables x2(t) and x3(t),in which x1 is the output. The second transfer
function in the time domain is:
d 2 x1 d 2 x1
y (t )  b2 2  b1 2  b0 x1  b0 x1  b1 x2  b2 x3
dt dt
The second block simply forms the output as a specified linear combination
of the state variables developed in the first block.

16
Transfer Function to State Space
Example :Consider the system defined by the following transfer function

Y (s) s 2  7s  2
G (s)   3
U ( s ) s  9 s 2  26s  24

In order to find the state-space representation of the given system we have


.to handle the numerator and the denominator separately

x1  x1
dx1 (t)
x2 
dt U(s) 1 X1(s) Y(s)
s 2  7s  2
d 2 x1 (t) s 3  9s 2  26s  24
x3 
dt 2

17
Transfer Function to State Space
Example (contd.)
 x 1  0 1 0   x 1  0 
 x   0 0 1   x 2   0u
 2 
 x 3   24  26  9   x 3  1 

For the second block we can express the output of the system as:
Y ( s )  ( s 2  7 s  2) X 1 ( s )
Taking the inverse Laplace transform with zero initial condition, we get:
y (t )  x1  7 x 1  2 x1, where x 1  x2 and x1  x3 y (t )  x  7 x  2 x
3 2 1

In the matrix form the output equation can be expressed as:


 x1 
y  2 7 1 x 2  where C  2 7 1and D  0
 x 3 
Note that the row vector has the same coefficients as the numerator of the
transfer function but in reverse order.
18
State Transition Matrix

Definition

The state transition matrix is defined as the matrix that satisfies the linear
:homogenous state equation
x (t )  A. x(t ) (1) x (t )  A. x(t )  Bu (t ) where u (t )  0
d (t )
 A.  (t ) (2)
dt
x(t )   (t ) x(0) (3)
:Taking the Laplace transform of (1) we get
sX ( s )  x(0)  A. X ( s )
[ sI  A] X ( s )  x(0)  X ( s )  [ sI  A]1 x(0)

 x(t )  L1[( sI  A) 1 ]x(0) (4)


Comparing (4) and (3) we conclude that the state transition matrix is given
: by  (t )  L1[( sI  A) 1 ]
19
State Transition Matrix

Definition

Another way to find the same result is the solution of x (t )  a. x(t ) is e at


The solution of  (t )  A.  (t ) is e At
1 22 1 33
Where e At  I  At 
A t  A t  ...
2! 3!
.Which is called the Taylor series approximation of 
Remarks

 The sate transition Matrix (t) represents the free response of the system
.(response due to initial conditions only)

 The sate transition Matrix (t) completely defines the transition of the
.state from the initial t=0 to any time t

20
State Transition Matrix

Properties

 (0)=I

 -1(t)= (-t)

(t2-t1) (t1-t0) = (t2-t0)

[(t)]k= (kt)

21
State Transition Matrix

0 1
Example: A  , compute  (t)
- 3 - 4

 ( s )  ( sI  A) 1
1
 s 0  0 1 
 ( s )      
 0 s   - 3 - 4 

1
 s - 1
 ( s )   
 3 s  4 

22
State Transition Matrix

1  s  4 1  11 ( s ) 12 (s) 


(s)     
s ( s  4)  3  - 3 s   21 ( s )  22 (s)
s4 1.5 0 .5
11 ( s )   
( s  3)( s  1) s  1 s  3

1 0 .5 0.5
12 ( s )   
( s  3)( s  1) s  1 s  3

23
State Transition Matrix

3  1 .5 1 .5
 21 ( s )   
( s  3)( s  1) s  1 s  3
s  0.5 1.5
 22 ( s )   
( s  3)( s  1) s  1 s  3

(1.5e  t - 0.5 e -3t ) (0.5e  t - 0.5 e -3t ) 


 (t )   t t -3t 
 ( 1 . 5e  1.5 e -3t
) (0.5e  1.5 e )

x(t )   (t ) x(0)
24
State Transition Matrix

d
x(t )  Ax(t )  Bu (t )
dt
By taking Laplace transform
s x( s )  x(0)  Ax ( s )  Bu ( s )
x( s )  ( sI  A) 1 x(0)  ( sI  A) 1 Bu ( s )
x( s )   ( s ) x(0)   ( s ) Bu ( s )
t
x(t )   (t ) x(0)    ( ) Bu (t   )d
By taking inverse 0
Laplace transform t
x(t )   (t ) x(0)    (t   ) Bu ( )d
0
25
State Transition Matrix

0 1 0   x1 (0)  0
A  , B   ,  x (0)  1 
- 3 - 4 1   2   
Free response
x1 (t )  0.5e  t  0.5e 3t
x2 (t )  0.5e t  1.5e 3t
Forced response
t
1
x1 (t )   [0.5e  ( t  )
 0.5e 3( t  )
]d  (1  e 3t )
0
3
t
x2 (t )   [0.5e (t  )  1.5e 3(t  ) ]d  e 3t
0

Complete response = free response + forced response


26
Controllability

A control system is said to be completely state


controllable if it is possible to transfer the
system from any arbitrary initial state to any
desired state in a finite time period. That is, a
control system is controllable if every state
variable can be controlled in a finite time period
by some unconstrained control signal.
If any state variable is independent of the control
signal, then it is impossible to control this state
variable and therefore the system is
uncontrollable.
27
Controllability

Example: Plant Growth

dx(t)
A
dt X(t)

Uncontrollable system

Any system with initial conditions only is uncontrollable

28
Controllability

Example: Plant Growth

dx(t)
 A  u(t) X(t)

dt
Controllable system

29
Controllability

Uncontrollable soil?

30
Controllability

A system is completely controllable if and only if the


controllability matrix

E  [ B AB A2 B  An1 B ]

is of rank n. Rank ( E )  n

31
Controllability

Example : Consider the following continuous-time


system: d  x1 (t )  0 1  x1 (t )  0
 x (t )  - 1 0   x (t )  1 u (t )
dt  2    2   
 x1 (t ) 
y (t )  (1 0) 
 x 2 (t ) 
Investigate if the system is completely state
controllable or not?
This system is completely state controllable where
0 1
det[ B AB]  det    1  0 ; rank  2  n
1 0
32
Controllability

If the state space model in a diagonal form:

 x1 (t )   1 0 0   x1 (t )  0 
d    0   x (t )  1 u (t )
x (t ) - 2 0
dt     2   
2

 x3 (t )  0 0 - 3   x3 (t )  2

The system is controllable if all control input gains


B’s elements are non-zero values

Is the above example controllable system?

33
State Feedback Control Design

Consider the following continuous-time system:

d
x(t )  Ax(t )  Bu (t )
dt
y (t )  Cx (t )  Du (t )

Design a state feedback controller to achieve the


regulation and tracking objectives

u (t )   Kx(t )  G yd (t )

34
State Feedback Control Design

D
yd(t) u x + y
+ +
G
-
B
+
 C
+

K-

Control law design: u (t )   Kx(t )  G yd (t )

Regulation Tracking
35
State Feedback Control Design
Pole-placement Technique
Desired characteristic equation
( s  1 )( s  2 )....( s  n ) (1)
Closed loop system d
x(t )  Ax(t )  B[ kx(t )  Gyd ]
dt
y (t )  Cx (t )  D[ kx(t )  Gyd ]

d
x(t )  ( A  BK ) x(t )  BGyd
dt
y (t )  (C  DK ) x(t )  DGyd
36
State Feedback Control Design

Closed loop system

d d
x(t )  ( A  BK ) x(t )  BGyd x(t )  Ax(t )  B yd
dt dt
y (t )  (C  DK ) x(t )  DGyd y (t )  C x(t )  D yd

Where
A  ( A  BK ), B  BG
C  (C  DK ), D  DG

37
State Feedback Control Design

To compute K (Regulation Objective)

Desired closed loop characteristic equation


( s  1 )( s  2 )....( s  n ) (1)

Actual characteristic equation in closed loop


det( sI  A) (2)

Equate equations (1)&(2) to compute K

38
State Feedback Control Design

To compute G (Tracking Objective)

The closed loop steady state gain has to be unity

GCL ( s ) s 0  C ( sI  A) 1 B  D 1
s 0

Example: Compute K& G for the continuous system


to locate the closed loop poles at (-4,-8)
d  x1 (t )  0 1   x1 (t )  0
        u (t )
dt  x2 (t ) 0 0   x2 (t ) 1 

39
Observability

A control system is said to be observable if every


initial state X can be determined from the
observation of Y over a finite time. The system,
therefore, is completely observable if every
transition of the state eventually affects every
element of the output vector.
In the state feedback scheme, we require the
feedback of all state variables. In practical,
however, some of the state variables are not
accessible for direct measurement. Then it
becomes necessary to estimate the un-
measurable variables in order to implement the
state variable feedback scheme.
40
Observability

41
Observability

42
Observability

43
Observability

A system is completely observable if and only if the


inverse of observability matrix O is available. Or
the rank of the observability matrix is n.

C 
CA 
O 
 
 n 1 
CA 

44
Observability

Example : Consider the following continuous-time


system: d  x1 (t )  0 1  x1 (t )  0
 x (t )  - 1 0   x (t )  1 u (t )
dt  2    2   
 x1 (t ) 
y (t )  (1 0) 
 x 2 (t ) 
Investigate if the system is completely state
observable or not ?.
This system is completely state observable where
1 0
det[C ; CA]  det    1  0 ; rank  2  n
0 1
45
Observability

If the state space model in a diagonal form:


 x1 (t )   1 0 0   x1 (t )   1  x1 (t ) 
d    0   x (t )  1 u (t ); y  1
 x 2 (t )   - 2 0   2    0 3 x2 (t )
dt
 x3 (t )  0 0 - 3   x3 (t )  2   x3 (t ) 

The system is observable if all output gains C’s


elements are non zero values

Is the above example observable system?

46
Observer Design

47
Observer Design

48
Observer Design

49
Observer Design

50
Observer Design

51
Observer Design

52
Observer Design

53
Observer Design

54
Observer Design

Matlab Commands ss2tf(a,b,c,d) = ]num,den[

tf2ss(num,den) = ]a,b,c,d[

( s  z1 )( s  z 2 ).....(s  z n )
H (s)  k
( s  p1 )( s  p2 ).....(s  pn )
zp2ss(z,p,k) = ]a,b,c,d[
E=ctrb(a,b) O=obsv(a,c)
rank(E) rank(O)

55
Remember That!

56

You might also like