7/31/2025 Dr.
Adel Rawea
Digital Control Systems
DCS SANA’A UNIVERSITY DR. ADEL RAWEA
Disturbance Inputs
𝑪𝒐𝒎𝒎𝒂𝒏𝒅 𝒊𝒏𝒑𝒖𝒕 Controlled
(Desired Plant 8, 10 ,12 bits
Behavior) Computer Final Plant Output
ADC DAC Control
Element G(z)
Clock
Sensor
FB
Microcontroller
DCS SANA’A UNIVERSITY DR. ADEL RAWEA
1 Dr Adel Rawea
7/31/2025 Dr. Adel Rawea
The z-Transforms
3
DCS SANA’A UNIVERSITY DR. ADEL RAWEA
THE Z-TRANSFORMS – THE SAMPLING THEOREM
❑ Analog-to-Digital Conversion
An anti-aliasing filter and a
sample-and-hold circuit are two
functions typically found in a
digital signal processing system.
The sample-and-hold function
does two operations, the first of
which is sampling. Sampling is the
process of taking a sufficient
number of discrete values at
points on a waveform that will
define the shape of the waveform.
Sampling converts an analog
signal into a series of impulses,
DCS DR. ADEL RAWEA
2 Dr Adel Rawea
7/31/2025 Dr. Adel Rawea
THE Z-TRANSFORMS – THE SAMPLING THEOREM
❑ The Sampling Theorem
Notice in last Figure that there are two input waveforms. One is the analog signal and
the other is the sampling pulse waveform. The sampling theorem states that, in order
to represent an analog signal, the sampling frequency, 𝒇𝒔𝒂𝒎𝒑𝒍𝒆 , must be at least twice
the highest frequency component 𝒇𝒂(𝒎𝒂𝒙) of the analog signal. Another way to say this
is that the highest analog frequency can be no greater than one-half the sampling
frequency. The frequency
𝒇𝒂(𝒎𝒂𝒙) is known as the Nyquist frequency and is expressed in next Equation. In
practice, the sampling frequency should be more than twice the highest analog
frequency
DCS DR. ADEL RAWEA
THE Z-TRANSFORMS – THE SAMPLING THEOREM
❑ Holding the Sampled Value
DCS DR. ADEL RAWEA
3 Dr Adel Rawea
7/31/2025 Dr. Adel Rawea
THE Z-TRANSFORMS – THE PHYSICAL SIGNIFICANCE OF Z AND S
There is some similarity between the significance of s and significance of z
SIGNIFICANCE OF S SIGNIFICANCE OF Z
✓ 𝒔 − 𝒅𝒊𝒇𝒇𝒆𝒓𝒆𝒏𝒕𝒊𝒂𝒕𝒊𝒐𝒏 ✓ 𝒛 − 𝒂𝒅𝒗𝒂𝒏𝒄𝒆𝒅 𝒊𝒏 𝒕𝒊𝒎𝒆 𝒃𝒚 𝑻
𝟏 𝟏
✓ − 𝒊𝒏𝒕𝒆𝒈𝒓𝒂𝒕𝒊𝒐𝒏 ✓ − 𝒅𝒆𝒍𝒂𝒚 𝒊𝒏 𝒕𝒊𝒎𝒆 𝒃𝒚 𝑻
𝒔 𝒛
DCS DR. ADEL RAWEA
THE Z-TRANSFORMS – THE PHYSICAL SIGNIFICANCE OF Z AND S
■ Analog controller computes u(t) from e(t) using differential equations.
■ Digital controller computes u(kT) from e(kT) using difference equations.
■ To interface the computer controller to the “real world” we need an analog-to-digital
converter (to measure analog signals) and digital-to-analog converter (to output signals).
DCS DR. ADEL RAWEA
4 Dr Adel Rawea
7/31/2025 Dr. Adel Rawea
THE Z-TRANSFORMS – THE PHYSICAL SIGNIFICANCE OF Z AND S
■ Sampling and outputting usually done synchronously, at a constant rate. If sampling
period = T, frequency f = 1/T .
■ The signals inside the computer (the sampled signals) are noted as y(kT), or simply y [k].
y[k] is a discrete-time signal, where y(t) is a continuous-time signal.
■ Discrete-time signals are usually converted to continuous-time signals using a zero-order
hold (ZoH):
e.g., to convert u [k] to u(t).
DCS DR. ADEL RAWEA
DIGITIZATION
Continuous-time controllers are designed with Laplace-transform techniques. The
resulting controller is a function of “s”.
So, “s” is a derivative operator. There are several ways of approximating this in discrete
time. We look at one now called the
“forward rectangular” rule.
If T is small,
DCS DR. ADEL RAWEA
5 Dr Adel Rawea
7/31/2025 Dr. Adel Rawea
DIGITIZATION
Example: consider
DCS DR. ADEL RAWEA
DIGITIZATION
Note that we often re-index the difference equation to be in more familiar terms of “k”
instead of “k + 1”
Present output of digital controller u[k] depends on:
1- previous output u[k - 1] as well as the
2- previous and current errors e[k - 1] and e[k].
Rule of thumb: Sampling frequency must be ≈ 30 times the bandwidth of the analog
system for comparable performance.
DCS DR. ADEL RAWEA
6 Dr Adel Rawea
7/31/2025 Dr. Adel Rawea
DIGITIZATION (Real-Time Controller Implementation)
x = 0. (initialization of “past” values for first loop through)
Define constants:
𝜶𝟏 = 𝟏 − 𝒃𝑻
𝜶𝟐 = 𝒌𝟎(𝒂𝑻 − 𝟏)
READ A/D to obtain y[k] and r[k].
𝒆[𝒌] = 𝒓[𝒌] − 𝒚[𝒌]
𝒖[𝒌] = 𝒙 + 𝒌𝟎𝒆[𝒌]
OUTPUT u[k] to D/A and ZOH.
Now compute x for the next loop through:
𝒙 = 𝜶𝟏𝒖[𝒌] + 𝜶𝟐𝒆[𝒌]
Go back to “READ” when T seconds have elapsed since last READ.
DCS DR. ADEL RAWEA
DIGITIZATION (EXAMPLE)
Choose to try a sample rate of 20 Hz and also try 40 Hz
Use next formula to digitize D(s)
DCS DR. ADEL RAWEA
7 Dr Adel Rawea
7/31/2025 Dr. Adel Rawea
DIGITIZATION (EXAMPLE)
DCS DR. ADEL RAWEA
DIGITIZATION (EXAMPLE)
DCS DR. ADEL RAWEA
8 Dr Adel Rawea
7/31/2025 Dr. Adel Rawea
THE Z-TRANSFORMS – Definition of the z-transform
In the Analog Control Systems we saw that the Laplace transform is a very powerful tool
for analysis and design of analog control systems. And
The last lecture we have seen z-transform for discrete-time (digital) control systems, as:
■ Like the Laplace-transform variable “s,” the z-transform variable “z” is a complex
number.
DCS DR. ADEL RAWEA
REVIEW OF SOME IMPORTANT Z-TRANSFORMS:
DCS DR. ADEL RAWEA
9 Dr Adel Rawea
7/31/2025 Dr. Adel Rawea
REVIEW OF SOME IMPORTANT Z-TRANSFORMS:
DCS DR. ADEL RAWEA
REVIEW OF SOME IMPORTANT Z-TRANSFORMS:
DCS DR. ADEL RAWEA
10 Dr Adel Rawea
7/31/2025 Dr. Adel Rawea
PROPERTIES OF Z- TRANSFORM
DCS DR. ADEL RAWEA
PROPERTIES OF Z- TRANSFORM
8.
DCS DR. ADEL RAWEA
11 Dr Adel Rawea
7/31/2025 Dr. Adel Rawea
PROPERTIES OF Z- TRANSFORM (Examples)
1- Linearity:
Then:
DCS DR. ADEL RAWEA
PROPERTIES OF Z- TRANSFORM (Examples)
2- Right shift in time (delay)
Suppose x[k] X (z), and q is a positive integer.
DCS DR. ADEL RAWEA
12 Dr Adel Rawea
7/31/2025 Dr. Adel Rawea
MULTIPLICATION BY 𝒄𝒐𝒔[𝝎𝒌] AND 𝒔𝒊𝒏[𝝎𝒌]
Multiply a time sequence 𝒙[𝒌] by 𝒄𝒐𝒔[𝝎𝒌] or 𝒔𝒊𝒏[𝝎𝒌]
Recall from Euler’s theorem
So,
DCS DR. ADEL RAWEA
MULTIPLICATION BY 𝒄𝒐𝒔[𝝎𝒌] AND 𝒔𝒊𝒏[𝝎𝒌] (Example)
Find the z-transform of 𝒙[𝒌] = 𝒄𝒐𝒔[𝝎𝒌] × 𝟏[𝒌]
Recall that 𝟏[𝒌]
DCS DR. ADEL RAWEA
13 Dr Adel Rawea
7/31/2025 Dr. Adel Rawea
TRANSFER FUNCTION OF SYSTEMS IN Z- TRANSFORM
Many discrete-time systems are described by Linear Constant Coefficient Difference
Equations (LCCDEs). These are of the form
where n > m.
- We can find the transfer function of this system by taking the z-transform of both
sides of this equation.
- System transfer functions always assume zero initial conditions, so we can use Delay
Theorem.
DCS DR. ADEL RAWEA
OUTPUT IN Z- TRANSFORM (Example)
Find the output of a system described by difference equation:
Where:
x[k] = 1[k] and
y[-1] = 6
DCS DR. ADEL RAWEA
14 Dr Adel Rawea
7/31/2025 Dr. Adel Rawea
OUTPUT IN Z- TRANSFORM (Example)
There are initial conditions, so we use Delay Theorem (8)
DCS DR. ADEL RAWEA
LAPLACE INVERSE
❑ If you have the Transfer Function F(s) as:
𝒔𝟐 +𝟐𝒔+𝟑
𝑭(𝒔) = In Laplace domain there are 3 pols in the left side
𝒔+𝟏 𝟑
𝑨 𝑩 𝑪 𝑨 𝒔+𝟏 𝟐 +𝑩(𝒔+𝟏)+𝑪
𝑭 𝒔 = + + =
(𝒔+𝟏) 𝒔+𝟏 𝟐 𝒔+𝟏 𝟑 𝒔+𝟏 𝟑
⇒ 𝒔𝟐 +𝟐𝒔 + 𝟑 ≡ 𝑨 𝒔 + 𝟏 𝟐
+ 𝑩 𝒔 + 𝟏 + 𝑪 ⇒ 𝑪 = 𝟐 𝒃𝒚 𝒖𝒔𝒊𝒏𝒈 𝒔 = −𝟏
𝒅 𝒅
(𝒔𝟐 + 𝟐𝒔 + 𝟑) ≡ 𝒅𝒔 (𝑨 𝒔 + 𝟏 𝟐
+ 𝑩 𝒔 + 𝟏 + 𝑪))
𝒅𝒔
⇒ 𝟐𝒔 + 𝟏 ≡ 𝟐𝑨 𝒔 + 𝟏 ⇒ 𝑩 = 𝟎 , 𝒃𝒚 𝒖𝒔𝒊𝒏𝒈 𝒔 = −𝟏 𝒂𝒏𝒅 𝑨 = 𝟐
𝟏 𝟐
∴𝑭 𝒔 = + 𝟑
(𝒔 + 𝟏) 𝒔+𝟏
𝒇 𝒕 = 𝑳−𝟏 𝑭 𝒔 = 𝒖 𝒕 [𝒆−𝒕 + 𝒕𝟐 𝒆−𝒕 ]
DCS DR. ADEL RAWEA
15 Dr Adel Rawea
7/31/2025 Dr. Adel Rawea
Z- TRANSFORM OF A FUNCTION EXPRESSED AS A LAPLACE TRANSFORM
❑ If you have the Transfer Function F(s) as:
𝟏
𝑭(𝒔) = In Laplace domain
𝒔+𝒂 𝟐
𝒇 𝒕
𝒇 𝒕 = 𝑳−𝟏 𝑭 𝒔 = 𝒖 𝒕 [𝒕 𝒆−𝒂𝒕 ]
𝒇∗ 𝒕 = 𝒇 𝒏𝑻 = 𝒏𝑻𝒆−𝒂𝒏𝑻
∞
𝑭 𝒛 = 𝒏𝑻𝒆−𝒂𝒏𝑻 𝒛−𝒏
𝒏=𝟎
−𝒂𝑻 −𝟏
= 𝑻𝒆 𝒛 + 𝟐𝑻𝒆−𝟐𝒂𝑻 𝒛−𝟐 + 𝟑𝑻𝒆−𝟑𝒂𝑻 𝒛−𝟑 + ⋯
= 𝑻(𝒆−𝒂𝑻 𝒛−𝟏 + 𝟐𝒆−𝟐𝒂𝑻 𝒛−𝟐 + 𝟑𝒆−𝟑𝒂𝑻 𝒛−𝟑 + ⋯ )
⇒ 𝒂 = 𝟏 𝒂𝒏𝒅 𝒓 = 𝒆−𝒂𝑻 𝒛−𝟏
𝒆−𝒂𝑻 𝒛−𝟏 𝒛𝟐 𝒆−𝒂𝑻 𝒛
𝑭 𝒛 =𝑻 𝟐 ∗ =𝑻
𝟏−𝒆−𝒂𝑻 𝒛−𝟏 𝒛𝟐 𝒛−𝒆−𝒂𝑻 𝟐
DCS DR. ADEL RAWEA
OUTPUT IN Z- TRANSFORM (Example)
𝟏
❑ IF YOU HAVE THE TRANSFER FUNCTION 𝑭 𝒔 = FIND 𝑭 𝒛 :
𝒔𝟐 +𝟓 𝒔+𝟔
𝑳−𝟏 𝒁−𝒕𝒓𝒂𝒏𝒔
𝑭 𝒔 𝒇(𝒕) 𝑭 𝒛
𝟏 𝑨 𝑩 𝑨 𝒔 + 𝟑 + 𝑩(𝒔 + 𝟐)
𝑭 𝒔 = = + =
𝒔 + 𝟐 (𝒔 + 𝟑) 𝒔+𝟐 𝒔+𝟑 𝒔 + 𝟐 (𝒔 + 𝟑)
⇒ 𝑨 𝒔+𝟑 +𝑩 𝒔+𝟐 = 𝟏
𝑩 = −𝟏 𝒘𝒉𝒆𝒏 𝒔 = −𝟑 𝒂𝒏𝒅 𝑨 = 𝟏 𝒘𝒉𝒆𝒏 𝒔 = −𝟐
𝟏 𝟏 𝑳−𝟏
∴𝑭 𝒔 = − 𝒇 𝒕 = 𝒆−𝟐𝒕 − 𝒆−𝟑𝒕 → 𝒇 𝒏𝑻 = 𝒆−𝟐𝒏𝑻 − 𝒆−𝟑𝒏𝑻
𝒔+𝟐 𝒔+𝟑
∞
𝑭 𝒛 = 𝒇(𝒏𝑻) 𝒛−𝒏 = 𝟎 + 𝒆−𝟐𝑻 𝒛−𝟏 − 𝒆−𝟑𝑻 𝒛−𝟏 + 𝒆−𝟒𝑻 𝒛−𝟏 − 𝒆−𝟔𝑻 𝒛−𝟏 + ⋯
𝒏=𝟎
𝒛 𝒛 𝒛 𝒛 − 𝒆−𝟑𝑻 − 𝒛 𝒛 − 𝒆−𝟐𝑻 𝒛(𝒆−𝟐𝑻 − 𝒆−𝟑𝑻 )
𝑭 𝒛 = − = = 𝟐
𝒛 − 𝒆−𝟐𝑻 𝒛 − 𝒆−𝟑𝑻 𝒛 − 𝒆−𝟐𝑻 𝒛 − 𝒆−𝟑𝑻 𝒛 − 𝒛 𝒆−𝟐𝑻 − 𝒆−𝟑𝑻 + 𝒆−𝟓𝑻
DCS DR. ADEL RAWEA
16 Dr Adel Rawea
7/31/2025 Dr. Adel Rawea
DCS SANA’A UNIVERSITY DR. ADEL RAWEA
17 Dr Adel Rawea