You are on page 1of 27

9 State Space Design

9 SS
• State space equations
• Pole assignment by state feedback
• Observer design

This file is much different from preprinted


module pack for better presentation

9 SS 1
State-Space Equation (SS Eq.): two carts example (1)
From differential Eq. to SS Eq.
q p
x1  p
x2  q
x3  x 1  p
u
x 4  x 2  q

x1  p p  u  k1 ( p  q)  b1 ( p  q )
x2  q
x3  x 1  p
  k1 ( p  q )  b1 ( p  q )  k 2 q  b2 q
q
x 4  x 2  q
x 1  x3
x 2  x4
x 3   k1 x1  k1 x2  b1 x3  b1 x4  u
x 4  k1 x1  (k1  k2 ) x2  b1 x3  (b1  b2 ) x4
9 SS 2
State-Space Equation: two carts example (2)
From differential Eq. to SS Eq.
x1  x3
x 2  x4
x 3   k1 x1  k1 x2  b1 x3  b1 x4  u
x 4  k1 x1  (k1  k 2 ) x2  b1 x3  (b1  b2 ) x4 y =p = x1

 x1   0 0 1 0   x1  0  x1 
 x   0   x  0  x 
0 0 1
 2     2    u y   1 0 0 0  2 
 x 3   k1 k1  b1 b1   x3  1  x3 
        
x
 4  1 k  ( k1  k 2 ) b1  (b1  b2   x4  0 
)  x4 

x  A x B u y C x

x  A x  B u
y  C x  Du (D0 )
9 SS 3
Transfer Function (tf) and State Space (ss) models
Plant to be controlled

p  u  k1 ( p  q )  b1 ( p  q )
  k1 ( p  q )  b1 ( p  q )  k 2 q  b2 q
q

[num den]= ss2tf (a, b, c, 0)


x  A x  B u
num( s )
y  cx  du G( s) 
den ( s )
[a b c d]= tf2ss (num, den)

9 SS 4
State Space Open-loop System
x  A x  Bu y  c x


Plant, Open-loop
system
State-space feedback u  (k1 x1  k2 x2  k3 x3  k4 x4 ) → closed-loop system
y ( s ) num( s )
 Gp (s)  
u ( s ) den( s)

u y
tf2ss
ss2tf

Open-loop system poles = roots of den(s) = eigenvalues of A >> eig(A)


9 SS 5
State Space Open-loop and closed-loop systems
x  A x  Bu y  c x

Open-loop system

u r K x
x  ( A  BK ) x  B r y  c x


 x1 
x 
  k1 k 2 k 3 k 4   2 
Closed-loop
 x3 
  system poles
 x4 
u  (k1 x1  k2 x2  k3 x3  k4 x4 ) >> eig(Ac)
x  A x  B u  A x  B (r  K x )  ( A  BK ) x  B r

Ac  (A  BK ) Ac is the losed-loop state space matrix "A"


9 SS 6
>> roots (den1) = >> eig(a1)
>> [num1 den1]=ss2tf (a1, b1, c1, 0) >> eig(a1)
% transfer a ss model to G(s) =num1(s) / den1(s) ans =
-0.0358 + 1.3975i
num1 = -0.0358 - 1.3975i
0 0.0000 1.0000 0.0500 1.4000 -0.0042 + 0.4956i
den1 = -0.0042 - 0.4956i
1.0000 0.0800 2.2006 0.0340 0.4800 poles in G(s) = eigenvalues of A
num1( s ) Their damping ratios ?
G( s)  
den1( s )
2
>> sys=tf(num1,den1)
s  0.05s  1.4 >> [Wn,Zeta] = damp(sys)
s 4  0.08s 3  2.2 s 2  0.034 s  0.48
% Zeta = 0.0085 ......0.0256 ......
>> roots (den1)
ans =
x  a1 x  b1 u
-0.0358 + 1.3975i
-0.0358 - 1.3975i y  c1 x
-0.0042 + 0.4956i
-0.0042 - 0.4956i
9 SS 7
“Two Carts” example: assign C.L. system poles
O. L. poles → >> c_p = >> k1 = place (a1, b1, c_p) % don’t need c1
-0.0358 + 1.3975i [ -1.4 + 1.4i k1 =
-0.0358 - 1.3975i -1.4 - 1.4i 4.8321 -6.6062 3.7200 0.0432
-0.0042 + 0.4956i -0.5 + 0.5i
% Checking
-0.0042 - 0.4956i -0.5 - 0.5i ]
>> eig (a1-b1*k1)
These are new poles you assigned % will show them the same as c_p


 x1 
x  Closed-loop
  k1 k2 k3 k4   2 
 x3  system poles
 
 x4 
>> eig(Ac)
x  A x  B u  A x  B (r  K x)  ( A  BK ) x  B r
A c  ( A  BK ) : closed - loop state space matrix
9 SS 8
Simulink model
• Do not use the “ready-made” model, quoted: “We are
looking for an enthusiastic person …… who wants to learn
and understand the complex equipment we make, from
nuts and bolts to complete systems”.
x  A x  B u y  c x
1
s

nuts and bolts


1
c1 B C
s

C2 C1 Inte grato r C Sco pe

A* u

Initiation condition = 0

9 SS 9
State-space model, a, b and c: data inputs

1
c1 B C
s

C2 C1 I ntegrator C S cope

A* u

