Professional Documents
Culture Documents
MATHEMATICAL MODEL OF
DISCRETE TIME CONTROL SYSTEMS
Introduction to discrete-time
discrete time system
The Z-transform
Transfer function of discrete-time system
State-space equation of discrete-time system
r(kT) u(kT)
(kT) uR(t) y(t)
Computer D/A Plant
yfb(kT)
A/D Sensor
yfb(kT)
Sampling Sensor
1 e Ts
GZOH ( s ) t
s 0
k
where:
z eTs (s is the Laplace variable, T is the sampling period)
X(z) : Z-transform of x(k).
Z
Notation: x ( k ) X ( z )
If x(k) = 0, k < 0 then X ( z ) Z x ( k ) x ( k ) z k
k 0
Z kx ( k ) z
Derivative in Z-domain:
dX ( z )
dz
Initial-value theorem: x (0) lim X ( z )
z
Fi l l theorem:
Final-value th x ( ) lim(1 z 1 ) X ( z )
z 1
Z (k
( k ) 1
0
Step
p function: u(k)
1 if k 0 1
u(k )
0 if k 0 k
0
Z u( k )
z
z 1
6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 13
The Z-
Z-transform of basic discrete signals (cont’)
Ramp function: r(k)
kT if k 0
r(k )
0 if k 0 k
0
Z u( k )
Tz
z 12
Exponential
p function:
x(k)
e -akT if k 0
x(k )
0 if k 0 k
0
Z x ( k )
z
z e aT
6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 14
Discrete transfer function
u(k) y(k)
Discrete system
The input-output
input output relation ship of a discrete system can be
described by the difference equation:
a0 y ( k n ) a1 y ( k n 1) ... an 1 y ( k 1) an y ( k )
b0u( k m) b1u( k m 1) ... bm1u( k 1) bmu( k )
where n>m, n is the order of the system.
Taking the Z
Z-transform
transform the two sides of the above equation:
a0 z nY ( z ) a1 z n 1Y ( z ) ... an 1 zY ( z ) anY ( z )
b0 z mU ( z ) b1 z m 1U ( z ) ... bm1 zU ( z ) bmU ( z )
6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 16
Derive TF from difference equation (con’t
(con’t))
Taking the ratio Y(z)/U(z) to obtain the transfer function:
Y ( z ) b0 z m b1 z m 1 ... bm 1 z bm
G( z)
U ( z ) a0 z n a1 z n 1 ... an 1 z an
y ( k 3) 2 y ( k 2) 5 y ( k 1) 3 y ( k ) 2u( k 2) u( k )
Solution: Taking
g the Z-transform the difference equation:
q
z 3Y ( z ) 2 z 2Y ( z ) 5zY ( z ) 3Y ( z ) 2 z 2U ( z ) U ( z )
Y ( z) 2z2 1
G( z) 3
U ( z ) z 2 z 2 5z 3
Y ( z) z 1 ( 2 z 2 )
G( z)
U ( z ) 1 2 z 1 5z 2 3z 3
6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 18
Calculate transfer function from block diagram
R(s) Y(s)
+ GC(z) ZOH G(s)
T
H(s)
Y ( z) GC ( z )G ( z )
The closed-loop TF: Gk ( z )
R ( z ) 1 GC ( z )GH ( z )
where
GC (z ) : TF of the controller, derive from difference equation
G ( s ) G ( s ) H ( s )
1
G ( z ) (1 z )Z 1
GH ( z ) (1 z )Z
s s
6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 19
Calculate TF from block diagram – Example 1
Find the closed-loop
closed loop transfer function of the system:
R(s) Y(s)
+ ZOH G(s)
T 0.5
3
G (s)
s2
1 G(s) 1 3
Solution: G ( z ) (1 z )Z (1 z )Z
s s (
(ss 2)
20.5
1 3 z (1 e )
(1 z )
2 ( z 1)( z e 2
20.5
)
0.948 a z (1 e aT )
G( z)
z 0.368 Z aT
s ( s a ) ( z 1)( z e )
6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 20
Calculate transfer function from block diagram – Example 1 (cont’)
0.948
G( z)
Gk ( z ) z 0.368
1 G( z) 0.948
1
z 0.368
0.948
Gk ( z )
z 0.580
H(s)
3e s 1
Given that G( s) H ( s)
s3 s 1
Solution:
Th closed-loop
The l dl t
transfer
f function:
f ti
G( z)
Gk ( z )
1 GH ( z )
6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 22
Calculate TF from block diagram – Example 2 (cont’)
1 G( s) 3e s
G ( z ) (1 z )Z G( s)
s ( s 3)
1 3 e s
(1 z )Z
s( s 3)
30.5
1 2 z (1 e )
(1 z ) z
( z 1)( z e 30.5 )
0.777
G( z) 2 a aT
z (1 e T )
z ( z 0.223) Z aT
s ( s a ) ( z 1)( z e )
z eTs e0.5 s
6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 23
Calculate TF from block diagram – Example 2 (cont’)
G ( s) H ( s)
1 3e s
GH ( z ) (1 z )Z G ( s)
s ( s 3)
s
1 3 e
(1 z )Z H (s)
1
s ( s 3)( s 1) ( s 1)
1 2 z ( Az B)
3(1 z ) z
( z 1)( z e 30.5 )( z e 10.5 )
(1 e 30.5 ) 3(1 e 0.5 )
A 0.0673
3(1 3) 1 z ( Az B)
Z aT bT
30.5
s ( s a )( s b ) ( z 1)( z e )( z e )
3e 30.5 (1 e 0.5 ) e 0.5 (1 e ) aT
B b(1 e 0).0346
a(1 e bT )
3(1 3) A
ab(b a)
0 .202 z 0. 104
aeaT (1 e bT ) be bT (1 e aT )
GH ( z ) 2
z ( z 0.223)( zB 0.607) ab(b a)
6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 24
Calculate TF from block diagram – Example 2 (cont’)
Th closed-loop
The l dl t
transfer
f function:
f ti
0.777
Gk ( z )
G( z) z 2
( z 0. 223)
1 GH ( z ) 0.202 z 0.104
1 2
z ( z 0.223)( z 0.607)
0.777( z 0.607)
Gk ( z ) 4
z 0.83z 3 0.135z 2 0.202 z 0.104
0.777
G( z) 2
z ( z 0.223)
0.202 z 0.104
GH ( z ) 2
G
z ( z 0.223)( z 0.607)
H(s)
5e 0.2 s
Given that: G( s) H ( s ) 0.1
s2
The controller is described by the difference equation:
u( k ) 10e( k ) 2e( k 1)
Solution:
The closed-loop transfer function:
GC ( z )G ( z )
Gk ( z )
1 GC ( z )GH ( z )
The TF of the controller is calculated from the difference
equation:
u( k ) 10e( k ) 2e( k 1)
U ( z ) 10 E ( z ) 2 z 1E ( z )
U ( z)
GC ( z ) 10 2 z 1
E ( z)
6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 27
Calculate TF from block diagram – Example 3 (cont’)
1 G ( s) 0.2 s
G ( z ) (1 z )Z G ( s)
5e
s s2
0.2 s
1 5e
5e 1 1 ( 0. 2) 2
z ( z 1)
(1 z )Z 3 5(1 z ) z
s 2 ( z 1 ) 3
0.1( z 1)
G( z)
z ( z 1) 2
1 G (s) H ( s)
GH ( z ) (1 z )Z H ( s ) 0.1
s
1 G ( s)
0.1(1 z )Z 1 T z ( z 1)
2
s Z 3
s 2( z 1)
3
0.01( z 1)
GH ( z )
z ( z 1) 2 z eTs e0.2 s
6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 28
Calculate TF from block diagram – Example 3 (cont’)
Th closed-loop
The l dl t
transfer
f function:
f ti
10 z 2 0.1( z 1)
. 2
GC ( z )G ( z ) z z ( z 1)
Gk ( z )
1 GC ( z )GH ( z ) 10 z 2 0.01( z 1)
1 . 2
z z ( z 1 )
z 2 0.8 z 0.2
Gk ( z ) 4 1
z 2 z 1.1z 0.08 z 0.02 C
3 2 G ( z ) 10 2 z
0.1( z 1)
G( z)
z ( z 1) 2
0.01( z 1)
GH ( z )
z ( z 1) 2
6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 29
State--space model of discrete system
State
x( k 1) Ad x( k ) Bd r ( k )
y ( k ) Cd x( k )
where:
h
Cd 1 0 0 0
6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 33
Derive SS equation from difference equation – Case 1 example
x( k 1) Ad x( k ) Bd r ( k )
The state equations:
q
y ( k ) Cd x( k )
where: 00
0 0 Bd 0 0
b0
0 1 0 1
Ad 0 0 1 0 0 1 1.5
a3 a2 a1 a0
2 2.5 0.5
a0 a0 a0 Cd 1 0 0
6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 34
Derive SS equation from difference equation
Case 2: The right
right-hand
hand side of the difference equation
involve the differences of the input:
a0 y ( k n) a1 y ( k n 1) ... an 1 y ( k 1) an y ( k )
b0u ( k n 1) b1u ( k n 2) ... bn 2u ( k 1) bn 1u ( k )
Define the state variable:
The first state variable is
x1 ( k ) y ( k )
the output
p of the system;
y ;
The ith state variable (i=2..n) x2 ( k ) x1 ( k 1) 1u( k )
is set to be one sample x3 ( k ) x2 ( k 1) 2 u ( k )
time-advanced (i 1)th
time ad anced of the (i1)
state variable minus a
quantity
q ypproportional
p to the xn ( k ) xn 1 ( k 1) n 1u( k )
input
6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 35
Derive SS equation from difference equation
Case 2 (cont’)
(cont )
x( k 1) Ad x( k ) Bd u( k )
The state equation:
y ( k ) Cd x ( k )
where:
0 1 0 0
1
x1 ( k ) 0 0 1 0
x (k ) 2
x(k ) 2 A B
d d
0 0 0 1
a n 1
n
x ( k ) a a
n n 1 n 2 1 a
n
0
a a 0 a 0 a 0
Cd 1 0 0 0
6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 36
Derive SS equation from difference equation
Case 2 (cont’)
The coefficient i in the vector Bd are defined as:
b0
1
a0
b1 a11
2
a0
b2 a1 2 a2 1
3
a0
bn 1 a1 n 1 a2 n 2 an 11
n
a0
6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 37
Derive SS equation from difference equation – Case 2 example
x( k 1) Ad x( k ) Bd u( k )
The state equations:
y ( k ) Cd x( k )
where: 1
0 1 0 0 1 0 Bd 2
Ad 0 0 1 0 0 1 3
a3 a2 a1
2 2.5 0.5
a0 a0 a0 Cd 1 0 0
6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 38
Derive SS from difference equation – Case 2 example (cont’)
The ffi i t i in
Th coefficient i th
the vector
t Bd are calculated
l l t d as:
b0 1
1 a 2 0.5
0
b1 a11 0 1 0.5
2 0.25
a0 2
b2 a1 2 a2 1 3 1 ( 0.25) 5 0.5 0.375
3
a0 2
0.5
Bd 0.25
0.375
(t ) L [ ( s )]
1
( s ) sI A
-1
where
Ad (T )
x[( k 1)T ] Ad x( kT ) Bd eR ( kT ) T
y ( kT ) Cd x( kT ) 0
with Bd ( ) Bd
Cd C
Step 4: Write the closed-loop discrete state equations (which
has input signal r(kT))
F
Formulate
l t the
th SS equations
ti d
describing
ibi the
th system:
t
where a = 2, T = 0.5, K = 10
Solution:
eR(t) 1 x2 1 x1 10 y(t)
Step 1:
s2 s
X 2( s )
X 1 (s) sX 1 ( s ) X 2( s ) x1 (t ) x 2 (t )
s
E R ( s) x2 (t ) 2 x2 (t ) e R (t )
X 2 ( s) ( s 2) X 2 ( s ) E R ( s )
s2
x1 (t ) 0 1 x1 (t ) 0
x (t ) 0 2 x (t ) 1 eR (t )
2 2
A B
x1 (t )
y (t ) 10 x1 (t ) 10 0
x2 (t )
C
6 December 2013 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 43
Formulation of state equations from block diagram – Example (cont’)
1 2t 1 20.5
1 (1 e ) 1 (1 e ) 1 0.316
Ad (T ) 2 2
0 2t 20.5 0 0 . 368
e t T 0 e
T
1 2 0 T 1 2
T
1 (1 e ) (1 e )
Bd ( ) Bd 2 d 2 d
0 0 2 1 0 e 2
e
0
T
e 2
0.5 e 20.5 1
2 2
2 2 2 2 2
2 0.092
0.316
e 2 e 20.5
1
2 0 2 2
Cd C 10 0
x( k 1) Ad x( k ) Bd u( k )
y ( k ) Cd x( k )
Th corresponding
The di transfer
t f function
f ti is:
i
Y ( z)
G( z) Cd ( zI Ad ) 1 Bd
U ( z)