You are on page 1of 29

CHAPITRE 2

Systèmes Échantillonnés

Mohamed Bougrine

Faculté de Technologie
Université de Laghouat
Digital Control Loops
Digital Control of an Analog Process
Representation of Discrete LTI Systems
Digital Control of a Digital Process
Discretization of LTI Systems

Digital Control of an Analog Process

Analog-to-Digital Converters (ADCs) and Digital-to-Analog Converters (DACs) are


essential for the operation of systems controlled by a Digital Computer (DC). These
converters enable the connection of the computer to its external environment. The
following figure shows a system controlled by a digital computer (DC). It is a digital
control of an analog process.

M. Bougrine Systèmes Échantillonnés


Digital Control Loops
Digital Control of an Analog Process
Representation of Discrete LTI Systems
Digital Control of a Digital Process
Discretization of LTI Systems

Elements of the structure (Devices)

a digital computer (DC): automatic calculation means allowing arithmetic


or analytical operations according to a determined program of digital
controller (PI, PID, RST, etc.);
an analog sensor allowing the measurement of the output quantity
(convert the physical quantity into an electrical signal).
an actuator which carries out the system command. It provides the energy
(power) necessary for the process to produce the desired effect. Examples:
a power amplifier, a regulating valve, etc.;
an analog-to-digital converter (ADC): allows the conversion of an analog
quantity into a digital quantity;
a digital-to-analog converter (DAC): a DAC transforms a digital quantity
into an analog quantity;
an analog process: an installation that we want to control. Examples:
robot, airplane, oven, etc.;
a comparator: it allows to construct the error signal e(t);

M. Bougrine Systèmes Échantillonnés


Digital Control Loops
Digital Control of an Analog Process
Representation of Discrete LTI Systems
Digital Control of a Digital Process
Discretization of LTI Systems

Elements of the structure (Signals)

a continuous setpoint w (t): signal to be followed by the process output;


a continuous physical quantity to be regulated y (t)
a continuous measurement m(t): image of the true regulated quantity
provided by the sensor;
a continuous error e(t): difference between the setpoint w (t) and the
measurement m(t);
a continuous control u(t): signal delivered by the DAC;
a digital error e(k): is the digital version of the error e(t);
a digital control u(k): signal delivered by the DC.

M. Bougrine Systèmes Échantillonnés


Digital Control Loops
Digital Control of an Analog Process
Representation of Discrete LTI Systems
Digital Control of a Digital Process
Discretization of LTI Systems

ADCs and DACs


Analog-to-digital converters (ADCs) and digital-to-analog converters
(DACs) can be modeled as follows:

Figure: Modeling of an Analog-to-Digital Converter (ADC)

Figure: Modeling of a Digital-to-Analog Converter (DAC)

M. Bougrine Systèmes Échantillonnés


Digital Control Loops
Digital Control of an Analog Process
Representation of Discrete LTI Systems
Digital Control of a Digital Process
Discretization of LTI Systems

General structure of digital control of a digital process

Figure: Digital control of a digital process

M. Bougrine Systèmes Échantillonnés


Digital Control Loops
Digital Control of an Analog Process
Representation of Discrete LTI Systems
Digital Control of a Digital Process
Discretization of LTI Systems

Elements of the structure

The digital computer ensures both control and digital comparison.


The signals w (k), e(k), u(k), y (k), and m(k) are digital signals.
C (z) and G (z) are respectively the discrete transfer functions of a
digital controller and a digital process.

M. Bougrine Systèmes Échantillonnés


Digital Control Loops
Representation by the recursive equation
Representation of Discrete LTI Systems
Representation by Block Diagram
Discretization of LTI Systems

Representation of Discrete LTI Systems

Figure: Discrete Monovariable LTI System

Several methods can be used to represent discrete-time linear


time-invariant systems, including:
Discrete transfer function
Difference equation (recurrent)
Block diagram representation

M. Bougrine Systèmes Échantillonnés


