Practical_Electronics-May_2019

([email protected]) #1

56 Practical Electronics | May | 2019


open-collector output transistor). The
simulation also shows the LM741 op amp
responds much more slowly than the
LM393 comparator, as discussed above.
In summary, op amps can be used as
comparators, but not without diffi culties,
and only in relatively slow-speed appli-
cations. Op amps may not perform well
with large differential or common-mode
inputs, but such conditions are common
in comparator applications – so the op
amp’s datasheet should be consulted
for relevant capabilities. Interfacing an
op amp output to logic may also be less
straightforward than with a comparator
specifi cally designed to drive logic inputs.


Hysteresis
A comparator used with a single thresh-
old (reference) value, as in the preceding
examples, may switch states many times
as a noisy, slowly changing input crosses
the threshold. This is often undesirable;
for example, if the number of threshold-
crossings is to be counted or you want to
avoid ‘chattering’ when the input is close
to the threshold. The problem may be over-
come by using two thresholds; eg, VTH and
VTL. The difference between VTH and VTL


is called the ‘hysteresis’. A comparator
with hysteresis can be made by applying
positive feedback to a basic comparator
to shift the threshold slightly, depend-
ing on which of its two output states the
comparator is currently in. Comparators
with hysteresis are also known as ‘regen-
erative comparators’ or ‘Schmitt triggers’.
The input-output response of a compara-
tor with hysteresis is shown in Fig.8. When
the input increases past VTH the compara-
tor switches, but it does not switch back
if the input decreases back past VTH. The
input must decrease past VTL before the
comparator switches again.
If the input noise level is known, the
hysteresis can be set slightly larger than
this. The comparator will then not switch
as a result of the noise. Fig.9 shows an
LTspice simulation schematic for compar-
ing comparator circuits with and without
hysteresis. The comparators use generic
op amp models (UniversalOpamps2),
which are provided with LTspice, rather
than specifi c devices like the LM393 or
LM741. This is sufficient to produce
waveforms to illustrate a general situa-
tion. LTspice techniques used here will
be discussed next month.
Fig.10 and Fig.11
show the result of
applying the same
noisy signal to a
basic comparator
(the circuit using
U2 in Fig.9) and
one with hysteresis
(the U1 circuit). As
mentioned above,
the basic compara-
tor switches multiple
times as the noisy
signal crosses the
threshold, whereas
the comparator with
hysteresis switches
cleanly. Fig.10 shows
that the behaviour of
the basic comparator

as it switches is different each time due
to the random nature of the noise. Fig.11
zooms into one threshold crossing.

Circuit design
As shown in Fig.12, a comparator with
hysteresis can be made using a basic com-
parator with positive feedback. As the
thresholds depend on the comparator’s
output voltages these should ideally be
accurately controlled.
Refer to Fig.12. The switching point
Vcomp depends on Vref and Vout. Vref will
usually be fixed but Vout depends on
the current state of the comparator. Vout
can take one of two values, which we
will assume to be ±VO (the positive and
negative outputs apply to split-supply
circuits). Initially, let us assume that Vin
< Vcomp so Vout = +VO (note that Vin goes
to the inverting input). If Vin is slowly in-
creased this condition remains until Vin
= Vcomp = VTH (see Fig.7), where:

This equation is obtained by applying
the potential divider equation twice and
adding the results. First to fi nd the con-
tribution of Vref to Vcomp with Vout = 0 and
then to fi nd the contribution of Vout to
Vcomp with Vref =0. This is an application
of the superposition theorem.
On switching at Vcomp = VA the output
changes to Vout = –VO, changing the
switching point to a new value, Vcomp = VB

Vout will now stay at –VO until the input
falls below Vcomp again. The difference
in the switching points; ie, the hysteresis
(VH) is given by:

The switching is symmetrical about the
average of VA and VB, which is:

If R 2 is much larger than R 1 (which is
common) the average of VA and VB is ap-
proximately equal to Vref. Under these
conditions the comparator switches at
points VH/2 above and below Vref. For the
circuit in Fig.9 the switching points are
1.548 ±0.161V (1.71V and 1.39V). Note, this

Fig.6. LTspice simulator schematic for comparing an LM393 comparator with an LM741
op amp used as a comparator. This simulation’s setup will be discussed next month.


Fig.7. Results from simulation of the circuit shown in Fig.6. The
cursor (white dotted line) marks where the threshold is crossed.


VTL VTH

VH

Vout

Vin

+VO


  • VO


Fig.8. Switching characteristic of
comparator with hysteresis.






␀!"=


᐀!


᐀!+᐀!


␀!"#+


᐀!


᐀!+᐀!


␀!


␀!"=


᐀!


᐀!+᐀!


␀!"#−


᐀!


᐀!+᐀!


␀!


␀"=␀!"−␀!"=


2 ᐀!


᐀!+᐀!


␀!


᐀!


᐀!+᐀!


␀!"


␀!"=


᐀!


᐀!+᐀!


␀!"


᐀!!"=


᐀!᐀!


᐀!+᐀!


␀!"=


᐀!!"


᐀!!"+᐀!


␀!!


᐀!!"=


᐀!᐀!


᐀!+᐀!


␀!"=


᐀!


᐀!+᐀!!"


␀!!







␀!"=


᐀!


᐀!+᐀!


␀!"#+


᐀!


᐀!+᐀!


␀!


␀!"=


᐀!


᐀!+᐀!


␀!"#−


᐀!


᐀!+᐀!


␀!


␀"=␀!"−␀!"=


2 ᐀!


᐀!+᐀!


␀!


᐀!


᐀!+᐀!


␀!"


␀!"=


᐀!


᐀!+᐀!


␀!"


᐀!!"=


᐀!᐀!


᐀!+᐀!


␀!"=


᐀!!"


᐀!!"+᐀!


␀!!


᐀!!"=


᐀!᐀!


᐀!+᐀!


␀!"=


᐀!


᐀!+᐀!!"


␀!!







␀!"=


᐀!


᐀!+᐀!


␀!"#+


᐀!


᐀!+᐀!


␀!


␀!"=


᐀!


᐀!+᐀!


␀!"#−


᐀!


᐀!+᐀!


␀!


␀"=␀!"−␀!"=


2 ᐀!


᐀!+᐀!


␀!


᐀!


᐀!+᐀!


␀!"


␀!"=


᐀!


᐀!+᐀!


␀!"


᐀!!"=


᐀!᐀!


᐀!+᐀!


␀!"=


᐀!!"


᐀!!"+᐀!


␀!!


᐀!!"=


᐀!᐀!


᐀!+᐀!


␀!"=


᐀!


᐀!+᐀!!"


␀!!







␀!"=


᐀!


᐀!+᐀!


␀!"#+


᐀!


᐀!+᐀!


␀!


␀!"=


᐀!


᐀!+᐀!


␀!"#−


᐀!


᐀!+᐀!


␀!


␀"=␀!"−␀!"=


2 ᐀!


᐀!+᐀!


␀!


᐀!


᐀!+᐀!


␀!"


␀!"=


᐀!


᐀!+᐀!


␀!"


᐀!!"=


᐀!᐀!


᐀!+᐀!


␀!"=


᐀!!"


᐀!!"+᐀!


␀!!


᐀!!"=


᐀!᐀!


᐀!+᐀!


␀!"=


᐀!


᐀!+᐀!!"


␀!!

Free download pdf