Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
27 views48 pages

IntroCtrlSys Chapter7

The lecture notes cover the fundamentals of discrete-time control systems, including the Z-transform, transfer functions, and state-space equations. It discusses the advantages of digital control systems, the process of sampling, and the reconstruction of discrete signals. Additionally, it provides examples of deriving transfer functions from difference equations and block diagrams.

Uploaded by

Tiến Bùi Văn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views48 pages

IntroCtrlSys Chapter7

The lecture notes cover the fundamentals of discrete-time control systems, including the Z-transform, transfer functions, and state-space equations. It discusses the advantages of digital control systems, the process of sampling, and the reconstruction of discrete signals. Additionally, it provides examples of deriving transfer functions from difference equations and block diagrams.

Uploaded by

Tiến Bùi Văn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 48

Lecture Notes

Fundamentals of Control Systems


Instructor: Dr. Huynh Thai Hoang
Department of Automatic Control
Faculty of Electrical & Electronics Engineering
Ho Chi Minh City University of Technology
Email: [email protected]
[email protected]
H
Homepage: www4.hcmut.edu.vn/~hthoang/
4h t d / hth /

16 November 2011 © H. T. Hoang - www4.hcmut.edu.vn/~hthoang/ 1


Chapter 7

MATHEMATICAL MODEL OF
DISCRETE TIME CONTROL SYSTEMS

16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 2


Content

‘ I t d ti to
Introduction t discrete-time
di t ti system
t
‘ The Z-transform
‘ Transfer function of discrete-time system
‘ State-space equation of discrete-time system

16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 3


Introduction to discrete
discrete--time systems

16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 4


Digital control systems

r(kT) u(kT)
(kT) uR(t) y(t)
Computer D/A Plant

yfb(kT)
A/D Sensor

‘ “Computer” = computational equipments based on


microprocessor technology (microprocessor,
(microprocessor
microcontroller, PC, DSP,…).
‘ Advantages
g of digital
g control system:
y
Ž Flexibility
Ž Easy to implement complex control algorithms
Ž Computer can control many plants at the same time.

16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 5


Discrete control systems

r(kT) Discrete u(kT) uR(t) y(t)


Hold Plant
processing

yfb(kT)
Sampling Sensor

‘ Discrete control systems are control systems which have


signals at several points being discrete signal.

16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 6


Sampling
‘ Sampling is the reduction of a continuous signal to a
discrete signal. * x(t) x (t)
‘ Mathematical expression T
describing the sampling process: x(t)
+∞
X * ( s ) = ∑ x ( kT )e −kTs t
k =0 0
x*(t)
‘ Shannon’s Theorem:
1 t
f = ≥ 2 fc
T 0

‘ If qquantization error is negligible,


g g , then A/D converters are
approximate the ideal samplers.
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 7
Sampled--data hold
Sampled
‘ Sampled-data
Sampled data hold is the reconstruction of discrete signal
to a continuous signal. * x (t) xR (t)
ZOH
‘ Zero-order
Zero order hold (ZOH): keep
signal unchanged between x*(t)
two co
consecutive
secut ve sampling
sa p g
instants. t
0
‘ Transfer function of the ZOH.
ZOH xR(t)

1 − e −Ts
GZOH ( s ) = t
s 0

‘ If qquantization error is negligible,


g g , then D/A converters are
approximate the zero-order hold.
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 8
The Z-transform

16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 9


Definition of the Z-
Z-transform
‘ Consider x(k),
x(k) k=0,1,2,…
k=0 1 2 being a discrete signal.
signal The Z-
Z
transform of x(k) is defined as:
+∞
X ( z ) = Z {x (k )} = ∑ x ( k ) z −k

k = −∞
where:
− z = eTs (s is the Laplace variable, T is the sampling period)
− X(z)
( ) : Z-transform
s o oof 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

‘ Region Of Convergence (ROC): set of z such that X(z) is finite.


16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 10
An interpretation of the Z-
Z-transform
‘ Suppose x(t) being a continuous signal,
signal sample x(t) at the
sampling periode T , we have a discrete signal x(k) = x(kT).
‘ The mathematic model of the process of sampling x(t)
+∞
X * ( s ) = ∑ x (kT )e −kTs (1)
k =0

‘ The Z-transform of the sequence x(k) = x(kT).


+∞
X ( z ) = ∑ x ( k ) z −k (2)
k =0

Due to z = e , the right hand-side of the expression (1)


Ts
‘
and ((2)) are identical. So pperformingg Z-transform of a signal
g
is equivalent to discretizing this signal.
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 11
Properties of the Z-
Z-transform
Given x(k) and y(k) being two sequences which have the Z- Z
transforms:
Z {x ( k )} = X ( z ) Z {y ( k )} = Y ( z )
‘ Linearity: Z {ax ( k ) + by ( k )} = aX ( z ) + bY ( z )
‘ Ti shifting:
Time hif i Z {x ( k − k0 )} = z − k0
X ( z)

‘ Scale in Z-domain: Z {a k
x ( k )} = X ( a −1
z)

‘ Derivative in Z-domain: Z {kx ( k )} = − z


dX ( z )
dz
‘ Initial-value theorem: x (0) = lim X ( z )
z →∞

‘ Final-value theorem: x ( ∞) = lim(1 − z −1 ) X ( z )


z →1

16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 12


The Z-
Z-transform of basic discrete signals

‘ Di impulse:
Dirac i l δ(k)
⎧1 if k = 0
δ (k ) = ⎨ 1
⎩0 if k ≠ 0 k

Z {δ (k
( k )} = 1
0

‘ Step function: u(k)


⎧1 if k ≥ 0 1
u(k ) = ⎨
⎩0 if k < 0 k
0
Z {u( k )} =
z
z −1
16 November 2011 © 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 − 1)2
‘ Exponential function: x(k)
⎧e -akT if k ≥ 0
x(k ) = ⎨
⎩0 if k < 0 k
0
Z {x ( k )} =
z
z − e −aT
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 14
Discrete transfer function

16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 15


Derive transfer function (TF) from difference equation
u(k) y(k)
Discrete system

‘ The input-output
Th i t t t relation l ti shiphi off a discrete
di t system
t can be b
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) + ... + bm−1u( k + 1) + bmu( k )
where n>m, n is the order of the system.

