Académique Documents
Professionnel Documents
Culture Documents
Chapter 44
44.1 Input Interface
44.2 Input Scaling
44.3 Filtering
44.4 PID Control
44.5 Output Scaling
44.6 Output Interface
44.7 Nomenclature
This chapter explains how a typical analogue con- in Figure 3.2, and whose implementation by com-
trol loop is realised by means of computer control. puter control is depicted in Figure 44.1.
A simple level control loop with a tag no LRC 47 This may be considered to consist of four sub
is considered. The signal is followed from the level systems:
transmitter,through the system and back out to the 1. Process and load (F/H), and instrumentation
control valve. Both hardware and software aspects comprising current to pressure (I/P) converter,
are covered. An explanation of the structure of the valve (P/F) and dp cell (H/I).
database is deferred to Chapter 45. 2. Input interface consisting of current to voltage
Consider again the level control loop depicted (I/V) converter,sampler and analogue to digital
in Figure 3.1, the block diagram for which is shown converter (A/D).
4-20 mA F1
0-25510 0-5V 0-5V 0.2-1.0 bar
F/H
u F0 h
D/A ZOH V/I I/P P/F F/H
AOT card
AIN card H/I
3. Function blocks for input scaling (AIN), fil- The sampling process, sometimes referred to as
tering (FIL), control (PID) and output scaling scanning, is necessary because the A/D converter
(AOT). is usually shared between all the input channels
4. Output interface consisting of sampler, digital on the card. The sampler is often referred to as a
to analogue converter (D/A), zero order hold multiplexer and sampled signals are said to be mul-
(ZOH) and transmitter (V/I). tiplexed. In operation, under control of the RTOS,
the 0–5 V signal is switched through to the input
of the A/D converter, and held there long enough
for the A/D conversion to take place. The analogue
44.1 Input Interface signal must be sampled frequently enough for the
samples to be a meaningful representation, but not
The three elements of I/V, sampler and A/D are all so often as to cause unnecessary loading on the
realised by the circuits of an AIN card.Assume that system. At the same time the sampling frequency
the dp cell’s output is one of a number of 4–20 mA must not be too low as to cause aliasing effects.
channels handled by the card, the circuit for which The various input channels would be sampled at
is as depicted in Figure 44.2. different frequencies, as appropriate.
The I/V conversion essentially consists of con- The A/D converter is an integrated circuit chip.
verting the 4–20 mA signal into a 0–5 V signal It converts the sampled 0–5 V signal into a bit pat-
compatible with the input range of the A/D con- tern. Given that the original level measurement is
verter. The mA signal is dropped to earth across a from a dp cell, whose accuracy is ±1% at best,
250 § resistor and converted into a 1–5 V signal. one would expect a 10-bit word with a range of
This is subsequently scaled into a 0–5 V signal by 0–102310 and a resolution of approximately ±0.1%
an op-amp circuit, as described in Chapter 6. Note to be adequate. However, this is insufficient resolu-
the RC network for filtering high frequency noise, tion for some routines.For example,in PID control,
such as mains frequency and harmonics thereof, the derivative action operates on the difference be-
as described in Chapter 69. Also note the barrier tween successive input samples and, to avoid nu-
for electrical protection which is described fully merical instability, higher resolution is required.
in Chapter 52. The barrier depicted is external but Therefore, it is not uncommon for A/D conversion
on some systems is realised by circuits on the AIN to use at least 14 bit words with a range of 0–1638310
card. and a resolution of approximately ±0.006%.
24V
Barrier
4-20mA
AIN card
1–5V 250Ω
0V
Fig. 44.2 Analogue input channel
44.2 Input Scaling 323
44.2 Input Scaling d0 1,j − 0,j
0,j+1 = 0,j + .t = 0,j + .t
dt j T
The AIN function block of Figure 44.1 represents
The following equation is used extensively for This effectively converts the pulse output from the
output scaling. The range of the controller output D/A converter into a quasi,or piecewise linear,ana-
is normally 0–100% and, for brevity, an 8-bit A/D logue signal that can be output to the I/P converter
converter is assumed: and thence to the control valve. Figure 44.4 depicts
(1 − bias) the construction of the quasi analogue signal.
0 = 255.
span
The output 0 is stored in the database as a bit pat- D/A output
tern. The algorithm used for the output scaling is
typically
t
OP: = 255∗ (IP − BI)/SN (44.4)
ZOH output
44.6 Output Interface
The four elements of sampler, D/A, ZOH and V/I
are all realised by the circuits of an AOT card. As- t
sume that the output is one of a number of 4–20 mA
channels handled by the card, the circuit for which
is as depicted in Figure 44.3.Again note the barrier Analogue
for electrical protection. equivalent
The sampler is virtual.On a regular basis,under
control of the RTOS, values of the AOT output are t
extracted from the database and routed through to
the D/A converter. The sampler is held open long Fig. 44.4 Construction of quasi analogue output signal
enough for the conversion to take place.
The D/A converter is an integrated circuit chip. The transmitterV/I provides the scaling and power
It converts the sampled bit pattern into a 0–5 V for signal transmission. The 0–5 V latched signal
signal. Since D/A converters are relatively cheap, it from the D/A is a very low power,TTL or otherwise,
is normal practice for each output channel to have signal. After scaling into a 1–5 V signal it is con-
its own dedicated D/A converter. verted into a 4–20 mA signal. The op-amp circuit
The ZOH holds, or latches onto, the output of shown in Figure 6.13 is typical of the type used for
the D/A converter in between sampling periods. such power amplification.
Barrier
4-20mA
0-5V
0V
Fig. 44.3 Analogue output channel
44.7 Nomenclature 325
44.7 Nomenclature
Symbols
some variable
T filter time constant
t step length which is, in effect,
the sampling period
k filter constant, t/T
Subscripts
0 output
1 input
j current value
Pseudocode
BI bias
E error
FC filter constant
IA integral action
IP input
KC proportional gain
KD derivative gain
KI integral gain
OP output
PIP previous input
P set point
SN span