It’s an easy concept—the inputs compare two voltages. The output is high or low. So, why all the chatter through the transition?
This effect usually occurs with slow changes through the transition voltage. Often it’s because the input signals have noise that jiggles through the transition voltage causing a chattering output. Even with very clean input voltages, comparators have their own noise—like an op amp. They also sometimes make noise when the output slams from one rail to another, reverberating through the supply or output circuitry back to the input. Chatter!
Whatever the cause, hysteresis is often the solution—controlled positive feedback. It’s like the snap action of a toggle switch. As you gradually push the lever, over-center spring action snaps to the new position. Without spring action a toggle switch might chatter midway, its contacts arcing and sparking.
Figure 1a shows a simple comparator with threshold, VR, set at 2V. A slowly rising and falling input has a tendency to trigger the output multiple times through the transition.
In figure 1b, R1 and R2 form a voltage divider from the output—positive feedback switches the threshold voltage to create hysteresis. When a rising input voltage reaches the threshold, the falling edge of Vo moves the threshold to a lower voltage, overcoming noise that causes chatter.
Magnitude of the hysteresis is determined by the output voltage swing of the comparator, VOH, in conjunction with the values of the resistor divider. The hysteresis band, ∆VT, is set according to the input noise level and tendency to chatter.
You can also make a non-inverting comparator circuit with hysteresis by reversing the connections to Vin and VR, figure 2. The threshold voltages are slightly different. Be sure the input signal is solid. In some circuits, feedback from the output transition can glitch the input signal source, creating ringing and more chatter.
Some comparators have open-drain (or open-collector) outputs. These types may be somewhat less effective in creating hysteresis on the positive-going output edge because output capacitance can slow the rising transition. This delivers less threshold change at the instant that you need it most. Also, be aware that, depending on the values chosen, the hysteresis network will load the output voltage, reducing output voltage swing.
Hysteresis creates different trip thresholds on rising and falling inputs and this can be a disadvantage in some applications. A capacitor in series with R2 can create a temporary change in the threshold—possibly long enough for the input to move through a noisy threshold range. This won’t work if you have a very slowly changing input such as battery voltage. Try this approach if you have reasonably fast moving input ramp rates.
Some comparators (TLV3201, for example) have built-in hysteresis, no external resistors required. This is accomplished with internal circuit nodes and leaves the inputs and output unencumbered for your circuitry. The fixed hysteresis voltage band of these devices is handy and effective for most circuits. You can add more with external resistors, if needed.
Can op amps be used as comparators? Yes, sometimes… read more here.
Thanks for reading. Please share your experience in comments below… got any good anti-chatter tricks?
Bruce email: thesignal@list.ti.com (Email for direct communications.)
Check out other interesting topics… Table of Contents for all The Signal blogs.