‘ Taking the Z-transform


Z 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 ) + ... + bm−1 zU ( z ) + bmU ( z )
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 16
Derive TF from difference equation ((con’t
con’t))

‘ T ki the
Taking th ratio
ti Y(z)/U(z)
Y( )/U( ) to
t obtain
bt i the
th transfer
t f function:
f ti
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

‘ The above transfer function can be transformed into the


equivalent form:
− ( n −m ) −1 − m +1 −m
Y ( z) z [b0 + b1 z + ... + bm −1 z + bm z ]
G( z) = =
U ( z) a0 + a1 z −1 + ... + an −1 z −n +1 + an z −n

16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 17


Derive TF from difference equation _ Example
‘ Consider a system described by the difference equation.
equation
Derive its transfer function:
y ( k + 3) + 2 y ( k + 2) − 5 y ( k + 1) + 3 y ( k ) = 2u( k + 2) + u( k )

‘ Solution: Taking the Z


Z-transform
transform the difference equation:

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
16 November 2011 © 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 ⎪⎭
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 19
Calculate TF from block diagram – Example 1
‘ Find the closed-loop transfer function of the system:
R(s) Y(s)
+ ZOH G(s)

T = 0.5
3
G (s) =
s+2

Solution: G ( z ) = (1 − z −1 )Z ⎧ G(s) ⎫ −1 ⎧ 3 ⎫
⎨ ⎬ = (1 − z )Z ⎨ ⎬
⎩ s ⎭ ( s + 2) ⎭
⎩ s (s
−2×0.5
−1 3 z (1 − e )
= (1 − z )
2 ( z − 1)( z − e −2×
2×0.5
)

⇒ 0.948 ⎧ a ⎫ z (1 − e − aT )
G( z) =
z − 0.368 Z⎨ ⎬= − aT
⎩ s ( s + a ) ⎭ ( z − 1)( z − e )
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 20
Calculate transfer function from block diagram – Example 1 (cont’)

‘ The closed-loop transfer function:

0.948
= z − 0.368
G( z)
Gk ( z ) =
1 + G ( z ) 1 + 0.948
z − 0.368

⇒ 0.948
Gk ( z ) =
z + 0.580

16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 21


Calculate TF from block diagram – Example 2
‘ Calculate the transfer function of the system:
R(s) Y(s)
+ ZOH G(s)

T = 0.5

H(s)

3e − s 1
Given that G ( s ) = H ( s) =
s+3 s +1
‘ Solution:
The
h closed-loop
l dl transfer
f function:
f i
G( z)
Gk ( z ) =
1 + GH ( z )
16 November 2011 © 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) ⎭
−3×0.5
−1 −2 z (1 − e )
= (1 − z ) z
( z − 1)( z − e −3×0.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
16 November 2011 © 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 −3×0.5 )( z − e −1×0.5 )
(1 − e −3×0.5 ) − 3(1 − e −0.5 )
A= = 0.0673
3(1 − 3) ⎧ 1 ⎫ z ( Az + B)
Z ⎨ ⎬ = − aT −bT
⎩ −3×0.5
s ( s + a )( s + b ) ⎭ ( z − 1)( z − e )( z − e )
3e −3×0.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
ae−aT (1 − e −bT ) − be −bT (1 − e −aT )
GH ( z ) = 2
z ( z − 0.223)( zB −= 0.607) ab(b − a)
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 24
Calculate TF from block diagram – Example 2 (cont’)

