Sunteți pe pagina 1din 93

1

Introduction to Discrete Time


Systems and the Z Transform
Dr. Ed. Palmer
School of Electrical & Electronic Systems
Engineering
2
Lecturer Contact Details
Dr. Ed. Palmer
School of EESE, QUT, GPO Box 2434,
Birsbane, Q. 4001 Australia
Tel. +6173864 2632
e-mail e.palmer@qut.edu.au

3
Module Overview

Discrete time control - single input /single
output
z transform based control design
State space control - multi-input, multi-output
time domain based

4
Text & references Modern
Control module
TEXT
Ogata, K. Discrete Time Control Systems,
Prentice-Hall
REFERENCE
Brogan, W., Modern Control Theory,
Prentice-Hall
5
Pre-requisite Knowledge
Good understanding of classical
(continuous time control)
good knowledge of linear algebra
in particular, rank, basis, eigenvalues,
eigenvectors
6
Contents
Data Acquisition,
A/D conversion, sample/hold,
Operations on discrete time signals
Z Transform
derivation, inverse transform, properties,
examples
Ref. Chapters 1 & 2 of Ogata
7
Data Acquisition
Typical Discrete Time control System

Plant
G(s)
c(t)
output
(measurement)
DAC
Digital
Controller
ADC
Set Input
Actuation
8
Data Acquisition
Analog to digital conversion
two stage process
Sample/Hold
A/D Converson
9
Sample/Hold (S/H)
Receives an analog signal and holds it
constant for a specified time
Sampling time short compared to sampling
period
10
Sample/Hold (S/H)

Amp 1 Amp 2
Buffering Amplifiers
C
Switch closed - tracking time, Switch open - hold time
Sampling
Trigger
11
Sample/Hold

Tracking Time
Aperture Time
Hold time
V
o
l
t
a
g
e

a
c
r
o
s
s

c
a
p
a
c
i
t
o
r

Capacitor voltage
following signal
level
12
Analog to Digital Conversion
Takes sampled signal and converts it to a
digital signal
a finite number of digits
Continuous Signal
Digital Signal
13
Analog to Digital Conversion
Accuracy depends on number of digital
levels available
Quantization
For an n bit word there are 2
n
available
quantization levels
14
Quantisation
Error incurred in rounding sampled signal
to nearest digital level
ith quantization level
(i+1)th quantization
level
Sampling instant
signal
Signal will be rounded up to (i+1)th
level - closest level
15
Quantization Error
Error incurred in rounding sampled signal to
nearest level
length byte ,
2
levels adjacent between range level on quantizati
Reading, Scale Full let
= =
= =
=
n
FSR
Q
Q
FSR
n
Source of random noise - can derive statistics
16
Quantization Error

) ( ) ( ) (
value quantized and value
signal actual between difference error on Quantizati
t y t x t e =
=
Q
Signal sample x(t)
Quantized
signal value y(t)
Error e(t)
17
Quantization Error
Worst case value of e(t) = 0.5Q
2
) ( 0
Q
t e < s
Error is uniformly distributed between -0.5Q and +0.5 Q
Mean = zero
18
Variance of Quantization Error

( ) ( )
12
1
2
2
2
2
2
2
2
Q
d
Q
e t e E
Q
Q
=
= =
}

o
o
19
D/A Conversion
Signal reconstructed using hold circuits
Zero Order hold
most commonly used - least delays
staircase function
Higher order holds
interpolation between sampling instants
delay increases with order of hold - stability
problems
20
D/A Conversion

Original signal
Signal samples
Reconstructed Signal - Staircase
function
Zero Order Hold
21
D/A Conversion

Original signal
Signal samples
Reconstructed signal
First Order Hold - Linear Interpolation
between samples - one sample delay
22
Operations on Discrete Time
Signals
Notation
( )
( ) integer an is where , or
) ( signal time discrete signal time continuous
1
rate sampling constant Assume
k k x
kT x t x
T
f
s

=
Note - Multi-rate sampling can occur in some systems
23
Operations on Discrete Time
Signals
Fourier Transforms - Continuous Signal
( ) ( ) ( ) ( )
} }

