Comparing two comparators

Thread Starter

cmartinez

Joined Jan 17, 2007
7,247
About a year ago, I built a circuit whose output I plugged into a comparator, and the comparator's other input was connected to a pot configured as a voltage divider. The intention of the circuit was to alert an MCU when a certain amount of current exceeds the pot's adjustment, and the circuit has been working beautifully ever since.

However, for my second build I had to replace the LM193N that I originally used on the first version because that chip has been declared obsolete. The one I'm using now is the LM2903P, and of course it's pin compatible and has similar characteristics with the previous one. I am, however, noticing differences in their behavior. Mainly in their hysteresis, if I'm correct. The LM193N seems to have a larger one, and that proved beneficial for my purpose. But the LM2903P seems to be a bit too sensitive, and runs a little unstable, or jittery, compared to the other one, for lack of a better word.

Questions, What would the main reason for their differences in behavior be? ... And is there a better replacement for the LM193N than the one I chose for this purpose?
 
Last edited:

danadak

Joined Mar 10, 2018
4,057
The Aol of the 2903 is speced a little lower, so if your signal in is quite small,
< ~ low 10's of uV, that could manifest itself with a little more instability,
assuming you have not instituted hysteresis in the circuit. Maybe post some
info about input signal properties and schematic might help.


Regards, Dana.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
7,247
The Aol of the 2903 is speced a little lower, so if your signal in is quite small,
< ~ low 10's of uV, that could manifest itself with a little more instability,
assuming you have not instituted hysteresis in the circuit. Maybe post some
info about input signal properties and schematic might help.


Regards, Dana.
Thanks for your help, Dana... as you've probably already noticed, I really know zilch about comparator's minutia ... so it would very much help me if you were to tell me what "Aol" means...

As for a diagram, here it is:

1579564818104.png

The input signal is obtained from this circuit.
 

OBW0549

Joined Mar 2, 2015
3,566
I am, however, noticing differences in their behavior. Mainly in their hysteresis, if I'm correct. The LM193N seems to have a larger one, and that proved beneficial for my purpose. But the LM2903P seems to be a bit too sensitive, and runs a little unstable, or jittery, compared to the other one, for lack of a better word.
Neither chip has any built-in hysteresis. If there was any, it would be listed in the datasheet.

Normally, if you want hysteresis in a comparator circuit, you provide it by connecting a large-value resistor between the output and the (+) input, sufficient to "snap" the input up or down by several millivolts. This is usually done to prevent the circuit from oscillating when the inputs are nearly equal (which comparator circuits are prone to doing).

Questions, What would the main reason for their differences in behavior be? ...
Different manufacturer? Different manufacturing lots? Who knows...

And is there a better replacement for the LM193N than the one I chose for this purpose?
I don't know of any.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
7,247
Normally, if you want hysteresis in a comparator circuit, you provide it by connecting a large-value resistor between the output and the (+) input, sufficient to "snap" the input up or down by several millivolts.
I might just do that... next time I build the circuit. For now, I'd just like to find a better replacement. I think Dana just said something important. As a matter of fact, I am working in the low 10ths of millivolts in the current setting. Would that be it?
 

Papabravo

Joined Feb 24, 2006
15,112
Aol is the open loop gain. Usually on the order 1e5 or 1e6. A couple of millivolts differential on the input will pin the output to the rail. You also want to be careful that neither input gets too close to either supply rail.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
7,247
Given that the input offset voltage of those comparators could be as much as ± 5 mV (± 9 mV over the temperature range), I'd say heck yeah!!
Temperature .... maybe that's it! ... the thing kind of drifts into instability after warming up for a bit ...

Is there a simple cure for that?
 

Papabravo

Joined Feb 24, 2006
15,112
I recommend adding your input voltage to Vcc/2 and comparing that voltage to the midpoint of the pot. You could also add some fixed resistance on either side of the pot to keep the adjustment range away from the supply rails
 

Thread Starter

cmartinez

Joined Jan 17, 2007
7,247
I recommend adding your input voltage to Vcc/2 and comparing that voltage to the midpoint of the pot. You could also add some fixed resistance on either side of the pot to keep the adjustment range away from the supply rails
For now, I'd just like to change the chip, if I can get away with it. The circuit's already built and it would be a PITA to add more components to it.
 

OBW0549

Joined Mar 2, 2015
3,566
Temperature .... maybe that's it! ... the thing kind of drifts into instability after warming up for a bit ...

Is there a simple cure for that?
Nope.

