EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: ali6x944 on February 24, 2016, 08:47:04 pm

Title: is it possible? to use comparetor op amps as crud audio amps
Post by: ali6x944 on February 24, 2016, 08:47:04 pm
hi everyone,
is it possible to use comparetor op amps like lm311 or lm339 as crud audio amps?
Title: Re: is it possible? to use comparetor op amps as crud audio amps
Post by: T3sl4co1l on February 24, 2016, 08:55:20 pm
Maybe. Probably not. Why would you want to?  Single op-amps are available in SOT-23-5.

Tim
Title: Re: is it possible? to use comparetor op amps as crud audio amps
Post by: bktemp on February 24, 2016, 08:58:34 pm
You could build a class-D amp using a comparator.
Maybe a comparator works as a linear amplifier, but it won't be good.
Title: Re: is it possible? to use comparetor op amps as crud audio amps
Post by: Audioguru on February 24, 2016, 09:27:46 pm
An opamp has a frequency compensation capacitor inside so that it doesn't oscillate when negative feedback is used.
A comparator oscillates when negative feedback is used.

The output of an opamp goes to any level within its linear range.
The output od a comparator goes digitally only high and low with linear nothing in between.
Title: Re: is it possible? to use comparetor op amps as crud audio amps
Post by: bktemp on February 24, 2016, 10:09:51 pm
The output of an opamp goes to any level within its linear range.
The output od a comparator goes digitally only high and low with linear nothing in between.
In theory, but all practical comparators have a finite gain (200k for a LM339, that is similar to an opamp). So adding a feedback will force them into linear operation (unless the comparator has an internal hysteresis).
Title: Re: is it possible? to use comparetor op amps as crud audio amps
Post by: Seekonk on February 24, 2016, 10:44:22 pm
It has been years since I used a LM339 in an audio application, but I don't recall it being bad at all.
Title: Re: is it possible? to use comparetor op amps as crud audio amps
Post by: T3sl4co1l on February 25, 2016, 04:28:56 am
The problem is the gain and output stage are wide open, so the gain extends to much higher frequencies, where the phase shift wraps around.  So you can hardly apply any feedback without it oscillating.

I think the usual approach is to shunt the output into submission with a Big Fuckin' Cap, but this doesn't address the fundamental problem, which is that the circuit itself is unstable and prone to oscillation.  Indeed, this tends to result in low level oscillation (~mV), as its screams are muffled into the large capacitor, but not silenced.

You also don't have a driving output, only open collector.  So you're limited to class A resistor loaded output.

Used in a proper PWM circuit, it's not bad, but now you're intentionally harnessing its screams, which means the possibility of high efficiency (adding a suitable output stage), and the requirement for heavy filtering.

Tim
Title: Re: is it possible? to use comparetor op amps as crud audio amps
Post by: Zero999 on February 25, 2016, 08:58:30 pm
Yes, it can be done. There are some examples of this on the datasheet. The VCO schematic on the LM339 uses a comparator as an op-amp integrator: see top left of the schematic.

(https://www.eevblog.com/forum/projects/op-amp-relaxation-oscillator-and-pwm-advice/?action=dlattach;attach=21317;image)

The LM311 will probably be better with the output connected as an emitter follower but there are no examples on the datasheet.
Title: Re: is it possible? to use comparetor op amps as crud audio amps
Post by: c4757p on February 25, 2016, 09:28:15 pm
Yup, LM339 is perfectly fine as an opamp - as mentioned stability can be an issue, but it's not too bad if you can slow it down a bit with a cap. Various revisions of the datasheet have even suggested this use, though recent versions seem to have been scrubbed of this. I've used it before for a very specific application - I needed an open collector opamp, which would be connected in "wired OR" with multiple others, with only one active at a time.

Keep in mind this is because LM339 is inordinately slow for a comparator. You may have worse luck with faster specimens like LM311.
Title: Re: is it possible? to use comparetor op amps as crud audio amps
Post by: Richard Crowley on February 25, 2016, 09:37:32 pm
I have even seen application notes showing DTL gates used as linear amplifiers (with appropriate biasing and feedback, of course.)

The original question was "is it possible to use comparetor op amps like lm311 or lm339 as crud audio amps?"
Was that a Freudian slip?   :-DD