= = df e f X t x dt e t x f X
ft j ft j t t 2 2
,
(CFT) FT Time Continuous
Continuous in time and frequency domains
24
Operations on Discrete Time
Signals
Fourier Transforms - Discrete time signal
infinite length
( ) ( ) ( ) ( )
}

= =
0.5
5 . 0
2 2
(DTFT) FT time Discrete
df e f X n x e n x f X
nf j
n
nf j t t
Discrete in time domain, continuous and periodic in
freq. domain
Normalised frequency =frequency(Hz)/Sampling
Frequency(Hz) -0.5<f<0.5
25
Operations on Discrete Time
Signals
Fourier Transforms - Finite time domain
sequence
( ) ( ) ( )


=

= =
1
0
2
1
0
2
1
) (
length sample Assume - (DFT) FT Discrete
N
k
N
nk
j
N
n
N
nk
j
e k X
N
n x e n x k X
N
t t
Discrete in time and frequency domains
Efficient version of DFT - Fast Fourier Transform
(FFT)
26
Operations on Discrete Time
Signals
Convolution
( ) ( )
( ) ( ) ( )


=
=
k
k h k n x n y
d h t x t y
Signal Time Discrete
) (
signal time Continuous
t t t
h(k) = discretised system impulse response
27
Operations on Discrete Time
Signals
Basically two types of digital filters
FIR - Finite Impulse Response
IIR - Infinite Impulse Response

x(n) = input
signal
y(n) = filtered
output signal
Digital Filter
28
Operations on Discrete Time
Signals
Filtering - Discrete time signals
Finite Impulse Response (FIR)
( )
( ) ) 1 ( ) 1 ( ... ) 1 ( ) 1 ( ) ( ) 0 (
) ( ) (
1
0
+ + + + =
=

=
N k x N h k x h k x h k y
m k x m h k y
N
m
29
FIR Filter Example
Low Pass Filter
moving average based on 5 samples
( )
T
h
k x k x k x k y
] 2 . 0 2 . 0 2 . 0 2 . 0 2 . 0 [
h * x y
or
) 4 ( ... ) 1 ( ) ( 2 . 0 ) (
=
=
+ + + =
30
FIR Filter Example Low Pass
Filter
Simple sinusoid with random noise
0 20 40 60 80 100
-1
-0.5
0
0.5
1
1.5
2
Sample Number
x
(
k
)

0 20 40 60 80 100 120
-4
-2
0
2
4
6
8
10
Sample Number
y
(
k
)

Raw Signal
Filtered Signal
5 point moving
average
31
Infinite Impulse Response (IIR)
Filter
Designed to have characteristics of analog
filters
Butterworth, Chebyshev, etc
( )
) 1 ( ... ) 2 ( ) 1 (
) 1 ( ... ) 1 ( ) (
2 1
1 1 0
+
+ + + + =

N n y a n y a n y a
M n x b n x b n x b n y
N
M
Function of previous output samples and present and past
input samples
32
Discrete Time signal operations
Filtering reference
Oppenheim & Schafer, Discrete-Time Signal
Processing, Prentice-Hall, 1989
Other issues eg aliasing will be dealt with in
lecture 3
33
The Z Transform
Z transform has similar role in discrete time
systems to that of Laplace transforms in
analog systems
( ) ( ) { }
( ) { } ( )

= =
=
0 k
k
z k x k x Z
t x Z z X
One sided Z transform
34
The Z Transform

( ) ( ) { }
( ) { } ( )

= =
=
k
k
z k x k x Z
t x Z z X
Two sided Z transform
We will mainly deal with the one sided Z Transform
We will use k to indicate a sequence index where the
sequence is not necessarily time based, kT when it is
35
Region of Convergence (ROC)
The operator z is a complex variable
the Z transform is basically a series which
will converge to a finite value within a
region which may only be part of the
complex z plane
Region of convergence
36
Z Transform of Unit Step
Function

( ) { }
... 1
) (
otherwise 0
0 1
function step unit time Discrete
3 2 1
0
0
+ + + + = =
=

>
=


z z z z
z kT u kT u Z
kT
u(kT)
k
k
k
k
37
Z Transform of Unit Step
Function

( ) { }
1 is ROC
1 if
1 1
1
... 1
1
3 2 1
>
>

=
+ + + + =


z
z
z
z
z
z z z kT u Z
38
Z Transform of Unit Ramp
Function

( )

>
=
0
0 kT kT
kT x
( )


=

= =
0 0 k
k
k
k
kz T kTz z X
39
Z Transform of Unit Ramp
Function

( )
( )
( )
( )
2
2
1
1
3 2 1
0 0
1
1
... 3 2

= + + + =
= =


z
Tz
z
Tz
z z z T
kz T kTz z X
k
k
k
k
40
Z Transform of Polynomial
Function a
k


( )

>
=
otherwise 0
0 k a
k x
k
( )
+ + + =
=

2 2 1
0
1 z a az
z a z X
k
k k
41
Z Transform of Polynomial
Function a
k


( )
X z az a z
az
z
z a
= + + +
=

1
1
1
1 2 2
1
...
42
Z Transform of an Exponential
Function

( )
x kT
e k
akT
=
>

0
0 otherwise
( ) ( )
X z x k z e z
k
k
akT k
k
= =


0 0
43
Z Transform of an Exponential
Function

( )
( )
X z e z
X z e z e z
e z
akT k
k
aT aT
aT
=
= + + +
=

0
1 2 2
1
1
1
1
...
44
Z Transform of an Exponential
Function

( )
X z
e z
z
z e
aT aT
=


1
1
1
45
Z Transform of a Sinusoidal
Function

( )
x kT
kT kT
=
>

sine 0
0 otherwise
| |
( )
Recall
sine
e e
e e
kT=
j
e e
X z
j
e z e z
j kT j kT
j T j T
1
2
1
2
1
1
1
1
1 1


46
Z Transform of a Sinusoidal
Function

( )
( )
( )
( )
X z
j
e z e z
X z
j
e e z
e e z z
j T j T
j T j T
j T j T
=

(
=

+ +

(
(



1
2
1
1
1
1
1
2
1
1 1
1
1 2
e e
e e
e e
47
Z Transform of a Sinusoidal
Function

( )
( )
( )
( )
X z
j
e e z
e e z z
X z
z T
z T z
j T j T
j T j T
=

+ +

(
(
=
+


1
2
1
1 2
1
1 2
1
1 2
e e
e e
e
e
sin
cos
48
Z Transform of a Sinusoidal
Function

( )
( )
X z
z T
z T z
X z
z T
z z T
=
+
=
+


1
1 2
2
1 2
2 1
sin
cos
sin
cos
e
e
e
e
49
Exercise
Find the Z transform of the cosine function
( )
x kT
kT kT
=
>

cose 0
0 otherwise
50
Exercise
Z transform of the cosine function
( )
X z
z z T
z z T
=

+
2
2
2 1
cos
cos
e
e
51
Z Transform Properties
Linearity (Superposition)
{ }
{ } { }
Z ax k by k aX z bY z
X z Z x k Y z Z y k
a b
( ) ( ) ( ) ( )
( ) ( ) , ( ) ( )
,
+ = +
= =
constants
Refer to text for proof
52
Z Transform Properties
Multiplication by a
k

( )
{ } ( )
Z a x k X a z
k
=
1
Refer to text for proof
53
Z Transform Properties
Shifting theorems
{ }
( ) { } ( )
( ) { } ( )
(

= +
=
=

1
0
) (
) ( ) ( If
n
k
k n
n
z kT x z X z nT t x Z
z X z nT t x Z
t x Z z X
Delay n samples
Advance n samples
54
Proof of Shifting Theorems
Delay Theorem
{ }
( ) { } ( )
( ) { } ( )
( )
To show Z x t nT z X z
Z x t nT x kT nT z
Z x t nT z x kT nT z
n
k
k
n k n
k
( ) ( ) =
=
=

0
0
55
Proof of Shifting Theorems
Delay Theorem
( ) { } ( )
( )
( ) { }

Let
Z x t nT z x kT nT z
m=k-n
Z x t nT z x mT z
n
k n
k
n m
m n
=
=

0
( )
56
Proof of Shifting Theorems
Delay Theorem
( ) { }
( ) { }
Z x t nT z x mT z
x mT m
Z x t nT z x mT z
n m
m n
n m
m
=
= <
=

=

( )
( ) ,
( )
Now 0 0
0
i.e. A causal
signal
57
Proof of Shifting Theorems
Delay Theorem
( ) { }
( ) { }
Z x t nT z x mT z
Z x t nT z X z
n m
m
n
=
=

=

( )
( )
0
58
Proof of Shifting Theorems
Advance Theorem
( ) { } ( )
( ) { } ( )
To show
Z x t nT z X z x kT z
Z x t nT x kT nT z
n k
k
n
k
k
+ =

(
+ = +

( )
0
1
0
59
Proof of Shifting Theorems
Advance Theorem
( ) { } ( )
( )
( )
Z x t nT x t nT z
z x kT nT z
k
k
n
k n
k
+ = +
= +

+
=

0
0
60
Proof of Shifting Theorems
Advance Theorem
( ) { }
( )
( )
( )
( )
Z x t nT z
x kT nT z x kT z
x kT z
n
k n
k
k
k
n
k
k
n
+ =
+ +

(
(
(
(
+
=

0 0
1
0
1
61
Proof of Shifting Theorems
Advance Theorem
( ) { } ( ) ( )
( ) ( )
Z x t nT z x kT z x kT z
z x kT z x kT z
n k
k
k
k
n
n k
k
k
k
n
+ =

(
=



0 0
1
0 0
1
This step can be understood by substituting values for k =
0,1,2
62
Example
Define discretized unit step function


Find the Z transform of
( )

>
=
otherwise 0
0 1
1
k
kT
( ) ( ) 4 1 & 1 1 k k
1(kT) is the discretized version of the step function u(t)
63
Example

( ) { }
( ) { }
1
4
1
4
1
1
1
1
1 1
1
4 1
1 1
1
1 1

=
z
z
z
z k Z
z
z
z
z k Z
64
Example

( ) ( ) ( ) ( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
( ) ( )
( ) ( ) ( ) z X z Y z z Y
k x k y k y
k x x x x k y
k x x x x k y h x k y
k
h
=
=
+ + + =
+ + + = =

1
0
) 1 (
1 ... 2 1 0 ) 1 (
... 2 1 0
65
Example

( ) ( ) ( )
( ) ( ) z X
z
z Y
z X z Y z z Y
1
1
1
1

=
=
66
Complex Translation Theorem

( ) { } ( )
aT akT
ze X kT x e Z =

67
Example

{ } ( )
( )
2
1
1
1

= =
z e
z Te
ze X te Z
aT
aT
aT at
Note that the z-transform of the unit ramp is
( )
2
1
1
1
) (

=
z
Tz
t Z
68
Initial Value Theorem

( ) ( ) { } z X x
z
= lim 0
( ) ( ) ( ) ( ) ( )
obvious is result as limit taking
... 2 1 0
Proof
2 1
0

+ + + = =

z
z x z x x z k x z X
k
k
69
Final Value Theorem

( ) { } ( ) ( ) { } z X z k x
z k
1
1
1 lim lim


=
( ) { } ( ) ( ) { } ( )
( ) ( ) ( ) ( ) z X z z X z k x z k x
z k x k x Z z k x k x Z
k
k
k
k
k
k
k
k
1
0 0
0 0
1
1 1 ,
Proof

=
= =


Used to define steady-state performance of system.
70
Final Value Theorem

( ) ( ) ( ) ( )
( ) ( ) ( ) ( ) { } z X z z k x z k x
z X z z X z k x z k x
z
k
k
k
k
z
k
k
k
k
1
1
0 0
1
1
0 0
1 lim 1 lim
limits taking
1
(cont.) Proof

=
)
`


=


71
Final Value Theorem

( ) ( ) ( ) ( ) { }
( )
( ) ( ) | | | | | | | |
( ) ( ) { } k x x
x x x x x x k x k x
k k x
z X z z k x z k x
k
z
k
k
k
k
z

= =
+
+ + =
< =
=
)
`


lim
...
) 1 ( ) 2 ( ) 0 ( ) 1 ( ) 1 ( ) 0 ( 1
becomes LHS 0 , 0 that Assuming
1 lim 1 lim
(cont.) Proof
0 k
1
1
0 0
1
72
Final Value Theorem

( ) { } ( ) ( ) { } z X z k x
z k
1
1
1 lim lim
(cont.) Proof


=
73
Inverse Z Transform
Four Methods
Direct Division
Computational
Partial Fraction Expansion
Inversion Integral
( ) ( )
( ) ( )
n
m
p z p z
z z z z b
z X


=
...
...
) ( Assume
1
1 0
X(z) = ratio of two polynomials in z
74
Direct Division
Divide denominator polynomial into
numerator polynomial to get series of form
( ) ... ) 2 ( ) ( ) 0 (
2 1
+ + + =

z T x z T x x z X
75
Example

( )
( )( ) 2 . 0 1
5 10

+
=
z z
z
z X
( )
2 1
2 1
2 . 0 2 . 1 1
5 10


+
+
=
z z
z z
z X
76
Example

( )
2 1
2 1
2 . 0 2 . 1 1
5 10


+
+
=
z z
z z
z X
1-1.2z
-1
+0.2z
-2

10z
-1
+5z
-2

10z
-1

10z
-1
-12z
-2
+2z
-3

17z
-2
-2z
-3

77
Example

1-1.2z
-1
+0.2z
-2

10z
-1
+5z
-2

10z
-1
+17z
-2

10z
-1
-12z
-2
+2z
-3

17z
-2
-2z
-3

17z
-2
-20.4z
-3
+3.4z
-4

18.4z
-3
-3.4z
-4

78
Example

1-1.2z
-1
+0.2z
-2

10z
-1
+5z
-2

10z
-1
+17z
-2
+18.4z
-3

10z
-1
-12z
-2
+2z
-3

17z
-2
-2z
-3

17z
-2
-20.4z
-3
+3.4z
-4

18.4z
-3
-3.4z
-4

18.4z
-3
-22.08z
-4
+3.86z
-5

18.68z
-4
-3.68z
-5

79
Computational Method
MATLAB filter command
determine response to Kronecker delta input
delta function for discrete time systems
( )

=
=
otherwise 0
0 1 k
k x
80
Computational Method
MATLAB filter command
( )
) , , (
....] 1 [ ....], [ Form
... 1
...
) ( Let
otherwise 0
0 1
2 1 2 1 0
2
2
1
1
2
2
1
1 0
x den num f ilter g
a a den b b b num
z a z a
z b z b b
z G
k
k x
=
= =
+ + +
+ + +
=

=
=


81
Computational Method
Difference Equation Approach based on
delay theorem
Example
( ) ( )
2 1 2 1
2 1
2 1
3393 . 0 4673 . 0 ) ( 6607 . 0 5357 . 1 1 ) (
6607 . 0 5357 . 1 1
3393 . 0 4673 . 0
) (
) (
) (
input delta Kronecker assume Again



= +
+

= =
z z z X z z z Y
z z
z z
z X
z Y
z G
82
Computational Method
Difference Equation Approach - Example
( ) ( )
) 2 ( 3393 . 0
) 1 ( 4673 . 0 ) 2 ( 6607 . 0 ) 1 ( 5357 . 1 ) (
) ( 3393 . 0
) ( 4673 . 0 ) ( 6607 . 0 ) ( 5357 . 1 ) (
3393 . 0 4673 . 0 ) ( 6607 . 0 5357 . 1 1 ) (
2
1 2 1
2 1 2 1

= +

= +
= +



k x
k x k y k y k y
z X z
z X z z Y z z Y z z Y
z z z X z z z Y
83
Computational Method
Difference Equation Approach - Example
1 ) 0 ( , 4673 . 0 ) 1 (
0 ) 0 (
) 2 ( 3393 . 0
) 1 ( 4673 . 0 ) 2 ( 6607 . 0 ) 1 ( 5357 . 1 ) (
= =
=

= +
x y
y
k x
k x k y k y k y
84
Partial Fractions
Similar to technique used with Laplace
( )
( )( ) ( )
residues
... ) (
: as expand & origin) at appears zero a if z by (divide
...
) (
2
2
1
1
2 1
=

+ +

=

=
i
n
n
n
a
p z
a
p z
a
p z
a
z X
p z p z p z
z N
z X
85
Partial Fractions
Calculation of residues
( ) ( ) | |
i
p z
i i
z X p z a
=
=
Double order pole
( )
( )
( )
( ) | | ( ) | |
i
i
p z
i
p z
i
i
i
z X p z
dz
d
c z X p z c
p z
c
p z
c
z X
=
=
)
`

= =

=
) ( , ) (
2
2
2
1
2
2
1
86
Example
Inverse Z transform of
( )
( )
( )( )
( ) ( )
( )( )
aT aT
aT
aT
aT
e z z e z z
e
z
z X
z
e z z
z e
z X

=


=


=
1
1
1
1
1
by divide - origin at Zero
1
1
87
Example

( )
( )
akT
aT
aT
aT
e
z e
Z
z
Z
z e z
z X
e z z z
z X

=
)
`

=
)
`

=
1
1
1
1
1 1
1
1
, 1
1
1
1
1
1
1
1
1
1
x(kT)=1 - e
-akT

88
Inversion Integral

{ }
}

= = =
C
k
k
dz z z X
j
kT x k x z X Z
z z X
z
1 1
1
) (
2
1
) ( ) ( ) (
then it, inside lie ) ( of poles the
all such that origin centre plane in the circle a be C Let
t
89
Inversion Integral

( ) { }
1
1
2 1
1
) ( lim
) ( of pole of residue
, ... ) (
) ( of residues of in terms computed be easily Can

=
=
+ + + =
k
i
z z
i
k
i i
m
k
z z X z z K
z z X z K
K K K k x
z z X
i
( )
( ) ( ) | |
1
1
1
lim
! 1
1
order pole Mutiple

=
k
q
i
q
q
z z
i
z z X z z
dz
d
q
K
q
i
90
Example

( )
( )
( )( )
aT
aT
e z z
e z
z X



=
1
1
of Transform Z
inverse the find method integral inversion the Using
91
Example

( )
( )
( )
( )( )
1
1
1
1 lim
1 at pole of residue
pole each at of residues the are , where , ) (
1
1
1
2 1 2 1
=
)
`



=
= =
+ =

aT
aT k
z
k
e z z
e z
z
z K
z X z
K K K K k x
92
Example

( )
( )
( )( )
akT
aT
aT k
z
aT
e
e z z
e z
z
e z K

=
)
`



=
= =
1
1
1 lim
at pole of residue
1
2
( )
akT
e K K kT x

= + = 1
2 1
93
Next Week
Solution of Difference Equations & Z
Transform examples
Impulse sampling,
signal reconstruction - aliasing
Pulse Transfer Functions
Realization of Digital filters and controllers
Ref. - Ogata Chapter 3

S-ar putea să vă placă și