‘ The closed-loop transfer function:


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)

16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 25


Calculate TF from block diagram – Example 3

‘ C l l t the
Calculate th closed-loop
l dl t
transfer
f function
f ti off the
th system:
t
R(s) e(k) u(k) Y(s)
+ GC(z) ZOH G(s)
− T=0.2

H(s)

−0. 2 s
Given that: G ( s ) = 5e
H ( s ) = 0.1
s2
The controller is described by the difference equation:
u( k ) = 10e( k ) − 2e( k − 1)

16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 26


Calculate TF from block diagram – Example 3 (cont’)

‘ Solution:
S l ti
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)
16 November 2011 © 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
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 28
Calculate TF from block diagram – Example 3 (cont’)

‘ The closed-loop transfer function:


⎡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
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 29
State--space model of discrete system
State

16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 30


The discrete state space (SS) equation
‘ The state-space model of a discrete system is a set of first-
order difference equations of the form:
⎧ x( k + 1) = Ad x( k ) + Bd r ( k )

⎩ y ( k ) = Cd x( k )
where:
h

⎡ x1 ( k ) ⎤ ⎡ a11 a12 K a1n ⎤ ⎡ b1 ⎤


⎢ x (k )⎥ ⎢a a K a ⎥ ⎢b ⎥
x(k ) = ⎢ 2 ⎥ Ad = ⎢ 21 22 2n ⎥
Bd = ⎢ 2 ⎥
⎢ M ⎥ ⎢ M M M ⎥ ⎢M⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎣ n ⎦
x (k ) ⎣ n1 n 2
a a K a nn ⎦ ⎣bn ⎦
C d = [c1 c 2 K c n ]
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 31
Derive SS equation from difference equation
‘ Case 1: The right-hand side of the difference equation
does not 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 )

‘ Define the state variables:


Ž The first state variable is the x1 ( k ) = y ( k )
output off the
h system; x2 ( k ) = x1 ( k + 1)
Ž The ith state variable (i=2..n) x3 ( k ) = x2 ( k + 1)
is set to be one sample time-
time
M
advanced of the (i−1)th state
variable. xn ( k ) = xn −1 ( k + 1)

16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 32


Derive SS equation from difference equation
Case 1 (cont
(cont’))
⎧ x( k + 1) = Ad x( k ) + Bd r ( k )
‘ The state equations:
q ⎨
⎩ y ( k ) = Cd x( k )
where:
⎡ 0 1 0 K 0 ⎤ ⎡0⎤
⎡ x1 ( k ) ⎤ ⎢ 0 0 1 K 0 ⎥ ⎢ 0 ⎥
⎢ x (k )⎥ ⎢ ⎥ ⎢ ⎥
x( k ) = ⎢ 2 ⎥ Ad = ⎢ M M M M ⎥ B =⎢ M ⎥
⎢ M ⎥ ⎢ ⎥ d ⎢0⎥
⎢ ⎥ ⎢ 0a 0 0 K 1 ⎥ ⎢b ⎥
⎣ xn ( k ) ⎦ ⎢ − n − an −1 − an −2 K − a1 ⎥ ⎢ 0⎥
⎢⎣ a0 a0 a0 a0 ⎥⎦ ⎣⎢ a0 ⎥⎦

Cd = [1 0 K 0 0]
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 33
Derive SS equation from difference equation – Case 1 example

‘ Write the state equations of the system described by:


2 y ( k + 3) + y ( k + 2) + 5 y ( k + 1) + 4 y ( k ) = 3u ( k )
⎧ x1 ( k ) = y ( k )

‘ Define the state variables: ⎨ x2 ( k ) = x1 ( k + 1)
⎪ x (k ) = x ( k + 1)
⎩ 3 2

⎧ x( k + 1) = Ad x( k ) + Bd r ( k )
‘ The state equations: ⎨
⎩ y ( k ) = Cd x( k )
where: 0⎡0⎤
⎡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]
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 34
Derive SS equation from difference equation
‘ Case 2: The right-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
D fi ththe state
t t variable:
i bl
Ž The first state variable is the
x1 ( k ) = y ( k )
output of the system;
x2 ( k ) = x1 (k + 1) − β1r ( k )
Ž The ith state variable (i=2..n)
is set to be one sample time- x3 ( k ) = x2 ( k + 1) − β 2 r ( k )
advanced of the (i−1)th state M
variable minus a quantity xn ( k ) = xn −1 ( k + 1) − β n −1r ( k )
proportional
i l to the
h input
i
16 November 2011 © 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 r ( k )
‘ The state equation:q ⎨
⎩ y ( k ) = Cd x( k )
where:
⎡ 0 1 0 K 0 ⎤
⎡ β1 ⎤
⎡ x1 ( k ) ⎤ ⎢ 0 0 1 K 0 ⎥ ⎢β ⎥
⎢ x (k )⎥ ⎢ ⎥ ⎢ 2⎥
x(k ) = ⎢ 2 ⎥ A =⎢ M M M M ⎥ B =⎢ M ⎥
⎢ M ⎥ d ⎢ ⎥ d
0 0 0 K 1 ⎢ ⎥
⎢ ⎥ ⎢ a ⎥ ⎢ β n −1 ⎥
⎣ n ⎦
x ( k ) a a
⎢ − n − n −1 − n −2 K − 1 ⎥ a
⎢⎣ β n ⎥⎦
⎣⎢ 0
a a 0 a 0 a 0⎥⎦

Cd = [1 0 K 0 0]
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 36
Derive SS equation from difference equation

Case
C 2 (cont’)
( t’)
The coefficient βi in the vector Bd are defined as:
b0
β1 =
a0
b1 − a1β1
β2 =
a0
b2 − a1β 2 − a2 β1
β3 =
a0
M
bn −1 − a1β n −1 − a2 β n −2 − K − an −1β1
βn =
a0
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 37
Derive SS equation from difference equation – Case 2 example

‘ Write the state equations of the system described by:


2 y ( k + 3) + y ( k + 2) + 5 y ( k + 1) + 4 y ( k ) = u( k + 2) + 3u( k )
⎧ x1 ( k ) = y ( k )

‘ Define the state variables: ⎨ x2 ( k ) = x1 ( k + 1) − β1r ( k )
⎪ x ( k ) = x ( k + 1) − β r ( k )
⎩ 3 2 2

⎧ 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]
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 38
Derive SS from difference equation – Case 2 example (cont’)

‘ ffi i t βi in
Th coefficient
The i the
th vector
t Bd are calculated
l l t d as:
⎧ b0 1
⎪ β1 = a = 2 = 0.5
⎪ 0
⎪ b1 − a1β1 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 ⎥⎦

16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 39


Formulation of SS from block diagram
r(t) e(t) e(kT) eR(t) y(t)
+ ZOH G(s)

T

‘ Step 1: Write the state space equations of the open-loop


continuous system:
⎧ x& (t ) = Ax(t ) + BeR (t )
eR(t) y(t) ⎨
G(s) ⎩ y (t ) = Cx(t )
‘ Step 2: Calculate the transient matrix:
Φ (t ) = L [Φ ( s )]
−1

Φ ( s ) = (sI − A)
-1
where
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 40
Formulation of SS equations from block diagram (cont’)

‘ Step 3: Discretizing the open-loop


open loop continuous SS equation:
e(kT) y(kT)
ZOH G(s)

⎧ Ad = Φ (T )
⎧ x[( k + 1)T ] = Ad x( kT ) + Bd eR ( kT ) ⎪⎪ T
⎨ with ⎨ Bd = ∫ Φ (τ ) Bdτ
⎩ y ( kT ) = Cd x( kT ) ⎪ 0
⎪⎩Cd = C
‘ Step 4: Write the closed-loop discrete state equations
( hi h has
(which h input
i t signal
i l r(kT))
(kT))
⎧ x[( k + 1)T ] = [Ad − Bd Cd ]x( kT ) + Bd r ( kT )

⎩ y ( kT ) = Cd x( kT )
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 41
Formulation of SS equations from block diagram – Example

‘ Formulate
l theh SS equations
i d
describing
ibi the
h system:

r(t) e(t) e(kT) eR(t) 1 x2 1 x1 K y(t)


+ ZOH
− s+a s
T

where a = 2, T = 0.5, K = 10

16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 42


Formulation of state equations from block diagram – Example (cont’)

‘ S l ti
Solution:
eR(t) 1 x2 1 x1 10 y(t)
‘ Step 1:
s+2 s
X 2( s )
X 1 (s) = ⇒ sX 1 ( s ) = X 2( s ) ⇒ x&1 (t ) = x 2 (t )
s
E R ( s) ⇒ ⇒ x&2 (t ) = −2 x2 (t ) +e R (t )
X 2 ( s) = ( s + 2) X 2 ( s ) = E R ( s )
s+2

