Global Sources
EE Times-Asia
Stay in touch with EE Times Asia
?
EE Times-Asia > Embedded
?
?
Embedded??

Unlock precision comparator design

Posted: 16 Jun 2008 ?? ?Print Version ?Bookmark and Share

Keywords:precision comparator designs? hysteresis circuit? threshold voltage? high-gain amplifier?

Comparators are frequently used circuit components with a wide range of applications. In many cases, the accuracy of the voltage-level comparison is not critical and can vary by several hundred millivolts without affecting circuit performance, such as in pulse-squaring circuits. However, there are many applications that require very accurate comparison voltages with minimum drift and no interaction with the hysteresis circuit. This article discusses several problems with applying typical comparators to precision voltage-level detection and concludes with a new precision comparator that overcomes these problems.

The basics
The comparator is a high-gain amplifier that is used to amplify a small differential signal at its input and drive the output to one of two output states. Figure 1a-d shows the basic comparator circuit that can be used in an inverting or non-inverting configuration. The input signal is compared with a threshold voltage (VTH) and the output changes state based on the input signal's being less than or greater than the VTH.

Figures 1b and 1d show the transfer function of the comparator circuit. A non-inverting comparator is defined as a comparator whose output is at its most positive when the signal input is more positive than the threshold voltage. An inverting comparator is defined as a comparator whose output is at its most negative when the signal input is more positive than the threshold voltage.

The gain of the comparator will determine the differential input voltage that will be required to drive the output to its high or low output state. For example, if the comparator's gain is 80dB, which is a gain of 10,000, then 0.5mV of input differential voltage will be needed to drive the output to its high or low state, assuming the supply voltage is 5V. This contributes to the problem of multiple state changes on the output of the comparator caused by noise on the signal or on the comparison voltage VTH.

The oscilloscope picture in Figure 2A shows a slightly noisy input signal and its effect on the output state for an inverting comparator as shown in Figure 1c. In Figure 2a, the green trace is the input signal, VS; the blue trace is VTH and the yellow trace is the comparator's output (VO).

The oscillation on the falling edge of the output of the comparator shown in Figure 2a can be eliminated by the use of positive feedback, which is used to add hysteresis to the comparator function. Figure 1e-h shows the comparators from Figure a-d with feedback resistors Rf and Ri adding positive feedback and hysteresis as shown in the graphs of the transfer function.

The positive feedback reinforces the difference between the signal voltage and the reference voltage at the transition point, VTH, and generates two threshold values: one for the positive-going input signal and one for the negative-going signal. These are labeled LSTV (lower state-transition voltage) and USTV (upper state-transition voltage) in Figure 1e-h. The hysteresis will reject noise amplitudes that are less than the width of the hysteresis loop and will prevent multiple output-state transitions.

The discussion of comparators with hysteresis requires the introduction of a new term: state-transition voltage, defined as the actual value of the signal voltage that will cause the output state of the comparator to switch states. The state-transition voltage has two distinct values, which are dependent on the output voltage of the comparator; VTH is the threshold voltage and is the desired comparison voltage.

STV is the state-transition voltage and is the signal voltage at which the output changes state. STV can have two values:

  • USTV is the upper state-transition voltage and is the STV that is more positive than the threshold voltage.

  • LSTV is the lower state-transition voltage and is the STV that is more negative than the threshold voltage.

Figure 2b is an oscilloscope picture showing the effect of adding hysteresis to the inverting comparator as shown in Figure 1e-h. The green trace is the input signal VS; the yellow trace is the output signal, VO; and the blue trace is the voltage at the IN+ pin of the comparator, which shows the step function of the threshold voltage when hysteresis is added, thus generating the USTV and LSTV. In this image, the input signal has been shifted up slightly to show the detail of the hysteresis step.

While the hysteresis will eliminate the output oscillations during the transition, the actual value of the state-transition voltage becomes less precise. With no hysteresis, VTH, USTV and LSTV are the same.

Figure 1: The transfer function of noinverting and inverting comparators are shown, without (a-d) and with (e-h) hysteresis.

With hysteresis, USTV and LSTV are affected by the precision of the feedback resistors, the output saturation voltages of the comparator, the value of the VTH, and any source impedance that may be associated with the signal source or threshold voltage source.

Referring to Figure 1e, which shows a non-inverting comparator with hysteresis, the voltage at the +IN pin is equal to Equation 1:

Equation 1 ignores the effects of input offset voltage and input bias currents. The output voltage term, (VO), has two valuesVOL, the output low saturation voltage, and VOH, the output high saturation voltageand results in two calculations for the +IN voltage. The values of the output saturation voltages are specified in most data sheets. The state-transition voltage is the value of the input signal VS where +IN = VTH.

Equation 2 shows the non-inverting lower state-transition voltage:

Equation 3 shows the non-inverting upper state-transition voltage:

Figure 1g shows an inverting comparator with hysteresis, and the voltage at the +IN pin is equal to Equation 4:

Equation 4 also ignores the effects of input offset voltage and input bias currents.

Equation 5 shows the inverting lower state-transition voltage:

Equation 6 shows the non-inverting upper state-transition voltage:

Locating hysteresis
Using the non-inverting comparator as an example, Equations 2 and 3 can be used to calculate a family of curves to show the effects of this form of hysteresis on the actual state-transition voltages, and the location of the hysteresis around VTH.

Figure 3 is a graph of the state-transition voltages as the VTH is swept through its range of 0 to 5V. The graph superimposes two nodes.

The yellow line, the graph of +IN = VTH, shows the voltages at the inputs of the comparator and is the point at which the comparator's output will change state.

The green line, labeled USTV, and the blue line, labeled LSTV, are the graphs of the upper and lower state-transition voltages, from the input signal's perspective, for a non-inverting comparator.

These values were calculated using Equations 2 and 3 for the condition of +IN = VTH, with Rf = 100kW, Ri = 20kW, VOL = 0V and VOH= 5V. The large value of positive feedback was chosen to show the results clearly. During the operation of the circuit, the output of the comparator will switch to the high output state when the VS signal is above the upper state-transition voltage and will switch to the low output state when VS is below the lower state-transition voltage.

Figure 2: An inverting comparator without hysteresis is shown above. Below, it is seen that the addition of hysteresis generates USTV and LSTV.

The primary effect to be seen here is the asymmetry of the hysteresis as the value of the threshold voltage changes. The position of the hysteresis curve is not centered on the threshold voltage, except at one point, and is dependent on the VTH.

Accurate dosing
For some comparator applications, the accuracy of the state-transition voltage is not critical, but there are a wide variety of applications that would benefit from an accurate, easily controlled state-transition voltage.

One such class of applications is in "dosing" applications, where the "dose" is the integral of the rate. For example, if a pipe has 1 gallon per minute of a liquid flowing though it, the dose, or total volume of liquid in a specific time interval, is the sum, or integral, of the flow rate over the period of interest.

Figure 3: The graph of the state-transition voltages for a non-inverting comparator as the VTH is swept through its range of 0 to 5V superimposes two nodes. The yellow line shows the voltages at the inputs of the comparator and is the point at which the comparator's output will change state.

A specific application for this example is medical X-ray dosimetry, which is used to control X-ray film exposure. The accurate exposure control of X-ray film during diagnostic X-ray procedures helps to minimize a patient's exposure to X-rays.

A circuit for this application is shown in Figure 4.

The circuit would be composed of two functions: an ion chamber to detect the X-rays and generate a current, IIC, proportional to the X-ray's intensity, and a transimpedance amplifier, composed of amplifier A1 and resistor RF, to convert the ion chamber current to a voltage:

Amplifier A1 is an LMP7721 designed for very low input bias current, typically 3fA, and works well with high source-impedance signals such as an ion chamber. Amplifier A2 is an integrator used to measure the dose, which is the integral of the dose rate:

The comparator, an LMP7300, is used to signal that the required dose has been reached when the output of the integrator, applied to pin 1, is equal to the threshold voltage applied to pin 2.

In this type of application, the required dose is dependent on many factors, such as the density of the mass being X-rayed.

Figure 4 shows a 12bit DAC being used to set the threshold voltage for the comparator. The LMP7300 has an accurate and stable 2.048V reference; that reference is amplified to 4.096V by amplifier A3 and is the voltage reference for the DAC, which provides the programmable threshold voltage for the LMP7300 comparator.

Another feature of the application is the use of the LM2787 and LM285-2.5 to generate a negative 0.25V supply voltage for amplifiers A1 and A2. This small negative voltage enables the amplifier's output to swing to 0V and removes the output saturation voltage, near 0V, of amplifiers A1 and A2 from rate and dose signals.

A comparator for this type of application needs to have an accurate threshold voltage that can be programmed within a range of values to optimize the film exposure. The threshold voltage should be independent of the amount of hysteresis voltage, the value of the threshold voltage, the comparator's output saturation voltage and the feedback resistor tolerances. A precision comparator such as the LMP7300 can provide these features. In Figure 4, the LMP7300 is shown with its independent comparator function and hysteresis control.

Figure 4: This X-ray dosimeter circuit uses an LMP7300 comparator to signal that the required dose has been reached when the output of the integrator, applied to pin 1, is equal to the threshold voltage applied to pin 2.

Moreover, the positive hysteresis, which controls the USTV, and the negative hysteresis, which controls the LSTV, have independent control inputs. The significance of this is shown in Figure 5, which shows the comparator's transfer function for the combination of input signals and hysteresis control. This comparator effectively separates the threshold voltage, which represents the desired comparison voltage, from the USTV and the LSTV. That accomplishes the task of providing an accurate signal comparison while still providing hysteresis.

Figure 5: The schematics A and D show two of the possible hysteresis connections. If a hysteresis pin is connected directly to the (VREF) voltage, that portion of the hysteresis loop is removed.

The hysteresis of the LMP7300 is controlled by the voltage difference between the (VREF) voltage and the voltage applied to the HYSTP and the HYSTN pins. The schematics in Figures 5A and 5D show two of the possible hysteresis connections. If a hysteresis pin is connected directly to the (VREF) voltage, that portion of the hysteresis loop is removed. Referring to Figure 4, the amount of hysteresis used is about 20mV:

2.048*(1K/(1K + 100K)) = 0.0203

And because the amount of hysteresis is separated from the VTH level, R5 and R6 do not need to be precision resistors. The width of the hysteresis loop can be made as wide as required without changing the value of VTH.

In conclusion, this article has highlighted how a precision comparator such as the LMP7300 can be used to overcome threshold and hysteresis interactions common in existing comparators using external feedback resistors to generate hysteresis.

- Walter Bacharowski
Amplifier Applications Manager
National Semiconductor Corp.





Article Comments - Unlock precision comparator design
Comments:??
*? You can enter [0] more charecters.
*Verify code:
?
?
Webinars

Seminars

Visit Asia Webinars to learn about the latest in technology and get practical design tips.

?
?
Back to Top