Adv Control & Robotic Lec 2
Adv Control & Robotic Lec 2
Lecture 2
G. Hovland 2004-2006
Example 1
y + a1 y + a 2 y = bu
It can be rewritten as (phase-variable form):
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 8
x1 = y
x1 = x2
x2 = x1 = y
x2 = − a 2 x1 − a1 x2 + bu
x2 = y
X = AX + Bu
Example 2: State Space Representation
R L i(t)
+ C
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 9
Vc(t)
di 1 V
L + Ri + idt = V −
dt C
dq
i=
dt
+ C
Vc(t)
V
di 1
L + Ri + idt = V −
dt C
di − 1 −R 1
= q+ i+ V q
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 10
dt LC L L x=
i x = Ax + Bu
dq u V y = Cx + Du
i= y VL
dt
di − 1
VL = L = q − Ri + V
dt C
! "! " # $
! %&%' ()
Example 2: State Space Representation
di − 1 −R 1
= q+ i+ V q
dt LC L L x=
i x = Ax + Bu
dq u V y = Cx + Du
i= y VL
dt
di − 1
VL = L = q − Ri + V
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 11
dt C
x1 0 1 x1 0
R L
= −1 −R
+ 1 u
i(t) x2 LC L x2 L
x1
y =[ − R] + [1]u
+ C
Vc(t) −1
V C
−
x2
!" #
$ $% & '
"$ ( $
$)
$* '+ ,
-
& #
$! . + / "
!. + %
0 #
$ +%
#
. + !. % 1
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 12
2 . 3
( 3 , 4
5 $$$ 1- $$$
&/ ! 5"6 0/-"/ 7 1
V oltage ac ros s induc tor
!
56 " !5"6 0.8
0.4
V oltage (V )
/ 6 2/- 1 - 4
0.2
1
!" 0
, -0.2
8
9 , 8
" -0.4
0 2 4 6 8 10 12 14
4 8( "8
"
Tim e (s )
4 89 , 9"8
"
&!0! !2"
"
Simulink Implementation of State-Space Models
Matrix Gain
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 13
*+ *, Alternatives:
*,
y + a1 (t ) y + a2 (t ) y = b(t )u
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 14
x1 = y , x1 = y = x2
x2 = y , x2 = y = − a 2 (t ) x1 − a1 (t ) x2 + b (t )u
where transfer function description is not possible state variable
description is straightforward.
Some reasons for using state-variable form
Introduce ideas of geometry into differential equations.
plot of position vs velocity is a phase plane, which shows motion
of system in two-dimension.
State-space generalises this idea to higher dimensions.
Visualise solutions of differential equations as trajectory in state-
space of appropriate dimension.
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 15
% " .
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 16
- !
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 18 METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 17
State equations:
! "! " # $
! %&%' ()
.
⇔ x = Ax + Bu
Output equation(s): y = Cx + Du
( s n + a n −1 s n − 1 + + a 1 s + a 0 )Y ( s ) = b0U ( s )
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 22
d
Remember: s ↔
dt
dny d n −1 y dy
n
+ an −1 n −1 + + a1 + a0 y = b0 u
dt dt dt
/ x1=y 0
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 23
x1 = x2
x2 = x3
xn −1 = xn
xn = − a0 x1 − a1 x2 − an −1 xn + b0u
% !
x1 0 1 0 0 x1 0
x1=y x2 0 0 1 0 x2 0
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 24
x1 = x2 = + u
x2 = x3 xn−1 0 0 0 1 xn−1 0
xn − a0 − a1 − an−1 xn 1
xn −1 = xn
xn = − a0 x1 − a1 x2 − an −1 xn + b0u
Convert Transfer Function into State Space: Y/U =
b(s)/a(s)
X 1( s) 1
= n
U ( s ) s + an −1s n −1 + + a1s + a0 s
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 25
Y ( s)
= bn −1s n −1 + + b1s + b0
X 1( s)
y (t ) = bn −1 xn + + b1 x2 + b0 x1
1
y (t ) = bn −1 xn + + b1 x2 + b0 x1
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 26
x1
x2
y = [b0 b1 bn−1 ]
xn
Convert Transfer Function into State Space - Summary
Y ( s) bn −1s n −1 + + b1 ( s ) + b0
=
U ( s ) s n + an −1s n −1 + + a1s + a0 s
x1 0 1 0 0 x1 0
x2 0 0 1 0 x2 0
= + u
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 27
xn −1 0 0 0 1 xn −1 0
xn − a0 − a1 − an −1 xn 1
x1
A matrix B vector
x2
y = [b0 b1 bn−1 ]
D=0
C vector xn
Transfer State-Space
Function Model
x = Ax + Bu 1
y = Cx + Du
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 29
Y ( s)
T ( s) = = C( sI − A ) −1 B + D
U ( s)
Next Topics
Cascade form
In Lecture 3 and 4 we will
Parallel form design controllers and
Controller canonical form observers based on these
two forms
Observer canonical form
Laplace Solution to State Equations and Stability
x = Ax + Bu
y = Cx + Du
/ 2 !
sX ( s ) − X (0) = AX ( s ) + BU ( s )
Y ( s ) = CX ( s ) + DU ( x)
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 31
3 0 4! *#( "5#(
X ( s ) = ( sI − A) −1[ X (0) + BU ( s )]
adj ( sI − A )
= [ X (0) + BU ( s )]
det( sI − A )
Y ( s ) = CX ( s ) + DU ( s )
46 " #
*#7( 7(
Y (s) adj( sI − A)
T ( s) = =C B+D
U (s) det( sI − A)
C adj( sI − A )B + D det( sI − A )
=
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 32
det( sI − A)
Poles of a state-space system are formed by:
Roots of the denominator, i.e. det(sI-A)
The eigenvalues of the system matrix A, i.e. det(sI-A)=0.
In Matlab: [num,den]=ss2tf(A,B,C,D,1)
roots(den)
eig(A)
State Space Representation to Transfer function e.g. 3.6
0 1 0 10
X= 0 0 1 X+ 0 u
−1 − 2 − 3 0
y = [1 0 0]X
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 33
3 k12 = ( −1)1+ 2 ⋅ [ −1 ⋅ ( s + 3) − 0 ⋅ 2] = s + 3
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 34
s 0 0 0 1 0 s −1 0 10
8( ( sI − A) = 0 s 0 − 0
# 0 1 = 0 s −1 B= 0
0 0 s −1 − 2 − 3 1 2 s+3 #
:( 0
s 2 + 3s + 2 s+3 1 C = [1 0 0]
−1 s ( s + 3) s
#
;(
−s − (2 s + 1) s 2 10( s 2 + 3s + 2)
#
9( ( sI − A) −1 =
adj ( sI − A)
= T (s) = 3
det( sI − A) s 3 + 3s 2 + 2 s + 1 s + 3s 2 + 2 s + 1
Y (s)
T (s) = = C( sI − A) −1 B + D
U (s)
Laplace transform solution of state equations – exercise 4.9
0 2 0 u = e −t
X= X+ u
−3 −5 1 2
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 35
y = [1 3]X X ( 0) =
1
0 2 0 u = e−t
X= X+ u
−3 −5 1 2
y = [1 3]X X ( 0) =
1
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 36
Matlab simulation
Ax = λx or (λI − A) x = 0
λ : eigenvalue
x: eigenvector corresponding to eigenvalue λ
MATLAB: [x, λ] = eig(A) diagonal matrix λ of
eigenvalues and a full matrix x whose columns are
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 38
1 6
<) ! !
4 !
$ !4
4 !
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 39
)
< 4 4 8
⇔ $)
=" 0 3 1 10
X= 2 8 1 X+ 0 u
! 4 ! "> )
− 10 − 5 − 2 0
y = [1 0 0]X
s 0 0 0 3 1 s −3 −1
( sI − A) = 0 s 0 − 2 8 1 = − 2 s − 8 −1
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 40
0 0 s − 10 − 5 − 2 10 5 s+2
det( sI − A) = s 3 − 6 s 2 − 7 s − 52
2 $ @4 0
s3 1 -7 4#( 0 ! A& A 7
s2 -6 -3 -52 -26 4 0 −0.8821 ±
?
j2.4330, 7.7642 4 0
s1 -47/3 -1 0 4 ! $)
s0 -26
8 4 4 8 4 ! $)
Signal Flow Graphs of State Equations
Figure 5.17
Signal-flow graph components:
a. system;
b. signal;
c. interconnection of systems and
signals
Figure 5.19
Signal-flow graph
development:
a. signal nodes;
b. signal-flow graph;
c. simplified signal-flow graph
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 43
2 −5 3 x1 2
x = − 6 − 2 2 ⋅ x2 + 5 r
1 − 3 − 4 x3 7
y = −4 x1 + 6 x2 + 9 x3
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 44
Figure 5.22
Stages of development of a
signal-flow graph for the system
above:
a. place nodes;
b. interconnect state variables and
derivatives;
c. form dx1/dt ;
d. form dx2/dt
(figure continues)
Signal flow graphs of state equations (cont'd)
2 −5 3 x1 2
x = − 6 − 2 2 ⋅ x2 + 5 r
1 − 3 − 4 x3 7
y = −4 x1 + 6 x2 + 9 x3
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 45
Figure 5.22
(continued)
e. form dx3 /dt;
f. form output
Try yourself:
Skill-Assessment Exercise 5.5 (pg 275)
C (s) 24
=
R( s ) ( s + 2)( s + 3)( s + 4)
−4 1 0 0
Ci ( s ) 1 x= −3 1 x+ 0 r
= 0
Ri ( s ) ( s + ai )
0 0 −2 24
y = [1 0 0]x
'$ 0
! )
@. )
4
"4 !)
Parallel Form
B ! # (
C (s) 24 12 − 24 12
= = + +
R( s ) ( s + 2)( s + 3)( s + 4) ( s + 2) ( s + 3) ( s + 4)
0 0 −4 12
y = [1 1 1]x
sX2(s) '$ 0
#
8( " . C
.) 8 " "! !) .)
80 $ $ 0"
sX3(s) " " ) #)4) xi+=aixi+bir(
#
9( ! ) . )
4
"4 !)
Special case parallel form – Jordan canonical form
B ! # (
C (s) ( s + 3) 2 −1 1
= = + +
R( s ) ( s + 1) 2 ( s + 2) ( s + 1) 2 ( s + 1) ( s + 2)
sX2(s) sX1(s) −1 1 0 0
x = 0 −1 0 x + 2 r
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 49
0 0 −2 1
y = [1 − 12 1]x
'$ 0 CD" !
sX3(s)
8) 3 "4
9) 3 4 "4
:) 8 !
! "4 ! "
:) 4 x1 − 9 − 26 − 24 x1 1
"4 x2 = 1 0 0 x2 + 0 r
" 4 x3 0 1 0 x3 0
y = [1 7 2][x1 x3 ]
T
! x2
'$ 0
!
! ! )
.)
!)
@ 0 $
"$
phase- controller ! "$
variable form canonical form
Observer canonical form
s 2 + 7s + 2 1 s + 7 s + 2 s3
2
C (s)
= =
R( s ) s 3 + 9 s 2 + 26s + 24 1 + 9 s + 26 s 2 + 24 s 3
" $ ! ! 4
C ( s ) = 1s [R( s ) − 9C ( s )] + s12 [7 R ( s ) − 26C ( s )] + s13 [2 R ( s ) − 24C ( s )]
C ( s ) = 1s [[R ( s ) − 9C ( s )] + 1s ([7 R( s ) − 26C ( s )] + 1s [2 R ( s ) − 24C ( s )])]
−9 1 0 1
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 51
x = − 26 0 1 x + 7 r
− 24 0 0 2
y = [1 0 0]x
'$ 0
E !
! !" 8
E !
! !
E ! !
2 2 2
E = "$ ! 0 $
x1 = −3x1 + x2
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 52
x2 = − 2 x2 + 100(r − c)
y = c = 5 x1 + ( x2 − 3 x1 ) = 2 x1 + x2
x2 = −200 x1 − 102 x2 + 100r
−3 1 0
x= x+ r
− 200 − 120 100
y = [2 1]x
Summary State Space Forms
Figure 5.31
State-space forms for
C (s) s+3
=
R( s ) ( s + 4)( s + 6)
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 53
y = c(t )
B 0 $ !
3 ! ! # :( x1 0 1 0 x1 0
x2 = 0 0 1 x2 + 0 u
Y (s) bn −1s n −1 + + b1 ( s ) + b0
= x3 − a0 − a1 − a2 x3 1
U ( s ) s n + an −1s n −1 + + a1s + a0 s
x1
y = [b0 b1 b 2 ] x2 + [0]u
x3
METR4202/7202 – Advanced Control and Robotics,Semester 2, 2006: Page 54
# ( !
'$ 0 !
x1 − a2 − a1 − a0 x1 1
x1 − a2 1 0 x1 b2
x2 = 1 0 0 x2 + 0 u
x2 = − a1 0 1 x2 + b1 u
x3 0 1 0 x3 0
x3 − a0 0 0 x3 b0
x1
x1
y = [b2 b1 b 0 ] x2 + [0]u
y = [1 0 0] x2 + [0]u
x3
x3
F G !
9 #
$( ?%" !
4 0 "4 !)