Chapter2 Handout
Chapter2 Handout
Control Systems II
Discrete-Time Systems
Bilal Komati
Lebanese University
Faculty of Engineering - Branch III - Hadath
Department of Electrical and Electronics Engineering
Table of Contents
1 Digital Systems
2 Difference Equation
3 The z-Transform
4 Time response
5 Transfer Function
6 Sampling Theorem
7 Stability
Table of Contents
1 Digital Systems
2 Difference Equation
3 The z-Transform
4 Time response
5 Transfer Function
6 Sampling Theorem
7 Stability
1 x(t)
Continuous-time signals or analog
0.5 signals are defined for every value of
time.
t
−1 −0.5 0.5 1 Discrete-time signals are defined only
at certain specific values of time.
−0.5 (time instants need not to be
equidistant, but in practice they are
equally spaced).
−1
0.5 0.5
t t
−1 −0.5 0.5 1 −1 −0.5 0.5 1
−0.5 −0.5
−1 −1
Sampling
Sampling (Uniform)
taking samples of the analog signal every
T sec.
x(n) = xa (nT )
where:
−∞ < n < ∞ is an integer or n ∈ Z
T is the sampling time.
1
Fs = is the sampling rate
T How to select T or Fs ?
(samples/sec) or frequency (Hz).
Quantization
Quantization
It is the process of converting a discrete-time (DT), continuous-valued (CV) signal into a
digital signal by representing the continuous-valued signal by a finite set of discrete value levels.
Quantization
Discrete-time (DT) continuous-valued (CV) signal
Example x(n)
1
Consider the analog signal: x(n) = 0.9n
0.8 xa (t) = 0.9t
t
xa (t) = 0.9 , t≥0
0.6
After Sampling:
( 0.4
T =1 sec 0.9n , n≥0
−−−−−→ xn = 0.2 T
Fs =1 Hz 0, n<0
···
n
1 2 3 4 5 6 7 8
Quantization
Discrete-time (DT) continuous-valued (CV) signal Discrete-time (DT) discrete-valued (DV) signal (digital)
xmin and xmax : minimum and maximum values of x(n) xmax − xmin
∆=
xmax − xmin : dynamic range of the signal L−1
Discrete-Time Systems (ULFG) Control Systems II Fall 2021/2022 11 / 80
Digital Systems Difference Equation The z-Transform Time response Transfer Function Sampling Theorem Stability
Quantization
x(n) xq (n) xq (n) eq (n) = xq (n) − x(n)
n Discrete-time signal (Truncation) (Rounding) (Rounding)
x(t) = 0.9t 0 1 1.0 1.0 0.0
for t ≥ 0 1 0.9 0.9 0.9 0.0
2 0.81 0.8 0.8 −0.01
3 0.729 0.7 0.7 −0.029
T = 1sec 4 0.6561 0.6 0.7 0.0439
5 0.59049 0.5 0.6 0.00951
x(n) = 0.9n 6 0.531441 0.5 0.5 −0.031441
for n ≥ 0 7 0.4782969 0.4 0.5 0.0217031
8 0.43046721 0.4 0.4 −0.03046721
9 0.387420489 0.3 0.4 0.012579511
Linear Interpolation
Zero-Order-Hold (ZOH)
Discrete-Time Systems (ULFG) Control Systems II Fall 2021/2022 15 / 80
Digital Systems Difference Equation The z-Transform Time response Transfer Function Sampling Theorem Stability
Table of Contents
1 Digital Systems
2 Difference Equation
3 The z-Transform
4 Time response
5 Transfer Function
6 Sampling Theorem
7 Stability
Example
Consider the tank control system
H = steady-state fluid height in the tank
h = height perturbation from the nominal value
Q = steady-state flow rate through the tank
qi = inflow perturbation from the nominal value
q0 = outflow perturbation from the nominal value
It is necessary to maintain a constant fluid level H by adjusting the fluid flow rate into the
tank around Q.
Let qi be constant over each sampling period T –that is, qi (t) = qi (k) = constant for t in the
interval [k · T , (k + 1)T ]. Then we can solve the analog equation over any sampling period to
obtain
h(k + 1) = e −T /τ h(k) + R[1 − e −T /τ ]qi (k), k = 0, 1, 2, · · ·
where the variables at time kT are denoted by the argument k.
This is the desired discrete-time model describing the system with piecewise constant control.
Difference Equations
w(t)
Digital Controller
Disturbances r(kT ) ê(kT ) Digital u(kT ) D/A u(t) Plant y(t)
Continuous Controller +
− and
Controller G(s)
hold
r(t) e(t) u(t) Plant y(t)
+ Controller
− G(s)
ŷ(kT ) Clock
ŷ(t)
Sampler
Sensor Sensor
A/D
T ŷ(t) 1
1
v(t)
The fundamental differences between the two implementations are that the digital system
operates on samples of the sensed plant output rather than on the continuous signal and that
the dynamics represented by D(s) are implemented by algebraic recursive equations called
difference equations.
Discrete-Time Systems (ULFG) Control Systems II Fall 2021/2022 22 / 80
Digital Systems Difference Equation The z-Transform Time response Transfer Function Sampling Theorem Stability
Difference Equations
Consider the a controller to be implemented inside
a computer given by the transfer function: Euler’s method to approximate the
derivative
U(s) s +a δx
D(s) = = K0 ẋ = lim
E (s) s +b δt→0 δt
x(k + 1) − x(k)
First, find the differential equation that corresponds ẋ ∼
=
T
to D(s):
T = tk+1 − tk
(s + b)U(s) = K0 (s + a)E (s) tk = kT
Using the inverse Laplace transform: x(k) is the value of x at tk
x(k + 1) is the value of x at tk+1
u̇ + bu = K0 (ė + ae)
Difference Equations
u̇ + bu = K0 (ė + ae)
Using Euler method for approximating the derivative:
u(k + 1) − u(k) e(k + 1) − e(k)
+ bu(k) = K0 + ae(k)
T T
Rearranging to put the difference equation in the desired form:
e(k + 1) − e(k)
u(k + 1) = u(k) + T −bu(k) + K0 + ae(k)
T
For computational efficiency, it is convenient to rearrange:
u(k + 1) = (1 − bT )u(k) + K0 (aT − 1)e(k) + K0 e(k + 1)
Discrete-Time Systems (ULFG) Control Systems II Fall 2021/2022 24 / 80
Digital Systems Difference Equation The z-Transform Time response Transfer Function Sampling Theorem Stability
Difference Equations
Suppose we call:
the input signals to the k-th sample e0 , e1 , e2 , · · · , ek
the output signals prior to that time u0 , u1 , u2 , · · · , uk−1
The next output can be written as a function of the above values:
uk = f (e0 , · · · , ek , u0 , · · · , uk−1 )
If the coefficients ai and bi are constants, the difference equation is referred to as a linear time
invariant LTI.
Discrete-Time Systems (ULFG) Control Systems II Fall 2021/2022 26 / 80
Digital Systems Difference Equation The z-Transform Time response Transfer Function Sampling Theorem Stability
Table of Contents
1 Digital Systems
2 Difference Equation
3 The z-Transform
4 Time response
5 Transfer Function
6 Sampling Theorem
7 Stability
The z-Transform
Definition
The z-transform of a discrete-time signal x(k) is defined as the power series
∞
X
X (z) = x(k)z −k
k=−∞
where z is a complex variable.
The z-Transform
Definition
Given the impulse train representation of a discrete-time signal,
k=∞
X
x ∗ (t) = x0 δ(t) + x1 δ(t − T ) + x2 δ(t − 2T ) + · · · + xk δ(t − kT ) + · · · = xk δ(t − kT )
k=−∞
Its Laplace transform:
k=∞
X k
X ∗ (s) = x0 + x1 e −sT + x2 e −2sT + · · · + xk e −ksT + · · · = xk e −sT
k=−∞
Let z be defined by: z = e sT
Then the z-transform expression can be determined.
Having defined the z-transform, we now obtain the z-transforms of commonly used
discrete-time signals such as the sampled step, exponential, and the discrete-time impulse.
The following identities are used repeatedly to derive several important results:
n
X 1 − an+1
ak = , a ̸= 1
1−a
k=0
∞
X 1
ak = , a<1
1−a
k=0
Example
Consider the discrete-time impulse
(
1, k = 0
x(k) = δ(k) =
0, k ̸= 0
Example
Consider the discrete-time step
(
1, k ≥0
x(k) = 1(k) =
0, k <0
Example
Consider the discrete-time one-sided exponential in time
(
ak , k ≥ 0
x(k) =
0, k < 0
The final value theorem allows us to calculate the limit of a sequence as k tends to infinity, if
one exists, from the z-transform of the sequence.
The main pitfall of the theorem is that there are important cases where the limit does not exist.
The two main cases are as follows:
1 An unbounded sequence
2 An oscillatory sequence
z 2 (z − a)
F (z) =
(z − 1)(z − b)(z − c)
What can you conclude concerning the constants b and c if it is known that the limit exists?
Table of Contents
1 Digital Systems
2 Difference Equation
3 The z-Transform
4 Time response
5 Transfer Function
6 Sampling Theorem
7 Stability
Convolution summation
The response of a discrete-time system to a unit impulse is known as the impulse response
sequence.
The impulse response sequence can be used to represent the response of a linear discrete-time
system to an arbitrary input sequence
To derive this relationship, we first represent the input sequence in terms of discrete impulses
as follows:
Convolution summation
For a linear system, the principle of superposition applies, and the system output due to the
input is the following sum of impulse response sequences:
{y (l)} = {h(l)} u(0) + {h(l − 1)} u(1) + · · · + {h(l − i)} u(i) + · · ·
Convolution summation
For a causal system, the response due to an impulse at time i is an impulse response starting
at time i and the delayed response h(k − i) satisfies
h(k − i) = 0, i >k
A causal system is one whose impulse response is a causal time sequence.
y (k) = u(0)h(k) + u(1)h(k − 1) + u(2)h(k − 2) + · · · + u(k)h(0)
k
X
= u(i)h(k − i)
i=0
A simple change of summation variable (j = k − i) transforms to
y (k) = u(k)h(0) + u(k − 1)h(1) + u(k − 2)h(2) + · · · + u(0)h(k)
k
X
= u(k − j)h(j)
j=0
Discrete-Time Systems (ULFG) Control Systems II Fall 2021/2022 42 / 80
Digital Systems Difference Equation The z-Transform Time response Transfer Function Sampling Theorem Stability
Convolution summation
Theorem (Response of an LTI System)
The response of an LTI discrete-time system to an arbitrary input sequence is given by the
convolution summation of the input sequence and the impulse response sequence of the
system.
2
X
y (2) = u(i)h(2 − i)
i=0
= u(0)h(2) + u(1)h(1) + u(2)h(0)
Discrete-Time Systems (ULFG) Control Systems II Fall 2021/2022 43 / 80
Digital Systems Difference Equation The z-Transform Time response Transfer Function Sampling Theorem Stability
Z
y (k) = h(k) ∗ u(k) Y (z) = H(z)U(z)
The function H(z) is known as the z-transfer function or simply the transfer function.
Applying the convolution theorem to the response of an LTI system allows us to use the
z-transform to find the output of a system without convolution as follows:
1 z-transform the input.
2 Multiply the z-transform of the input and the z-transfer function.
3 Inverse z-transform to obtain the output temporal sequence.
An added advantage of this approach is that the output can often be obtained in closed form.
Example
Given the discrete-time system y (k + 1) − 0.5y (k) = u(k), y (0) = 0
Find the impulse response of the system h(k):
1 From the difference equation
2 Using z-transformation
Solution:
Table of Contents
1 Digital Systems
2 Difference Equation
3 The z-Transform
4 Time response
5 Transfer Function
6 Sampling Theorem
7 Stability
U(z)
let k − 1 = j
E (z) z −1 E (z)
∞
X ∞
X
uk−1 z −k = uj z −(j+1) = z −1 U(z)
k=−∞ j=−∞
We can obtain:
T
U(z) = z −1 U(z) + E (z) + z −1 E (z)
2
T 1 + z −1 U(z) T z +1
⇒ U(z) = −1
E (z) ⇒ H(z) = =
2 1−z E (z) 2 z −1
Discrete-Time Systems (ULFG) Control Systems II Fall 2021/2022 50 / 80
Digital Systems Difference Equation The z-Transform Time response Transfer Function Sampling Theorem Stability
Qm
b(z) (z − zi )
H(z) = = K Qni=1
a(z) i=1 (z − pi )
ADC Model
Assume that
ADC outputs are exactly equal in magnitude to their inputs (i.e., quantization errors are
negligible).
The ADC yields a digital output instantaneously.
Sampling is perfectly uniform (i.e., occurs at a fixed rate).
Then the ADC can be modeled as an ideal sampler with sampling
period T
DAC model
To obtain the transfer function of the ZOH, we replace the number or discrete impulse by an
impulse δ(t). The transfer function can then be obtained by Laplace transformation of the
impulse response.
1
L {1(t)} =
s
e −sT
L {1(t − T )} =
s
Thus, the transfer function of the ZOH is
1 − e −sT
GZOH (s) =
s
Table of Contents
1 Digital Systems
2 Difference Equation
3 The z-Transform
4 Time response
5 Transfer Function
6 Sampling Theorem
7 Stability
The well-known relationship between the transfer function Ha (s) and the frequency response
Ha (jω):
Ha (jω) = Ha (s)|s=jω
where r (kT ) is the value at time kT , and δ(t − kT ) denotes a Dirac delta at time kT .
where the Fourier coefficients, Cn , are given by the integral over one period as
∞
1 T /2 X
Z
Cn = δ(t − kT )e −jn(2πt/T ) dt
T −T /2
k=−∞ The shifting property of the impulse
Z T /2
1
δ(t)e −jn(2πt/T ) dt
Z ∞
=
T −T /2 f (t)δ(t − a)dt = f (a)
−∞
1
=
T
Discrete-Time Systems (ULFG) Control Systems II Fall 2021/2022 61 / 80
Digital Systems Difference Equation The z-Transform Time response Transfer Function Sampling Theorem Stability
Taking the Laplace transform of the output of the mathematical " sampler,
∞ ∞
Z ∞ #
X L 1 X
r ∗ (t) = r (t)δ(t − kT ) −→ L [r ∗ (t)] = r (t) e jnωs t e −st dt
−∞ T n=−∞
k=−∞
∞ Z ∞ ∞ Z ∞
1 X 1 X
⇒R ∗ (s) = r (t)e jnωs t e −st dt = r (t)e −(s−jnωs )t dt
T n=−∞ −∞ T n=−∞ −∞
∞
∗ 1 X
⇒ R (s) = R(s − jnωs )
T n=−∞
Discrete-Time Systems (ULFG) Control Systems II Fall 2021/2022 62 / 80
Digital Systems Difference Equation The z-Transform Time response Transfer Function Sampling Theorem Stability
−fB fB f
∗
|R (f )|
|S ∗ (f )|
f
−2fs −fs fs 2fs
One can recover a signal from its samples if the sampling frequency (fs = 1/T ) is at least
twice the highest frequency in the signal: i.e. fs > 2fB
In control, usually the sampling frequency is chosen: 6fB < fe < 25fB
Discrete-Time Systems (ULFG) Control Systems II Fall 2021/2022 64 / 80
Digital Systems Difference Equation The z-Transform Time response Transfer Function Sampling Theorem Stability
Sampling Theorem
Aliasing in the time domain
0.5
2 4 6 8 10
−0.5
−1
Table of Contents
1 Digital Systems
2 Difference Equation
3 The z-Transform
4 Time response
5 Transfer Function
6 Sampling Theorem
7 Stability
Stability
Definition
A system is stable if all solutions remain within a small distance of each other after a
specific discrete value of time
Asymptotic stability refers to the condition that all the solution to the discrete model are
stable and the distance between them goes to zero as k → ∞.
A system is called Bounded-Input-Bounded-Output (BIBO) stable if for every Bounded
Input, we should have a Bounded Output.
Asymptotic Stability for a linear system implies both stability and BIBO stability
Definition
A system is said to be asymptotically stable if its response to any initial conditions decays to
zero asymptotically in the steady state,that is, the response due to the initial conditions
satisfies
lim y (k) = 0
k→∞
If the response due to the initial conditions remains bounded but does not decay to zero, the
system is said to be marginally stable.
Exponential stability
A system is said to be exponentially stable if it is asymptotically and in addition its response to
any initial conditions decays to zero exponentially in the steady state.
Bounded-Input–Bounded-Output Stability
The second definition of stability concerns the forced response of the system for a bounded
input. A bounded input satisfies the condition
|u(k)| < bu , k = 0, 1, 2, · · ·
0 < bu < ∞
Definition
A system is said to be bounded-input–bounded-output (BIBO) stable if its response to any
bounded input remains bounded–that is, for any input satisfying the above condition, the
output satisfies
|y (k)| < by , k = 0, 1, 2, · · ·
0 < by < ∞
Stability conditions
Theorem (Asymptotic Stability)
In the absence of pole-zero cancellation, an LTI digital system is asymptotically stable if its
transfer function poles are in the open unit disc and marginally stable if the poles are in the
closed unit disc with no repeated poles on the unit circle.
Im(s) Im(z)
BIBO stability
BIBO stability concerns the response of a system to a bounded input. The response of the
system to any input is given by the convolution summation
k
X
y (k) = h(k − i)u(i), k = 0, 1, 2, · · · h(k) : impulse response
i=0
Internal Stability
We consider that system as having two outputs, Y and U, and two inputs, R and D. Thus,
the transfer functions associated with the system are
C (z)GZAS (z) GZAS (z)
Y (z) 1 + C (z)G
ZAS (z) 1 + C (z)GZAS (z) R(z)
=
C (z)(z)
C (z)GZAS (z) D(z)
U(z)
1 + C (z)GZAS (z) 1 + C (z)GZAS (z)
It is not sufficient to prove that the output of the controlled system Y is bounded for bounded
reference input R because U can be unbounded.
The system output
Discrete-Time must be bounded in the
Systems (ULFG) presence
Control Systems II of a disturbance. Fall 2021/2022 72 / 80
Digital Systems Difference Equation The z-Transform Time response Transfer Function Sampling Theorem Stability
Internal Stability
Because internal stability guarantees the stability of the transfer function from R to Y , among
others, it is obvious that an internally stable system is also externally stable.
However, external stability does not, in general, imply internal stability.
Definition
If all the transfer functions that relate system inputs (R and D) to the possible system outputs
(Y and U) are BIBO stable, then the system is said to be internally stable.
Theorem
The closed-loop system is internally stable if and only if all its closed-loop poles are in the
open unit disc.
Nyquist criterion
The Nyquist criterion allows us to answer two questions:
1 Does the system have closed-loop poles outside the unit circle?
2 If the answer to the first question is yes, how many closed-loop poles are outside the unit
circle?
We begin by considering the closed-loop characteristic polynomial
NL (z)
pcl (z) = 1 + KD(z)G (z) = 1 + L(z); L(z) = : loop gain
DL (z)
NL (z) NL (z) + DL (z)
pcl (z) = 1 + =
DL (z) DL (z)
Nyquist criterion
Nyquist criterion
Corollary
An open-loop stable system is closed-loop stable if and only if its Nyquist plot does not
encircle the point (−1, 0) (i.e., if N = 0).
Nyquist criterion
Example
1
Consider a linearized model of a furnace: G (s) =
+ 3s + 1 s2
Determine the closed-loop stability of the system with digital control and a sampling period of
0.01.
4.95z + 4.901
G (z) = 10−5
z2 − 1.97z + 0.9704
Nyquist criterion
Example
Consider the previous model of the furnace after adding
the discrete-time first-order actuator
0.9516
Ga (z) = K
z − 0.9048
Determine the closed-loop stability of the system with
digital control and a sampling period of 0.01.