0% found this document useful (0 votes)
43 views

TD-Digital Control 3AI2S

This document contains exercises related to digital control systems and the z-transform. It introduces the z-transform and its properties, then covers using the inverse z-transform to solve linear time-invariant difference equations. Finally, it discusses sampled systems, including determining sampled transfer functions from continuous-time transfer functions using a zero-order hold, and examining the relationship between poles and zeros of continuous and discrete systems.

Uploaded by

Admasu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

TD-Digital Control 3AI2S

This document contains exercises related to digital control systems and the z-transform. It introduces the z-transform and its properties, then covers using the inverse z-transform to solve linear time-invariant difference equations. Finally, it discusses sampled systems, including determining sampled transfer functions from continuous-time transfer functions using a zero-order hold, and examining the relationship between poles and zeros of continuous and discrete systems.

Uploaded by

Admasu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Tutorials - Digital

control
n◦ 1
H. Garnier
F. Collin

Ask your question, you will be an idiot for a second.


Do not ask and you will be an idiot all your life. Albert Einstein.

The z-transform and its properties

A knowledge of the z-transform is very important in digital control, as it is a valuable tool for representing,
analyzing and designing discrete-time control systems. The unilateral z-transform of a discrete-time sequence
is given by:
+∞
X
X(z) = x(k)z −k
k=0

The z-transforms of common discrete-time sequences have been calculated in closed form. They are usually
given in the form of table (see Appendix). Such table is particularly useful in finding the inverse z-transform.

Exercise 1.1
Plot each of the following discrete-time sequences. Find their z-transform:

(a) x1 (k) = δ(k − 1) + 3δ(k − 2) + δ(k − 3)


(b) x2 (k) = δ(k) + 4δ(k − 1) + 16δ(k − 2) + 64δ(k − 3)
M
X −1
(c) x3 (k) = δ(k − i)
i=0
(d) x4 (k) = Γ(k)
(e) x5 (k) = ak Γ(k)

(f ) x6 (k) = cos ω0 k Γ(k)

where δ(k) and Γ(k) denotes the discrete-time unit impulse and step sequences respectively.

Exercise 1.2
Consider the following discrete-time signal

x(k) = − 1 + 2k Γ(k)


By using the table of z-transforms (see Appendix), find the z-transform Use the initial value theorem to
check the correctness of your z-transform calculation.
Deduce from X(z) the z-transform of y(k) = x(k − 2).

Exercise 1.3
Given the following z-transform of a discrete-time sequence,

X(z) = 4z −2 + 2 + 3z −1

determine the inverse z-transform by direct inspection.


Express x(k) in as a sum of weighted discrete-time delayed impulses and plot the discrete-time sequence.
Use the initial and final value theorems to check your calculation.

1
Tutorials - Digital
control
n◦ 2
H. Garnier
F. Collin

Ask your question, you will be an idiot for a second.


Do not ask and you will be an idiot all your life. Albert Einstein.

Inverse z-transform and its application for solving linear


time-invariant difference equations
Just as linear continuous-time systems are described by differential equations, linear digital control systems
are described by difference equations. We have seen that Laplace transform is a powerful method of solving
linear time-invariant differential equations. Similarly, z-transform is an operational method for solving linear
time-invariant difference equations.

Exercise 2.1
Given the following z-transforms of causal linear time-invariant signals, determine their inverse z-transform
by first expanding them into a power series using long division and then by using the partial fraction
expansion method.

z2 z
(a) X1 (z) = (b) X2 (z) =
(z − 1)(z − 2) (z − 1)(z − 2)
0.2z z(3z − 1)
(c) X3 (z) = (d) X4 (z) =
(z − 1)(z − 0.8) (z − 1)(z − 2)
z
(e) X5 (z) = 2
z + 6z + 8
Give, when it is possible, the first four terms of each sequence and the final value x(∞). Use the initial value
theorem to check the correctness of your inverse z-transform calculation.

Exercise 2.2
Using the z-transform, solve the following difference equation:

s(k) − 3s(k − 1) = e(k)

when e(k) = 4Γ(k)

Exercise 2.3
Using the z-transform, solve the following difference equation:

s(k) − 5s(k − 1) + 6s(k − 2) = e(k)

when e(k) = Γ(k)

Exercise 2.4
Consider the discrete-time system given by
3 1 5
s(k + 2) − s(k + 1) + s(k) = e(k), with the initial conditions s(0) = 1, s(1) = .
2 2 2
Show that its response to a discrete-time unit step input is given by.

s(k) = 2kTs + (0.5)k Γ(k)




2
Tutorials - Digital
control
n◦ 3
H. Garnier
F. Collin

Ask your question, you will be an idiot for a second.


Do not ask and you will be an idiot all your life. Albert Einstein.

Sampled systems
Exercise 3.1

1. Recall the closed-loop block-diagram of the digital control of a continuous-time systems described by
its transfer function G(s).

2. State the goal of the zero-order hold (ZOH).


3. Recall the plot of the impulse response of the ZOH. Deduce from the plot its mathematical expression
bo (t) and derive its transfer function Bo (s) from it.
4. Recall the formula of the so-called sampled transfer function GZOH (z) which is also denoted as the
discretized version of the plant G(s) by using the zero-order hold method.

5. Recall the formula of the sampled transfer function GZOH (z) when the continuous-time plant is a first
b
order G(s) = s+a . Note the dependency of the sampled transfer function parameters to the sampling
period Ts .

Exercise 3.2

Figure 3.1: Sampled transfer function

Consider a sampled system constituted by the cascade of a zero-order hold (ZOH) Bo (s), a continuous-time
transfer function G(s) and a sampler as shown in Figure ?? where:
2
G(s) =
1 + 2s
1. Give the steady-state gain, the time-constant, the pole and zero of G(s).

2. Determine the sampled transfer function GZOH (z) when Ts = 1s.


3. Check your results with Matlab by typing the following commands:
s = tf(’s’);
G=2/(1+2*s)
Gzoh=c2d(G,1,’zoh’)

4. Calculate the pole and zero of GZOH (z).

3
5. Recall the relationship between the poles of G(s) and GZOH (z).
6. Give the difference equation of the sampled system.
7. Calculate the response y(k) to a unit discrete-time step u(k) = Γ(k) for k = 0, 1, 2, 3, 4 and compare it
with the step response of the continuous-time system G(s) recalled below :

yc (t) = K(1 − e−t/T )Γ(t)

computed at the appropriate sampled time-instants t = kTs for k = 0, 1, 2, 3, 4.


Exercise 3.3
Consider a sampled system constituted by the cascade of a zero-order hold (ZOH) Bo (s), a continuous-time
transfer function G(s) and a sampler where
s+4
G(s) =
(s + 1)3

1. Calculate the poles and zero of G(s).


2. Use Matlab to plot zero-pole diagram and the step response of the continuous-time transfer function.
Note that the continuous-time process exhibits an aperiodic step response which is due to its zero in
the left half of the s-plane

3. Given that the unit of time is minutes, determine the sampled transfer function GZOH (z) by using
Matlab and investigate the location of its zeros with respect to the unit circle when the sampling period
Ts is 2 and 0.5 min.
4. For each case, plot the step response of the sampled transfer function and check whether the sampled
transfer function exhibits an non-inverse response.

Exercise 3.4
Consider a sampled system constituted by the cascade of a zero-order hold (ZOH) Bo (s), a continuous-time
transfer function G(s) and a sampler where
−3s + 1
G(s) =
(2s + 1)(5s + 1)

1. Use Matlab to plot the step response of the continuous-time transfer function. Note that the continuous-
time second-order process exhibits an inverse step response which is due to its zero in the right half of
the s-plane.
2. Given that the unit of time is minutes, determine the sampled transfer function GZOH (z) by using
Matlab and investigate the location of its zero with respect to the unit circle when the sampling period
is 1, 2, 6, 7, 8, and 10 min.
3. For each case, plot the step response of the sampled transfer function and check whether the sampled
transfer function exhibits also an inverse response.