[a1 b1 c1 d1]= tf2ss (num, den)

Default: Element-wise (K.*u)

A a1 Matrix (K*u)
B b1 Element-wise (K.*u)
C c1 Matrix (K*u) (u vector)

9 SS 10
Summary of what you do in your lab sessions

1
kss b2 c2
s
Step kss B Integrator C S cop e

Kss = 1 a2* u
x0 = 0 y_o ut

Y ou tp ut

Plant
t
k2
Cl ock Ti me
-k2 * u

Model

• Get a2, b2, c2 and d2 from your plant num and den tf2ss(num, den)
• Find open-loop system poles eig(a2)
• >> i = sqrt(-1), assign closed-loop system poles: c_p (poles must be at
the left-hand side of the s-plane, any complex poles must be conjugate
pair) place, check closed-loop system poles: eig(a2-b2*k2)
• run simulation, find the steady-state value “y_out_ss”
• set Kss = 1/y_out_ss (whenever you change c_p (k2) , need to change it
again)
9 SS 11
Where to put the closed-loop system in the s-plane ?
Simply move to left Change the pattern
o: O.L.S. poles o: O.L.S. poles
x: C.L.S. poles x: C.L.S. poles

Im Im
X o
X

X o X o o o
Re Re

X o X

How much left ? Discuss late on

9 SS 12
Output feedback control v.s. State feedback control

r u
u
Plant
u rK x
x

Classical
Root locus Arbitrarily pole
assignment
9 SS 13
Spend an hour do
work specified in slide 11.
This is a necessary
practice before you can
understand next topic
“State Observer”
9 SS 14
Your extra work: investigate
C.L.S poles and time responses

9 SS 15
Changing pole positions in the s-plane (a)

1  Ae at sin( t   )

9 SS 16
Changing pole positions in the s-plane (b)

1  Ae  at sin( t   )

9 SS 17
Changing pole positions in the s-plane (c)

9 SS 18
What is a state observer, why do we need it

sensors to
x1  p measure
x2  q X
x3  x 1  p
But States are difficult
x 4  x 2  q or costly to measure
u Kx
u r K x

Observer is a
observer
“software” sensor X^

9 SS 19
State variable x not available for u = -kx, using observer
and u = -kx^, where x^ is an estimation of x
y

-kx^

observer

observer output x^
9 SS 20
Observer is a feedback system
it has a feedback gain “L”

Estimated ^y
measured y
observer
error

9 SS 21
Simulink model (compare it with the block diagram)

1
kss b2 K*uvec
s
Step kss B Integrator C Scope
A

a2* u
y_out

t -K-
Y output
Obs_B 1
Cl ock T ime K*uvec
s
Obs_Inte Obs_C

Obs_A

a2* u

Obs_gai n_L

L'* u

Feedback: the i nput i s from x estim ati on

-k2* u

9 SS 22
Slide 14

Obs_A = a2
Obs_B = b2
Obs_C = c2

9 SS 23
Simulink model: new observer feedback gain L

1
kss b2 K*uvec
s
Step kss B Integrator C Scope
A

a2* u
y_out

t -K-
Y output
Obs_B 1
Cl ock T ime K*uvec
s
Obs_Inte Obs_C

Obs_A

a2* u

Obs_gai n_L

L'* u

Feedback: the i nput i s from x estim ati on

-k2* u

L
Element-wise (K.*u)

How to design L ?

(Notice: in Obs_gain_L block, it is L not L’)


9 SS 24
How to design L : the idea and two steps

Observer is also a feedback


system, it has poles =
eig (A’ – C’L)

x^(t) need to trace changing x(t). Therefore, to choose observer poles


such that the observer response will much faster than the “out-loop”
system x(t), i.e., ob_poles are more left than c_p (slide 13)
(1) ob_poles = …… % you assign values for the observer poles
(2) L = place (a2’, c2’, ob_poles) you may use eig (a2’ – c2’L) to
check 9 SS 25
Select different x0, check performance of observer
0

1
x_out
kss b2 K*uvec
s
Step kss B Integrator C Scope
A

a2* u
y_out
t -K-
Y output

0.2
Obs_B 1
Cl ock T ime K*uvec
s
Obs_Inte Obs_C

Obs_A

a2* u
Obs_y_out
Obs_gai n_L

Compare L'* u

Feedback: the i nput i s from x estim ati on

y_out with Obs_y_out -k2* u

x_out with Obs_x_out Obs_x_out

t  0, 
t , 

Output of a system with an observer (here) is normally not as good as


a system using direct state-feedback (slide 14), why ?
9 SS 26
Classical Feedback Control vs. Modern State Space method
Classical Feedback Control Modern State Space (SS)
method
Main features Well-studied, wide day-to-day Potential of advanced and
applications. Easy to understand, optimal control, to deal with
suitable for low cost, simple large complex systems. An
controls. active research area.
Typical model Transfer functions (TF, tf) Vector-matrix diff. equations

num( s ) x  A x  B u
G ( s ) 
History of main From 2nd worlddenwar( sto) 1960s  ctox now
From y1960s  du
development

Recent control R+D: Networked Control System


T. C. Yang, “Networked Control System: A Brief Survey”, IEE Proceedings:
Control Theory and Applications, Vol. 153,  No. 4, pp. 403- 412, July, 2006.
Up to 22/11/2014, the paper has been sited by other 558 research papers.
9 SS 27

You might also like