Basic comparator problem

Thread Starter

Nemanja_95

Joined Nov 14, 2017
24
I was thinking about basic comparator circuit, and I realized that at some high frequency op amp will make -90 degrees phase shift.
So, if that is correct, that means loop phase shift is not more 0 as we need for positive feedback.

My question is: what is theoretically happening at this high frequency? Will some delay make additional 90 degrees to cancel that -90 degrees? Or positive feedback become negative because phase shift is not 0?
slika aac.jpg
 

OBW0549

Joined Mar 2, 2015
3,566
Op amps usually aren't very useful as comparators except except when the input frequencies are very low, because of their very limited output slew rate (i.e., the maximum dV/dT their output can generate) and in some cases because of saturation recovery time problems. The input protection diodes in some op amps can cause problems, too. In most cases it's better to use a proper comparator IC, such as an LM393 (dual) or LM339 (quad). For very high-speed jobs, something like an LT1016 or LT1116 may be necessary.
 

danadak

Joined Mar 10, 2018
4,057
Typical open loop response looks like this -



This is a single pole compensated response curve, two pole in typical fast OpAmps
have even more complicated curves. This response is driven largely by gm and comp
cap in the internals of the OpAmp.

http://web.mit.edu/klund/www/papers/ACC04_opcomp.pdf

You can see that the phase moves from 180 degrees at DC and approaches
0 at high frequency, which implies positive feedback. The term "phase margin"
is used to denote the stability margin a deisgn has, and is the phase when G = 1
(o dB) in the frequency response curve. C load, parasitic C, and compensation
all affect this margin. As the phase margin decreases in time domain you start to
see increased ringing in pulse driven waveform output of OpAmp.



http://mgh-courses.ece.gatech.edu/ece4430/Filmed_lectures/OAC1/L420-OpAmpCompI.pdf


Regards, Dana.
 
Last edited:

ebp

Joined Feb 8, 2018
2,332
It really isn't helpful to think in terms of phase shift when using an op amp as a comparator. It is more instructive to think in terms of delay times.
When an op amp is used as a comparator it is essentially always operating in the "large signal" area - it is overdriven and out of control, with the fundamental notion of maintaining a virtual short circuit between the inputs impossible. Phase shift is really only meaningful when operating in the "small signal" area.

As OBW has pointed out, op amps don't generally make good comparators if speed is at all important. The are quite usable in some circumstances and may be a good choice if extremely low input offset voltage or high input impedance is required, but only if you can accept the speed limitations. Comparator input offset voltage is typically not especially good an input impedance is usually quite low, the latter especially so for very fast comparators.

In your circuit, the delay time must be considered and can certainly work counter to intent, as you have suggested. Perhaps someone knows if there are complete internal models for any common op amps that you could play with with one of the free simulation packages. It might be quite revealing to watch events from input to output of an amp used as a comparator.
 

Thread Starter

Nemanja_95

Joined Nov 14, 2017
24
Op amps usually aren't very useful as comparators except except when the input frequencies are very low, because of their very limited output slew rate (i.e., the maximum dV/dT their output can generate) and in some cases because of saturation recovery time problems. The input protection diodes in some op amps can cause problems, too. In most cases it's better to use a proper comparator IC, such as an LM393 (dual) or LM339 (quad). For very high-speed jobs, something like an LT1016 or LT1116 may be necessary.
But let's say that I work with some lower frequencies around 30hz.
My op amp bode plots are shown in picture. At about 30 hz (w = 100), phase shift from op amp is 45 degrees, and feedback phase shift is 0 because it's only resistors there.
Did slew rate is actually making additional -45 degrees to keep positive feedback (0 phase shift) ?
bodeovi dijagrami.jpg
I am trying to link knowledge gained in various electronics courses, so questions may be little unusual. :rolleyes:
 

Thread Starter

Nemanja_95

Joined Nov 14, 2017
24
Thank you all very much for help!

It really isn't helpful to think in terms of phase shift when using an op amp as a comparator. It is more instructive to think in terms of delay times.
I know that it is not usual way, I am just trying to link knowledge gained on different electronic courses. :D
Regards!
 

OBW0549

Joined Mar 2, 2015
3,566
But let's say that I work with some lower frequencies around 30hz.
My op amp bode plots are shown in picture. At about 30 hz (w = 100), phase shift from op amp is 45 degrees, and feedback phase shift is 0 because it's only resistors there.
Did slew rate is actually making additional -45 degrees to keep positive feedback (0 phase shift) ?
Like @ebp said, phase shift and Bode plots are meaningful ONLY when the op amp is operating as a linear device (i.e., with negative feedback). When operated as a comparator, always think in terms of slew rate and delay time instead.
 

ebp

Joined Feb 8, 2018
2,332
The following are worth a look, particularly the first:

http://www.analog.com/en/analog-dialogue/articles/amplifiers-as-comparators.html
http://www.analog.com/media/en/technical-documentation/application-notes/AN-849.pdf
http://www.analog.com/media/en/training-seminars/tutorials/MT-084.pdf

It is certainly worthwhile trying to tie pieces of knowledge from different sources together. I get the impression that a lot of people who try to design electronics don't do that, and their ability suffers for it. This just happens to be a case where the fundamentals like phase and n-pole response aren't all that helpful. But you are thinking about it and trying to understand it, and that is to be much commended.
 
Top