4
Tutorials - Digital
control
n◦ 4
H. Garnier
F. Collin

Ask your question, you will be an idiot for a second.


Do not ask and you will be an idiot all your life. Albert Einstein.

Analysis of discrete-time systems


Exercise 4.1
Consider the sampled system given by its transfer function

Y (z) 0.4z −1
GZOH (z) = =
U (z) 1 − 0.8z −1

1. Give the system order and determine its steady-state gain, its zero and pole.

2. Plot the zero-pole diagram. Conclude about the stability of the sampled system.
3. Check your answers by executing the following Matlab code:
Gd=tf([0 0.4],[1 -0.8],pi)
dcgain(Gd)
zero(Gd)
pole(Gd)
pzplot(Gd)
4. Determine the difference equation of the discrete-time system.
5. Compute its response to a sampled unit step input.

6. Use the final value theorem to determine the step response when k = ∞.
7. Determine the frequency response when the sampling frequency is ωs = 2 rad/s. Use Matlab to plot
the Bode diagram and observe of the main characteristics of the system in the frequency domain.

Exercise 4.2
Consider a sampled system given by the following second-order difference equation:

y(k) = 1.739y(k − 1) − 0.7533y(k − 2) + 0.01138u(k − 1) + 0.01036u(k − 2)

1. Determine its discrete-time transfer function.

2. Give the system order and determine its steady-state gain, its zero and poles.
3. Plot the zero-pole diagram. Conclude about the stability of the sampled system.
4. Check your answers by using Matlab.

5. Compute its response to a sampled unit step input.


6. Use the final value theorem to determine the step response when k = ∞.
7. Use Matlab to plot the Bode diagram and observe of the main characteristics of the system in the
frequency domain.

5
Exercise 4.3
Consider the sampled system given the following discrete-time transfer function

2z −5 0.2
GZOH (z) =
(z − 1)2 z − 0.8

1. Give the system order, its zero and poles.


2. Determine the gain, the number of integrators and number of samples of the time-delay.

Exercise 4.4
State whether the discrete-time transfer functions given below are stable, marginally stable or unstable.
Justify your answer.
5z 5z
G1 (z) = G2 (z) =
(z + 0.2)(z − 0.8) (z + 1.2)(z − 0.8)
5(z + 1) 5(z + 1.2)
G3 (z) = G4 (z) = 2
z(z − 1)(z − 0.8) z (z − 1)2 (z + 0.1)

Exercise 4.5
The characteristic equation of a linear digital feedback control system is given as

D(z) = z 2 + z + Kp

where Kp is a real positive constant.

Find the range of values for Kp so that the digital feedback control system is stable.

6
Tutorials - Digital
control
n◦ 5
H. Garnier
F. Collin

Ask your question, you will be an idiot for a second.


Do not ask and you will be an idiot all your life. Albert Einstein.

Design of digital controller


Exercise 5.1
A continuous-time process is reasonably well modeled by the following first-order transfer function model:
K
G(s) = K>0
1 + Ts
1. Represent the block-diagram of the closed-loop analog control system when a simple proportional
controller C(s) = Kp is used (Kp > 0).
2. Show that in continuous time, the closed-loop system is always stable, for all positive values of pro-
portional controller gain Kp .
3. Recall the sampled transfer function GZOH (z) for a given sampling period Ts (see Appendix).
4. Represent the block-diagram of the closed-loop digital control system.
5. Show the range of proportional gain Kp which guarantees the discrete-time closed-loop system to be
stable is given by
1 + e−Ts /T
Kp < Kc with Kc =
K(1 − e−Ts /T )
Exercise 5.2
A continuous-time process consisting of two first-order systems in series is reasonably well modeled by the
following transfer function model:
1.5
G(s) =
(1 + 5s)(1 + 12s)
The time constants are in minutes, and the actuator and sensor dynamics may be considered negligible.
1. Determine the range of proportional gain Kp which guarantees the continuous-time closed-loop system
to be stable.
2. Under digital proportional feedback control, incorporating a ZOH, find the range of Kp values for
which the closed-loop system will remain stable when the sampling period is Ts = 1min.
3. Repeat the question above for Ts = 5 min.
Exercise 5.3
Assume that the following simple controller has been designed in continuous-time:
U (s) s+1
C(s) = =
ε(s) s + 10
For a sampling period Ts = 0.1s, find the digital version of the analog controller by using
z−1 1 − z −1
1. the forward difference rule: s = =
Ts Ts z −1
z−1 1 − z −1
2. the backward difference rule: s = =
zTs Ts

