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: firstname.lastname@example.org (Email for direct communications.)
Check out other interesting topics… Table of Contents for all The Signal blogs.
Thanks Bruce. In your experience, is "chatter" a normally distributed effect? Also, by fast moving ramp rates are you thinking kilohertz or more? Just wondering. Thanks.
David--In my experience, a slowly rising input eventually causes a sudden onset of chatter. Chatter begets more chatter due to self-created noise. As the ramp continues, it dies out more gradually. With appropriate hysteresis, it's clean. I was deliberately vague on the specifics of ramp rate. It depends so much on the speed of the comparator and magnitude of the noise in your inputs. kHz. == Bruce
What about the offset voltage? Vt + Vos + Vhys would be the trip point.
Ken-- The upper and lower threshold are shifted by the offset voltage so the hysteresis band remains the same. -- Bruce
good read. If I may, I have one suggestion for reducing chatter for comparators with slowly moving signals: place a capacitor in **parallel** with R2 . You mentioned having one in series with R2, but I have found that placing a cap in series with the feedback (hysteresis) resistor is very effective in eliminating chatter. Sometimes an additional resistor in series with the new capacitor is also needed.
By having the capacitor as a parallel path to R2, one can think of the feedback as having two parts:
1. a DC part (set by R2 and R1 in the circuit above), and
2. an AC part, which would be set by the capacitor, its series R (if any), and R1.
The AC part provides a high positive feedback, which forces the output to change rapidly, and avoids chatter during the transition. Once the output transition is done, the DC part of the feedback sets the new threshold for the opposite transition. Suggest set the time constant of the AC part as being 2 to 5 times the time delay of the comparator (time from input crossing threshold to output reaching 90% of of final value), but of course, there is a trade off since this time constant would also set a lower limit on how quickly the compartor can then react to an input swapping over to the opposite state.
Loking forward to more posts on analog stuff!
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.