Internet Explorer no es un explorador compatible con TI.com. Para disfrutar de una mejor experiencia, utilice otro navegador.

VIDEO SERIES

Serie Precision labs: comparadores

En esta serie, aprenderá sobre las funcionalidades básicas de los comparadores, así como el efecto del ruido externo, la diferencia entre fuentes de alimentación simples y dobles, las ventajas y desventajas de utilizar amplificadores operacionales como comparadores y más.

Video Player is loading.
Current Time 0:00
Duration 0:00
Loaded: 0%
Stream Type LIVE
Remaining Time 0:00
 
1x
  • Chapters
  • descriptions off, selected
  • subtitles off, selected

      Presenter(s)

      Hello, and welcome to the TI Precision Labs video series discussing comparator applications. The comparator's job is to compare two analog input signals and produce a digital or a logic level output based on that comparison. In this video, we'll discuss the basic functionality of the analog comparator and some of its key specifications, including input offset voltage, or VOS.

      Let's begin by introducing the basic functionality of a comparator. Similar to a standard op amp, a comparator has two inputs, one output, and two power supply pins. From a schematic perspective, it looks the same as an op amp, although its intended function is quite different.

      A comparator gets its name because it compares the voltages applied to its inputs and sets its output voltage based on the input levels. One input is considered to be the primary input signal, or VIN. And the other input is considered to be the reference signal, VREF. These inputs may have both DC and AC components.

      The output voltage, Vout, can be set to one of two levels-- a high level, or logic 1, or a low level, or logic zero. VH, the output high level, approaches V plus, the positive power supply voltage. VL, the output low level, approaches 0 volts or ground or the negative supply in dual supply configurations.

      The comparator shown on this slide is configured for non-inverting operation. In this condition, VIN, the input signal, is connected to the non-inverting input plus IN and VREF, the reference signal, is connected to the inverting input minus IN. If VIN is greater than VREF, the comparator output goes high. If VIN is less than VREF, the output goes low.

      A comparator can also be used in an inverting configuration. In this condition, VIN, the input signal, is connected to the inverting input minus IN, and VREF, the reference signal, is connected to the non-inverting input plus IN. Because of the change in how we've defined our input signals, the output behavior can be considered inverted. Now, if VIN is greater than VREF, the comparator output goes low. And if VIN is less than VREF, the output goes high.

      Let's take a look at the simplified internal design of a bipolar comparator, the LM139. The objective here is not to teach transistor theory or the detailed workings of a competitor design, but rather to give you a general idea of how a comparator works. The input stage outlined in the blue box is comprised of a PNP differential amplifier. Each side of the differential stage uses Darlington PNP transistors. Using Darlington connected transistors increases the input impedance, lowers the input bias current, and allows the common mode input voltage to extend down to 0 volts.

      Each transistor in this stage has a current source in the emitter circuit that sets the emitter current. The collectors of the transistors in the differential input stage are connected to NPN transistors that act as a dynamic load, as shown outlined in turquoise. Finally, the output of the dynamic load stage is coupled to an NPN driver and open collector output stage as shown outlined in purple. During normal operation of a comparator, the differential input signal plus IN minus minus IN is amplified by the voltage gain of the input differential amplifier. The output of this differential stage is developed on T6 and is used to turn the output stage on or off depending on the input polarity.

      To better understand the internal function, let's now apply some changing input signals to the comparator and see how the internal voltages change in the various states. In this example, we will be using the comparator in an inverting configuration with VREF connected to plus IN and VIN connected to minus IN. Let's first apply a 2.5-volt reference voltage to plus IN and a 2.4-volt input signal to minus IN. So we are comparing 2.4 volts against a 2.5-volt reference.

      The voltages are shown in red on each of the nodes. And the case with the 2.4-volt input is given on the bottom. Looking into minus IN, the transistors connecting to that side of a differential input pair connect to dynamic load transistor T6.

      The voltage at the collector of T6 is equal to 0.3 volts clamped by the base-to-emitter voltage of transistor T7. Transistor T7 is now on, which turns transistor T8 off by pulling down its base voltage. Since T8 is off, its collector looks like a high impedance and the output voltage of the comparator is pulled high by the 2-kiloohm pull-up resistor connected to the positive power supply.

      Now, let's keep the 2.5-volt reference on plus IN but change the input signal on minus IN to 2.65 volts. We are now comparing 2.65 volts against the 2.5-volt reference. Transistor T4 and T6 will be on and saturated, making the voltage across T6 very low. T7 now turns off, allowing T8 to fully turn on and drive the comparator output voltage down to approximately 0 volts, our logic low.

      Comparators are divided into two main types based on the design of their output stage. These two types are called open-drain or open-collector and push-pull, also known as drain-drain our collector-collector. Open-collector and collector-collector comparators are built with bipolar transistors. While, open-drain and drain-drain comparators are build with FETs.

      The comparator on the left and the LM139 example from the previous slide have an open-collector output with an output stage consisting of a single NPN bipolar transistor. When this transistor is on, it actively sinks current from collector to emitter and pulls the output voltage, VO, down very close to ground, our 0 volts. How close the output can swing to ground depends on the collector-to-emitter saturation voltage.

      When the transistor is off, its collector looks like a high impedance and has essentially no effect on the output voltage. In this case, a small amount of current is sourced from V plus through the pull-up resistor, and VO rises to VOH, our logic 1. Without this pull-up resistor, VO could float to an unknown state.

      Push-pull comparators, on the other hand, have an output stage consisting of a pair of output transistors. Either the upper or lower transistor in the pair turns on and actively sources or sinks current in order to drive the output high or low as needed. In the example on the right, the P channel upper FET turns on to source current and push the output high. While, the N channel lower FET turns on to sink current and pull the output low. No pull-up resistor is required for this type of comparator.

      A commonly desired function of comparators is to generate a logical OR, where an output is logic low when either of its two inputs is on. This functional block is commonly implemented by wiring the outputs of two comparators together. However, care must be taken to use the right type of comparator, as we'll discuss.

      Let's first consider the circuit on the left with to push-pull devices whose outputs are tied together. Remember, a push-pull competitor actively sources or sinks current to push or pull its output voltage high or low. You may already see the problem with this circuit configuration. But let's analyze the different possibilities of its operation.

      In the case where the outputs of both comparators are high, the top transistor in each push-pull output stage turns on, and the output is driven high. Similarly, if both outputs are low, then the bottom transistors in each competitor turn on, and the output is driven low. The problem arises when the two comparators try to drive the output to different states.

      In this case, there is a conflict, as each comparator tries to source or sink current to force the output to a different voltage. This creates a high current condition and drives the output to some indeterminate state, which is neither high nor low. As you might imagine, this condition is undesirable and can even damage the devices. For this reason, push-pull comparators should never be connected together in this way.

      On the other hand, open-collector or open-drain comparators worked perfectly with this approach. Remember that the output stage of an open-collector or open-drain comparator is built with a single transistor that pulls the output low when it turns on and looks like a high impedance when it turns off. Now, no matter which combination of high or low is present on each output, the output will be safely driven to a known state.

      If both outputs are low, both output transistors are on and pull the overall output down to approximately 0 volts. If both outputs are high, both transistors are off and act like a high impedance, allowing the output to be pulled up to logic high through the pull-up resistors. If one output is high and one output is low, the low state will dominate, as the transistor which is on can sink much more current to pull the output low than the pull-up resistor can provide to try to drive the output high.

      You can check the truth table on the right for the logical behavior in all four possible input states. As you can see this is equivalent to a logic OR function. This implementation of the logical OR with comparators is commonly called the wired-or configuration.

      We'll end this first video in the series with a discussion of comparator DC parameters, which should be very familiar to anyone with knowledge of op amps. This diagram shows the basic comparator schematic, along with many of the most common DC parameters, including input offset voltage, or VOS, represented as a voltage source in series with a non-inverting input; input bias current, or IB; and input offset current, or IOS, represented as current sources flowing into or out of the comparator inputs; input common mode voltage range, or VCM, the range of allowable input common mode voltages before the input transistors will saturate or cut off, typically extending from one supply rail to the other on modern devices; input differential voltage range, or VDFF, the maximum allowable differential voltage across plus IN and minus IN; voltage output high from the rail, or VOH, the maximum logic high voltage relative to the positive power supply; voltage output low from the rail, or VOL, the minimum logic low voltage relative to ground or the negative power supply; output short circuit current, or ISC, the maximum output current which can be sourced or sunk by the output stage transistors; quiescent current, or IQ, the typical current consumption of the device when the output current is 0; and power supply voltage range, or VS, the range of allowable power supply voltages for specified operation.

      Other parameters may be specified, such as the open loop gain, voltage offset drift, common-mode rejection, and power supply rejection. But they are typically less critical to a comparator than the previous specifications and are considered less often.

      One of the most critical DC specifications is the input offset voltage, VOS. Since the VOS of a comparator creates an additional DC voltage in series with the non-inverting input, it has a major effect on the threshold at which the output of a comparator changes states. Let's analyze a non-inverting comparator circuit with three different VOS values to better understand the effect.

      Remember that for a non-inverting comparator, Vout is high if VIN is greater than VREF, and Vout is low if VIN is less than VREF. In this example, we will apply a reference voltage of 2.5 volts to the inverting input. The input signal is a slow-moving ramp, transitioning from 2.46 volts to 2.54 volts, as you can see in the dark blue waveform in the plot on the right.

      The offset voltage adds to the input signal to create a total effective input signal equal to VIN plus VOS. If VOS equals 0, then the total input voltage is equal to VIN plus 0, and the circuit works as expected. When VIN is greater than 2.5 volts, Vout is high. And when VIN is less than 2.5 volts, Vout is low, as you can see in the red waveform.

      If VOS equals plus 10 millivolts, then the total input voltage is equal to VIN plus 10 millivolts. Now, the output will transition at a lower voltage of VIN, because the added voltage from VOS allows the total input voltage to reach 2.5 volts earlier. You can see in the orange waveform that Vout is high when VIN is greater than 2.49 volts, and Vout is low when VIN is less than 2.49 volts.

      Finally, if VOS equals minus 10 millivolts, then the total input voltage is equal to VIN minus 10 millivolts. Now, the output will transition at a higher voltage of VIN, because of the voltage which is subtracted by the negative VOS. You can see in the light blue waveform that Vout is high when VIN is greater than 2.51 volts, and Vout is low when VIN is less than 2.51 volts.

      Keep in mind that not only does the threshold voltage change due to VOS, but the timing of the output waveform is also affected. For example, when VOS equals plus 10 millivolts, the output waveform is high for approximately 600 milliseconds. When VOS equals minus 10 millivolts, the output waveform is high for less than 400 milliseconds. This timing behavior may cause issues in certain designs, but the very slow moving input signal in this example creates a worst case scenario.

      To help prevent these types of errors, the frequency of the input signal can be increased. Many engineers used to designing with modern op amps may be accustomed to offset voltages in the range of microvolts to a few millivolts. Comparators typically have offsets which are somewhat higher, ranging from about plus or minus 2 millivolts up to plus or minus 15 millivolts.

      In some cases, the offset voltage of the comparator can completely change its output signal. Consider the circuit shown on the left, an inverting comparator with its input signal provided by a digital-to-analog converter, or DAC. Digital-to-analog converters generate analog voltages or currents based on digital codes. So their output will often seem to step between different DC voltages over time.

      Let's analyze the output of this circuit when we provide a reference voltage of 1.25 volts and the offset voltage changes from plus 5 millivolts to 0 millivolts to minus 5 millivolts. In this circuit, VOS is added to VREF, so the total effective reference voltage becomes VREF plus VOS. When VOS equals plus 5 millivolts, the total reference voltage is equal to 1.25 volts plus 5 millivolts, or 1.255 volts.

      Because of the increased reference voltage, the comparator output only goes low twice during the input waveform, as shown in the blue plot on the top right. When VOS equals 0 volts, the total reference voltage is simply equal to 1.25 volts. The comparator output is shown in the red plot on the right.

      When VOS equals minus 5 millivolts, the total reference voltage is now equal to 1.25 volts minus 5 millivolts, or 1.245 volts. The comparator output changes again and is shown in the green plot on the bottom right. The small input signal range of this example shows a worst case scenario for errors due to VOS.

      To prevent these types of errors, try to increase the range of the input signal relative to the offset voltage. However, this type of behavior can still be encountered when the input signal fluctuates near the reference voltage. Make sure to watch the later videos in this series to learn simple but powerful techniques that can help to prevent these kinds of errors.

      That concludes this video. Thank you for watching. Please try the quiz to check your understanding of this video's content.

      View series

      Serie Precision labs: comparadores