Digital Control Systems
Digital Control Systems
Systems
1
Continuous vs. Discrete Time
Disadvantages Advantages
Develop complexImproved
math algorithms
sensitivity •
Lose information
Use digital
duringcomponents
conversions •
Control algorithms easily modified •
Many systems inherently digital •
Digital Control Systems:
Zero-Order Hold
sT
1e
H2 ( s)
s
Digital Control Systems:
Zero-Order Hold (cont)
Digital Control Systems:
The z-transform
:Def’n of z-Transform
Z{f(t)} = F(z) =
f ( kT) z
k
k 0
sT
z e
Digital Control Systems:
The z-transform (cont)
1 Tz
t
2 2
s ( z 1)
at 1 z
e
sa ze
aT
z sin T
sin t
z 2z cos T 1
2 2 2
s
Digital Control Systems:
Stability in s-plane
:Region of Stability
Left-Hand Plane
Sampled-data system
9
The sampling process 6.1
A sampler is basically a switch that closes every T seconds.
10
r(t): continuous signal
11
• q: amount of time the
switch is closed
In practice, •
qT,
and the pulses can be
approximated by flat-
topped rectangles.
12
If q is neglected, the
operation is called
“ideal sampling”
13
Ideal sampling
• Ideal sampling of a continuous signal can be considered as a
multiplication of the continuous signal, r(t), with a pulse train,
P(t).
14
• The pulse train: P (t ) (t nT );
n
Ideal sampling
r * (t ) P(t )r (t ),
r (t ) r (t ) (t nT ).
*
n
r (t )
*
r (nT ) (t nT ).
n
• Let, r(t) = 0, for t<0, then,
r * (t ) r (nT ) (t nT ).
n 0
15
The z-transform
• Taking Laplace transform of the sampled signal r*(t)
gives:
R* ( s) r (nT )e nTs .
n 0
i.e. the r(nT ) are the coefficients of this power series at different
sampling instants.
17
The z-transform
18
D/A converter as a zero-order hold (ZOH)
• D/A converter converts the sampled signal r∗(t) into a
continuous signal y(t).
19
The zero-order hold (ZOH)
• The impulse response of a ZOH:
Ts Ts 20
1 e 1 e
G(s) .
s s s
The zero-order hold (ZOH)
21
Example 6.1
Figure 6.10 shows an ideal sampler followed by a ZOH. Assuming the
input signal r (t) is as shown in the figure, show the waveforms after the
sampler and also after the ZOH.
Answer
22
The z-transform of some common
functions
23
Unit Step Function
0, n 0,
r (nT )
1, n 0.
R( z ) r (nT ) z n z n 1 z 1 z 2 z 3 ...
n 0 n 0
1
1 z 1
z 24
, | z | 1.
z 1
Useful closed-form series summations
1
n 0
x 1 x x x
n 1 2 3
1 x
x
n 0
nx x 2 x 3x
n 2 3
(1 x ) 2
N 1
N
1 x
n 0
x n
1 x1
x 2
x N
1 x
25
Unit Ramp Function
0, n 0,
r (nT )
nT , n 0.
R( z ) r (nT ) z n
nTz n Tz 1 2Tz 2 3Tz 3 ...
n0 n 0
Tz
, z 1.
( z 1) 2
26
Exponential Function
0, t 0,
r (t ) at
e , t 0.
0, n 0,
r (nT ) anT
e , n 0.
R( z ) r (nT ) z n
e anT z n 1 e aT z 1 e 2 aT z 2 ...
n0 n 0
1 z
. 27
1 e aT z 1 z e aT
General Exponential Function
0, n 0,
r ( n) n
p , n 0.
R( z ) r (nT ) z n
p n z n 1 pz 1 p 2 z 2 ...
n 0 n0
1
1 pz 1
z
.
z p 28
Sine Function
0, n 0,
r ( n)
sin nT , n 0.
1, n 0,
r ( n) ( n)
0, n 0.
R( z ) r (nT ) z n 1.
n 0
30
Delayed Discrete Impulse Function
1, n k 0,
r ( n) ( n k )
0, n k.
R( z ) r (nT ) z n z k .
n0
31
32
The z-Transform of a Function Expressed
as a Laplace Transform
33
Example 6.2
Given
1
G( s) 2 .
s 5s 6
Determine G(z).
34
Answer:
Using Inverse Laplace transform
• Partial fraction
1 1 1 1
G (s) 2 .
s 5s 6 ( s 2)( s 3) s 2 s 3
• Inverse Laplace transform
z z z (e 2T e 3T ) 35
G( z) 2T
3T
2T 3T
.
z e z e ( z e )( z e )
Method 2:
Laplace to z-transform table
1 1 1 1
• So, G (s) 2 .
s 5s 6 ( s 2)( s 3) s 2 s 3
z z z (e 2T e 3T )
G( z) 2T
3T
2T 3T
. 36
z e z e ( z e )( z e )
37
Discrete-time controller design
:The design procedure is outlined as follows
.Derive the transfer function of the plant (process) .1
Transform the system transfer function into the z- .2
.plane
.Design a suitable digital controller in the z-plane .3
Implement the controller algorithm on a digital .4
.computer
38
Discrete-time controller design
Today, we will study two methods for discrete
:controller design
Deadbeat controller •
a technique to achieve an ideal response but
.require excessive control signals
Dahlin controller •
a technique to approximate the deadbeat controller
.but does not require excessive control signals
39
Digital controllers
• The closed-loop transfer function of the system shown is
Y ( z) D( z )GH ( z )
.
R( z ) 1 D( z )GH ( z )
:Suppose that the closed-loop transfer function is chosen to be •
Y ( z)
T ( z) .
R( z )
:Then, the controller required to achieve T(z) is given by •
1 T ( z)
D( z ) .
GH ( z ) 1 T ( z )
40
Digital controllers
• The equation,
1 T ( z)
D( z ) ,
GH ( z ) 1 T ( z )
• The controller D(z) must be realizable. That is, D(z) must not
have a numerator whose order exceeds that of the numerator.
41
Deadbeat Controller
Deadbeat controller is one in which a step input is
followed by the system but delayed by one or more
sampling periods, i.e. the system response is required
to be equal to unity at every sampling instant after the
application of a unit step input.
42
Deadbeat Controller
Therefore, the desired closed-loop transfer function is
T ( z) z k , k 1.
1 T ( z) 1 z k 1 1
D( z ) k .
GH ( z ) 1 T ( z ) GH ( z ) 1 z k GH ( z ) z 1
43
Example 9.1
The open-loop transfer function of a plant is given by
e 2 s
G(s) .
10s 1
Design a dead-beat digital controller for the system. Assume that
T = 1 s.
Answer:
The transfer function of the system with a ZOHis given by
1 e Ts 1 e 2Ts
GH ( z ) Z G ( s ) (1 z ) Z
s s (10 s 1)
1 2 1 44
(1 z ) z Z
s (10 s 1)
From the z-transform tables •
a Z z (1 e aT )
s( s a) ( z 1)( z e aT )
,So •
0.1
GH ( z ) (1 z 1 ) z 2 Z
s ( s 0.1)
1 2 z (1 e 0.1 )
(1 z ) z
( z 1)( z e 0.1 )
0.095
3
z 0.904 z 2
Hence, the controller is given by •
1 T ( z) z 3 0.904 z 2 1 45
D( z ) k .
GH ( z ) 1 T ( z ) 0.095 z 1
.For realizability, we must choose k ≥ 3 •
Choosing k = 3, we obtain the controller •
z 3 0.904 z 2 1 z 3 0.904 z 2
D( z ) .
0.095 z 1 0.095( z 1)
3 3
46
To analyze the designed system performance, let us simulate •
.the step response of the closed-loop and the control signal
As designed, the step response is unity after 3 secconds and
.stays at this value
Note: It is important to realize that the response is correct only 47
at the sampling instants and the response can have an
.oscillatory behavior between the sampling instants
For the control signal, we can realize that the maximum
magnitude of the control signal is very high at the beginning 48
(≈11). Usually, this is not acceptable in practice.
Drawbacks of deadbeat control
49
MATLAB code for Deadbeat control
Deadbeat control, Dogan Ibrahim, Chapter 9, Example 9.1 %
;Gru=Gc/(1+Gc*Gpd)
u=step(Gru,t)
figure(2)
plot(t,u,'o','MarkerSize',6)
xlabel('time, sec')
ylabel('control signal, u')
50
axis([0 10 0 15])
title('Control signal')
Dahlin Controller
• Dahlin controller is a modification of the deadbeat
controller which produces an exponential response that is
smoother than deadbeat control.
• The desired closed-loop response for step input looks like:
51
Dahlin Controller
• Hence, the desired closed-loop transfer function is:
e Ls
Gcl ( s )
s 1
• As step input is assumed (which is constant between
samples), the desired closed-loop transfer function in the
z-domain will be
1 e Ts e Ls
T ( z ) Z {Gzoh ( s )Gcl ( s )} Z
s s 1
52
Example
The open-loop transfer function of a plant is given by
e 2 s
G(s)
10s 1
53
Answer
First, we need to find the z-transform of the process (preceded •
:by a ZOH). From the previous example, this is found to be
0.095
GH ( z ) 3
z 0.904 z 2
Second, we need to find the z-transform of the desired closed- •
.loop transfer function, T(z)
,As the desired closed-loop time constant, τ, is 5 sec •
e Ls
T ( s) 54
5s 1
• Therefore,
1 e s e Ls
T ( z) Z
s 5s 1
1 L /T 1
(1 z ) z Z
s (5 s 1)
1 k 0.2
(1 z ) z Z
s ( s 0.2)
0.2T
1 k z (1 e )
(1 z ) z
( z 1)( z e 0.2T )
k (0.181)
z 55
( z 0.819)
The Dahlin controller is thus given by
1 T ( z)
D( z )
G( z) 1 T ( z)
k (0.181)
z
z 0.904z
3 2
( z 0.819)
0.095 k (0.181)
1 z
( z 0.819)
z 3 0.904z 2 0.181z k
0.095 z 0.819 0.181z k
0.181z 3 k 0.164z 2 k
k
.
0.095z 0.078 0.017 z
56
For the controller to be realizable, the degree of the •
numerator must be less than or equal to the degree of the
.denominator, i.e
3 k 1 k 2
60
Discrete-time controller design
Today, we will study two methods for discrete
:controller design
Deadbeat controller •
a technique to achieve an ideal response but
.require excessive control signals
Dahlin controller •
a technique to approximate the deadbeat controller
.but does not require excessive control signals
61
Digital controllers
• The closed-loop transfer function of the system shown is
Y ( z) D( z )GH ( z )
.
R( z ) 1 D( z )GH ( z )
:Suppose that the closed-loop transfer function is chosen to be •
Y ( z)
T ( z) .
R( z )
:Then, the controller required to achieve T(z) is given by •
1 T ( z)
D( z ) .
GH ( z ) 1 T ( z )
62
Digital controllers
• The equation,
1 T ( z)
D( z ) ,
GH ( z ) 1 T ( z )
• The controller D(z) must be realizable. That is, D(z) must not
have a numerator whose order exceeds that of the numerator.
63
Deadbeat Controller
Deadbeat controller is one in which a step input is
followed by the system but delayed by one or more
sampling periods, i.e. the system response is required
to be equal to unity at every sampling instant after the
application of a unit step input.
64
Deadbeat Controller
Therefore, the desired closed-loop transfer function is
T ( z) z k , k 1.
1 T ( z) 1 z k 1 1
D( z ) k .
GH ( z ) 1 T ( z ) GH ( z ) 1 z k GH ( z ) z 1
65
Example 9.1
The open-loop transfer function of a plant is given by
e 2 s
G(s) .
10s 1
Design a dead-beat digital controller for the system. Assume that
T = 1 s.
Answer:
The transfer function of the system with a ZOHis given by
1 e Ts 1 e 2Ts
GH ( z ) Z G ( s ) (1 z ) Z
s s (10 s 1)
1 2 1 66
(1 z ) z Z
s (10 s 1)
From the z-transform tables •
a Z z (1 e aT )
s( s a) ( z 1)( z e aT )
,So •
0.1
GH ( z ) (1 z 1 ) z 2 Z
s ( s 0.1)
1 2 z (1 e 0.1 )
(1 z ) z
( z 1)( z e 0.1 )
0.095
3
z 0.904 z 2
Hence, the controller is given by •
1 T ( z) z 3 0.904 z 2 1 67
D( z ) k .
GH ( z ) 1 T ( z ) 0.095 z 1
.For realizability, we must choose k ≥ 3 •
Choosing k = 3, we obtain the controller •
z 3 0.904 z 2 1 z 3 0.904 z 2
D( z ) .
0.095 z 1 0.095( z 1)
3 3
68
To analyze the designed system performance, let us simulate •
.the step response of the closed-loop and the control signal
As designed, the step response is unity after 3 secconds and
.stays at this value
Note: It is important to realize that the response is correct only 69
at the sampling instants and the response can have an
.oscillatory behavior between the sampling instants
For the control signal, we can realize that the maximum
magnitude of the control signal is very high at the beginning 70
(≈11). Usually, this is not acceptable in practice.
Drawbacks of deadbeat control
71
MATLAB code for Deadbeat control
Deadbeat control, Dogan Ibrahim, Chapter 9, Example 9.1 %
;Gru=Gc/(1+Gc*Gpd)
u=step(Gru,t)
figure(2)
plot(t,u,'o','MarkerSize',6)
xlabel('time, sec')
ylabel('control signal, u')
72
axis([0 10 0 15])
title('Control signal')
Dahlin Controller
• Dahlin controller is a modification of the deadbeat
controller which produces an exponential response that is
smoother than deadbeat control.
• The desired closed-loop response for step input looks like:
73
Dahlin Controller
• Hence, the desired closed-loop transfer function is:
e Ls
Gcl ( s )
s 1
• As step input is assumed (which is constant between
samples), the desired closed-loop transfer function in the
z-domain will be
1 e Ts e Ls
T ( z ) Z {Gzoh ( s )Gcl ( s )} Z
s s 1
74
Example
The open-loop transfer function of a plant is given by
e 2 s
G(s)
10s 1
75
Answer
First, we need to find the z-transform of the process (preceded •
:by a ZOH). From the previous example, this is found to be
0.095
GH ( z ) 3
z 0.904 z 2
Second, we need to find the z-transform of the desired closed- •
.loop transfer function, T(z)
,As the desired closed-loop time constant, τ, is 5 sec •
e Ls
T ( s) 76
5s 1
• Therefore,
1 e s e Ls
T ( z) Z
s 5s 1
1 L /T 1
(1 z ) z Z
s (5 s 1)
1 k 0.2
(1 z ) z Z
s ( s 0.2)
0.2T
1 k z (1 e )
(1 z ) z
( z 1)( z e 0.2T )
k (0.181)
z 77
( z 0.819)
The Dahlin controller is thus given by
1 T ( z)
D( z )
G( z) 1 T ( z)
k (0.181)
z
z 0.904z
3 2
( z 0.819)
0.095 k (0.181)
1 z
( z 0.819)
z 3 0.904z 2 0.181z k
0.095 z 0.819 0.181z k
0.181z 3 k 0.164z 2 k
k
.
0.095z 0.078 0.017 z
78
For the controller to be realizable, the degree of the •
numerator must be less than or equal to the degree of the
.denominator, i.e
3 k 1 k 2
;Gru=Gc/(1+Gc*Gpd)
u=step(Gru,t)
figure(2)
plot(t,u,'o','MarkerSize',6)
xlabel('time, sec')
ylabel('control signal, u')
82
axis([0 30 0 5])
title('Control signal')