⎡ x&1 (t ) ⎤ ⎡0 1 ⎤ ⎡ x1 (t ) ⎤ ⎡0⎤
⎢ x& (t )⎥ = ⎢0 − 2⎥ ⎢ x (t )⎥ + ⎢1⎥ eR (t )
⎣ 2 ⎦ 1 ⎣ 4243⎦ ⎣ 2 ⎦ ⎣{⎦
⇒ A B
⎡ x1 (t ) ⎤
y (t ) = 10 x1 (t ) = [10 0]⎢
123 ⎣ x2 (t )⎥⎦
C
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 43
Formulation of state equations from block diagram – Example (cont’)

‘ Step 2: Calculate the transient matrix


−1 −1
⎛ ⎡1 0⎤ ⎡0 1 ⎤ ⎞ ⎛ ⎡s − 1 ⎤ ⎞
Φ ( s ) = (sI − A) = ⎜⎜ s ⎢ −⎢ ⎟ = ⎜⎢ ⎟
-1
⎥ ⎥ ⎟ ⎜ ⎥ ⎟
⎝ ⎣0 1 ⎦ ⎣0 − 2 ⎦ ⎠ ⎝ ⎣0 s + 2 ⎦ ⎠
⎡1 1 ⎤
1 ⎡ s + 2 1⎤ ⎢ s s ( s + 2) ⎥
= ⎢ ⎥ =⎢ ⎥
s ( s + 2) ⎣ 0 s⎦ ⎢ 1 ⎥
0
⎢⎣ s + 2 ⎥⎦
⎧⎡ 1 1 ⎤ ⎫ ⎡ −1 ⎧ 1 ⎫ −1 ⎧ 1 ⎫⎤
⎪ ⎢ ⎥ ⎪ ⎢ L ⎨ ⎬ L ⎨ ⎬⎥
⎪ ⎪ ⎩ s ( s + 2) ⎭ ⎥
Φ (t ) = L −1[Φ ( s )] = L −1 ⎨⎢ s s ( s + 2) ⎥ ⎬ = ⎢ ⎩ ⎭
s
⎪⎢ 0 1 ⎥⎪ ⎢ −1 ⎧ 1 ⎫ ⎥
0 L ⎨ ⎬ ⎥
⎪⎩⎢⎣ s + 2 ⎥⎦ ⎪⎭ ⎢⎣ ⎩s + 2⎭ ⎦
⎡ 1 − 2t ⎤
⇒ ⎢ 1 (1 − e )⎥
Φ (t ) = 2
⎢0 −2t ⎥
⎣ e ⎦
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 44
Formulation of state equations from block diagram – Example (cont’)

‘ open loop ⎧ x[(k + 1)T ] = Ad x(kT ) + Bd eR (kT )


Step 3: Discretizing the open-loop

continuous state equations: ⎩ y (kT ) = Cd x(kT )

⎡ 1 −2t ⎤ ⎡ 1 − 2×0.5 ⎤
1 (1 − e ) 1 (1 − e )⎥ ⎡1 0.316⎤
Ad = Φ (T ) = ⎢ 2 ⎥ = ⎢ 2 =⎢ ⎥
⎢0 − 2t ⎥ ⎢ − 2×0.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 −2×0.5 1 ⎞⎤
⎢⎜⎜ + 2 ⎟⎟⎥ ⎢⎜⎜ + − 2 ⎟⎟⎥
= ⎢⎝ 2 2 ⎠⎥ = ⎢⎝ 2 2 2
2 ⎠⎥ = ⎡0.092⎤
⎢0.316⎥
⎢ e −2τ ⎥ ⎢ e − 2×0.5
1 ⎥ ⎣ ⎦
⎢ − ⎥ ⎢ − + ⎥
⎣ 2 ⎦0 ⎣ 2 2 ⎦

Cd = C = [10 0]

16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 45


Formulation of state equations from block diagram – Example (cont’)

‘ Step 4: The closed-loop discrete state equations:


⎧ x[( k + 1)T ] = [Ad − Bd Cd ]x( kT ) + Bd r ( kT )

⎩ y ( kT ) = Cd x( kT )

⎡1 0.316⎤ ⎡0.092⎤ ⎡ 0.080 0.316⎤


where [Ad − Bd Cd ] = ⎢ ⎥ −⎢ ⎥ [10 0] = ⎢ ⎥
⎣ 0 0 . 368 ⎦ ⎣ 0 . 316 ⎦ ⎣ − 3 . 160 0 . 368 ⎦

‘ Conclusion: The closed-loop


closed loop state equation is:
⎡ x1 ( k + 1) ⎤ ⎡ 0.080 0.316⎤ ⎡ x1 ( k ) ⎤ ⎡0.092⎤
⎢ x ( k + 1)⎥ = ⎢ − 3.160 0.368⎥ ⎢ x ( k )⎥ + ⎢0.316⎥ r ( k )
⎣ 2 ⎦ ⎣ ⎦⎣ 2 ⎦ ⎣ ⎦
⎡ x1 (k ) ⎤
y (k ) = [10 0].⎢ ⎥
⎣ 2 ⎦
x ( k )
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 46
Calculate transfer function from state equation

‘ Gi
Given th state
the t t equation
ti
⎧ x( k + 1) = Ad x( k ) + Bd u( k )

⎩ y ( k ) = Cd x( k )

‘ Th corresponding
The di transfer
f function
f i is:
i
Y ( z)
G( z) = = Cd ( zI − Ad ) −1 Bd
U ( z)

16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 47


Calculate transfer function from state equation - Example

‘ Calculate the TF of the system described by the SS equation:


⎧ x(k + 1) = Ad x(k ) + Bd u (k )

⎩ y ( k ) = C d x( k )
⎡ 1⎤ ⎡0 ⎤
Cd = [1 0]
0
Ad = ⎢ ⎥ Bd = ⎢ ⎥
⎣ − 0 . 7 − 0 . 1⎦ ⎣ 2⎦
‘ Solution: The transfer function is:
G ( z ) = Cd ( zI − Ad ) −1 Bd
−1
⎛ ⎡ 1 0⎤ ⎡ 0 1⎤ ⎞ ⎡0⎤
= [1 0]⎜⎜ z ⎢ ⎥ −⎢ ⎥ ⎟ ⎢ ⎥
⎟ 2
⎝ ⎣ 0 1⎦ ⎣ − 0 .7 − 0 . 1⎦ ⎠ ⎣ ⎦
⇒ G( z) = 2
z 2 + 0.1z + 0.7
16 November 2011 © H. T. Hoàng - www4.hcmut.edu.vn/~hthoang/ 48

You might also like