7
Figure 5.1: Digital controller design via approximation of analog controller

2 z−1 2 1 − z −1
3. the bilinear ou Tustin rule: s = =
Ts z + 1 Ts 1 + z −1
In every case, write the difference equation and examine the stability of the resulting digital filter.

Type the following Matlab commands to compare the Bode diagram of the analog and digital controllers:
s = tf(’s’);
C=(s+1)/(s+10);
Ts=0.1;
Cf=tf([1 -0.9],[1 0],Ts)
Cb=tf([0.55 -0.5],[1 -0.5],Ts)
Ct=c2d(C,Ts,’tustin’)
bode(C,Cf,Cb,Ct)
legend(’Analog’,’forward’,’backward’,’tustin’)

Exercise 5.4 Write the Matlab code that implements the control for the digital controller

U (z) 0.3 − 0.4z −1 + 0.2z −2


C(z) = =
ε(z) 1 − z −1

8
Tutorials - Digital
control
n◦ 6
H. Garnier
F. Collin

Ask your question, you will be an idiot for a second.


Do not ask and you will be an idiot all your life. Albert Einstein.

Design of digital PID controller


Exercise 6.1
The PID controller in its so-called ideal form is described by the following transfer function:
 1 Td s 
C(s) = Kp 1 + +
Ti s Td
1+ s
N
Two classical approaches in practice to find a digital approximation are based on the use of the following
approximation rules
z−1
1. the forward difference rule: s =
Ts
z−1
2. the backward difference rule: s =
zTs
where Ts denotes the sampling period.
Determine the transfer function of the digital controller C(z) by using the forward difference approximation
for the integral part and the backward difference approximation for the derivative part.

Exercise 6.2
A continuous-time system is modeled by the following first-order plus delay transfer function
1
G(s) = e−2s
1 + 8s
1. Find the PI controller that results by applying the Ziegler-Nichols tuning rules to the process
2. Determine the transfer function of the digital controller C(z) by using the forward difference approxi-
mation for the integral part when N = 10 and Ts = 0, 1s.

3. Give the difference equation of the digital controller output.

Exercise 6.3
The digital implementation in Python of a PID controller is given below. Determine the transfer function of
both digital and analog controllers.
def pid(sp,pv,pv_last,ierr,dt):
Kc = 10.0 # K
tauI = 50.0 # sec
tauD = 1.0 # sec
# Parameters in terms of PID coefficients
KP = Kc
KI = Kc/tauI
KD = Kc*tauD
# u0 for controller (initial heater)
u0 = 0
# calculate the error

9
error = sp-pv
# calculate the integral error
ierr = ierr + KI * error * dt
# calculate the measurement derivative
dpv = (pv - pv_last) / dt
# calculate the PID output
P = KP * error
I = ierr
D = -KD * dpv
u = u0 + P + I + D

Exercise 6.4
Write a Matlab program that implements the closed-loop control for the digital PID controller derived in
Exercise 6.2 and discuss its ability to track a set-point step.

Exercise 6.5
Write a Simulink program that implements the closed-loop control for the digital PID controller derived in
Exercise 6.2 and discuss its ability to track a set-point step.

10
English to French translation

bandwidth : bande passante


