Author Topic: Op amp as a comparator, bad practice?  (Read 4488 times)

0 Members and 1 Guest are viewing this topic.

Offline Jim from Chicago

  • Regular Contributor
  • *
  • Posts: 57
  • Country: us
  • Power Electronics
Re: Op amp as a comparator, bad practice?
« Reply #25 on: April 04, 2023, 05:41:36 pm »
I have recently been working on a design with an opamp used as a comparator. We recently replaced the old opamp with a new part (TLV910) and some of them are behaving unexpectedly. Some of them are failing and the noninverting input is getting effectively shorted (~tens of ohms) to the positive and negative supply rail. So it seems the opamp is being stressed and damaged by the normal operation of our circuit. We are supplying the opamp with 7V and our circuit is set up such that there can be 7V difference between the input pins, and the max differential spec in the datasheet is supply voltage + 0.2V. So my concern is that we are operating too close to the max spec and stressing/damaging the opamp. The previous opamp we were using had a max differential spec of 30V so there was plenty of margin before.

Before encountering this issue, I had no idea that using regular opamps as comparators could be problematic.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 7189
  • Country: pl
Re: Op amp as a comparator, bad practice?
« Reply #26 on: April 04, 2023, 06:11:46 pm »
Any chance of transients exceeding the positive rail or going below ground?
Maybe some AC coupling capacitors along the way, or the opamp's supply coming up after the signal is present?
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 8366
  • Country: us
  • Retired, now restoring antique test equipment
Re: Op amp as a comparator, bad practice?
« Reply #27 on: April 04, 2023, 08:50:50 pm »
When I needed a precision comparator at work (before retirement), I would often use a fast op-amp with two Schottky diodes back-to-back in the feedback loop (inverting circuit) to drive a fast comparator chip.
The inverting op-amp circuit allowed easy adjustment of the setpoint with a second input resistor from the bias level, and the comparator could have hysteresis.
 

Offline Jim from Chicago

  • Regular Contributor
  • *
  • Posts: 57
  • Country: us
  • Power Electronics
Re: Op amp as a comparator, bad practice?
« Reply #28 on: April 04, 2023, 09:04:57 pm »
Supply rail is rated for 16V, we are putting 7V on it. I checked the startup and output for the supply which provides the 7V and it looked ok. There is 0.1uF between noninverting and negative supply rail. We put a diode between the negative supply rail and noninverting input to prevent it from going more than a schottky drop below ground.

One thing I find odd is that there seems to be some contradictory advice from TI about this issue. In a TI paper about this issue (previously linked in this thread), they say rather strongly that you shouldn't use opamps in open-loop as comparators.

But in the datasheet for the opamp I'm using (TLV910), they give an open-loop opamp comparator as a typical application.  :-//
 

Offline TimFox

  • Super Contributor
  • ***
  • Posts: 8366
  • Country: us
  • Retired, now restoring antique test equipment
Re: Op amp as a comparator, bad practice?
« Reply #29 on: April 04, 2023, 09:06:21 pm »
TI gives specific reasons  in their app note why that op amp can be used, despite the general rule against doing so.
 

Offline Jim from Chicago

  • Regular Contributor
  • *
  • Posts: 57
  • Country: us
  • Power Electronics
Re: Op amp as a comparator, bad practice?
« Reply #30 on: April 04, 2023, 09:24:56 pm »
I noticed that but I'm still skeptical that they have addressed all potential concerns. They mention that because they're using a novel input stage, the TLV910 has a relatively wide differential voltage range spec compared to typical opamps. They also mention a relatively high slew rate and low offset. But in the paper I previously referenced, the author says the main difference between regular opamps and dedicated comparators is the output stage, and they don't mention much about the output stage in that section of the TLV910 datasheet.

I'm just kind of paranoid about this part because I'm banging my head against the wall trying to figure out why it's failing in my particular circuit. Maybe it is perfectly suitable as a comparator but we are just pushing it too close to it's max differential voltage spec.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 7189
  • Country: pl
Re: Op amp as a comparator, bad practice?
« Reply #31 on: April 05, 2023, 06:33:51 am »
There is 0.1uF between noninverting and negative supply rail. We put a diode between the negative supply rail and noninverting input to prevent it from going more than a schottky drop below ground.
This capacitor discharges to the positive rail through input protection when the circuit powers down. Not sure if there is enough energy there to cause damage, but it is technically out of spec if capacitor discharge current can briefly exceed 10mA. You could try a second schottky to the positive rail, or simply a series resistor in front of the input pin which limits current through the internal diodes (if Johnson noise is not a concern).

One thing I find odd is that there seems to be some contradictory advice from TI about this issue. In a TI paper about this issue (previously linked in this thread), they say rather strongly that you shouldn't use opamps in open-loop as comparators.

But in the datasheet for the opamp I'm using (TLV910), they give an open-loop opamp comparator as a typical application.  :-/
The appnote sounds like generic CYA. There are opamps which can be blown up by using them as comparators (e.g. due to diodes between IN+ and IN- like NE5532), there are others which work OK-ish (like LM358) if you accept sluggish response time and maybe not truly rail to rail output.
 
The following users thanked this post: Jim from Chicago

Offline MathWizard

  • Super Contributor
  • ***
  • Posts: 1609
  • Country: ca
Re: Op amp as a comparator, bad practice?
« Reply #32 on: April 06, 2023, 01:30:55 pm »
The only comparators I know by name are LM393, what are some newer jellybean ones ?
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17117
  • Country: us
  • DavidH
Re: Op amp as a comparator, bad practice?
« Reply #33 on: April 07, 2023, 01:05:51 am »
The only comparators I know by name are LM393, what are some newer jellybean ones ?

The LM339 is the quad version of the LM393.  The LM311 is a faster single part with a more versatile output stage.

I would say that the LT1016 is the highest performance universal "jellybean" part.
 
The following users thanked this post: MathWizard

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19920
  • Country: gb
  • 0999
Re: Op amp as a comparator, bad practice?
« Reply #34 on: April 07, 2023, 01:20:08 pm »
The nice thing about the LM311 is the output stage can sink up to 50mA, which is enough to drive a small relay and it can be configured as a source, if necessary. The disadvantages of the LM311 are it's only one channel and the inputs only extend to 0.5V above the -V supply.

I disagree about the LT1016 being jellybean, as there are not other manufacturers. The MCP6542 and TLV3202 are also good and cheap, yet I don't consider them to be jellybean, since they're single source.
« Last Edit: April 07, 2023, 04:41:12 pm by Zero999 »
 
The following users thanked this post: MathWizard


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf