LM339 and LM393 as an op-amp and overcoming ringing/oscillation problems
A while ago I made a post about using LM339 comparators as op amps, thier datasheet provides a circuit which allows them to work as a low frequency op amp but what I needed was a high speed op amp and in simulation they worked great as a high speed op amp. However, in reality there are some odd problems, one of which I don't know how to overcome and ultimately it is not very useful as a (near) rail to rail op amp. It can get really close to ground or V- within about 300mV, but towards the high rail things get highly non-linear and it can only go to about half the supply before reaching it's limit or getting too non-linear. This is all without mentioning the awful ringing, if you don't add a big filter cap on the output, all you get are high frequncy spikes.
Despite this, it is still usable; say if you were trying to keep the parts count down and only needed one comparator and one op amp or if you didn't need a massive output voltage swing, but that's what I'm after: Ground to near V+ output voltage swing.
So it's back to ol' faithful: the LM324. A bit slow but in my current aplication it barely slows down the fastest rise I am working with.
Now, overcoming ringing in the LM339/393: I noticed there was ringing even when used as a basic comparator; with the inverting input supplied with a reference voltage from two resistors set up as a potential divider and the non-inverting input supplied with the signal. This simple circuit still yeilded unwanted high frequncy oscillation if the rise time of the input signal was very slow (which it is) but I overcame this problem simply by putting a low value capacitor to ground on the inverting input! Something in the order of 1n to 100n, I used 47n and 100n with little to no difference noticed between values. You may have to alter the value for different frequency ranges, these values are for audio range applications.
Unusual, I know. I tried adding positive feedback as many online resources and even the datasheet suggest but this caused the output waveform to become distorted and it even slowed down the rise time. Reducing the amount of feedback improved rise time but then the oscillation came back! Nowhere do I see my method mentioned but it works much better; a sharp waveform is maintained, the rise time is still fast and there's no oscillation at all.
Jack of all trades, master of none, but often better than a master of one.