closed-loop system : système bouclé
cut-off frequency : fréquence (ou pulsation) de coupure
damped frequency : pulsation amortie
damping ratio : coefficient d’amortissement
feedback : contre-réaction
feedback system : système à contre-réaction
impulse response : réponse impulsionnelle
integral wind-up : emballement du terme intégral
impulse response : réponse impulsionnelle
input : entrée
gain : gain
linear time-invariant (LTI) : linéaire invariant dans le temps
output : sortie
overshoot : dépassement
rise time : time de montée
root locus : lieu des racines
sampled : échantillonné
setpoint : consigne
settling time : temps de réponse
steady-state gain : gain statique
steady-state response : réponse en régime permanent
step response : réponse indicielle
time-invariant : invariant dans le temps
transient response : réponse transitoire
undamped natural frequency : pulsation propre non amortie

11
Appendix

Table of common unilateral Laplace and z-transforms

The table below provides a number of Laplace and z-transform pairs and their region of convergence (ROC).
Remarks:

f (t) F (s) f (k) F (z) ROC

δ(t) 1 δ(k) 1 All z

δ(t − t0 ) e−st0 δ(k − i) z −i z 6= 0

1 z
Γ(t) s Γ(k) z−1 |z| > 1

1 zTs
tΓ(t) s2 kTs Γ(k) (z−1)2 |z| > 1

z
ak Γ(k) z−a |z| > |a|

e−at Γ(t) 1
s+a e−akTs Γ(k) z
z−e−aTs
|z| > |a|

Ts e−aTs z
te−at Γ(t) 1
(s+a)2 kTs e−akTs Γ(k) (z−e−aTs )2
|z| > |a|

s z(z−cos(ω0 Ts ))
cos(ω0 t)Γ(t) s2 +ω02
cos(ω0 kTs )Γ(k) z 2 −2 cos(ω0 Ts )z+1 |z| > |1|

ω0 sin(ω0 Ts )z
sin(ω0 t)Γ(t) s2 +ω02
sin(ω0 kTs )Γ(k) z 2 −2 cos(ω0 Ts )z+1 |z| > |1|

• The notation for z found in the table above may differ from that found in other tables. For example, the basic
z-transform of a unit discrete-time step Γ(k) can be written as either of the following two expressions, which are
equivalent:
z 1
Z(Γ(k)) = Γ(z) = =
z−1 1 − z −1
• The ROC for a given sequence x(k), is defined as the range of z for which the z-transform converges. Since the
z-transform is a power series, it converges when x(k)z −k is absolutely summable. Stated differently,
+∞
X
|x(k)z −k | < ∞ must be satisfied for convergence.
k=0

Property 1. if x(k) is of finite duration, then the ROC is the entire z-plane, except possibly z = 0 and/or z = ∞.

Property 2. The ROC does not contain any poles.

Useful properties of geometric series

N
X
finite sum of geometric series qk = N + 1 if q = 1
k=0
N
X
k 1 − q N +1
q = if q 6= 1
1−q
k=0
N
X 1
infinite sum of geometric series lim qk = if |q| < 1
N →+∞ 1−q
k=0

12
Useful properties of the unilateral z-transform

Some useful properties which have found practical use are summarized below.

Property signal z-transform

linearity ax(k) + by(k) aX(z) + bY (z)

time-delay x(k − 1) z −1 X(z) if x(k) is causal

x(k − i) z −i X(z) if x(k) is causal

x(k − 1) z −1 X(z) + z −2 x(−1) if x(k) is non-causal


−1
X
x(k − i) z −i X(z) + z j−i x(j) if x(k) is non-causal
j=−i

time-advance x(k + 1) zX(z) − zx(0)

x(k + 2) z 2 X(z) − z 2 x(0) − zx(1)


i−1
X
x(k + i) z i X(z) − z i−j x(j)
j=0

convolution y(k) = h(k) ∗ u(k) Y (z) = H(z)U (z)


+∞
X
y(k) = h(i)u(k − i)
i=−∞

differentiation kx(k) −z dX(z)


