Maker Pro
Maker Pro

Increasing speed of Opamp used as Comparator

K

Klaus Kragelund

Hi

I have an application where I have a quad LM324 opamp and I'm using
only three of the opamps in the package. I would like to use the last
opamp as a comparator.

For simplicity the opamp is supplied from 5V and the value I compare to
is 2.5V. The input is fed directly to the other input. My problem is
though that the opamp saturates against either rail and is slow when it
needs to change the output state. (input stage i saturated due to V+/v-
is not operating closed loop

Are there a fancy way to actively clamp the output just below either
rail to speed up the "out of saturation" time?

Regards

Klaus
 
K

Klaus Kragelund

Klaus Kragelund skrev:
Hi

I have an application where I have a quad LM324 opamp and I'm using
only three of the opamps in the package. I would like to use the last
opamp as a comparator.

For simplicity the opamp is supplied from 5V and the value I compare to
is 2.5V. The input is fed directly to the other input. My problem is
though that the opamp saturates against either rail and is slow when it
needs to change the output state. (input stage i saturated due to V+/v-
is not operating closed loop

Are there a fancy way to actively clamp the output just below either
rail to speed up the "out of saturation" time?
Perhaps unclear. Input signal is fed to Opamp + input, 2.5V (half
supply) is fed to opamp - input. When the signal passes 2.5V I want a
pretty fast response to detect that level

Regards

Klaus
 
J

Jim Thompson

Klaus Kragelund skrev:

Perhaps unclear. Input signal is fed to Opamp + input, 2.5V (half
supply) is fed to opamp - input. When the signal passes 2.5V I want a
pretty fast response to detect that level

Regards

Klaus

What is the character of the input signal? Perhaps a slow DC loop to
hold the output centered?

...Jim Thompson
 
E

Eeyore

Klaus said:
Klaus Kragelund skrev:

Perhaps unclear. Input signal is fed to Opamp + input, 2.5V (half
supply) is fed to opamp - input. When the signal passes 2.5V I want a
pretty fast response to detect that level

You should realise that the 324 is a pretty sluggish op-amp and that's likely to
be most of the trouble !

You could always use a small 'speed-up cap' from O/P to + I/P.

Graham
 
R

rob

Klaus Kragelund said:
Hi

I have an application where I have a quad LM324 opamp and I'm using
only three of the opamps in the package. I would like to use the last
opamp as a comparator.

For simplicity the opamp is supplied from 5V and the value I compare to
is 2.5V. The input is fed directly to the other input. My problem is
though that the opamp saturates against either rail and is slow when it
needs to change the output state. (input stage i saturated due to V+/v-
is not operating closed loop

Are there a fancy way to actively clamp the output just below either
rail to speed up the "out of saturation" time?

Regards

Klaus

I think it was analog devices that had an article in their "Analog Dialogue"
newsletter on this subject. It may be useful.

http://www.analog.com/library/analogDialogue/archives/37-04/comparator.pdf
 
J

Jon

Klaus said:
Klaus Kragelund skrev:

Perhaps unclear. Input signal is fed to Opamp + input, 2.5V (half
supply) is fed to opamp - input. When the signal passes 2.5V I want a
pretty fast response to detect that level

Regards

Klaus
 
J

Jon

Klaus said:
Hi

I have an application where I have a quad LM324 opamp and I'm using
only three of the opamps in the package. I would like to use the last
opamp as a comparator.

For simplicity the opamp is supplied from 5V and the value I compare to
is 2.5V. The input is fed directly to the other input. My problem is
though that the opamp saturates against either rail and is slow when it
needs to change the output state. (input stage i saturated due to V+/v-
is not operating closed loop

Are there a fancy way to actively clamp the output just below either
rail to speed up the "out of saturation" time?

Regards

Klaus

Sorry about the previous "blank" post!

Connect a voltage divider from output to ground. Calculate values such
that when the output is above the max allowable output (4V, for
example), the divider output is +2.5V. Conect a diode from divider
output to the Inv input (cathode to the Inv input). This will prevent
the output from rising above the max allowable.
..
Do the same thing for the low output value, except the low end of the
divider must go to a negative supply. Calculate values such that when
the output is below the min allowable output (1V, for example), the
divider output is +2.5V. Connect the diode cathode to the output of
this divider. This will limit the lower output level to 1V.
..
For this scheme to work, the input voltage to the NI input must be
limited to the maximum alowable output excursions (+4, +1 in the
example given).
Regards,
Jon
 
J

Jon

Jon said:
Sorry about the previous "blank" post!

Connect a voltage divider from output to ground. Calculate values such
that when the output is above the max allowable output (4V, for
example), the divider output is +2.5V. Conect a diode from divider
output to the Inv input (cathode to the Inv input). This will prevent
the output from rising above the max allowable.
.
Do the same thing for the low output value, except the low end of the
divider must go to a negative supply. Calculate values such that when
the output is below the min allowable output (1V, for example), the
divider output is +2.5V. Connect the diode cathode to the output of
this divider. This will limit the lower output level to 1V.
.
For this scheme to work, the input voltage to the NI input must be
limited to the maximum alowable output excursions (+4, +1 in the
example given).
Regards,
Jon

Klaus,
I left out one step: You must place a resistor between the +2.5V
reference and the Inv input, so that you can get negative feedback.
Regards,
Jon
 
M

Mike Monett

I think it was analog devices that had an article in their "Analog
Dialogue" newsletter on this subject. It may be useful.

Good link - thanks. But are they really serious in Fig. 1?

"Figure 1. Responses of single-supply amplifier (63 pV)
and comparator (280 mV) models to a –1-mV inputvoltage
difference."

It's not a typo. The figure shows 62.82pV, so he rounded up.

Bob Pease has an article that may be useful: "What's All This Comparator
Stuff, Anyhow?"

http://www.elecdesign.com/Articles/Index.cfm?AD=1&ArticleID=9517

Regards,

Mike Monett
 
J

John Popelish

Klaus said:
Klaus Kragelund skrev:



Perhaps unclear. Input signal is fed to Opamp + input, 2.5V (half
supply) is fed to opamp - input. When the signal passes 2.5V I want a
pretty fast response to detect that level

How much output voltage swing is required as a response? The smaller
the swing, the faster the response.
 
A

Ancient_Hacker

Maybe add a little positive feedback? Depending on the impedances at
the inputs, a 100k to 1 meg resistor from output to + input, then a
10K resistor in series with the input. That will add a 1 to 10 percent
hysterisis and a snap-action. A small capacitopr across the feedback
resistor will also help improve the snap.
 
L

Luhan

Klaus said:
Klaus Kragelund skrev:

Perhaps unclear. Input signal is fed to Opamp + input, 2.5V (half
supply) is fed to opamp - input. When the signal passes 2.5V I want a
pretty fast response to detect that level

I've restled with the same problem once. Easier maybe to add LM393 (20
cents American) for a real comparator.

Luhan
 
S

Spehro Pefhany

Klaus Kragelund skrev:

Perhaps unclear. Input signal is fed to Opamp + input, 2.5V (half
supply) is fed to opamp - input. When the signal passes 2.5V I want a
pretty fast response to detect that level

Regards

Klaus

So what's "pretty fast"? Is your problem with the time it takes to
reach 50% output or the slew rate?



Best regards,
Spehro Pefhany
 
J

Jon

Ancient_Hacker said:
Maybe add a little positive feedback? Depending on the impedances at
the inputs, a 100k to 1 meg resistor from output to + input, then a
10K resistor in series with the input. That will add a 1 to 10 percent
hysterisis and a snap-action. A small capacitopr across the feedback
resistor will also help improve the snap.

Adding positive feedback will increase the transition speed and improve
the noise immunity, but it will not help pull the output stage out of
saturation faster. Positive feedback can be used in conjunction with
the circuit I suggested in my earlier post.
Regards,
Jon
 
J

John Larkin

Hi

I have an application where I have a quad LM324 opamp and I'm using
only three of the opamps in the package. I would like to use the last
opamp as a comparator.

For simplicity the opamp is supplied from 5V and the value I compare to
is 2.5V. The input is fed directly to the other input. My problem is
though that the opamp saturates against either rail and is slow when it
needs to change the output state. (input stage i saturated due to V+/v-
is not operating closed loop

Are there a fancy way to actively clamp the output just below either
rail to speed up the "out of saturation" time?

Regards

Klaus


Be aware that, in many LM324's, driving one amp to its rails will do
very strange things to the other three amps in the package. So a
feedback-type clamp is necessary even if speed isn't an issue. So you
may as well use some other amp, or better yet a separate comparator.

John
 
K

Klaus Kragelund

Eeyore skrev:
You should realise that the 324 is a pretty sluggish op-amp and that's likely to
be most of the trouble !

You could always use a small 'speed-up cap' from O/P to + I/P.
The idea behind using the LM324 is that it is the cheapest I can dig up
(0.1USD) and we are running high volume.

I have the option to use the LM139 comparator - but will add an entire
new IC to the design (penalty = 0.1USD)

Regards

Klaus
 
J

Jim Thompson

Be aware that, in many LM324's, driving one amp to its rails will do
very strange things to the other three amps in the package. So a
feedback-type clamp is necessary even if speed isn't an issue. So you
may as well use some other amp, or better yet a separate comparator.

John

And how would you clamp a follower anyway? And feedback won't work
without the input being carefully bounded.

...Jim Thompson
 
K

Klaus Kragelund

Ancient_Hacker skrev:
Maybe add a little positive feedback? Depending on the impedances at
the inputs, a 100k to 1 meg resistor from output to + input, then a
10K resistor in series with the input. That will add a 1 to 10 percent
hysterisis and a snap-action. A small capacitopr across the feedback
resistor will also help improve the snap.

I tried adding the pos feedback before posting and it did nothing (i
guess when the amp finally slewing the overdrive is significant and no
more pos feedback matters)

I may however add a NPN from output to GND (output to base via
resistor, emitter to GND and collector pulled up). This will make the
output respond fast (reducing the slew from GND to VCC) in one
direction (I only need fast response in one direction.

Regards

Klaus
 
K

Klaus Kragelund

John Larkin skrev:
Be aware that, in many LM324's, driving one amp to its rails will do
very strange things to the other three amps in the package. So a
feedback-type clamp is necessary even if speed isn't an issue. So you
may as well use some other amp, or better yet a separate comparator.

The datasheet for 5 different manufactors I looked up didn't mention
this and I have never heard of this. Is this some soft of undocumented
feature that is constrained to us westerneers so the terrorist bombs
explode prematurely due to the quirks of the LM324s? (bad joke, sorry)

Regards

Klaus
 
J

John Larkin

John Larkin skrev:


The datasheet for 5 different manufactors I looked up didn't mention
this and I have never heard of this.

Not maky datasheets have a list of non-features. Instead of bullets,
they could use little frowney-faces.
Is this some soft of undocumented
feature that is constrained to us westerneers so the terrorist bombs
explode prematurely due to the quirks of the LM324s? (bad joke, sorry)

I did a box that used two '324 sections as regular amps and two as
comparators. Every time a comparator switched, the other three
sections made a huge output glitch. Jim says that some 324's may do it
and some may not, depending on how they shared some internal current
mirrors I guess. I dropped in an LF347 and it worked fine.

LM324 is a rotten opmap anyhow. Don't even think about pulling any of
the inputs even a little below ground.

John
 
Top