Author Topic: comparator woes  (Read 1315 times)

0 Members and 1 Guest are viewing this topic.

Offline vixoTopic starter

  • Regular Contributor
  • *
  • Posts: 79
comparator woes
« on: March 15, 2017, 10:53:06 am »
i've been making a little music gadget recently, which works pretty well apart from an important comparator circuit, or actually two comparator circuits.

I'm finding that whatever I seem to do, I get a little bit of 'chatter' in the transition, which, as I'm feeding an interrupt on a microcontroller, triggers that interrupt twice. I didn't notice it at first as it's *so* slight and I have to zoom right in to see it, but sure enough it's there, on both comparator circuits to a greater or lesser degree.

I also really would like not to have to use this pull-up arrangement, which, if you want to get a really fast transition, is power hungry and really I want this to be as low power consumption as possible. lastly, in the second comparator circuit, i have used a er..  slightly dodgy way of mixing two signals in with each other - the idea is you get a pulse when an incoming wave is either below (for example) 5v or above 5v. because I'm using the coupling cap, the output takes a longer time to charge and I kill my upward transition (which I realise i could re-arrange so the resistor is on the emitter) but this coupling also seems to affect the level of 'chatter' I get.

As you can see I have used hysteresis and filtered the inputs but the chatter remains. What can I do to stop it? Is there a simpler way I can achieve the same goal? I wouldn't have thought this would be such a pain to get right...

 

Offline MagicSmoker

  • Super Contributor
  • ***
  • Posts: 1408
  • Country: us
Re: comparator woes
« Reply #1 on: March 15, 2017, 11:42:54 am »
If your comparators are chattering then you need (more) hysteresis. With a 1k input and 100k positive feedback resistor you have a hysteresis band of about 1% of the output swing, and something like 5-10% would be more appropriate here. So, reduce the feedback resistance and/or increase the input resistance then see if things behave better.

 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13232
Re: comparator woes
« Reply #2 on: March 15, 2017, 12:12:26 pm »
Add  1K isolation resistors between the filter caps C11, C12 and each comparator's +in, with the hysterisis resisors direct to +in.
 

Offline snarkysparky

  • Frequent Contributor
  • **
  • Posts: 419
  • Country: us
Re: comparator woes
« Reply #3 on: March 15, 2017, 12:18:11 pm »
What is the source impedance driving the circuit.  It needs to be low for the hysteresis to work correctly.
 

Offline amspire

  • Super Contributor
  • ***
  • Posts: 3802
  • Country: au
Re: comparator woes
« Reply #4 on: March 15, 2017, 01:10:11 pm »
MagicSmoker's idea about adding more hysteresis - more hysteresis will give you more overdrive on the input and a faster transition.

339's can suffer from oscillation on the inputs which is cured by adding 100 ohms to 1K series resistance to the inputs. This tends to happen when an input is directly connected to a low impedance - such as a capacitor. If you notice a comparator that seems to be switching when it shouldn't, try adding resistors in series with the inputs. When this problem happens, they seem to switch the output even when the voltages in the inputs are wrong.

You can get newer, low power comparitors with active pullup that gives better speed as well. The LM339 is over 40 years old.

There is the LVM339 family from TI and the Micrel/Microchip MIC6270 IttyBitty comparitor.
« Last Edit: March 15, 2017, 01:12:19 pm by amspire »
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: comparator woes
« Reply #5 on: March 15, 2017, 10:01:28 pm »
amspire
LM319  :)
.  That took much longer than I thought it would.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf