Clever Geek Handbook
📜 ⬆️ ⬇️

Comparator

The symbolic image of an analog comparator on electrical and structural diagrams.

Comparator of analog signals (from Latin comparare “compare”) - a comparator [1] : an electronic circuit that receives two analog signals at its inputs and outputs a high level signal if the signal at the non-inverting input (“+”) is larger than at the inverting (inverse) input (“-”), and a low level signal if the signal at the non-inverting input is less than at the inverse input. The value of the output signal of the comparator when the input voltage is equal, in the general case is not defined. Typically, in logic circuits, a high-level signal is assigned a logical 1 value, and a low-level logic 0 value.

Through comparators, a connection is made between continuous signals, for example, voltages and logical variables of digital devices.

They are used in various electronic devices, ADC and DAC, alarm devices, tolerance control, etc.

One of the voltages (signals) supplied to one of the inputs of the comparator is usually called the reference or threshold voltage . The threshold voltage divides the entire range of input voltages supplied to the other input of the comparator into two subranges. The output state of the comparator, high or low, indicates which of the two subranges the input voltage is in. A comparator with one input threshold voltage is usually called a single threshold comparator, there are comparators with two or more threshold voltages, which, respectively, divide the input voltage range by the number of subbands by 1 greater than the number of thresholds.

The signal to be compared can be applied to both the inverting and non-inverting inputs of the comparator. Accordingly, depending on this, the comparator is called inverting or non-inverting.

Content

Mathematical description of the comparator

 
Feedthrough characteristic of a non-inverting comparator.Uop=Uref {\ displaystyle U _ {\ text {op}} = U_ {ref}}   in the formulas.

In an analytical form, an ideal single-threshold non-inverting comparator is defined by the following system of inequalities:

Uout={U0,ifUin<Urefundefined,ifUin=UrefUone,ifUin>Uref{\ displaystyle U_ {out} = {\ begin {cases} U_ {0}, & {\ mbox {if}} U_ {in} <U_ {ref} \\ {\ text {undefined}}, & {\ mbox {if}} U_ {in} = U_ {ref} \\ U_ {1}, & {\ mbox {if}} U_ {in}> U_ {ref} \ end {cases}}}  
WhereUref {\ displaystyle U_ {ref}}   - voltage comparison threshold,
Uout{\ displaystyle U_ {out}}   - output voltage of the comparator,
Uin{\ displaystyle U_ {in}}   - input voltage at the signal input of the comparator.

To the third, undefined value, in the case of a binary output state, you can:

  1. to assignU0 {\ displaystyle U_ {0}}   orUone {\ displaystyle U_ {1}}   ,
  2. to assignU0 {\ displaystyle U_ {0}}   orUone {\ displaystyle U_ {1}}   randomly dynamically,
  3. take into account the previous state of the output and consider the equality insufficient to switch,
  4. to take into account the first time derivative of the output signal and its equality to zero is considered insufficient for switching.

In the case of using multi-valued logic, for example, ternary to account for the third state (equality), apply the corresponding ternary function from the clear ternary logic with a clear third value.

Comparator

The simplest circuit comparator is a differential amplifier with a high gain (ideally, infinite). Typically, voltage comparators in modern electronics use operational amplifier circuits (op amps). But there are microchips specialized for use as comparators.

The comparator microchip differs from the usual linear (op-amp) device in both input and output stages:

  • The input stage of the comparator must withstand a wide range of differential input voltages (between inverting and non-inverting inputs), up to the values ​​of the supply voltage, as well as the full range of common-mode voltages.
  • The output stage of the comparator is usually designed to be compatible by logic levels and currents with a common type of logic circuit inputs ( TTL , ESL technologies, etc.). The output stage of the comparator is possible on a single transistor with an open collector , which ensures simultaneous compatibility with TTL and CMOS logic circuits.
  • Comparator microcircuits are not designed to work with negative feedback as an op-amp, and when used, negative feedback is not used. Conversely, to form a hysteresis transfer characteristic, comparators often cover with positive feedback. This measure avoids fast unwanted switching of the output state due to noise in the input signal when the input signal changes slowly.
  • When designing comparator microcircuits, special attention is paid to the fast restoration of the input stage after overload and changing the sign of the difference in input voltages. In high-speed comparators, to improve performance, circuitry does not allow bipolar transistors to enter the saturation mode in the output stage.

Comparators covered by positive feedback have hysteresis and, in fact, are two-threshold comparators, often such a comparator is called a Schmitt trigger .

If the input voltages are equal, real comparators and op-amps included in the comparator circuit give a randomly changing output signal due to intrinsic noise and noise of the input signals. The usual measure of suppressing such chaotic switching is the introduction of positive feedback to obtain a hysteretic transfer characteristic.

In the software modeling of the comparator, a problem arises of the output voltage of the comparator at the same voltage at both inputs of the comparator. At this point, the comparator is in a state of unstable equilibrium . The problem can be solved in many different ways, described in the "software comparator" subsection.

Comparator software modeling

In programs, as a first approximation, you can use the simplest model of an asymmetric comparator, in which the third value with equal values ​​of the compared input variables is constantly assigned to “0” or to “1”, in the example below, the third value is constantly assigned to “0”:

  DEFINT Y
 DEFSNG X
 Xref = 2.5
 Xin = 2.6
 IF Xin> Xref THEN Y = 1 ELSE Y = 0 'Asymmetric Comparator
 PRINT Y

In more complex models of symmetric comparators, the third value is possible, within the framework of binary logic :

  1. attributed to "0" or to "1" constantly,
  2. assign to "0" or to "1" randomly dynamically,
  3. take into account the previous value and consider equality insufficient to switch,
  4. consider the first derivative and its equality to zero is considered insufficient for switching,

or go beyond binary logic and:

  1. to account for the third value (equality), apply the corresponding ternary function from the clear ternary logic with a clear third value.

The existing problem of the third state in software modeling, when the two numbers represented by code words can be exactly equal, in practice does not occur: the two voltages cannot exactly coincide, since, firstly, the analog voltage is non-quantized, and in secondly, there is noise, bias voltage of the inputs of the comparator, and other perturbations that resolve the ambiguity even if the input voltages of the analog comparator are equal.

Comparators with two or more comparison voltages

They are built on two or more conventional comparators.

Two-threshold (ternary) comparator

The two-threshold (ternary) comparator has two comparison voltages and consists of two conventional comparators. Two comparison voltages divide the entire range of input voltages into three fuzzy subranges in the fuzzy ternary logic , which are assigned three distinct values ​​in a clear ternary logic . A two-bit ternary (2B BCT) logic signal ( trit ) at the output of the ternary comparator indicates which of the three subranges the input voltage is in. The logical part of the ternary comparator performs the unary ternary logical function - “repeater” (F107 3 = F8 10 ). Two-bit ternary trit (2B BCT) can be converted to three-bit trit (3B BCT) or three-level trit (3LCT).

In an analytical form, a two-threshold (ternary) comparator is defined by the following systems of inequalities:

{Uref2>UrefoneUoutone={0,ifUin<Urefoneundefined,ifUin=Urefoneone,ifUin>UrefoneUout2={0,ifUin<Uref2undefined,ifUin=Uref2one,ifUin>Uref2{\ displaystyle {\ begin {cases} U_ {ref2}> U_ {ref1} \\ U_ {out1} = {\ begin {cases} 0, & {\ mbox {if}} U_ {in} <U_ {ref1} \\ undefined, & {\ mbox {if}} U_ {in} = U_ {ref1} \\ 1, & {\ mbox {if}} U_ {in}> U_ {ref1} \ end {cases}} \\ U_ {out2} = {\ begin {cases} 0, & {\ mbox {if}} U_ {in} <U_ {ref2} \\ undefined, & {\ mbox {if}} U_ {in} = U_ {ref2 } \\ 1, & {\ mbox {if}} U_ {in}> U_ {ref2} \ end {cases}} \ end {cases}}}  

Where:
U ref1 and U ref2 - voltage of the lower and upper comparison thresholds,
U out1 and U out2 are the output voltages of the comparators, and
U in - input voltage on the comparators.

The two-threshold (ternary) comparator is the simplest single-digit ternary ADC .

The ternary comparator is an adapter from fuzzy ternary logic to ternary logic to solve fuzzy ternary logic by means of ternary logic.

Toggle switches and switches to 3 positions without fixing (ON) -OFF- (ON) [2] [3] are mechanoelectric ternary (two-threshold) comparators in which the input value is the mechanical deviation of the lever from the middle position.

The two-threshold (ternary) comparator is available as a separate MA711H chip (K521CA1).

It is used in the Schmitt precision trigger of the popular NE555 timer chip .

A low-quality ternary comparator with binary comparators based on 2I-NOT digital logic elements is used in the ternary power supply voltage indicator with the conversion of three input voltage ranges into one three-bit single-unit trit (3B BCT) [4] . To build Schmitt's precision trigger , this circuit does not have a binary RS-trigger that can be performed on two additional 2I-NOT logical elements (for example, use two of the four logical elements 2I-NOT of the K155LA3 chip).

Multi-Input Comparators

The input stage of parallel ADCs of direct conversion is a multilevel comparator. It uses2n-one {\ displaystyle 2 ^ {n} -1}   comparison voltages, where n is the number of bits of the output code. The difference between adjacent comparison levels in such multi-input comparators is usually constant.

Comparator Integrated Circuit Examples

An example of well-known comparators: LM311 (Russian counterpart - KP554CA3), LM339 (Russian counterpart - K1401CA1). This microcircuit is often found, in particular, on computer motherboards, as well as in PWM control systems of controllers in voltage conversion units (for example, in computer power supplies with an ATX power system) [5] [6] .

Comparator Options

The parameters characterizing the quality of the comparators can be divided into three groups: precision, dynamic and operational. The comparator is characterized by the same accuracy parameters as the opamp. The main dynamic parameter of the comparator is the switching time tp. This is the period of time from the beginning of the comparison to the moment when the output voltage of the comparator reaches the opposite logical level. The switching time is measured at a constant reference voltage supplied to one of the inputs of the comparator and a jump in the input voltage Uin supplied to the other input. This time depends on the magnitude of the excess of Uin above the reference voltage. In fig. Figure 8 shows the transient characteristics of the comparator mА710 for various values ​​of the differential input voltage Ud with a total input voltage jump of 100 mV. The switching time of the comparator tp can be divided into two components: the delay time tz and the rise time to the threshold of the logic circuit tn. In reference books, the switching time is usually given for a differential voltage value of 5 mV after the jump.

Notes

  1. ↑ Translation from the “English-Russian Dictionary of Computer Science and Programming” ABBYY Lingvo (link not available)
  2. ↑ Toggle switch without fixation 3 positions 5114.3709
  3. ↑ Toggle switches single-pole KN3 for 3 positions without locking (ON) -OFF- (ON)
  4. ↑ Simple devices on the K155LA3 chip. The second circuit is an indicator of the status of the output voltage of the power source.
  5. ↑ Milovzorov O.V. Pankov I.G. Electronics - 2004
  6. ↑ Weissburd F.I., Panaev G.A., Savelyev B.N. Electronic devices and amplifiers - 2005

Links

  • Analog Comparators, Theory of Work
Source - https://ru.wikipedia.org/w/index.php?title=Comparator&oldid=99360442


More articles:

  • O'Sullivan Ronnie
  • Stepan
  • Kirk (mythology)
  • Spotted Marshes
  • Jouz
  • Venus Express
  • Irpen (river)
  • The Grimm Brothers (film)
  • My, Daniel arap
  • Ermakovo (Danilovsky district)

All articles

Clever Geek | 2019