Notes A2 DiscreteSystems
Notes A2 DiscreteSystems
Syllabus
Discrete time linear systems. The z-transform and its properties. Conversion be-
tween difference equations and z-transform transfer functions. Obtaining the dis-
crete model of a continuous system plus zero order hold from a continuous (Laplace)
transfer function. Mapping from s-plane to z-plane. Significance of pole positions
and implications to stability. Discrete time system specifications. Discrete time
state space systems. Discrete time solutions. Euler discretization.
Lecture notes
These lecture notes are provided as handouts. These notes as well as the lecture
slides that follow the same structure are also available on the web (Canvas).
The first four chapters of the notes follow in part lecture material that was produced
and was previously taught by Prof. Mark Cannon. His input and his permission to
use material from his lecture notes is gratefully acknowledged.
Recommended text
Other reading
• R C Dorf & R H Bishop Modern Control Systems Pearson Prentice Hall, 2008
• K J Astrom & R M Murray Feedback Systems: An Introduction for Scientists
and Engineers Princeton University Press, 2008
The course follows the first book above which will be referred to as [Franklin et
al, 1998]; reference to particular book chapters and sections is provided throughout
the notes. Consulting the book for detailed elaboration on several concepts as well
as for additional examples and exercises is highly recommended.
3 CONTENTS
Contents
1 Introduction 5
1.1 Digitization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
1 Introduction
1.1 Digitization?
Discrete time systems are dynamic systems whose inputs and outputs are defined
at discrete time instants. Within a control context, digitization is the process of
converting a continuous controller (Figure 1) into a set of difference equations that
can be implemented by a computer within a digital control system (Figure 2). The
digital controller operates on samples of the sensed output, resulting upon analogue
to digital (ADC) conversion, rather than the continuous signal y(t). The generated
discrete time command is then applied to the plant upon digital to analogue (DAC)
conversion. This provides practical advantages in terms of accuracy and noise
rejection, and simplifies monitoring and simultaneous control of large numbers of
feedback loops. However the ability of a digital control system to achieve specified
design criteria depends on the choice of digitization method and sample rate.
Figure 3: Upper panel: RC racing car platform at ETH Zurich (figure taken from
http://control.ee.ethz.ch/∼ racing///); Lower panel: RC racing car platform at University of
Oxford.
The general architecture underpinning the operation of each car is shown in Figure
4. It is based in the following sequence of steps:
1. The camera based vision system captures the cars on the track, each of them
characterised by a unique marker pattern.
7 Introduction
actuation
reference command sensor output
Control State
control action algorithm estimation
Figure 5: Embedded board of each car (figure taken from http://control.ee.ethz.ch/∼ racing///).
2. The position and velocity of each car is estimated by means of some state
estimation algorithm, and is broadcasted to the computer used for control
calculation.
3. The control inputs (e.g., speed commands) are sent via Bluetooth to the
1.3 Organization of the notes 8
embedded board microcontroller of each car (see Figure 5), which then drives
around the track.
The overall configuration in both cases is naturally a discrete system, e.g., see on
board microcontroller. The controller could either be designed in continuous time
(using e.g., methods from the first 8 lectures of A2 Introduction to Control The-
ory course) using a continuous time model of car, sampled and then implemented
approximately in discrete time, or it could be designed directly as a discrete system
using a discrete time model of the car. In the sequel we will derive methods that
allow us to analyse both alternatives.
In these notes we will study the entire feedback interconnection of Figure 2: Chapter
2 will introduce discrete time linear systems and the notion of sampling continuous-
time signals. It will focus on the controller block of Figure 2, and provide the
machinery to represent it in discrete-time, introducing the z-transform and the
discrete-time transfer function (similarly to the continuous-time one). Chapter
3 will concentrate on obtaining a discrete-time model (transfer function) of the
DAC-Plant-Sensor-ADC interconnection, while Chapter 4 will focus on the closed-
loop system, and in particular on how we can investigate its stability properties,
analyse its response, and verify whether certain performance criteria are met by
the designed controller. Chapter 5 will introduce the the state space formalism for
discrete time systems, and analyze the structure of their solution in the time-domain,
thus complementing the transfer function developments. It will also discuss the
effects of Euler discretization on approximating differential with difference equations.
Finally, the Appendix provides a more rigorous treatment and proof of the inverse
z-transform.
9 Discrete time linear systems and transfer functions
Discrete time signals typically emanate from continuous time ones by a procedure
called sampling. If a digital computer is used for this purpose, then we typically
sample the continuous time signal at a constant rate:
T = sample period (or sampling interval);
1/T = sample rate (or sampling frequency) in Hz;
[2π/T = sample rate in rad s−1 ].
By tk = kT for k = {. . . −2, −1, 0, 1, 2, 3, . . . } we denote the sampling instants
or sample times, at which we obtain a “snapshot” of the continuous time signal.
Sampling a continuous signal produces a sampled signal:
sample
y(t) −−−→ y(kT ),
y(kT ) = y(k) = yk .
Such a signal is the outcome of the analogue to digital conversion (ADC) taking
place at the sensor of our system (see Figure 2). With reference to the same figure,
at the other end of the process the output of the digital controller u(kT ) must
be converted back to a continuous time signal. This is usually done by means of
a digital to analogue converter (DAC) and a hold circuit which holds the output
signal constant during the sampling interval. This is known as a zero-order hold
(ZOH); see also Figure 7.
Discrete time systems are systems whose inputs and outputs are discrete time
signals. Due to this interplay of continuous and discrete components, we can
observe two discrete time systems in Figure 2, i.e., systems whose input and output
are both discrete time signals. The obvious one refers to the controller block, whose
input is the error signal ek and its output is the actuation command uk . A second
less obvious discrete time system is the one that admits uk as the input and yk as
its output. It has the DAC and ADC converters as well as the plant dynamics that
are in continuous time intervened, but still it is a discrete time system. We refer
to the latter as a sampled data system. Taking the controller block as an example,
to derive the corresponding discrete time system suppose we have a access to the
transfer function of the controller, namely,
U (s) K(s + a)
D(s) = = .
E(s) (s + b)
We first unravel this as
and determine the corresponding differential equation with s replaced by d/dt, i.e.,
du
de
+ bu = K + ae .
dt dt
Here we use Euler’s forward approximation in out differential equation to obtain the
difference equation
uk+1 − uk
ek+1 − ek
+ b uk = K + a ek .
T T
Finally, to implement the controller we need the new control value, uk+1 ,
Normally T , K, a and b are fixed, so what the computer has to calculate every
cycle can be encoded by a standard form recursion
It should be noted that the coefficients of the difference equation change with T ,
hence the sample rate is usually kept fixed; the smaller T the more the discrete
system approximates the continuous one (depending on the Euler approximation
used we could formally quantify conditions so that the discrete approximation is at
least not divergent). The obtained recursion provides an input-output representation
of the discrete time system. In particular, the output of the system uk+1 depends
on the past output uk , as well as on the current and past inputs ek+1 and ek ,
respectively. Since this dependency is linear, we refer to such systems as discrete
linear systems.
In continuous (linear) systems the Laplace transform was used to transform differ-
ential equations to algebraic ones, since the latter were easier to use in view of
obtaining input-output relationships, and eventually transfer functions. Similarly,
for discrete systems, we will define a new transform, the so called z-transform,
that will allow us to transform difference or recurrence equations to algebraic ones
and construct discrete transfer functions that will allow us to analyze discrete time
systems from an input-output point of view.
Note: There are two differences with the z-transform definition of [Franklin et al,
1998], that we will be, however, adopting for this course:
1. In [Franklin et al, 1998] the “two-sided” z-transform is used, with the index k
2.2 The z-Transform 12
starting at −∞ whereas these notes (along with HLT) use the “single-sided”
z-transform to correspond to the single sided Laplace transform that you are
already familiar with. In this course, all signal values are defined to be zero for
k < 0 so the two definitions yield the same results.
2. In [Franklin et al, 1998] the z-transform definition was based on the assumption
that upper and lower bounds, respectively, on the magnitude |z| exist, thus
ensuring convergence of the series in the z-transform definition. Here, we
assume throughout that this is the case, and we will impose such bounds on
a case by case basis by exploiting convergence conditions for geometric series
as these are involved in the z-transform definition (see example below).
This is a geometric series and has a closed form solution if |e−aT z −1 | < 1, or
equivalently if |z| > e−aT :
C Cz
X(z) = = .
1 − e−aT z −1 z − e−aT
then delaying e by a period T will create a new sequence (let’s call it fk ) with
This is an example of a z-transform property that holds true more generally, i.e., if
a signal is delayed by a period T , its z-transform gets multiplied by z −1 .
C
which gives Y (z) = .
z − e−aT
Z-transform overview
z-Transform
X(z)
Sequence Solution
{x0 , x1 , . . .} xk = x(k)
Recurrence equation
xk = a1 xk−1 + · · · + an xk−n
where the first equality follows from the fact that for all k < n, fk−n is assumed
to be zero, and the second inequality follows by a change of the summation index.
Note that in [Franklin et al, 1998] no constraint on n is imposed, since the two-sided
z-transform is employed.
n o
2. Linearity: Z αf (kT ) + βg(kT ) = αF (z) + βG(z).
n o d n o
3. Differentiation: Z k f (kT ) = −z Z f (kT ) .
dz
X∞
4. Convolution: Z f (iT ) g(kT − iT ) = F (z) G(z).
i=0
where the second equality follows from changing k − i to p, and noticing that
the summation limits remain unchanged since all terms corresponding to negative
indices are assumed to be zero. For the last equality notice that i and p are arbitrary
variables so each summation corresponds to the z-transform of f and g, respectively.
n o
5. Final value theorem: lim f (kT ) = lim (z − 1)F (z) , if the poles of
k→∞ z→1
(z − 1)F (z) are inside the unit circle and F (z) converges for all |z| > 1.
where the fourth equality follows from the third one by changing the summation
index of the first summation, and the last one constitutes an equivalent way of
representing a summation limit that tends to infinity.
Take now in both sides the limit as z tends to one. We then have that
K
(fk+1 − fk )z −k ,
X
lim(z − 1)F (z) = lim f0 z + lim
z→1 z→1 K→∞ k=0
K
X
= f0 + lim (fk+1 − fk )
K→∞ k=0
where the second equality follows from the first one by exchanging the order of
limits and taking the limit as z → 1. The third equality is due to the fact that
PK
k=0 (fk+1 −fk ) is a so called telescopic series, with all intermediate terms cancelling
each other.
It should be noted that the fact that F (z) converges for all |z| > 1 justifies our
assumption that the summation of terms corresponding to negative indices is zero
and ensures that limk→∞ fk exists, while the fact the poles of the poles of (z −
1)F (z) are inside the unit circle ensures that taking the limit with respect to z is
well defined, and the exchange of limits in the previous derivation is justified. Such
a condition will be discussed in more detail in Chapter 5. Note that in [Franklin et
al, 1998], §4.6.1, an alternative proof is provided.
We have already seen that in a typical controller the new control output is calculated
as a function of the new error, plus previous values of error and control output. In
general we have a linear recurrence equation (also often called a linear difference
equation),
Let U (z) and E(z) denote the z-transforms of uk and ek , respectively. Using the
linearity and time delay properties of the z-transform we have that
Clearly when n > m, there are (n − m) zeros at the origin and when n < m, there
are (m − n) poles at the origin. Like continuous systems we must have at least as
many poles as zeros? . If b0 6= 0, we have an equal number of each and if b0 = 0,
we have one fewer zero. Likewise if b0 = b1 = 0 we have two fewer zeros, etc.
By defining z-domain transfer functions in this way, we can extend to discrete sys-
tems all the techniques that were developed for continuous systems in the s-domain.
In particular, series or feedback interconnections among transfer functions as often
encountered in block-diagrams are addressed identically with the continuous-time
case. However, when it comes to stability and performance analysis certain differ-
ences are encountered; these are discussed in Chapter 4.
?A
greater number of zeros than poles in D(z) would indicate that the system is non-causal since uk
would then depend on ek+i , for i > 0.
2.5 Pulse response and convolution 18
e(kT ) ? u(kT ) = ?
Take the case where e(kT ) is the discrete version of the unit pulse, i.e.,
1 for k = 0,
ek =
0
for k > 0
In this case
∞
ek z −k = 1 ⇒ U (z) = D(z) E(z) = D(z).
X
E(z) =
k=0
As we have applied a unit pulse to this system, the output, u(kT ) will be its pulse
response and U (z) will be the z-transform of the pulse response. This implies that,
similarly to the continuous time case,
U (z) = T /2 + T z −1 + T z −2 + T z −3 + . . .
∞
T z −k − T /2
X
=
k=0
T T T z + 1
= − = , [for |z| > 1],
1 − z −1 2 2 z−1
which is equal to D(z) as expected.
2.5.2 Convolution
Because the system is linear and because e(kT ) is just a sequence of values, for
example, e0 , e1 , e2 , e3 , e4 , . . . = 1.0, 1.2, 1.3, 0, 0, . . ., we can decompose e(kT ) into
a series of pulses: e(kT ) = 1.0δk + 1.2δk−1 + 1.3δk−2 .
2.5 Pulse response and convolution 20
We can now determine the response of u(kT ) for each of the individual pulses and
simply sum them to get the response when the input is e(kT ). Suppose the pulse
response of the system is:
Then we obtain:
k 0 1 2 3 4 5 6 7
e(kT ) 1 1.2 1.3 0 0 0 0 0
e(0) d(kT ) 1 0.5 0.3 0.2 0.1 0 0 0
e(1) d(kT − T ) 0 1.2 0.6 0.36 0.24 0.12 0 0
e(2) d(kT − 2T ) 0 0 1.3 0.65 0.39 0.26 0.13 0
u(kT ) 1 1.7 2.2 1.21 0.73 0.38 0.13 0
From the table it can be observed that
u0 = e0 d0 ,
u1 = e0 d1 + e1 d0 ,
u2 = e0 d2 + e1 d1 + e2 d0 ,
u3 = e0 d3 + e1 d2 + e2 d1 + e3 d0 ,
..
.
k
X
uk = ei dk−i ,
i=0
which is the convolution of the input and the pulse response (sometimes written
as uk = ek ∗ dk ). A graphical calculation of convolution can be shown in Figure 8.
From the last row of the table, it can be shown that the z-transform of u(kT ) is
given by
∞
u(kT )z −k = 1 + 1.7z −1 + 2.2z −2 + . . .
X
U (z) =
k=0
On the other hand, we can easily calculate the z-transforms of e(kT ) and d(kT )
which are given by
∞
e(kT )z −k = 1 + 1.2z −1 + 1.3z −2 + . . .
X
E(z) =
k=0
∞
d(kT )z −k = 1 + 0.5z −1 + 0.3z −2 + . . .
X
D(z) =
k=0
21 Discrete time linear systems and transfer functions
It can be directly verified, that U (z) = D(z)E(z), as expected due to the convo-
lution property of the z-transform. In general, the following fact holds.
u0 = e0 d0 u1 = e0 d1 + e1 d0
u2 = e0 d2 + e1 d1 u3 = e0 d3 + e1 d2
+ e2 d0 + e2 d1 + e3 d0
Figure 8: Graphical illustration of the setps required to compute the convolution of two sequences, i.e.,
ek and dk .
We have determined already a few methods to compute the z-transform Y (z) given
a sequence yk :
P∞ −k
1. Evaluate the sum Y (z) = k=0 yk z directly.
This method was used earlier to compute the z-transform of a sequence with
only a finite number of non-zero terms. It was also the method used to compute
the z-transform of exponential signals using the formula for a geometric series.
What has not been discussed yet is how to obtain a discrete time signal if its z-
transform is available, or in other words, we have not discussed about the inverse
z-transform Some methods of determining the inverse z-transform yk of a function
Y (z) are provided below:
3. Treat Y (z) as a transfer function and determine its pulse response yk . For
example,
1 + 2z −1
Y (z) = =⇒ yk − 2yk−1 = δk + 2δk−1 Z with yk = 0 for k < 0,
1 − 2z −1
hence {y0 , y1 , y2 , . . .} = {1, 4, 8, 16, . . .} or yk = 2k+1 − δk , for k = 0, 1, . . ..
23 Discrete time linear systems and transfer functions
2.7 Summary
• Discrete transfer functions map the z-transform of the input sequence to the
z-transform of the output sequence, e.g., U (z) = D(z)E(z).
• Given the z-transform Y (z), different methods were discussed to obtain its
inverse yk .
24
The z-domain provides a means of handling the discrete part of the system. It
remains to deal with the rest of the system, namely the plant, actuators, sensors
etc, which operate in continuous time, or in other words computing the transfer
function of the so called sampled data system between uk and yk with reference to
Figure 2. For convenience, this part is shown in Figure 9. To this end, given the
continuous part of the system, G(s), driven by a zero-order hold, the problem is to
calculate a transfer function† G(z).
To achieve this, first consider the ZOH. For each sample time k it admits uk as
input and has the continuous time signal u(t) (rectangular pulse of height uk and
width T ) as output (see Figure 10).
For each sample uk , the output of the ZOH is therefore a step of height uk at time
tk = kT plus a step of height −uk at time tk+1 = (k + 1)T , so the continuous
? Franklin
§4.3
† Wedenote the continuous and discrete transfer functions of a sampled data system G as G(s) and
G(z) respectively. These functions of s and of z will not generally be the same – whether we’re talking
about the continuous or discrete model is indicated by whether the argument is s or z.
25 Discrete models of sampled data systems
However, in Section 2.5, it was shown that the pulse response of a system coincides
with its discrete time transfer function, i.e., Y (z) = G(z) when uk = δk . Therefore,
to calculate G(z) it suffices to set uk = δk and compute Y (z).
a
Example 5. Suppose that G(s) = . Then, using the formula above,
s+a
G(z) is obtained from
a
G(z) = (1 − z −1 )Z L−1
s(s + a)
1 1
= (1 − z −1 )Z L−1 −
s (s + a)
n
−1 −at
o
= (1 − z )Z U(t) − e U(t) t=kT
Example 6. Now suppose that the ADC and DAC in the previous example
are not synchronized, and that there is a fixed delay of τ seconds between
sampling the plant output at the ADC and updating the DAC, 0 ≤ τ ≤ T .
This situation arises for example if there is a non-negligible processing delay
(known as latency) in the controller. The delay has exactly the same effect
as a delay of τ in the continuous system, which is represented as a factor
27 Discrete models of sampled data systems
e−sτ multiplying G(s). Thus we can determine a new pulse transfer function,
Gτ (z), which represents the same plant as G(z) but now includes the delay
of τ :
e−sτ a
−1 −1
Gτ (z) = (1 − z )Z L
s(s + a)
= (1 − z −1 )Z U(kT − τ ) − e−a(kT −τ ) U(kT − τ ) .
n o
Substituting for
∞ 1
z −k =
n X
Z U(kT − τ )} = ,
k=1 z−1
∞ e−a(T −τ )
Z e−a(kT −τ ) U(kT − τ ) = e−a(kT −τ ) z −k =
n o X
,
k=1 z − e−aT
(recall that τ < T so the impulse response is delayed by at most one sample),
and rearranging gives
A discrete transfer function can only describe the map from one discrete signal
to another. This is important to remember when calculating the pulse transfer
functions of systems with more than one output variable.
Consider for example the system in Figure 11, which has two output variables: y
and z. The pulse transfer function between uk and yk is
Y (z) −1
G1 (s)
= (1 − z )Z ,
U (z) s
whereas that from uk to zk is clearly
Z(z) −1
G1 (s)G2 (s)
= (1 − z )Z .
U (z) s
Even though z is related to y via Z(s) = G2 (s)Y (s), this cannot be used directly
to simplify computation of the the pulse transfer function from uk to zk because z
3.2 ZOH transfer function 28
In the previous section DAC and ZOH were considered together. We now focus on
their individual effects on the signals involved, as shown in Figure 12. To this end,
recall that the Laplace transform of the signal at the output of the ZOH is given
by U (s) = ∞ k=0 uk e
−kT s
(1 − e−T s )/s. However, u∗ (t) is a train of Dirac functions,
P
G(z)
uk u*(t) u(t) y(t) y*(t) yk
k t t t t k
Figure 12: Impulse modulation model of sampled signals in a sampled data system.
1
| ZOH ( j ! ) | / T
0.8
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
!T/2"
at least two times the bandwidth (for bandlimited signals) to avoid aliasing.
The z-transform can be used to compute the response of a discrete system analo-
gously to the way that Laplace transforms are used for continuous systems:
G(z)
u(kT ) y(kT )
2. Compute the transform U (z) of the input signal u(kT ) (or look it up in tables).
3. Multiply the transform of the input by the transfer function to find the trans-
form of the output Y (z).
4. Invert this transform to obtain the output y(kT ) (or look it up in tables).
The following two tables provide the z-transforms for several useful signals. It should
be noted that:
3. The closed form solutions for F (z) are valid for |z| > |pi |, where pi are their
pole positions.
? [Franklin et al, 1998] §4.4
31 Discrete models of sampled data systems
5. If the main objective is to determine the system output yk for a specific input
uk , it may well be easier to perform the convolution of the input with the
impulse response of the system, or to iterate the difference equation. The
main purpose of z-transforms in this context is to predict the system response
using the poles and zeros of the pulse transfer function, as it will be discussed
in Chapter 4.
1 z
e−akT
s+a z − e−aT
1 T ze−aT
kT e−akT
(s + a)2 (z − e−aT )2
1 1 2 −akT T 2 −aT z(z + e−aT )
(s + a)3 2 (kT ) e 2
e
(z − e−aT )3
1 (−1)m−1 ∂ m−1 −akT (−1)m−1 ∂ m−1 z
e
(s + a)m (m − 1)! ∂am−1 (m − 1)! ∂am−1 z − e−aT
a −akT z(1 − e−aT )
1−e
s(s + a) (z − 1)(z − e−aT )
3.4 Laplace and z-transform of commonly encountered signals 32
3.5 Summary
As for continuous systems, the poles, zeros and the d.c. gain of a discrete trans-
fer function provide all the information needed to estimate the response. When
designing a controller, an understanding of how the poles affect the approximate
response is often more insightful than the ability to compute the exact response.
This chapter provides a characterization of the system response in terms of the
locations of the poles of the discrete transfer function.
We will start with the z-transform of a cosine which grows or decays exponentially.
This will provide insight on the location of poles in the z-plane and their effect on
the response of the system.
Let y(t) = e−at cos(bt) U(t) (where U(t) is the unit step function). We then have
that
y(kT ) = rk cos(kθ) U(kT ), with r = e−aT , θ = bT,
= rk 21 (ejkθ + e−jkθ ) U(kT ).
Its z-transform is given by
∞ ∞
1 X k jkθ −k 1 X k −jkθ −k
Y (z) = 2 r e z + 2 r e z
k=0 k=0
1 1 1 1
= −1
+ [for |z| > r]
jθ
2 1 − re z 2 1 − re−jθ z −1
1 z 1 z
= +
2 z − rejθ 2 z − re−jθ
z(z − r cos θ) z(z − r cos θ)
= . [= ]
(z − rejθ )(z − re−jθ ) z 2 − 2r(cos θ)z + r2
Suppose that this signal is generated by applying a unit pulse to the system with
transfer function:
z(z − r cos θ)
G(z) = .
(z − rejθ )(z − re−jθ )
Figure 14 shows the poles of this transfer function at z = re±jθ and the zeros at
z = 0 and z = r cos θ. Figures 15 and 16 give the responses (when the input is a
unit pulse) as r and θ vary.
35 Step response and pole locations
. For θ = 0 and r = 1:
z
Y (z) = ,
z−1
which is a unit step (see z-transform tables).
4.1 Poles in the z-plane 36
r = 0.7
0.5
yk θ = π/4
0
−0.5
0 2 4 6 8 10
sample k
1
0.5
yk
0
r = 1.0
−0.5
θ = π/4
−1
0 2 4 6 8 10
sample k
10
5
yk
0 r = 1.3
θ = π/4
−5
0 2 4 6 8 10
sample k
. For r = 0:
Y (z) = 1,
which is a unit pulse (see z-transform tables).
For a complete view, Figure 17 summarizes the different responses according to the
locations of the poles in the z-plane.
37 Step response and pole locations
1
r = 0.7
yk
θ=0
0.5
0
0 2 4 6 8 10
sample k
1
r = 0.7
0.5
θ = π/2
yk
−0.5
0 2 4 6 8 10
sample k
1
0.5
yk
0
r = 0.7
−0.5
θ=π
−1
0 2 4 6 8 10
sample k
Figure 16: Responses for varying θ.
. Poles inside the unit circle (|z| < 1) → stable and convergent response.
. Poles outside the unit circle (|z| > 1) →unstable response.
. Poles on the unit circle (|z| = 1) → constant response or a sustained
oscillation.
. Real poles at 0 < z < 1 → exponential pulse response.
. Real poles near |z| = 1 are slow.
. Real poles near z = 0 are fast.
. Complex poles give faster responses as their angle to the real axis in-
creases.
4.2 The mapping between s-plane and z-plane 38
Figure 17: Pulse response for various pole locations (from [Franklin et al, 1998] p.126).
. Complex poles give a more resonant response as they get nearer the unit
circle.
These observations are in direct comparison with poles in the s-plane. Moreover,
notice that stability here is defined informally; we discuss about stability more
formally in the next chapter.
It turns out that the pole structure in the example of the previous section holds
true more generally. To this end, consider the z-transforms in pages 31 and 32. It
can be noticed, that if a continuous-time signal F (s) has a pole at s = a, then the
39 Step response and pole locations
z-transform F (z) always has a pole at z = eaT . This is to be expected since e−sT
and z −1 encode a delay in the continuous and discrete setting, respectively, but we
formalize it below.
z = esT ,
is a pole of the discrete time transfer function F (z). Note that this relationship
does not hold for the zeros of F (s) and F (z).
Therefore, the pole locations of a continuous signal in the s-plane map to the pole
locations of the sampled signal in the z-plane under the transformation z = esT .
Writing s = σ + jω, we obtain
(σ+jω)T σT jωT
|z| = eσT ,
z=e =e e =⇒
arg(z)
= ωT.
s-plane z-plane
Im(s) Im(z)
ω = π/T sT
z = e-
Re(s) 6 Re(z)
ω = −π/T ω = ±π/T
@
R
@
Figure 18: The mapping z = esT from s-plane to z-plane; the colour coding shows the corresponding
regions in the two planes.
negative real axis (ω = 0, −∞ < σ < 0) −→ real axis (0 < z < 1);
positive real axis (ω = 0, 0 < σ < ∞) −→ real axis (z > 1);
negative infinity (σ → −∞) −→ origin (z = 0).
The mapping from s-plane to z-plane is not an one-to-one mapping, because
for any integer n. On the basis of Nyquist’s sampling theorem, which states that we
need to sample at a frequency at least twice the signal bandwidth, i.e., T1 > 2 |ω|
2π , we
only consider the part of the s-plane within the half-sampling frequency, |ω| < π/T
which maps one-to-one onto the entire z-plane (Figure 18).
Figure 20: z-plane lines of constant damping ratio and natural frequency (from [Franklin et al, 1998]
p.125). Note that ωn in the figure corresponds to ω0 in these notes.
Typically we aim for a damping factor ζ around 0.7 and natural frequency ω0 as high
4.4 System specifications 42
Figure 22: Second order system step responses (from [Franklin et al, 1998] p.19, see also HLT p.168).
as reasonably possible to make the response as fast as possible (see also Figure 27
to justify this choice). Examples of second order system step responses and design
specifications are shown in Figures 22 and 23, respectively. Actual design criteria
include:
Rise time: tr ;
Settling time: ts ;
Peak overshoot: Mp ;
Steady state error: ess ;
Gain and Phase margin specifications.
For a 2nd-order underdamped system, we can obtain some approximate relationships
between these criteria and the pole positions:
Rise time (10% to 90%): tr ≈ 1.8/ω0 ;
Settling time (to 1%): ts ≈ 4.6/(ζω0 );
√
−πζ/ 1−ζ 2
Peak overshoot: Mp ≈ e , (for 0 ≤ ζ ≤ 1);
Steady state error: ess = limz→1 (z − 1)E(z);
Phase margin: φP M ≈ 100ζ, φP M ≤ 60◦ (φP M in degrees).
43 Step response and pole locations
Figure 23: Step response design criteria (from [Franklin et al, 1998] p.20).
−1G(s)
G(z) = (1 − z )Z
s
(z − 1)
0.1
= Z 2 .
z s (s + 0.1)
4.4 System specifications 44
G(z) =
z 0.1(z − 1)2 (z − e−0.1 )
(0.1 − 1 + e−0.1 )z + (1 − e−0.1 − 0.1e−0.1 )
=
0.1(z − 1)(z − e−0.1 )
0.0484(z + 0.9672)
= .
(z − 1)(z − 0.9048)
2. Determine the controller transfer function D(z): Using the linearity and
delay properties of the z-transform, we obtain
U (z) (1 − 0.88z −1 ) (z − 0.88)
D(z) = = 13 = 13 .
E(z) (1 + 0.5z −1 ) (z + 0.5)
3. Verify steady state error specification. The transfer function from r to e
is given by
E(z) 1
= .
R(z) 1 + D(z)G(z)
and the steady state error is ess = limk→∞ ek . From the z-transform of
a ramp (see z-transform tables) we obtain that
Tz
R(z) = .
(z − 1)2
By the final value theorem property of the z-transform we thus have that
Tz 1
ess = lim(z − 1)E(z) = lim (z − 1)
z→1 z→1 (z − 1)2 1 + D(z)G(z)
Tz
= lim , [poles of (z − 1)E(z) in unit circle]
z→1 (z − 1)(1 + D(z)G(z))
1 − 0.9048
=
0.0484(1 + 0.9672)D(1)
1 (1 + 0.5)
≈ = = 0.96.
D(1) 13(1 − 0.88)
Therefore, ess < 1 as required.
r = e−ζω0 T
ζ ln(1/r)
=⇒ √ = = 0.680 =⇒ ζ = 0.56.
1 − ζ2
q
θ = ω0 T 1 − ζ 2
θ
1.5
1
Output y and input u/10
0.5
−0.5
−1
−1.5
0 1 2 3 4 5 6 7 8 9 10
Time (sec)
4.5 Summary
• The pulse response of a 2nd order system is investigated as the radius and
argument of its z-plane poles are varied.
. the left half plane (σ < 0) maps to the unit disk (|z| < 1);
. s-plane poles with damping ratio ζ, natural frequency ω0 map to z-plane
√
poles with |z| = e−ζω0 T , arg(z) = 1 − ζ 2 ω0 T .
• Design specifications (rise time, settling time, overshoot) translate into con-
straints on the ζ and ω0 values of the dominant closed loop poles, that can
be verified for the designed controller.
47 Discrete time linear systems in state space form
We have already seen that discrete time systems emanate from continuous ones
via sampling. In particular, in the previous chapters we focused on such systems
that are linear, analyzed them and discussed their stability properties by means of
transfer functions. Here, we will revisit the problem of analyzing discrete time linear
systems, but we will do so directly in the discrete time domain.
3. We will discuss how stability can be inferred directly from the system’s state
space representation, without resorting to poles and transfer functions.
Consider a generalization of the plant that is shown in Figure 2, that may have
multiple inputs, encoded by the vector u(t) ∈ Rm , and multiple outputs, encoded
by the vector y(t) ∈ Rp . Rather than describing the plant by means of a transfer
function, we have already seen in earlier lectures of A2 Introduction to Control
Theory that, if it is given by a continuous time linear and time-invariant system
with an input vector u(t) ∈ Rm and an output vector y(t) ∈ Rp , then we can
equivalently represent it in the so called state space form. Specifically, the state
space form of a given plant is given by
Vector x(t) ∈ Rn denotes the so called system state that acts as an “internal” vec-
tor, whose elements correspond to physical quantities that change over time, hence
their evolution is described by means of ordinary differential equations (ODEs).
5.1 State space representation 48
Stacking these ODEs together gives rise to the first of the equations in the state
space description above. The second equation is an algebraic one and encodes
the information that is available in the output of the system by means of sensor
measurements. These equations together constitute the state space form of a con-
tinuous, time-invariant, linear system and are fully parameterized by the matrices
Ā ∈ Rn×n , B̄ ∈ Rn×m , C̄ ∈ Rp×n and D̄ ∈ Rp×m .
With reference to Figure 2, we would like to analyze the sampled data system with
input uk and output yk , where k ≥ 0 corresponds to any given sampling instance.
Recall that for any t ∈ [kT, (k + 1)T ] the state solution of the continuous time
linear system can be written as
Z t
Ā(t−kT )
x(t) = e xk + eĀ(t−τ ) B̄u(τ )dτ,
kT
where xk = x(kT ) plays the role of the initial condition of the state over the
sampling interval under consideration. As the initial condition is not x(0), the term
kT appears in the exponential of the first term and the lower limit of the integral in
the second term, to account for the fact that the initial time of the state evolution
is no longer zero but kT . Notice that between consecutive sampling instances kT
and (k + 1)T , the control input remains constant to uk as an effect of the ZOH,
i.e., we have that
u(t) = uk for all t ∈ [kT, (k + 1)T ).
Evaluating the state solution at t = (k + 1)T and setting xk+1 = x((k + 1)T ), we
have that
(k+1)T
Z
xk+1 = eĀT xk + eĀ((k+1)T −τ ) B̄dτ
uk
kT
[change of variables: τ ← τ − kT ]
T
Z
= eĀT xk + eĀ(T −τ ) B̄dτ
uk .
0
yk = C̄xk + D̄uk .
where yk = y(kT ). Combining the derived equations for the (next) state xk+1 and
the output yk as functions of xk and uk we obtain the state space description of a
sampled data, discrete time linear system. This is summarized below.
49 Discrete time linear systems in state space form
A sampled data, discrete time linear system is said to be in state space form
if it can be written as
D = D̄ ∈ Rp×m . Matrices (Ā, B̄, C̄, D̄) correspond to the state space form
of the continuous time, linear, time-invariant system prior to sampling, and T
denotes the sampling period.
A = eĀT = e−T ,
Z T Z T
B= eĀ(T −τ ) B̄dτ = eτ −T dτ = 1 − e−T .
0 0
For the case where unlike the preceding example the system is non-scalar, given a
continuous time state space description we can construct the discrete time one by
means of the following two steps:
elementwise for every entry of the matrix eĀ(T −τ ) B̄ that appears in the inte-
grand, which in turn involves the matrix exponential.
Consider a discrete time linear system in state space form, and an arbitrary initial
state x0 . For a given sequence of inputs uk , k = 1, . . ., we can provide an explicit
characterization of the solution to such systems. In particular, the state xk and
output yk solution for any instance k, are given by
k−1
CAk x0 CAk−i−1 Bui + Duk .
X
yk = +
| {z } i=0
zero input response | {z }
zero state response
We will not prove that the expressions for xk and yk satisfy the difference and
output equation, respectively; this can be achieved using induction. Notice that
51 Discrete time linear systems in state space form
These solutions are in direct correspondence with the ones for continuous time
linear systems; the only difference is that the convolution integral is replaced with
a summation involved in discrete time convolution, while the matrix exponential is
replaced by Ak . The latter is the term that is the most difficult to compute so that
we determine the state output solutions xk and yk . We discuss its computation
separately for systems with a diagonalizable and a non-diagonalizable matrix A.
1. If a matrix A ∈ Rn×n has distinct eigenvalues (i.e., λi 6= λj for all i 6= j), then
its eigenvectors are linearly independent.
2. If a matrix is symmetric (A = A> ∈ Rn×n ), then i) its eigenvalues are real; ii)
its eigenvectors are orthonormal (hence linearly independent).
where W is a matrix whose columns are the eigenvectors of A (invertible since the
eigenvectors are linearly independent), and Λ is a diagonal matrix whose diagonal
entries correspond to the eigenvalues of A. For discrete time linear systems with
a diagonalizable matrix A the quantity Ak that appears in the expressions for the
state and output solutions can be computed efficiently in closed form.
5.2 Solutions to discrete time linear systems 52
Fact 4. Consider a discrete time linear system with matrix A ∈ Rn×n being
diagonalizable, thus admitting a decomposition A = W ΛW −1 . We then have
that
Ak = W Λk W −1 ,
k
λ1 0 ... 0
k
0 λ2 . . . 0
k
where Λ = . .
. . . ... , with λi being the i-th eigenvalue of A.
.. ..
k
0 0 . . . λn
3. Show the claim for the (k + 1)-th case: By the induction hypothesis we
have that Ak = W Λk W −1 . Hence,
:I
W−1
Ak+1 = Ak A = W Λk ΛW −1 = W Λk+1 W −1 .
W
xk = Ak x0 = W Λk W −1 x0
1 1 21k 0 1 −1 −1
=
0 1 0 1 0 1 1
1
1 − 2k−1
= .
1
1
Notice that as k → ∞ the state tends to .
1
Matrices that exhibit this property (excluding the trivial case of a zero matrix), i.e.,
there exists some integer k̄ such that Ak = 0 for all k ≥ k̄, are called Nilpotent.
Triangular n × n matrices with zeros along the main diagonal are all Nilpotent with
k̄ ≤ n. For Nilpotent matrices the state solution satisfies
In other words, the state of the system becomes zero in finite time (k̄ time instances)
and stays there from then on. Therefore, for non-diagonalizable but Nilpotent ma-
trices A the system’s state solution can be easily computed. Despite the analogies
between continuous and discrete time linear systems, this behaviour is not encoun-
tered in continuous time systems.
In this section we will investigate the stability properties of discrete time linear
systems with no inputs, i.e., systems governed by
xk+1 = Axk .
In other words, we will analyze the so called zero input transition of the state
solution, namely xk = Ak x0 . However, stability is related to the limiting behaviour
55 Discrete time linear systems in state space form
We then say that a system that is not stable is unstable. We will investigate these
notions of stability for systems of the form xk+1 = Axk , separately for diagonalizable
and non-diagonalizable A matrices.
xk = Ak x0 = W Λk W −1 x0 .
It follows then that Ak (and as result xk ) will be a linear combination of terms λki ,
i = 1, . . . , n, where λ1 , . . . , λn are the eigenvalues of A. The coefficients of this
linear combination would then depend on the eigenvectors that appear in W and
the initial state, and would dictate how the terms λki , i = 1, . . . , n, mix.
It follows then that the eigenvalues affect the limiting behaviour of the state. Eigen-
values are in general complex, hence we can represent them as λi = σi + jωi , which
q
implies that |λi | = σi2 + ωi2 . It can be then observed that
The relationships above sumarize the limiting behaviour for one of the terms that
would appear in the state solution, i.e., the one related to λki . However, the state
solution would be a mix of such terms corresponding to the different eigenvalues of
A. We are then able to make the following statements related to stability.
• Stable (for all initial conditions) if and only if |λi | ≤ 1 for all i = 1, . . . , n.
• Asymptotically stable (for all initial conditions) if and only if |λi | < 1 for
all i = 1, . . . , n.
• Unstable (for some initial conditions) if and only if there exists i such
that the corresponding eigenvalue has |λi | > 1.
Note that it suffices that at least one eigenvalue has magnitude greater than one
for the system to be unstable. Moreover, if at least one eigenvalue has magnitude
equal to one, while all other ones have magnitude strictly lower than one, then the
system is stable but not asymptotically stable. The reason is that the contribution
of that particular eigenvalue in the state solution is bounded (constant or periodic,
hence we only stay “close” to zero but do not converge to it). Notice that this is
the case in Example 9 as one of the eigenvalues is equal to one, hence in the limit
the state does not tend to zero for the particular choice of the initial condition.
These implications of stability are in direct correspondence with the less formal
stability observations according to the poles of the system’s transfer function. In
particular, poles and eigenvalues convey the same information about stability. In
fact, a pole is also an eigenvalue of the system’s A matrix; vice verca, if the there
are no pole-zero cancellations, an eigenvalue is also a pole of the system’s transfer
function.
57 Discrete time linear systems in state space form
In the case where A is non-diagonalizable but Nilpotent, then the state reaches zero
in finite time and stays there afterwards (see Example 11), hence we have stability
and in fact we achieve this in finite time. However, for non-diagonalizable matrices
with generic structure, eigenvalues offer less information as far as determining the
system’s stability is concerned. To see this, recall first that for non-diagonalizable
matrices at least one eigenvalue will be repeated. If for all eigenvalues |λi | ≤
1, i = 1, . . . , n, but the repeated eigenvalue is such that |λi | = 1 then, unlike
diagonalizable matrices, the response may be stable or unstable according to the
initial condition (and how this relates to eigenvectors). We illustrate this by means
of an example.
Notice that the first initial state (aligned with the eigenvector) leads to a
stable solution, while for the second initial state kxk k tends to inifinity as k
increases.
However, looking into the eigenvalues we can still claim the following.
• Asymptotically stable (for all initial conditions) if and only if |λi | < 1 for
all i = 1, . . . , n.
• Unstable (for some initial conditions) if there exists i such that the cor-
responding eigenvalue has |λi | > 1.
5.4 Summary
• Given a continuous time linear system with state space description encoded by
(Ā, B̄, C̄, D̄), the associated sampled data (with sampling period T ), discrete
time linear system can be written in state space form as
• The state and output solutions to discrete linear systems are, respectively,
59 Discrete time linear systems in state space form
given by
k−1
k
Ak−i−1 Bui ,
X
xk = A x0 +
i=0
k−1
yk = CAk x0 + CAk−i−1 Bui + Duk .
X
i=0
• The stability of discrete time systems of the form xk+1 = Axk was analyzed
and conditions to guarantee stability based on the eigenvalues of matrix A
were derived. Irrespective of whether A is diagonalizable or not, if λ1 , . . . , λn
denote its eigenvalues, we can claim that:
To calculate the integral is rather not easy, and relies on the following result which
is based on Cauchy’s residue calculus. Consider some function G(z) and let zi be
the i-th pole of G(z) which is of order n. The function (z − zi )n G(z) is then
analytic at zi and as such we can obtain its Taylor series expansion as
(z − zi )n G(z) = A−n + A−n+1 (z − zi ) + . . . + A−1 (z − zi )n−1 + A0 (z − zi )n + . . .
A−1 is then defined as the residue of G(z) at zi , and is denoted as Res(zi ). For
single poles (i.e., n = 1) the residue is the constant term of the Taylor series
expansion. According to Cauchy’s residue calculus we then have that
1 I X
G(z) dz = Res(zi ), [Cauchy’s equation]
2πj i
if G(z) is analytic on the closed contour where the integral is defined, as well as in
its interior, except from a finite number of singularities.
Proof of the inverse z-transform: We will show that the right-hand side of the
inverse z-transform is indeed f (kT ). To achieve this consider the right-hand side
of the inverse z-transform, and substitute F (z) according to its definition, i.e.,
1 I k−1 1 I k−1 X ∞
z F (z) dz = z f` z −` dz
2πj 2πj `=0
1 ∞ I
f` z k−1−` dz,
X
=
2πj `=0
? [Franklin et al, 1998] §4.6.2
61 Appendix: The inverse z-transform
where the integral and the summation can be exchanged as the integration contour
is taken in the region where F (z) is convergent.
1 H k−1−`
G(z) = z k−1−` we have that 2πj z dz = 1. Hence, the right-hand side of the
inverse z-transform definition becomes
1 I k−1
z F (z) dz = f (kT ),
2πj
which is indeed the discrete-time signal f (kT ).
z
Example 12. Let F (z) = z−1 (with convergence region |z| > 1). We will
show that its inverse z-transform is
1,
k ≥ 0,
f (kT ) =
0,
k < 0.
i.e., the unit step signal.
Consider the inverse z-transform
1 I z k−1 1 I zk
fk = Z −1 F (z) =
n o
z dz = dz,
2πj z−1 2πj z−1
where the contour encircles the region |z| > 1, where convergence for F (z) is
ensured.
zk
Consider first the case k ≥ 0. Let G(z) = z−1 and notice that it has only
one single pole at one. Hence, by the Taylor series expansion of (z − 1)n G(z)
with n = 1,
(z − 1)G(z) = z k = 1 + k(z − 1) + . . .
with the residue A−1 being equal to 1. By Cauchy’s equation we then have
1 H
that 2πj G(z)dz = 1, which in turn implies that fk = 1 for all k ≥ 0.
62
k
z
Consider now the case k < 0. Let G(z) = z−1 and notice that it has a single
pole at one and a pole at zero of order k. For the pole at one, the Taylor
expansion is the same as before, and the residue is 1. For the pole at zero, by
the Taylor series expansion of z n G(z) with n = −k (recall k is negative),
1
z −k G(z) = = −1(1 + z −1 + z −2 + . . .).
z−1
The residue is −1 irrespective of the value of k. Therefore, Res(1)+Res(0) =
1 H
1 − 1 = 0. As a result, by Cauchy’s equation we have that 2πj G(z)dz = 0,
which in turn implies that fk = 0 for all k < 0.
z
Therefore, we have shown that the inverse z-transform of F (z) = z−1 is the
unit step as expected from the inverse z-transform tables. However, it should
be noted that knowledge of the region of convergence for the z-transform (in
that case |z| > 1) is essential for the determination of the integral’s contour,
and hence the correct calculation of the inverse transform.