Digital Control Loops
Representation by the recursive equation
Representation of Discrete LTI Systems
Representation by Block Diagram
Discretization of LTI Systems

Discrete Transfer Function

It is the ratio of the z-transform of the output to the z-transform of the


input.
Y (z)
G (z) = (1)
X (z)

The transfer function G (z) is also the z-transform of the impulse


response g (t) (to think about)

Three forms for G (z) to distinguish


Polynomial fraction in z
Polynomial fraction in z −1
zpk form (zeros-poles-gain)

M. Bougrine Systèmes Échantillonnés


Digital Control Loops
Representation by the recursive equation
Representation of Discrete LTI Systems
Representation by Block Diagram
Discretization of LTI Systems

z-Domain Transfer Function

N(z) b0 z m + b1 z m−1 + · · · + bm
G (z) = = (2)
D(z) z n + a1 z n−1 + · · · + an

Fundamentals
The poles of the system are the roots of D(z)
The zeros of the system are the roots of N(z)
The order of the system is n (degree of D(z))

The poles and zeros of a discrete system play an important role in its
behavior, and in the design of a digital controller.

M. Bougrine Systèmes Échantillonnés


Digital Control Loops
Representation by the recursive equation
Representation of Discrete LTI Systems
Representation by Block Diagram
Discretization of LTI Systems

Example

Consider a discrete LTI system defined by its transfer function polynomial


in ’z’

Matlab code:

NumG= [1 1];
DenG = [1 0.2 -1];
T= 1;
G = tf(NumG,DenG,T,'variable','z')

M. Bougrine Systèmes Échantillonnés


Digital Control Loops
Representation by the recursive equation
Representation of Discrete LTI Systems
Representation by Block Diagram
Discretization of LTI Systems

Transfer Function in the Variable ’z −1 ’

A discrete LTI system can also be represented by a transfer function


polynomial in the variable ’z −1 ’:

N(z −1 ) b0 + b1 z −1 + · · · + bm z −m
G (z −1 ) = = (3)
D(z −1 ) 1 + a1 z −1 + · · · + an z −n

Remark
The transformation from G (z) to G (z −1 ) is done by multiplying N(z)
and D(z) by z −n .

Attention
For the same system, the bi of G (z) and those of G (z −1 ) coincide only if
d = n − m = 0. In the general case, they are equal with a shift of d.

M. Bougrine Systèmes Échantillonnés


Digital Control Loops
Representation by the recursive equation
Representation of Discrete LTI Systems
Representation by Block Diagram
Discretization of LTI Systems

Example

Let’s consider the same discrete LTI system as before, but defined by its
transfer function in "z −1 ":

Matlab code:

NumG= [0 1 1];
DenG = [1 0.2 -1];
T= 1;
G = tf(NumG,DenG, T,'variable','z^-1')

M. Bougrine Systèmes Échantillonnés


Digital Control Loops
Representation by the recursive equation
Representation of Discrete LTI Systems
Representation by Block Diagram
Discretization of LTI Systems

Transfer Function in zpk Form (Zeros-Poles-Gain)

G (z) can be factorized as follows:


Qm
(z − z1 ) (z − z2 ) . . . (z − zm ) j=1 (z − zj )
G (z) = b0 = b0 n
Q (4)
(z − p1 ) (z − p2 ) . . . (z − pn ) i=1 (z − pi )

where pi , zi , and b0 are respectively the poles, zeros, and gain (Evans
factor) of the discrete LTI system.

M. Bougrine Systèmes Échantillonnés


Digital Control Loops
Representation by the recursive equation
Representation of Discrete LTI Systems
Representation by Block Diagram
Discretization of LTI Systems

Example
Consider the following transfer function:

Matlab code:

ZerosG= [0 -0.5]';
PolesG= [-1.105 0.905]';
b0G= 2;
T= 1;
G = zpk(ZerosG,PolesG,b0G,T)

M. Bougrine Systèmes Échantillonnés


Digital Control Loops
Representation by the recursive equation
Representation of Discrete LTI Systems
Representation by Block Diagram
Discretization of LTI Systems

