Practical_Electronics-May_2019

([email protected]) #1

the input voltage is ≤2V or ≥3V requires
two comparators, one inverting (with a
2V reference) and the other non-inverting
(with a 3V reference). A similar common
requirement is to have a single output in-
dicating when the input voltage is within
a particular range (ie, above a lower limit
VrefL, but below an upper limit VrefU). This
is known as a ‘window comparator’. It
also requires two comparators (again,
one inverting and one non-inverting), but
the outputs are combined with a logical
(Boolean) AND function (above-lower
AND below-upper). The AND function
can be implemented by a logic gate, but
it is common to use comparators with
open-collector outputs, which can be
connected together to the same pull-up
resistor (see Fig.4) to produce what is
known as a ‘wired-AND’ circuit.


Op amps vs. comparators
Op amps are designed to be used with
negative feedback (eg, provided by the
resistors used to set the circuit gain). All
amplifiers have some delay from input to
output, which results in increasing phase
shift as signal frequency increases. At
some point, the phase shift reaches 180°,
equivalent to inverting the signal, at which
point the negative feedback network is ac-
tually delivering positive feedback. If the
gain of the amplifier and feedback net-
work together is greater than one at this
frequency then oscillation will occur. The
gain of most op amps is deliberately rolled
off as frequency increases to prevent this
instability – this is called compensation.
Comparators are used open loop or with
positive feedback, so compensation is not
required, leading to significant differences
between the two types of device.


Op amps are high-gain, linear, differen-
tial amplifiers; so in normal operation the
voltage difference between an op amp’s
inputs is very small (typically microvolts to
millivolts). Comparators often have much
larger input differences. Not all op amps
can tolerate large input voltage differenc-
es and they perform very poorly, or may
even by damaged, under such conditions.
Op amp input impedance may drop sig-
nificantly for large input differences due
to conduction of protection diodes – this
could upset driving an op amp used as a
comparator. Comparators are common-
ly used to compare voltages that are not
close to half the supply range. For an op
amp, this is a large common-mode input
voltage. Again, not all op amps perform
well under such conditions.
Gain and offset are characteristics
shared by op amps and comparators;
however, the switching behaviour of
comparators means that they have char-
acteristics related to switching which are
not relevant to the standard analogue am-
plifier usage of op amps. The switching
characteristics are illustrated in Fig.5,
which shows comparator input and output
waveforms for a non-inverting configura-
tion with a fixed reference voltage.

Speed of switching
When the comparator input voltage cross-
es the reference voltage the comparator
output will switch. This will not happen
instantaneously – the time taken for the
comparator output to reach 50% of the re-
sulting voltage change is the propagation
delay. The time taken for the comparator
output voltage to rise from 10% to 90%
of its range is the rise time. The amount
of voltage applied to the comparator’s
input beyond the switching threshold
(reference voltage) is known as the over-
drive. Propagation delay and rise time
are usually sensitive to overdrive, with
increasing overdrive resulting in faster
switching times. Comparator speed is also
usually dependent on supply voltage.
The maximum rate of change of output
voltage an op amp or comparator can de-
liver is the slew rate. Slew rate is important
for op amps because it indicates how well
the output voltage will track fast-chang-
ing analogue waveforms; failure to do so
causes distortion. Slew rate also directly
determines the maximum frequency at
which an op amp can produce a pure
sinewave at full output swing (the full-
power bandwidth). However, sinewave
output is of no relevance to comparators.
For any circuit used as a comparator,
either the slew rate or the bandwidth may
be the dominant factor in determining the
propagation delay. Because comparators
are just required to switch their outputs
quickly, the slew rate itself is not usual-
ly very important as a specification – it

is the propagation delay and rise time
which are quoted. The compensation
applied to op amps tends to reduce their
slew rate, making them relatively slow
when used as comparators.
A comparator’s output will typically
switch between the positive and negative
supply voltages (or ground and supply in
single-supply circuits). However, the output
may switch, or it may be possible to arrange
for it to switch, to a different voltage from
the main comparator supply to facilitate
interfacing to logic circuits. Often, com-
parator output circuits are designed to be
easy to interface with specific types of logic.
Comparators are therefore available with
a variety of output configurations includ-
ing push-pull, open-drain or collector and
LVDS (low-voltage differential signalling).
Open-drain and open-collector outputs re-
quire an external resistor connected from
the output to the positive (digital) supply.
Op amps are designed for use where the
output voltage does not hit the supply rails


  • this would normally imply clipping of
    the waveform and hence distortion. When
    op amp outputs are driven hard into sat-
    uration they tend to be slow to recover.
    Like compensation, this makes op amps
    poor comparators where fast switching is
    required. The internal circuitry of com-
    parators is designed to prevent the output
    stages going far into saturation, allowing
    them to recover very quickly. A further
    subtlety to this is that op amp saturation
    recovery time is likely to vary between in-
    dividual devices, making the propagation
    delay somewhat unpredictable.


LM393 vs. LM741 simulation
Qasim asked about using the LM741 as a
comparator. If we obtain a SPICE models for
this op amp and a comparator then we can
run a simulation to compare output wave-
forms. Fig.6 shows an LTspice schematic
for just this purpose (we will discuss the
setup of this next month). The simulation
configures both devices in a basic compara-
tor configuration on a single supply, which
is 20V to correspond with the LM741 rec-
ommended minimum of ±10V. The lack
of a split supply is not an issue with these
basic circuits and a comparator reference
at the centre of the supply range is used.
The LM393 has an open-collector output
so a pull-up resistor (R1) is required.
The results of the simulation are shown
in Fig.7. This shows that the output of the
LM741 only gets to within about ±1V of
the supplies – as described by Qasim.
This is an inherent characteristic of the
LM741, but not fundamental to using op
amps as comparators – rail-to-rail output
op amps are available, which can output
voltages closer to the supply rails. The
LM393’s output goes up to 20V because
there is no load, and down to 0.15V (the
collector-emitter saturation voltage of the

+





+


  • Vout


R 1

Vin

VrefU

VCC

VrefL

Input

time

Overdrive

time

VRef

Output
90%

10%

50%

VOH

VOL

tpd

tr

Fig.4. Window comparator using
comparators with open-collector outputs.


Fig.5. Comparator propagation delay.

Free download pdf