Strange distortion in audio input circuit with LM358 - Page 1
Forum section: electronics / projects

author: svofski
author_rank: Regular Contributor
timestamp: January 14, 2013, 11:52:23 pm
content: Hi,This is the analog input of the project that I'm building, pardon me for some KiCad cheesiness. Buffer amps, then 2-nd order lowpass filters:The problem here is that I get a weird distortion and I have no idea about what is causing it or how to remedy that. This is a textbook example for all I know. I do not know how to describe the distortion and it depends on input frequency so the best I can do is shoot a lame video. Please take a look:First I'm holding the probe at the output of one channel that's fully wired, say pin 1 of U2A — observe the wtf.Then I move the probe to the output of another channel that I have disconnected from the rest of the circuit, that would be pin 7 of U2B — it looks perfectly well.The opamp is LM358D, single polarity, the power is +9V, the trimpots are zeroed so it ought to be 1 gain and it seems to be so. I'm testing this with all high current circuits powered off so there is no switching noise.Loading the output of U2 via 8k2 to the ground is fine. When I add the 2n7 capacitor (as in only keeping R9/C15) it goes nuts even worse than in the beginning of the video where the complete second stage is wired.What is this that I'm seeing?

author: Lightages
author_rank: Unknown
timestamp: January 15, 2013, 12:09:57 am
content: Just a guess, but you are referencing the + input to less than half the VCC. Why? Try using equal resistors for the ref voltage and maybe lower them to more like 22k each.

author: svofski
author_rank: Regular Contributor
timestamp: January 15, 2013, 12:16:19 am
content: Thanks for the answer —Quote from: Lightages on January 15, 2013, 12:09:57 amAs to why — it was more convenient to have them a little bit lower because that way I would more easily fit the signal into the ADC input range. Why it could be a problem? The signal is about 1Vpp and it's floating at around +3.5V, that leaves a huge margin to the rails. But I guess I should try your suggestion anyway, maybe the lower values on the divider will make it more solid?

author: lewis
author_rank: Frequent Contributor
timestamp: January 15, 2013, 12:23:09 am
content: The 2.7nF caps need to be referenced to the VCC/2 (well, not quite /2), not AGND (which as far as the op-amp is concerned is the negative rail).You'll need to add a buffer between the junction of R5 and R6 and everything else before referencing the caps here. Or, lower the values of R5 and R6 to something like 1k each.Also the input coupling caps need to face the other way because the virtual earth point at pins 2 and 6 of U2 is more positive than AGND. Or, reference the input ground to your VCC/2 point.

author: qno
author_rank: Frequent Contributor
timestamp: January 15, 2013, 08:07:11 am
content: HiThe LM358 is not the most ideal audio opamp.Due to the output stage.Try to load all outputs with 10k to ground. This could help.Else try the TL072 opamp.

author: svofski
author_rank: Regular Contributor
timestamp: January 15, 2013, 12:28:29 pm
content: Quote from: qno on January 15, 2013, 08:07:11 amI tried loading as you said, it had no effect. Maybe I should try a smaller resistance.What makes LM358 not the most ideal audio opamp? For example, what should I look out for in an opamp datasheet that would say if it's good for me or not?

author: lewis
author_rank: Frequent Contributor
timestamp: January 15, 2013, 07:58:02 pm
content: LM358 is OK, but not ideal for audio. Have a look at TI or Analog Devices. You'd be looking for an 'Audio op-amp'. NE5532 and OPA2134 spring to mind, but they're current hungry.Did you try my suggestion above?

author: svofski
author_rank: Regular Contributor
timestamp: January 15, 2013, 09:13:11 pm
content: @lewis, yes, I did. I did not notice any difference. In fact even disconnecting C15/C16 does not help anything, the second stage magically affects the output of the first one. I changed the divider to 1K/750? too. I have a TL072 but it's in a DIP package. If I manage to somehow stuff it in the board I'll see if it makes a difference. If not, I'm going to just bypass the input buffer stage for the time being and increase the gain in the filter instead.

author: JuKu
author_rank: Frequent Contributor
timestamp: January 15, 2013, 09:28:56 pm
content: I'm guessing you are seeing the side effects of the first stage oscillating at higher frequency than your scope can show. Try 100pF between U2 neg input and output. As a general rule, you want to band-limit all op-amp circuits.

author: svofski
author_rank: Regular Contributor
timestamp: January 16, 2013, 12:35:12 am
content: JuKu: that's a valid guess, it looks like self-excitation but I don't think that it can happen in a 1MHz opamp on a frequency that a 60MHz scope can't see at all. So far I have no explanation to this. But —I had a TL072 in the stash but in a DIP package. Don't ask me how I stuffed it in SO8 footprint, the story would be full of depravities. But it works as expected now, no distortion.By observing the output of the second stage I formed an idea that LM358 likes to be loaded on something relatively low-impedance. When the second stage is left hanging I can observe a similar problem on its output. When loaded on 1K it works fine.Feeling content. Thanks everyone!

author: PChi
author_rank: Frequent Contributor
timestamp: January 16, 2013, 10:09:37 pm
content: The LM324 and I presume the LM358 has a pure class B output stage with a large dead band in the middle where neither half of the output stage is conducting so the output driver has to slew a fair way in the cross over period. At low frequencies not much of a problem but at a few kHz not good. It's had me fooled before. I agree with previous replies, try another operational amplifer. I guess that even an LMV358 will be better and has rail to rail outputs which may not be important.

author: CarlG
author_rank: Regular Contributor
timestamp: January 17, 2013, 09:22:05 pm
content: So right...

author: CarlG
author_rank: Regular Contributor
timestamp: January 17, 2013, 09:36:49 pm
content: LM358 simplified schematic.

author: svofski
author_rank: Regular Contributor
timestamp: January 18, 2013, 01:03:08 am
content: CarlG, amazing! Thanks for the explanation.

author: GK
author_rank: Super Contributor
timestamp: January 18, 2013, 04:21:45 am
content: A fix for the x-over distortion with these type of op-amps is to tie the output terminal to the negative rail via either a current source or a fixed resistor, forcing the NPN to conduct over the entire cycle (class A).