Recursive equation

The recursive equation plays an equivalent role, in the study of


discrete-time systems, to that played by the differential equation in the
study of continuous-time systems. Formally, the recursive equation of a
discrete system allows expressing the output at time k in terms of past
samples of the output and the input. It is written as:
m
X n
X
y (k) = bj x(k − j) − ai y (k − i) (5)
j=0 i=1

M. Bougrine Systèmes Échantillonnés


Digital Control Loops
Representation by the recursive equation
Representation of Discrete LTI Systems
Representation by Block Diagram
Discretization of LTI Systems

Example

Determine the recursive equation of the following transfer function:


0.2
F (z) =
z − 0.8

First, express F (z) in polynomial form in "z −1 ":

0.2z −1 Y (z)
F (z) = =
1 − 0.8z −1 X (z)

which gives:
Y (z) − 0.8z −1 = 0.2z −1 X (z)
Applying the inverse z transform yields:

y (k) = 0.8y (k − 1) + 0.2x(k − 1)

M. Bougrine Systèmes Échantillonnés


Digital Control Loops
Representation by the recursive equation
Representation of Discrete LTI Systems
Representation by Block Diagram
Discretization of LTI Systems

Representation by Block Diagram

Scalar multiplication

Algebraic summation

Time shift

M. Bougrine Systèmes Échantillonnés


Digital Control Loops
Representation by the recursive equation
Representation of Discrete LTI Systems
Representation by Block Diagram
Discretization of LTI Systems

Example

Consider the LTI system defined by the following block diagram:

x(k) x(k − 1) y (k)


z −1 Σ

z −1
3
y (k − 1)
3y (k − 1)
z −1
−2
y (k − 2)
−2y (k − 2)

M. Bougrine Systèmes Échantillonnés


Discretization using ZOH
Digital Control Loops
Discretization using BOU
Representation of Discrete LTI Systems
Discretization using Tustin’s approximation
Discretization of LTI Systems
Discretization using Euler’s approximations

Discretization of a continuous process

Consider a continuous single-input single-output (SISO) LTI system


defined by a continuous transfer function G (p), such that:

X (p) G (p) Y (p)

Commonly used discretization methods include:


Discretization using Zero-Order Hold (ZOH) and Zero-Order Hold
(ZOH)
Discretization using Tustin’s approximation
Discretization using Euler approximations (forward and backward)

M. Bougrine Systèmes Échantillonnés


Discretization using ZOH
Digital Control Loops
Discretization using BOU
Representation of Discrete LTI Systems
Discretization using Tustin’s approximation
Discretization of LTI Systems
Discretization using Euler’s approximations

Discretization using ZOH


The discrete transfer function is obtained by discretizing the system after
the insertion of a ZOH as follows:

⇐⇒

The obtained function G (z) is given by:


 
−1 G (p)
G (z) = (1 − z )Z
p

M. Bougrine Systèmes Échantillonnés


Discretization using ZOH
Digital Control Loops
Discretization using BOU
Representation of Discrete LTI Systems
Discretization using Tustin’s approximation
Discretization of LTI Systems
Discretization using Euler’s approximations

Discretization using BOU


The discrete transfer function is obtained by discretizing the system after
the insertion of a BOU as follows:

⇐⇒

The obtained function G (z) is given by:


 
1 + Tp
G (z) = (1 − z −1 )2 Z G (p)
Tp 2

M. Bougrine Systèmes Échantillonnés


Discretization using ZOH
Digital Control Loops
Discretization using BOU
Representation of Discrete LTI Systems
Discretization using Tustin’s approximation
Discretization of LTI Systems
Discretization using Euler’s approximations

Discretization using Tustin’s approximation

It is also possible to obtain an approximate discrete version of the system


G (p) using Tustin’s approximation (bilinear approximation) as shown in
the following figure:

2 z−1
This involves replacing the Laplace complex variable p with T z+2 ,
yielding:
G (z) = G (p)
p= T2 z−1
z+2

