10/11/2023
Digital (Discrete-Time) Control Systems
E1541 Introduction to Digital Control Systems
Lec.#02
Prof. Dr. Walaa Gabr
Associate Prof. Dr. Omar Salim
Department of Electrical Engineering
Benha Faculty of Engineering
Benha University
Oct. 2023
Course Syllabus:-
1. Introduction
2. Spectrum analysis of sampling process
3. Signal reconstruction
4. Difference equation
5. The z-transform
6. Impulse transfer function
7. Mapping between s-plan and z-plan
8. Transient and steady state response analysis
9. Design based on root-locus
10.Design based on frequency response
11.Analytical design
2 12.Controllability & observability tests
1
10/11/2023
Lecture Agenda:-
Intro Recall “Overview on DCSs”
Structure of DCS
Digital Sampling and its types
Quantization
Intro. To Computer Control.
References
Analog to Digital Signal Conversion “Recall”
A digital signal is superior to an analog signal
because it is more robust to noise and can
easily be recovered, corrected and amplified. Continuous-time analog signal
For this reason, the tendency today is to
change an analog signal to digital data. Continuous-time quantized signal
Sampled data signal
4
Digital signal
2
10/11/2023
Structure of a DCS
Block diagram of a digital control system
showing signals in binary or graphic form
5
Digital Sampling ( Analog Signal Sampling)
3
10/11/2023
Sampling
Analog signal is sampled every TS secs (Ts is the sampling interval).
fs = 1/Ts is called the sampling rate or sampling frequency.
There are 3 sampling methods:
Ideal - an impulse at each sampling instant
Natural - a pulse of short width with varying amplitude
Flattop - sample and hold, like natural but with single amplitude value
Sampling Types
4
10/11/2023
Note
According to the Nyquist theorem, the
sampling rate must be
at least 2 times the highest frequency
contained in the signal.
Suppose the highest frequency component is fmax. According to the Nyquist Theorem,
the sampling rate must be at least 2fmax, or twice the highest analog frequency
component. If the sampling rate is less than 2fmax, some of the highest frequency
components in the analog input signal will not be correctly represented in the digitized
output. When such a digital signal is converted back to analog, false frequency
components appear that were not in the original analog signal. This undesirable
condition is a form of distortion called aliasing.
9
Nyquist Theorem
For lossless digitization, the sampling rate should be at least twice the
maximum frequency response.
In mathematical terms:
fs > 2fmax
where fs is sampling frequency and fmax is the maximum frequency in
the signal
10
10
5
10/11/2023
Recovery of a sampled sine wave for different sampling rates
11
11
Sampling of a clock with only one hand
12
12
6
10/11/2023
Analog-Digital Converter (ADC)
An electronic integrated circuit which converts a signal from analog (continuous) to
digital (discrete) form
Provides a link between the analog world of transducers and the digital world of signal
processing and data handling
t t
13
13
14
14
7
10/11/2023
ADC Conversion Process
Two main steps of process
1. Sampling and Holding (for Conversion Circuits delay)
2. Quantization and Encoding ( for data Transmission if needed)
Analog-to-Digital Converter
Quantizing
and
Encoding
Sampling and Hold
t
Input: Analog Signal t
15
15
ADC Process Sampling & Hold
Measuring analog signals at uniform time
intervals
Ideally twice as fast as what we are Continuous Signal
sampling
Digital system works with discrete states
Taking samples from each location
t
Reflects sampled and hold signal
Digital approximation
16
16
8
10/11/2023
Types of sample Timing:
Periodic Sampling
x x x x x
In this case the sampling instants
are equally spaced,
or tk = kT (k=0, 1, 2, …) 0 5 10 15 20
x x xx
Multiple-Order Sampling
In this case the sampling instants are not
equally spaced -1 0 9 10
17
17
Quantizing and Quantization Error
The process of representing a continuous or analog signal by a
finite number of discrete states is called amplitude quantization.
Quantizing means transforming a continuous or analog signal into
a set of discrete states.
18
18
9
10/11/2023
Quantization
Sampling results in a series of pulses of varying amplitude values
ranging between two limits: a min and a max.
The amplitude values are infinite between the two limits.
We need to map the infinite amplitude values onto a finite set of known
values.
This is achieved by dividing the distance between min and max into L
zones, each of height
= (max - min)/L
19
19
Quantization Level
The midpoint of each zone is assigned a value from 0 to L-1
(resulting in L values)
Each sample falling in a zone is then approximated to the value
of the midpoint.
20
20
10
10/11/2023
Quantization Zones and Encoding
Assume we have a voltage signal with amplitudes Vmin=-20V and Vmax=+20V.
We want to use L=8 quantization levels.
Zone width = [20 – (-20)]/8 = 5
The 8 zones are: -20 to -15, -15 to -10, -10 to -5, -5 to 0, 0 to +5, +5 to +10,
+10 to +15, +15 to +20
The midpoints are: -17.5, -12.5, -7.5, -2.5, 2.5, 7.5, 12.5, 17.5
Each zone is then assigned a binary code.
The number of bits required to encode the zones, or the number of bits per sample as it is
commonly referred to, is obtained as follows: nb = log2 L
Given our example, nb = 3
The 8 zone (or level) codes are therefore: 000, 001, 010, 011, 100, 101, 110, and 111
Assigning codes to zones:
000 will refer to zone -20 to -15
001 to zone -15 to -10, etc.
21
21
Quantization and encoding of a sampled signal
22
22
11
10/11/2023
23
23
24
24
12
10/11/2023
25
25
26
26
13
10/11/2023
27
27
28
28
14
10/11/2023
29
29
30
30
15
10/11/2023
Quantizing
Leftmost bit of the natural binary code has the most weight (one half of
the FS) – called MSB
Rightmost bit has the least weight (1/2ⁿ times the full scale) and is called
the least significant bit (LSB). Thus,
FSR
LSB =
2n
The least significant bit is the quantization level Q
31
31
Quantization Error.
A/D conversion involves quantization error. Such quantization error varies between
0 and ±½Q. This error depends on the fineness of the quantization level and can be
made as small as desired by making the quantization level smaller (that is, by
increasing the number of bits n)
• Above show a block diagram of a quantizer together with its input-output
characteristics. In numerical analysis the error resulting from neglecting the
remaining digits is called the round-off error. Since the quantizing process is an
approximating process in that the analog quantity is approximated by a finite
digital number, the quantization error is a round-off error.
32
32
16
10/11/2023
Data Acquisition, Conversion, And Distribution Systems
With the rapid growth in the use of digital computers to perform digital control ,
both the data-acquisition system and the distribution system have become an
important part of the entire control system. The signal conversion that takes place in
the digital control system involves the following operations:
1. Multiplexing and de-multiplexing
2. Sample and hold.
3. Analog-to-digital conversion (quantizing and encoding).
4. Digital-to-analog conversion (decoding)
33
33
Block diagram of a data-distribution system
Physical Low – Pass Analog A/D Sample To digital
Variable Transducer Amplifier Filter multiplexer Converter and Hold controller
(a)
- system
block diagram of a data acquisition
From D/A To
digital Register demultiplexer Converter Hold actuator
controller
(b)
A block diagram of a data-distribution system
34
34
17
10/11/2023
Computer Control
The output from the process y(t) is a continuous-time signal. The output is
converted into digital form by A/D converter. The A/D converter can be
included in the computer or regarded as a separate unit, according to one's
preference. The conversion is done at the sampling times, tk. The computer
interprets the converted signal, {y(tk)}, as a sequence of numbers, processes
the measurements using an algorithm, and gives a new sequence of
numbers, {u(tk)}.
35
35
References
TextBooks:
Katsuhiko Ogata, ‘Discrete-Time Control Systems,’ 2nd edition, 1994.
st
Digital control engineering, Analysis and design, M. Sam Fadali, 1 Edition 2009
Automatic control systems, Kuo
Lecture Notes:
Omar Salim, Ph.D. Lecture notes E 1541 (Mechatronics Since 2017)
Professor Walaa Gabr, Ph.D. Lecture Notes 2015 and 2016.
Omar Salim, Ph.D. Lecture notes for SYS674 Oakland University 2010.
Software Packages:
MATLAB Simulink, for Mathworks.
Web Sites:
https://en.wikipedia.org/wiki/Sampling_(signal_processing)
https://en.wikipedia.org/wiki/Quantization_(signal_processing)
36
36
18