Professional Documents
Culture Documents
Computer Controlled System: Examiner: DR Paul Wen
Computer Controlled System: Examiner: DR Paul Wen
ELE3105/70520
Controller Plant
1.1 Introduction
Computer controlled system
GHP(z)
M(z) Y(z)
E(z)
R(z) Gc(z) ZOH GP(s)
A/D D/A
time Time kT
f(t) f(kT)
A/D
time Time kT
1.3 ADC and DAC
f(kT)
f(kT)
D/A
Time kT
Time kT
D/A is used as a ZOH.
1.3 ADC and DAC
ADC
Output Output
Input
ADC
Digital
Analog
Input
• Have a discrete number of quantization levels
• Number of levels L=2N, where N is the number of bits
• eg N=3 bits, L=23=8 levels
1.3 ADC and DAC
ADC
Bits Level Signal Error
1 2 5 5/2=2.5
2 4 5 5/4=1.25
3 8 5 5/8=0.625
4 16 5 5/16=0.3125
1.3 ADC and DAC
ADC
More bits more accuracy. The commonly
used ADC has
• 8-bits: L=28=256 (coarse)
• 10-bits: L=210=1024 (adequate)
• 12-bits: L=212=4096 (works well)
• 16-bits: L=216=65536 (almost overkill)
1.3 ADC and DAC
ADC
• Distances between sequential levels are the
same. eg 5v/28=0.0195v
• The weight of each bit is different. The
most significant bit is the most left bit and
the least significant bit is the most right bit.
2N-1 20
Analog Input
Digital
Example: For N=8 and the signal is from 0 to 5, find
the output value for the number 145.
Solution:5/255=x/145, x=5*145/255=2.8431=2.84
1.3 ADC and DAC
MUX AD
Digital
signal Status Control
Analog signal
Multi-channel A/D converter
1.3 ADC and DAC
Control
…
Analog
DA MUX signals
Digital signals
Multi-channel D/A converter
1.4 Errors
ADC Output
Errors
Input
1.4 Errors
• The quantization error or resolution error is the
difference between the analog input value and the
equivalent digital value. On average it is one half
of the LSB.
• Linearity error: the maximum deviation in step
size from ideal step size, expressed as a percentage
of full scale.
• Settling time: the time it takes for the output to
reach within +/- half of the step size of the final
output.
1.4 Errors
Gain error
Output Output
Input
ADC
Digital
Analog
Input
1.5 Sampling theorem
f(t) f(kT)
Sampling
time Time kT
f(t) f(kT)
A/D
time Time kT
1.5 Sampling theorem
5 5
4 4
3 3
2 2
1 1
0 0
-1 -1
-2 -2
-3 -3
-4 -4
-5 -5
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
4 4
3 3.5
2
3
1
2.5
0
-1 2
-2
1.5
-3
1
-4
0.5
-5 0 1 2 3 4 5 6 7 8 9 10
0 1 2 3 4 5 6 7 8 9 10
1.5 Sampling theorem
If we need the sampled data to keep all the features
of the original signal, what is the minimum
sampling frequency?
Or what conditions should we meet if we wish that
the sampled data can represent the original data
exactly?
The answer to the above question forms the
Sampling theorem/Shannon’s sampling
theorem/Shannon’s theorem.
1.5 Sampling theorem
A continuous-time signal f(t) with a finite
bandwidth 0 (the highest frequency
component in the signal, or the Nyquist
frequency) can be uniquely described by the
sampled signal f(kT){k=…,-1,0,1….}, when the
sampling frequency s is greater than 20.
In other words, if a signal is sampled twice faster
than its highest frequency component, the sampled
date can represent all the features of this signal.
1.6 The proven of sampling theorem
The proven is based on Fourier Transform
1. Fourier transform: A transformation from time
domain to frequency domain f(t) F(), where t
is time and is frequency.
For a continuous time function f(t), we can uniquely
find F(). If given F(), we can also unique
determine f(t).
It means that f(t) and F() are equivalent.
1.6 The proven of sampling theorem
f(t)
5
4
F()
3
2
Fourier
1
0
Transform
-1
-2
-3
0
-4
-0
-5
0 1 2 3 4 5 6 7 8 9 10
1.6 The proven of sampling theorem
2. For a sampled signal fs(t), we have
5
2
Fourier
1
Transform
0
-1
-2
-3
-4
-5
0 1 2 3 4 5 6 7 8 9 10
Fs()
4 F()
Fourier
3
-1 Transform
-2
-3
-4
-0 0
-5
0 1 2 3 4 5 6 7 8 9 10
4 Fs()
3
-1
-2
-4
-5
0 1 2 3 4 5 6 7 8 9 10
1.6 The proven of sampling theorem
4. If we change the sampling frequency, what will
happen with fs(t) and Fs().
5
4 Fs()
3
-1
-2
-4
-5
0 1 2 3 4 5 6 7 8 9 10
Fs()
3
-1
-2
-4
-5
0 1 2 3 4 5 6 7 8 9 10
1.6 The proven of sampling theorem
Fs()
5
3
-1
-2
-4
-5
0 1 2 3 4 5 6 7 8 9 10
1
Fs()
0
-1
-2
-4
-5
0 1 2 3 4 5 6 7 8 9 10
Fs()
4
3.5
2.5
1.5
0.5
1
0 1 2 3 4 5 6 7 8 9 10
-2s -s -0 0s 2s
1.6 The proven of sampling theorem
5. Conclusions
If our sampling frequency s is faster enough, that is
s>20, there will be gaps between the shifting
F() in Fs(). We can always put a filter to figure
out F() from Fs(). Otherwise if the repeating
F() figures overlap in Fs(), we cannot put a filter
to figure out F() from Fs(). The turning point
from possible to impossible is s =20, where 0 is
the highest frequency component or Nyquist
Frequency of the signal.
1.7 Aliasing
1. Aliasing problem
1
0. 8
0. 6
0. 4
0. 2
-0. 2
-0. 4
-0. 6
-0. 8
-1
0 10 20 30 40 50 60 70 80 90 100
0. 8
0. 6
0. 4
0. 2
-0. 2
-0. 4
-0. 6
-0. 8
-1
0 10 20 30 40 50 60 70 80 90 100
1.7 Aliasing
Ambiguity: alias
1
0. 8
0. 6
0. 4
0. 2
-0. 2
-0. 4
-0. 6
-0. 8
-1
0 10 20 30 40 50 60 70 80 90 100
0.8
0.6
0.4
0.2
-0. 2
-0. 4
-0. 6
-0. 8
-1
0 10 20 30 40 50 60 70 80 90 100
0.8
0.6
0.4
0.2
-0. 2
-0. 4
-0. 6
-0. 8
-1
0 10 20 30 40 50 60 70 80 90 100
1.7 Aliasing
2. Finding aliases
The fundamental alias frequency is given by
=| (0+ n)mod(s) - n|
where mod() means the remainder of an division operation,
0 is signal bandwidth, n Nyquist frequency, and s
sampling frequency
Example: For f0=90Hz & fs=100, find alias.
Solution: =2f, fn=fs/2=50Hz,
f=| (f0+ fn)mod(fs) - fn|=|(90+50)mod(100)-50|
=|40-50|=10Hz
1.7 Aliasing
3. Preventing aliases
Make sure your sampling frequency is greater
than twice of the highest frequency
component of the signal
• Pre-filtering
• Set your sampling frequency to the
maximum if possible
1.7 Aliasing
Textbook
• Chapter 1 : Introduction to discrete time
control system
• Chapter 3: pages 90-92 & 96-98.
Exercise
Exercise 1: The frequency spectrum of a continuous-time
signal is shown below.
1) What is the minimum sampling frequency for this signal
to be sampled without aliasing.
2) If the above process were to be sampled at 10 Krad/s,
sketch the resulting spectrum from –20 Krad/s to 20
Krad/s.
F()
Krad/s
-8 -4 4 8
Hints
The relationship between f(t) and fs(t), and F() and
Fs().
F()
5
3
Fourier
Transform
2
-1
-2
-3
0
-4
-0
-5
0 1 2 3 4 5 6 7 8 9 10
3
Fs()
2
-1
-2
-0-s
-3
-4
-5
0 1 2 3 4 5 6 7 8 9 10
-0-2s -0 0 + 0+2s
0-2s 0-s -0+s 0 s
-0+2s
Answers
f s 2 * 8 16 Krad / s
F()
2 4 6 8 10 12 14 16 18
Krad/s
Tutorial
Solution: 1) From the spectrum, we can see that the
bandwidth of the continuous signal is 8 Krad/s.
The Sampling Theorem says that the sampling
frequency must be at least twice the highest
frequency component of the signal. Therefore,
the minimum sampling frequency for this signal
is 2*8=16 Krad/s.
F()
Krad/s
-8 -4 4 8
Tutorial
2) Spectrum of the sampled signal is formed by
shifting up and down the spectrum of the
original signal along the frequency axis at i
times of sampling frequency. As s=10 Krad/s,
for i =0, we have the figure in bold line. For i=1,
we have the figure in bold-dot line.
F()
-8 -4 2 4 6 8 10 12 14 16 18
Krad/s
Tutorial
For I=-1, 2,… we have
F()
-18 -14 -8 -6 -4 -2 2 4 6 8 10 12 14 16 18
Krad/s
2 4 6 8 10 12 14 16 18
Krad/s