M. Bougrine Systèmes Échantillonnés


Discretization using ZOH
Digital Control Loops
Discretization using BOU
Representation of Discrete LTI Systems
Discretization using Tustin’s approximation
Discretization of LTI Systems
Discretization using Euler’s approximations

Discretization using Euler’s approximations


This approach involves approximating the continuous derivative between
two sampling instants (Euler’s principle). Two approximations are
distinguished: backward and forward.
z−1
Backward approximation: p 7→ Tz

z−1
Forward approximation: p 7→ T

M. Bougrine Systèmes Échantillonnés


Discretization using ZOH
Digital Control Loops
Discretization using BOU
Representation of Discrete LTI Systems
Discretization using Tustin’s approximation
Discretization of LTI Systems
Discretization using Euler’s approximations

Example

Consider a first-order continuous transfer function with a static gain


K = 1 and a time constant τ = 10, i.e.:
1
Gc (p) =
10p + 1

Discretize the system using two different methods with a sampling period
of T = 10s.

M. Bougrine Systèmes Échantillonnés


Discretization using ZOH
Digital Control Loops
Discretization using BOU
Representation of Discrete LTI Systems
Discretization using Tustin’s approximation
Discretization of LTI Systems
Discretization using Euler’s approximations

Example: Discretization using BOZ


The formula is:  
Gc (p)
Gd (z) = 1 − z −1 z

p
Gc (p)
First, let’s decompose p into partial fractions:
Gc (p) 1 1
= −
p p p + 1/10
   
Gc (p) 1 1 1 1
Z =Z − = −
p p p + 1/10 1 − z −1 1 − e −T /10 z −1
Calculating the discrete version with T = 10s:
   
−1
 Gc (p) −1
 1 1
Gd (z) = 1 − z z = 1−z −
p 1 − z −1 1 − e −1 z −1
Hence:
1 − e −1 z −1

0.6321z −1 0.6321
Gd (z) = −1 −1
= −1
=
1−e z 1 − 0.3679z z − 0.3679
M. Bougrine Systèmes Échantillonnés
Discretization using ZOH
Digital Control Loops
Discretization using BOU
Representation of Discrete LTI Systems
Discretization using Tustin’s approximation
Discretization of LTI Systems
Discretization using Euler’s approximations

Example: Discretization using Tustin’s approximation

The formula is:

G (z) = G (p) p= T2 z−1


z+2

1
=
10p + 1 p= T2 z−1
z+2

Therefore,
Tz + T
Gd (z) =
(T + 20)z + (T − 20)
With T = 10, we have:

z +1 0.3333z + 0.3333 0.3333 + 0.3333z −1


Gd (z) = = =
3z − 1 z − 0.3333 1 − 0.3333z −1

M. Bougrine Systèmes Échantillonnés


Discretization using ZOH
Digital Control Loops
Discretization using BOU
Representation of Discrete LTI Systems
Discretization using Tustin’s approximation
Discretization of LTI Systems
Discretization using Euler’s approximations

Example: MATLAB

These results can be obtained with the following MATLAB code:

NumGc= 1;
DenGc = [10 1];
Gc = tf(NumGc,DenGc) ;
T= 10;
% Discretization using BOZ
Gd_BOZ = c2d(Gc,T,'zoh')
% Discretization using Tustin's approximation
Gd_Tustin = c2d(Gc,T,'tustin')
% Continuous and discrete step responses
step(Gc,100,'b')
hold on
step(Gd_BOZ,100,'r')
step(Gd_Tustin,100,'g')
legend('Continuous Response','Discrete Response ...
(BOZ)','Discrete Response (Tustin)')

M. Bougrine Systèmes Échantillonnés


Discretization using ZOH
Digital Control Loops
Discretization using BOU
Representation of Discrete LTI Systems
Discretization using Tustin’s approximation
Discretization of LTI Systems
Discretization using Euler’s approximations

Example: MATLAB

M. Bougrine Systèmes Échantillonnés

You might also like