EE 312 Lecture 3
EE 312 Lecture 3
EE 312 Lecture 3
University of Benghazi
Faculty of Engineering
Electrical and Electronic Engineering Department
----------------------------------------------------------------------------------------------------------------------------
Control systems EE312 Fall 2011/2012
----------------------------------------------------------------------------------------------------------------------------
References:
- Modern control systems, R.C. Dorf
- Control systems Engineering, Norman Nise
- Linear control systems engineering, Morris Driels
---------------------------------------------------------------------------------------------------------------------------
Introduction
In the previous lectures block diagram and signal flow graph methods were presented
for system modeling. Although these two approaches are relatively straightforward,
they have certain disadvantages which can be summarized as:
• Applicable for linear systems.
• Initial conditions are neglected.
• Not easy to handle multivariable systems.
From these shortcomings, the state space technique looks an attractive dynamic
method for system modeling that can address effectively the mentioned
disadvantages. However this course will focus on linear systems.
1
EE 312/ lecture no. 3/ State Space modelling approach
&
X ( n×1) = A ( n×n ) X ( n×1) + B ( n× m ) u ( m×1) (1)
Y( l×1) = C ( l×n ) X ( n×1) + D ( l×m ) u ( m×1) (2)
Where
X state vector
&
X derivative of the state vector with respect to time
y output vector
u input or control vector
A system matrix
B input matrix
C output matrix
D feedforward matrix
Equation (1) is called the state equation and equation (2) is called the output equation.
Definition
State equations are a set of n simultaneous, first order differential equations with n
variables. Where the n variables to be solved are state variables.
dx1
= a11 x1 + a12 x2 + b1v(t )
dt
dx2
= a 21 x1 + a 22 x2 + b2 v(t )
dt
Where x1 and x2 are the state variables. If there is a single output , the output equation
could take on the following form:
y = c1 x1 + c2 x 2 + d1v(t )
The choice of state variables for a given system is not unique. The requirement in
choosing the state variables is that they be linearly independent and that a minimum
number of them be chosen.
Example
Obtain the state space model for the circuit shown in the fig (1).
2
EE 312/ lecture no. 3/ State Space modelling approach
Solution
Current through the inductor and the voltage across the capacitor are taken as state
variables as follows:
1 dx 1 1
x1 = i = i L x 2 = vc =
C ∫ idt ⎯
⎯→ 2 = i = x1
dt C C
Apply KVL
di 1
dt C ∫
vi = iR + L + idt
or
dx1
vi = Rx1 + L + x2
dt
dx1 vi R x
= − x1 + 2 # (1)
dt L L L
dx 2 x1
= # (2)
dt dt
1
y = v c = ∫ idt = x 2 # (3)
C
From #(1)& #(2) the state equations can be constructed as:
⎡ dx1 ⎤ ⎡ R 1⎤
⎢ dt ⎥ ⎢− L - ⎥ ⎡1⎤
L ⎡ x1 ⎤ ⎢ ⎥
⎢ ⎥=⎢ ⎥ ⎢ ⎥ + L vi
⎢ dx 2 ⎥ ⎢ 1 ⎢ ⎥
0 ⎥ ⎣ 2 ⎦ ⎣0 ⎦
x
⎢⎣ dt ⎥⎦ ⎢⎣ C ⎥⎦
3
EE 312/ lecture no. 3/ State Space modelling approach
It is possible to say that the previous equation is a linear combination of the state
variables ( x1 , x 2 ,............, x n ) and the input function f (t ) .
An nth-order differential equation can be converted to n simultaneous first order
differential equations, as illustrated in the coming example:
d3y d2y d y
3
+ 6 2
+5 + 8y = u (4)
dt dt dt
To convert this model to a state space model let:
y = x1
dy dx1
= = x2
dt dt
d 2 y dx 2
= = x3
dt 2 dt
d 3 y dx3
=
dt 3 dt
Equation (4) can be re-arranged as:
d3y d y d2y
= u − 8 y − 5 − 6
dt 3 dt dt 2
Or
dx3
= u − 8 x1 − 5 x 2 − 6 x3
dt
Then the state space model can be constructed as:
& =
X AX + BU
4
EE 312/ lecture no. 3/ State Space modelling approach
⎡ dx1 ⎤
⎢ dt ⎥
⎢ ⎥ ⎡0 1 0 ⎤ ⎡ x1 ⎤ ⎡0⎤
⎢ 2 ⎥ = ⎢0 0 1 ⎥ ⎢ x ⎥ + ⎢0 ⎥ u
dx
⎢ dt ⎥ ⎢ ⎥ ⎢ 2⎥ ⎢ ⎥
⎢ ⎥ ⎢⎣- 8 - 5 - 6⎥⎦ ⎢⎣ x3 ⎥⎦ ⎢⎣1 ⎥⎦
⎢ dx3 ⎥
⎢⎣ dt ⎥⎦
The general form of a state space model of an n th order differential equation might be
expressed as follows:
dny d n −1 y d n−2 y dy
n
+ a1 n −1 + a 2 n − 2 + − − − − + a n −1 + a n y = ku
dt dt dt dt
Let
y = x1
dy dx1
= = x2
dt dt
d 2 y dx 2
= = x3
dt 2 dt
M
d n y dx n
= n
dt n dt
& =
X AX + BU
⎡ dx1 ⎤
⎢ dt ⎥
⎢ ⎥ ⎡0 1 0LL 0 ⎤ ⎡ x1 ⎤ ⎡0 ⎤
⎢ dx 2 ⎥ ⎢0 0 1 0L 0 ⎥ ⎢x ⎥ ⎢ ⎥
⎢ dt ⎥ = ⎢ ⎥ ⎢ 2 ⎥ + ⎢0 ⎥ u
⎢ ⎥ ⎢LLLLLLLL ⎥ ⎢M ⎥ ⎢M ⎥
⎢M ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢ dx n ⎥ ⎣− a n − a n −1 LL − a1 ⎦ ⎣ x n ⎦ ⎣k ⎦
⎢ ⎥
⎣ dt ⎦
5
EE 312/ lecture no. 3/ State Space modelling approach
⎡ x1 ⎤
⎢x ⎥
y = 1 0 0 0 L 0 ⎢ 2 ⎥ + [0] u
[ ]
⎢M ⎥
⎢ ⎥
⎣ xn ⎦
Example
Find the state space representation in phase form for the transfer function shown in
the following figure.
Solution
Step 1: find the associated differential equation, since
C(S) 24
= 3
R(S) S +9S2 + 26S + 24
( S 3 + 9 S 2 + 26S + 24) C ( S ) = 24 R( s )
6
EE 312/ lecture no. 3/ State Space modelling approach
That leads to
dx1
= x&1 = 0 x1 + x 2 +0 x 3
dt
dx 2
= x& 2 = 0 x1 + 0 x 2 + x 3
dt
dx 3
= x& 3 = −24 x1 − 26 x 2 −9 x 3 + 24 r
dt
The output equation:
y = C = x1
⎡x&1 ⎤ ⎡0 1 0 ⎤⎡x1 ⎤ ⎡ 0 ⎤
⎢x& ⎥ = ⎢0 0 1 ⎥⎢x ⎥ + ⎢ 0 ⎥ r
⎢ 2⎥ ⎢ ⎥⎢ 2 ⎥ ⎢ ⎥
⎢⎣x&3 ⎥⎦ ⎢⎣- 24 - 26 -9 ⎥⎦⎢⎣x3 ⎥⎦ ⎢⎣−24⎥⎦
7
EE 312/ lecture no. 3/ State Space modelling approach
⎡ x1 ⎤
y = [1 0 0 ]⎢⎢ x 2 ⎥⎥ + [0 ]u
⎢⎣ x 3 ⎥⎦
Notice that the third row of the system matrix has the same coefficients as the
denominator of the transfer function but negative and inverse order. Graphically the
system can be represented as in the Fig below.
8
EE 312/ lecture no. 3/ State Space modelling approach
Solution
Step 1:
Separate the system into cascade blocks as illustrated in the fig below. The first block
contains the denominator and the second block contains the numerator.
Step 2:
Find the state equation from the block containing the denominator as:
R( s)
X 1 (s) =
a3 S + a 2 S 2 + a1 S + a 0
3
Then
X 1 ( s )(a3 S 3 + a 2 S 2 + a1 S + a 0 ) = R ( s )
a3 S 3 X 1 ( s ) + a 2 S 2 X 1 ( s ) + a1 SX 1 ( s ) + a 0 X 1 ( s ) = R ( s )
9
EE 312/ lecture no. 3/ State Space modelling approach
dx1
= 0 x1 + 1x 2 + 0 x3 + 0r (1)
dt
dx 2
= 0 x1 + 0 x 2 + 1x3 + 0r (2)
dt
dx3 a a a 1
= − 0 x1 − 1 x 2 − 2 x3 + r (3)
dt a3 a3 a3 a3
⎡ dx1 ⎤
⎢ dt ⎥ ⎡ ⎤ ⎡ x1 ⎤ ⎡ ⎤
⎢ ⎥ ⎢ 0 1 0⎥ ⎢⎢ ⎥⎥ ⎢ 0 ⎥
⎢ ⎥
⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥
⎢ dx ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥
⎢ 2⎥ = ⎢ 0 0 ⎥
1 ⎢ x2 ⎥ + ⎢ 0 ⎥ r
⎢ dt ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ a0 a1 a2 ⎥ ⎢ ⎥ ⎢ 1 ⎥
⎢ 3 ⎥ ⎢−
dx − − ⎥
⎢⎣ dt ⎥⎦ ⎣ a a a ⎦ ⎢⎣ x3 ⎥⎦ ⎢⎣ a3 ⎥⎦
Step 3:
Introduce the effect of the block with numerator. This should yield the output
equation as:
Y ( s ) = C ( s ) = (b2 S 2 + b1 S + b0 ) X 1 ( s )
d 2 x1 d x1
y (t ) = b2 2
+ b1 + b0 x1
dt dt
d x1 d 2 x1
y (t ) = b0 x1 + b1 + b2
dt dt 2
y (t ) = b0 x1 + b1 x 2 + b2 x3
10
EE 312/ lecture no. 3/ State Space modelling approach
⎡ x1 ⎤
y = [b0 b1 b2 ] ⎢ x ⎥ + [0]r
⎢ 2⎥
⎢⎣ x3 ⎥⎦
Remark:
9 From another perspective, the denominator of the transfer function yields the
state equation while the numerator yields the output equation.
Example:
In the above block diagram if:
b2 = 1, b1 = 7, b0 = 2
a3 = 1, a 2 = 9, a1 = 26, a0 = 24
obtain the state space equations and plot the block diagram that represents the state
space model of the given transfer function.
Solution
⎡ x1 ⎤
y = [2 7 1] ⎢⎢ x 2 ⎥⎥ + [0] r
⎢⎣ x3 ⎥⎦
11
EE 312/ lecture no. 3/ State Space modelling approach
X& = AX + BU (1)
Y = CX + DU (2)
Remember that the state space model denotes the internal structure of
modelling techniques
Remember that the transfer function model represents the external model
approach.
To achieve that:
Take Laplace transform for eq. (1) & (2) assuming zero initial conditions as:
SX ( s ) = AX ( s ) + BU ( s ) (3)
Y ( s ) = CX ( s ) + DU ( s ) (4)
12
EE 312/ lecture no. 3/ State Space modelling approach
SX ( s ) − AX ( s ) = BU ( s )
X ( s )( SI − A) = BU ( s )
X ( s ) = ( SI − A) −1 BU ( s ) (5)
In this way the internal signal, X(s), is now absorbed by the input signal U(s).
Substitute eq. (5) into eq.(4). This produces
Y ( s ) = C ( SI − A) −1 BU ( s ) + DU ( s ) (6)
Y ( s)
Tf ( s ) = = C ( SI − A) −1 B + D (7)
U ( s)
Example:
Given the system defined by
⎡ 0 1 0⎤ ⎡10⎤
& ⎢
X =⎢ 0 0 1⎥ X + ⎢⎢0 ⎥⎥
⎥
⎢⎣− 1 − 2 − 3⎥⎦ ⎢⎣0 ⎥⎦
y = [1 0 0] X
Y ( s)
Find the transfer function Tf ( s ) = where U (s ) is the input and Y (s ) is the
U ( s)
output.
Solution
Find ( SI − A) as following:
⎡ S 0 0⎤ ⎡ 0 1 0⎤ ⎡ S −1 0 ⎤
⎢ ⎥ ⎢
( SI − A) = ⎢0 S 0⎥ − ⎢ 0 0 1⎥⎥ = ⎢⎢ 0 S − 1 ⎥⎥
⎢⎣0 0 S ⎥⎦ ⎢⎣− 1 − 2 − 3⎥⎦ ⎢⎣ 1 2 S + 3⎥⎦
To find ( SI − A) −1 :
9 Find the determinant of ( SI − A) , Δ
9 Find the cofactor of ( SI − A)
9 Take transpose of the cofactor matrix
9 Divide each element in the cofactor matrix by Δ
⎡ S −1 0 ⎤
det ( Δ ) of ( SI − A) = det ⎢⎢ 0 S − 1 ⎥⎥
⎢⎣ 1 2 S + 3⎥⎦
13
EE 312/ lecture no. 3/ State Space modelling approach
⎡+ − + ⎤
⎢S −1 0 ⎥⎥
Δ=⎢ = S ( S ( S + 3) + 2) − (−1)(1) + 0
⎢0 S −1 ⎥
⎢ ⎥
⎣1 2 S + 3⎦
Δ = S ( S 2 + 3S + 2) + 1
Δ = S 3 + 3S 2 + 2S + 1
Cofactor of ( SI − A) =
⎡ S −1 0 −1 0 S ⎤
⎢ − ⎥
⎢ 2 S+3 1 S+3 1 2 ⎥
⎢ −1 0 S 0 S −1 ⎥
⎢− − ⎥
⎢ 2 S+3 1 S+3 1 2 ⎥
⎢ ⎥
⎢ −1 0 S 0 S −1 ⎥
−
⎢ S −1 0 −1 0 S ⎥
⎣ ⎦
⎡ S ( S + 3) + 2 − (1) −S ⎤
⎢ ⎥
= ⎢+ ( S + 3) S ( S + 3) − (2S + 1)⎥
⎢ − (− S ) S 2 ⎥⎦
⎣ 1
T
⎡ S 2 + 3S + 2 −1 −S ⎤
⎢ ⎥
= ⎢ S +3 S 2 + 3S − (2 S + 1)⎥
⎢ 1 S S 2 ⎥⎦
⎣
⎡ S 2 + 3S + 2 S +3 1 ⎤
⎢ ⎥
= ⎢ −1 S 2 + 3S S ⎥
⎢ −S − (2S + 1) S 2 ⎥⎦
⎣
⎡ S 2 + 3S + 2 S +3 1 ⎤
⎢ ⎥
⎢ −1 S + 3S
2
S ⎥
⎢ −S − (2 S + 1) S 2 ⎥⎦
⎣
Δ
This gives:
14
EE 312/ lecture no. 3/ State Space modelling approach
⎡ S 2 + 3S + 2 S +3 1 ⎤
⎢ ⎥
⎢ Δ Δ Δ ⎥
⎢ ⎥
⎢ ⎥
−1 S 2 + 3S S ⎥
( SI − A) = ⎢
−1
⎢ Δ Δ Δ⎥
⎢ ⎥
⎢ ⎥
⎢ −S − (2 S + 1) S2 ⎥
⎢ Δ Δ Δ ⎥⎦
⎣
Y ( s)
It is easy now to find Tf ( s ) = , recall equation no. (7), which provides:
U ( s)
Y ( s)
Tf ( s ) = = C ( SI − A) −1 B + D
U ( s)
⎡ S 2 + 3S + 2 S +3 1 ⎤
⎢ ⎥
⎢ Δ Δ Δ ⎥
⎢ ⎥
⎢ ⎥ ⎡10⎤
−1 S 2 + 3S ⎢0 ⎥ + [0]
= [1 0] ⎢
Y ( s) S ⎥
Tf ( s ) = 0 ⎢ ⎥
U ( s) ⎢ Δ Δ Δ⎥
⎢ ⎥ ⎢⎣0 ⎥⎦
⎢ ⎥
⎢ −S − (2S + 1) S2 ⎥
⎢ Δ Δ Δ ⎥⎦
⎣
⎡10⎤
Y ( s ) ⎡ S 2 + 3S + 2 S +3 1⎤ ⎢ ⎥
Tf ( s ) = =⎢ ⎥ 0
U ( s) ⎣ Δ Δ Δ⎦ ⎢ ⎥
⎢⎣0 ⎥⎦
Y ( s ) 10 ( S 2 + 3S + 2)
Tf ( s ) = =
U ( s) Δ
Since Δ = S 3 + 3S 2 + 2S + 1 then
Y ( s ) 10 ( S 2 + 3S + 2)
Tf ( s ) = =
U ( s ) S 3 + 3S 2 + 2 S + 1
15