If you want to cure the problem, you'll have to increase the input voltage span so the comparator isn't having to work with such teeny, tiny voltages..

Sorry.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
7,247
Nope.

If you want to cure the problem, you'll have to increase the input voltage span so the comparator isn't having to work with such teeny, tiny voltages..

Sorry.
*sigh* ... my heart is broken...

Anyway, I found a few LM193N laying around, and I'm going to use them to replace the 2903, see if that fixes the problem for now. Remember, the first circuit is working just fine even with those small voltages.

So... if I understand what you and Papabravo have just said, next time I have to make sure that:
  • The voltages to be compared are nowhere close to the rails
  • I need to amplify the input signal to increase the working voltage span

Here's a couple of details I hadn't mentioned. The input signal is generated by the aforementioned circuit, which monitors the amount of current being drawn by a 220VAC drill motor. At the comparator, I use both of its channels. One is to monitor if too much current is being drawn by the drill. And that part hasn't given me any trouble, since the working voltage span is wide enough and quite within range. The other channel I use to make sure that the motor is rotating. That is, I use it to verify that it is turned on. And since an idle drill motor draws very little current, it produces a very small voltage at the monitoring circuit.

Maybe there's a better way (preferably solid state, and galvanically isolated) to monitor if the motor is indeed turned on?
 

MisterBill2

Joined Jan 23, 2018
7,998
Thanks for your help, Dana... as you've probably already noticed, I really know zilch about comparator's minutia ... so it would very much help me if you were to tell me what "Aol" means...

As for a diagram, here it is:


The input signal is obtained from this circuit.
It is quite simple to add a bit of hysteresis to a comparator circuit, it is the calculation that is complex. Just a high value resistor from the output back to the POSITIVE input. That way you are not depending so much on the device characteristics to determine exactly how it works. Several megohms, perhaps a 2.2 meg or even a 4.7 meg feedback resistor at first. National Semiconductor had a good discussion in their old analog applications book, I am sure that there must be other explanations as well.
The LM193 was the premium, the LM2903 has wider variability, a narrower temperature range, and probably a less expensive process. Depending on how many units you need, you may still be able to purchase a few of those "obsolete" LM193 units from some suppliers.
The really good news is that there are still quite a few companies in the linear IC business and you should be able to find a replacement that is even better than the 193
 

OBW0549

Joined Mar 2, 2015
3,566
So... if I understand what you and Papabravo have just said, next time I have to make sure that:
  • The voltages to be compared are nowhere close to the rails
With LM193-type comparators, the input common-mode range includes V- and goes up to within 2 volts (no closer) of V+. It's in the data sheet.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
7,247
With LM193-type comparators, the input common-mode range includes V- and goes up to within 2 volts (no closer) of V+. It's in the data sheet.
So you're saying that it'll work much better comparing low voltages than high ones? (within its working range, of course)

What other "LM193-type" comparators are out there? Perhaps I could find an even more suitable replacement, as Bill's just mentioned.
 

OBW0549

Joined Mar 2, 2015
3,566
So you're saying that it'll work much better comparing low voltages than high ones? (within its working range, of course)
No, I would not say it will work "much better" comparing low voltages than high voltages. It is specified to work with its inputs within the input common-mode voltage range, period. AFAIK, it should perform equally well at all input voltages within the input common-mode voltage range.

What other "LM193-type" comparators are out there? Perhaps I could find an even more suitable replacement, as Bill's just mentioned.
Dunno; it's been a long time since I looked around for comparators. Try looking at the manufacturers' product selection pages and see what's on offer.
 

TeeKay6

Joined Apr 20, 2019
572
Thanks for your help, Dana... as you've probably already noticed, I really know zilch about comparator's minutia ... so it would very much help me if you were to tell me what "Aol" means...

As for a diagram, here it is:


The input signal is obtained from this circuit.
If the comparator is oscillating when the two inputs are at nearly the same voltage, you can do several things to reduce the likelihood of that. One, connect a cap (e.g. 0.01uF to 10uF) from the non-inv input to ground. Two, reduce the resistance value of the pot (e.g. change from 50K to 5K). Three, add hysteresis via added resistor(s). Four, make sure that the pot ground and the Cir_Out ground are both connected to the same point, preferably near the neg power terminal of the comparator.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
7,247
If the comparator is oscillating when the two inputs are at nearly the same voltage
Yes, that is indeed what seems to be happening.

Option #2 seems the most promising. It only requires that I change a component, and not alter the circuit by adding or removing any items. I'm going to put it to the test and come back later with the results.

Many thanks!
 
Top