Design of Linear Control Systems
Design of Linear Control Systems
Revision lecture 1
Ordinary Differential Equations
Autumn 2008
Modeling
Model: f(t)
Ordinary Differential Equations (ODE):
x(t)
F ma f f friction ma
2 friction
dx d
f Bu ma f B m x
dt dt 2
Dynamics:
Properties of the system, we have to solve/study the ODE.
Autumn 2008
First order systems: Study approaches
Analytic:
Explicit formula for x(t) (a solution separate variables, integrating factor)
which satisfies dx f ( x, t )
dt
Autumn 2008
First order linear equations
x'kx u
0.1
Numerical Solution: k=5, u=0.5
0.08
k 0.06
Gain
u
1 x 0.04
u Dx s x
u Integrator Scope
0.02
0
0 1 2 3 4
Autumn 2008
Analytic solution: Step input
k const
e
kdt
ekt
ekt x' kx ektu ekt x ' ektu
e kt x ' dt e ktudt
e kt x e ktudt c x e kt e ktudt e kt c
t
xe kt
x0 e kt
udt1
e kt1
Autumn 2008
Response to a sinusoidal input
y1 ' ky1 k cos t y2 ' ky2 k sin t jy2 ' kjy2 kj sin t
jy2 ' kjy2 y1 ' ky1 kj sin t k cos t y1 ' jy2 ' k y1 jy2 k cos t j sin t
~ y ke jt
y ' k~
1
j t tan k
1 j t tan
1
~
y e
Re y Re
~ 1
e k
1
2
1 2
k2
2
k
1
cos t tan 1 k
1
2
k2
Autumn 2008
Response to a sinusoidal input
Gain
1 total
s total
Sine Wave Integrator Scope
1
k eu s
steady state
Clock Product Integrator1
Gain2 Math Product1 Scope1
Function
-k eu
0.1
0.05
-0.05
-0.1
-0.15
-0.2
0 2 4 6 8 10
Autumn 2008
Second order ODEs
d 2x
Second order ODEs: f ( x' , x, t )
dt 2
d 2x dx
2
a at C1 x 0.5at 2 C1t C2 So I am expecting 2 arbitrary constants
dt dt
A A2 4 B x C1x1 C2 x2
r x1 , x2
2
Autumn 2008
Overdamped system
Overall solution
r 2 4r 3 0 r 3r 1 0
x0 C1 C2 1
x' 0 3C1 C2 0 0
3t
x1
x 0.5e 3 e t
2 -0.5
0 1 2 3 4 5 6
Autumn 2008
Critically damped system
x C1 x1 C2 x2 1
0.9 e-t
C1e rt C2tert 0.8
te-t
0.7 overall
0.6
A=2, B=1, x(0)=1, x(0)=0 =>
c1=c2=1 0.5
0.4
0.3
0.2
0.1
0
0 2 4 6 8 10
Autumn 2008
Underdamped system
A A2 4 B A2 4 B
r Roots are complex Underdamped system
2 A0
Theorem: If x is a complex solution to a real ODE then Re(x) and Im(x) are
the real solutions of the ODE:
x c1x1 c2 x2 c1eat cos(bt) c2eat sin(bt)
x1 e at cos(bt), x2 e at sin(bt)
eat c1 cos(bt) c2 sin(bt) eat G cosbt
, & tan 1 c2
c1
G
c1
cos tan 1 c2
c1
Autumn 2008
Underdamped system, example
1.5 1.5
C1cos(bt)
1 1 eat
C1cos(bt)+C2sin(bt) C1cos(bt)+C2sin(bt)
0.5 0.5
0 0
-0.5 -0.5
C2sin(bt)
-1 Overall
-1
-1.5 -1.5
0 2 4 6 8 10 0 2 4 6 8 10
Autumn 2008
Undamped
0.8
0.6
0.4 Overall
0.2
-0.2
-0.4
-0.6
-0.8
-1
0 2 4 6 8 10
Autumn 2008
Stability
In all previous cases if the real part is positive then the solution will diverge to
infinity and the ODE (and hence the system) is called unstable.
jb jb
a a
Critical or Stable
overdamped
underdamped Unstable
Autumn 2008
Natural frequency, damping frequency, damping factor
A A2 4 B 2n 2n 2 4n2 r n 2n2 n2
r
2 2
Case 1:
0
n2
2
n2 1 1
2 => Overdamped system implies that 1
Autumn 2008
Natural frequency, damping frequency, damping factor
Case 2:
2n2 n2 2 1 1 => Critically damped system implies that 1
r n x C1e n t C2te n t
Case 3:
0
n2
2
n2 1 1 => Underdamped systems implies 1
2
d n 1 2
r1, 2 n j n2 2
n2 n jn 1 2
n jd
Autumn 2008
Summary
Autumn 2008
Stability revised
n
n
Critical or
overdamped
Stable
underdamped Unstable
Autumn 2008
NonHomogeneous (NH) differential equations
Autumn 2008
Example
1.5
Particular solution
Overall
1
Homogeneous solution
0.5
-0.5
-1
0 2 4 6 8 10
Autumn 2008
State Space
x n f x, x' , x' ' ,...x n 1
Very difficult to be studied => so we use computers
m x F B x kx
Computers are better with 1st order ODE
x1 x
1 nth => n 1st
x2 x
Powerful tools from the linear algebra
x1 x x2 0 1 x 0
x1 k B 1
1 x2 F
x2 x F Bx2 kx1 x 2 m m m
m
Autumn 2008
State Space
X AX BU Input
X AX BU
Output
y CX DU U y CX DU y
U1 y1
U1
X AX BU y2
Uq y CX DU yp
u1 y1
U X AX BU Y u y X(t ) At X(t ) B(t )U(t )
U , Y
2 2
y CX DU y3 Y(t ) C(t ) X(t ) D(t )U(t )
u q yp
Autumn 2008
Block Diagram
X is an n x 1 state vector
U is an q x 1 input vector
Y is an p x 1 output vector
A is an n x n state matrix
B is an n x q input matrix
C is an p x n output matrix
D is an p x m feed forward matrix (usually zero)
Autumn 2008
State space rules
The state vector describes the system => Gives its state =>
If the current state of the system and the future input signals are known then it
is possible to define the future states and outputs of the system.
The choice of the state space variables is free as long as some rules are followed:
1. They must be linearly independent.
2. They must specify completely the dynamic behaviour of the system.
3. Finally they must not be input of the system.
Autumn 2008
State space
x1 x1 , 0, , 0T x 2 0, x2 , , 0T ... x n 0, 0, , xn T
2 3
R R
x2
x3
x1 x2
1
x
Matlab definition
Autumn 2008
Solution
x2 7 x2 6x2 0
x1 2 2 x1
x1 2 x1 2 x2
2 5 x2 x2 2 x1 5 x2
x 2 r 2 7r 6 0
x1
1
x2 5 x2
2 xa Cet
x1 x2 5 x2
1
2 xb De 6t
1
x2 5 x2 2 1 x2 5 x2 2 x2
2 2
1 5
x2 x2 x2 5 x2 2 x2
2 2
x2 5 x2 2 x2 10 x2 4 x2
x2 7 x2 6 x2 0
Autumn 2008
Solution II
x1 2 2 x1 a1 t a1 t
X e X e
2 5 x2 a2 a2
x 2
a 2 2 a1 t a1 2a1 2a2
X 1 e t a e a 2a 5a How can we solve that ???
2
a 2 5 2 2 1 2
2 a1 2a2 0 2 2
0 2 7 6 0
2a1 5 a2 0 2 5
Autumn 2008
Solution III
1
2 7 6 0 1
2 6
a1 2a2 0
1 1
1
2 a 4 a2 0
1: 1 2
a 2
I assume that a2=1 so a1=2 X1 (t ) e t
a2 1 1
4a1 2a2 0 1
1 6 I assume that a1=2 so a2=-2 X 2 (t ) e 6t
1
2 a a2 0 6
2 1
Xt C1 e t C 2 e 6t
1 2
Matlab example
Autumn 2008
General Solution
X AX X c e e t e A e I Ae 0 I A 0
1 2 2 ...n
ei
Xt C1e1e 1t C2e 2 e 2t ... Cne n e nt
i
Autumn 2008
Properties of general solution
Ci e i e it
Autumn 2008
Example
state space
1.5
x1 2 2 x1
2 5 x2
x 2
1
e1
0.5
x2
0
0,0
-0.5
e2
-1
-1 -0.5 0 0.5 1 1.5
x1
Autumn 2008
Example
Autumn 2008
Example
Autumn 2008
State Transition Matrix
Until now the use of vector ODEs was not very helpful.
We still have special cases I A 0
x ax xt e at x0 X AX X e At X0
1
e At At At 2 1 At 3 ... Use the command expm (not exp)!
2! 3!
X(0)=[1 2]
x1 2 2 x1 2 2
A
2 5 x2 2 5
x 2 X(5) =?
Autumn 2008
State Transition Matrix
X e At X0 Xt C1 e1e 1t C2 e 2 e 2t ... Cn e n e nt
1
Ae i ei i Ae1 e 2 e n e1 e 2 e n
n
AT T A T1
e At At
1
2!
At 2 1 At 3 ... T1 t 1 T1 t 1 T1 t ...
3! 2!
2
3!
3
T1 2 T T T
1 1 2 1
e At 1
TI T 1
1
1
t T 21 t 2 T31 t 3 ...
2! 3!
e 1t
e t
1 1
T t t 2 t 3 ...1 Te t 1
e n
t
2! 3!
Autumn 2008
State Transition Matrix
X e At X0 Te t 1X0
e 1t
X e1 e 2 e n e1 e 2 e n X0
1
e nt
w w x (0)
e 1t 1 e1t 1 1
w 2 w 2 x2 (0)
X e1 e 2 e n X0 X e1 e 2 e n
e nt e n
t
w n w n xn (0)
Xt C1 e1e 1t C2 e 2 e 2t ... Cn e n e nt
Autumn 2008
Solution
d at
x ax bu x ax bu e at
e at x ax e xt e at bu
dt
t t t
d a
dt e x d e a
bud e at
x t x 0 e a
bud
0 0 0
t t
xt e x0 e
at at
e
a
bud xt e x0 e a t bud
at
0 0
t
Xt e At X0 e A t BUd
0
Autumn 2008
SS => TF???
LT
X(t ) AX(t ) BU(t ) sX(s) X(0) AX(s) BU(s)
Y(s) CX(s) DU(s) Y(s) C sI A1BU(s) sI A1 X(0) DU(s)
Y(s) CsI A1 B D U(s) CsI A1 X(0)
CsI A1 B D TF
Autumn 2008
SS => TF???
ILT
X( s ) sI A BU( s ) sI A X(0)
1 1
X(t ) L1 sI A1 BU(s) L1 sI A1 X(0)
X(t ) L sI A X(0)
1 1
X(t ) e X(0)
At
e At L1 sI A1
Gs CsI A1 B D G s
sI A D BC
sI A sI A CE of the TF
The TF is a matrix
G11 ( s ) G12 ( s ) G1q ( s )
G ( s ) G ( s ) G2 q ( s ) Y1 Y1 Y2 Y2
G (s)
21 22 G11 , G12 , G21 , G22 ...
U1 U2 U1 U2
G p1 ( s ) G p 2 ( s ) G pq ( s )
Autumn 2008
SS => TF???
Autumn 2008
Basic properties of state space
Autumn 2008
Basic properties of state space
G1 s CsI A 1 B D
G1 s C TT1 sI A 1 TT1 B D
~
G1 s CT TsI A T 1 T B D~
1 1
Matlab example
G1 s C sI TAT 1
~
1B~ D~
G1 s CsI A B D G 2 s
~ ~ 1 ~ ~
Autumn 2008
Observability - Controllability
Observability - Controllability
2 0 2
x 2 x 2u X X 1 u
0 1 Notice the structure of A and C
y 3x
y 3 0X
x 2 x 2u 3s 21 2 6
y 3x s2
2 0 2 1
X X u s 2 0 2
0 1 1 3 0 0 1
s 1
y 3 0X
s 1 0 2 2s 1 2
3 0 3 0
0 s 2 1 s2
3 0 s 2 6
s 2s 1 s 2s 1 2 s2
s 1
Autumn 2008
Observability - Controllability
Autumn 2008
Observability - Controllability
2 0 2 2 0 2 s 1 0 2
X X 1 u X 0 u 3 2
s 2 0
X
0 1 0 1 0
y 3 0X y 3 2X s 1s 2
3 2 2 6
In this case we can see how both states behave s 2
s 1 0 s 2
but we can not change U in any way
so that we can influence x2 due to the form of B.
Autumn 2008
Observability - Controllability
C
CA
M O CA
2
MC B AB A2B An 1B
n 1 Check the rank
CA
>> rank(obsv(A,C))
>> rank(ctrb(A,B))
Autumn 2008