Page 72 - Mechatronics with Experiments
P. 72
58 MECHATRONICS
and duration of a single sampling period. The transfer function of it is an integrator
response to an impulse minus the same response delayed by a sampling period,
( −sT )
1 − e
ZOH(s) = (2.41)
s
The frequency response (filter transfer function) of the ZOH D/A can be obtained
from the above equation by substituting jw for the s variable, and after some algebraic
manipulations it can be shown that the frequency response of a ZOH D/A is
( −jωT )
1 − e
ZOH(j ) =
j
( )
jωT jωT
jωT −
− e 2 − e 2
= e 2
jw
T
jωT sin
− 2
= T ⋅ e 2
T
2
( T )
jωT
= e − 2 ⋅ T ⋅ sin c (2.42)
2
Clearly, compared to Equation 2.37 which represents the ideal reconstruction filter
transfer function, the transfer function of the ZOH type D/A converter is different
than the ideal case, but it is a practical one.
2.2.5 Real-time Control Update Methods and Time Delay
Time delay is an important issue in control systems. Time delay in the feedback loop can
cause instability since it introduces phase lag. There is inherent time delay in digital control.
The A/D and D/A conversion takes a finite amount of time to complete. The execution of
the control calculations takes a finite amount of time. The sampling period is determined
by the sum of the time periods that these operations take. The sampling period is a good
indication of the time delay introduced into the loop due to the digital implementation. If
the sampling frequency is much higher than the bandwidth of the closed loop system (i.e.,
50 times faster), the influence of time delay due to the digital sampling period will not be
significant. As the sampling frequency gets closer to the control system bandwidth (i.e.,
2 times), the time delay associated with sampling rate can create very serious stability and
performance problems. Figure 2.10 shows two different implementations of a closed loop
system in terms of sampling and control update timing.
A control system will have periodic sampling intervals. The sampling period can be
programmed using a clock. After every sampling period is passed, an interrupt is generated.
The real-time control software can be divided into two groups,
1. foreground program,
2. background program.
Normally, the CPU runs the background program handling operator input/output operations,
checks error and alarm conditions, and checks other process inputs and outputs (I/O) not
used in closing the control loop but used for other logic and sequencing functions. The
foreground program is the one that is executed every time the sampling clock generates
an interrupt. When a new interrupt is generated every sampling period, the CPU saves the
status of what it is doing in the background program, and jumps to the foreground program