dz
n
X
1
accumulation x(k) 1−z −1 X(z)
k=0

initial value theorem if x(k) = 0 for k < 0 x(0) = lim X(z)


z→+∞

final value theorem lim x(k) = lim (z − 1)X(z) if the limit exists
k→+∞ z→1

——————————————————————————————————————

13
Sampled transfer functions of continuous-time systems

Sampled transfer functions of continuous-time systems

Figure A.1: Sampled system

Consider a Zero-Order Hold (ZOH) Bo (s) cascaded with a continuous-time transfer function G(s) and a
sampler as shown in Figure ??, the corresponding sampled transfer function is given by:
     
Y (z)   G(s) z−1 G(s)
= Z Bo (s)G(s) = 1 − z −1 Z

GZOH (z) = = Z
U (z) s z s

First-order systems
Consider a continuous-time first-order system given by its Laplace transfer function:
b
G(s) =
s+a
Its equivalent ZOH sampled transfer function is given by:
b1 z −1
 
 
−1
 b
GZOH (z) = Z Bo (s)G(s) = 1 − z Z =
s(s + a) 1 + a1 z −1
where 
a1 = −e−aTs
b
b1 = (1 + a1 )
a
where Ts denotes the sampling period.

Second-order systems
Consider a continuous-time second-order system given by its Laplace transfer function:
a×b
G(s) =
(s + a)(s + b)
then
 
 
−1
 a×b
GZOH (z) = Z Bo (s)G(s) = 1 − z Z
s(s + a)(s + b)
b1 z −1 + b2 z −2
=
(1 + αz −1 )(1 + βz −1 )
Its equivalent ZOH sampled transfer function is given by:



 α = −e−aTs
−bT
β = −e s



b×α−a×β
b1 = +1

 b−a
b×β−a×α



b2 =
 +α×β
b−a
——————————————————————————————————————

14
PID tuning by using empirical rules

A PID controller defined in its so-called ideal form is defined as:


 
1 Td s  1 s
C(s) = Kp 1 + + = Kp + Ki + Kd (1)

Ti s Td  s Td
1+ s 1+ s
N N
The individual effects of these three Kp , Ki and Kd parameters appearing in (??) on the closed-loop per-
formance of stable plants are recalled in Table 1 below.

Tuning of the PID controller by using the Ziegler-Nichols rules


Assume a continuous-time process is reasonably well modeled by the first-order plus time-delay transfer
function model:
Ke−τ s
G(s) =
1 + Ts
Several tuning rules are available for determining the PID controller parameter values. The proposed rules
address different design specifications such as load disturbance rejection or setpoint tracking.
The most popular tuning rules are those attributed to Ziegler-Nichols. Their aim is to provide satisfactory
load disturbance rejection.
Table ?? shows the Ziegler-Nichols rules for P, PI, or PID controllers defined in its so-called ideal form (see
(??)).

Controller type Kp Ti Td

T
P

T
PI 0.9 3τ

T
PID 1.2 2τ 0.5τ

Table 1: Ziegler-Nichols disturbance rejection tuning rules for a first-order-plus delay model determined from
an open-loop step response

Tuning of the PI controller by using the Chien-Hrones-Reswick rules


As previously said, the Ziegler-Nichols rule aim is to provide satisfactory load disturbance rejection.
For setpoint tracking (or servo control), it can be advantageous to use the empirical rules suggested by
Chien-Hrones-Reswick which are given in Table ?? for P, PI, and PID controllers in their ideal form (see (??)).

15
Controller type Kp Ti Td

T
P 0.3
τ
T
PI 0.35 1.2T
τ
T
PID 0.6 T 0.5T
τ

Table 2: Chien-Hrones-Reswick setpoint tracking tuning rules for a first-order-plus delay model determined
from an open-loop step response

Appendix 4 - Digital position and velocity forms of the analog PID controller

where T above denotes the sampling period. Either the form of Eq. (26.1) or that of Eq. (26.2) can be used
for digitally implementing the analog PID controller.

16

You might also like