My Suspect LM386 Problem Seems To Be Solved...

Started by Paul Marossy, May 19, 2018, 07:46:27 PM

Previous topic - Next topic

Paul Marossy

So it turns out that the LM386s I got off ebay a few weeks ago seem to be OK. I discovered that if I add a 47uF cap between V+ & ground, literally right below the IC, the circuit goes from a farting, oscillating, weird noise making machine that won't even pass a signal to a circuit that works exactly like I expect it to. The weird thing is that my LM386s from 12-14 years ago work just fine in same circuit with none of the aforementioned weirdness. So it would appear to me that sometime in the last 10-12 years they made some kind of change to the design of the chip that makes the power rails completely unstable unless there are electrolytic caps between pins 4 & 6, located right at the chip. Even though I have a power supply with lots of filtering and a voltage regulator that's just not good enough to prevent this problem from happening.

My question is why the hell would they change the design of the chip for the worse? To save 1/4 cent per chip or something? I dunno, just glad I figured this out because it was bugging the hell out of me.

Here's the thread I started last week about suspected counterfeit LM386s for reference: https://www.diystompboxes.com/smfforum/index.php?topic=120305.0

GibsonGM

Did you happen to check if a smaller cap will do the job, Paul?  <1u?  Tho it sounds like you spent some time getting to the electro solution...
  • SUPPORTER
MXR Dist +, TS9/808, Easyvibe, Big Muff Pi, Blues Breaker, Guv'nor.  MOSFace, MOS Boost,  BJT boosts - LPB-2, buffers, Phuncgnosis, FF, Orange Sunshine & others, Bazz Fuss, Tonemender, Little Gem, Orange Squeezer, Ruby Tuby, filters, octaves, trems...

Gus



One way to figure out if the ICs are counterfeit would be to de-encapsulate it and a known good one and compare them under a microscope.



ElectricDruid

They sound more like QA fails than counterfeit to me.

Paul Marossy

#4
Quote from: GibsonGM on May 20, 2018, 08:11:29 AM
Did you happen to check if a smaller cap will do the job, Paul?  <1u?  Tho it sounds like you spent some time getting to the electro solution...

I didn't try a small cap. Since it's a Little Gem MKII and it has a 100uF cap next to the ICs on the layout on ROG I just split that into two, one at each LM386. I discovered the caps need to be right at the ICs after watching some YouTube videos that mentioned this. Anyway, it was a VERY frustrating learning experience but glad I can add this to my knowledge base now.

EDIT: I should clarify that I did not have any power related caps on the circuitboard, they were elsewhere but within a few inches of wire length. Apparently that is not good enough for these ICs. Never have I had a problem like this in the dozens of things I have built over the years, except for these very finicky LM386s.

Rob Strand

#5
QuoteMy question is why the hell would they change the design of the chip for the worse? To save 1/4 cent per chip or something? I dunno, just glad I figured this out because it was bugging the hell out of me.
It's just part tolerances.

Parts are designed to be stable with a certain configuration and external environment.     When the parts (as in the internals of the IC)  are on the tolerance fringe and the circuit is on the environment/configuration fringe the assumptions break down and so does the circuit.   Amps and regulators (which actually contain amplifiers) are high on the offender list.     

The fact you don't see it on all chips is simply a matter of statistics and probabilities of occurrence.     Because parts from a given batch are similar, ie. there is a batch correlation, the problems often show up on a whole batch.    If a design is marginal and you make enough batches eventually a problem will appear!

There's even nastier cases where people use caps with the wrong ESR.   In production everything looks OK.  But later, as the capacitor ages, the ESR changes and the circuit fails early.  (Again sometimes only on one batch).
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

anotherjim

We haven't seen the actual full circuit...
But if someone takes a design for battery and powers it off an AC adapter, and even more the power input has a series protection diode, any chip amp can be in trouble.
Battery is a very good capacitor so the original design may have gotten by without any supply cap fitted. Without a battery there is no AC  bypass on the power supply and the amp must have some to be stable. Right on the chip pins is the best place for the cap but adjacent ought to be good enough.

One oscillation problem that's hard to diagnose is when it's a high enough frequency to be inaudible in itself. The audible sign is usually nasty intermodulation distortion when you put some audio in. The cure for that one is a supply cap, but this time it a smaller value ceramic type. A disc or mlcc of 100nF is generally selected in addition to the main electro which is usually ok at 100uF(*). There appears to be disagreement about the need for a ceramic -  simply because many cases get away without having it. It is however accepted "best practice". It's up there with "grid stopper" resistors in tube circuits that you can argue against, but really it is a wise inclusion.
Ceramic works better than the electro to bypass high frequencies and transients despite the lower capacity.
Ceramic cap is small and cheap.
It has no adverse effect on sound quality.
It prevents hard to diagnose mystery faults.
The ceramic is the one that should be closest to the chip power pins - or the connection length made as short as possible.


(*) The value of the electro cap is for the cap local to the chip. The design assumes the power supply has sufficient smoothing/bypass capacitance of it's own and isn't too far away from the amp chip. "Not too far away" means the average wall-wart with a yard or two of skinny cable is almost always too far away! A much bigger electro cap of maybe 1000uF local to the chip might be wise.
Fitting a series protection diode, while it's the most effective protection from reverse polarity, makes the power supply capacitance even less effective since the amps AC currents can't find a path back through it. That don't sound nice either. That means a big electro cap by the amp chip is even more necessary.

Possibly another issue affecting stability when used to drive a speaker is a Zobel/snubber network. Because speaker load is inductive, that small resistor/capacitor network has a balancing/calming effect. The datasheet values of 10R + 47nF suit most uses. But I have seen 386 circuits without one. You will see circuits where the 386 is used as a distortion/overdriver/preamp device and since there is no speaker, it don't need a Zobel, but if you see this...

...and this is offered as a speaker driver. Do you see what's missing?


Paul Marossy

Quote from: Rob Strand on May 20, 2018, 09:41:16 PM
QuoteMy question is why the hell would they change the design of the chip for the worse? To save 1/4 cent per chip or something? I dunno, just glad I figured this out because it was bugging the hell out of me.
It's just part tolerances.

I might agree with that if I didn't get the same results in two identical circuits using LM386N-1s and LM386MM-1s from two different sellers. Both had about the same results but the N-1s were far worse.

All 10 of the N-1s did exactly the same thing and same with all 5 of the MM-1s.

Paul Marossy

#8
Quote from: anotherjim on May 21, 2018, 10:00:14 AM
We haven't seen the actual full circuit...
But if someone takes a design for battery and powers it off an AC adapter, and even more the power input has a series protection diode, any chip amp can be in trouble.
Battery is a very good capacitor so the original design may have gotten by without any supply cap fitted. Without a battery there is no AC  bypass on the power supply and the amp must have some to be stable. Right on the chip pins is the best place for the cap but adjacent ought to be good enough.

One oscillation problem that's hard to diagnose is when it's a high enough frequency to be inaudible in itself. The audible sign is usually nasty intermodulation distortion when you put some audio in. The cure for that one is a supply cap, but this time it a smaller value ceramic type. A disc or mlcc of 100nF is generally selected in addition to the main electro which is usually ok at 100uF(*). There appears to be disagreement about the need for a ceramic -  simply because many cases get away without having it. It is however accepted "best practice". It's up there with "grid stopper" resistors in tube circuits that you can argue against, but really it is a wise inclusion.
Ceramic works better than the electro to bypass high frequencies and transients despite the lower capacity.
Ceramic cap is small and cheap.
It has no adverse effect on sound quality.
It prevents hard to diagnose mystery faults.
The ceramic is the one that should be closest to the chip power pins - or the connection length made as short as possible.


(*) The value of the electro cap is for the cap local to the chip. The design assumes the power supply has sufficient smoothing/bypass capacitance of it's own and isn't too far away from the amp chip. "Not too far away" means the average wall-wart with a yard or two of skinny cable is almost always too far away! A much bigger electro cap of maybe 1000uF local to the chip might be wise.
Fitting a series protection diode, while it's the most effective protection from reverse polarity, makes the power supply capacitance even less effective since the amps AC currents can't find a path back through it. That don't sound nice either. That means a big electro cap by the amp chip is even more necessary.

Possibly another issue affecting stability when used to drive a speaker is a Zobel/snubber network. Because speaker load is inductive, that small resistor/capacitor network has a balancing/calming effect. The datasheet values of 10R + 47nF suit most uses. But I have seen 386 circuits without one. You will see circuits where the 386 is used as a distortion/overdriver/preamp device and since there is no speaker, it don't need a Zobel, but if you see this...

...and this is offered as a speaker driver. Do you see what's missing?

Little Gem MKII, two identical circuits (builds). Had the same problem regardless of how it was powered - used battery, wall wart and 9V voltage regulator with dedicated power supply. No series diode. At least 470uF of filtering is on the power supply, not counting the pair of 47uFs I added. Distance between power supply outlet and the chips is less than 6 inches. And of course, the Zobel network is present in that circuit. No matter what I did all I got was squealing, farting, really nasty oscillation and it would pass ZERO signal. All of this went away when I added those 47uF caps literally right underneath the chips.

I had none of this BS with my min. of 12 year old LM386s.

EDIT: At times I was picking up a radio station that I sometimes get in my wah pedals. I did not have the ceramic cap on the power supply, so I don't know, maybe I had some ultrasonic oscillation getting into the power supply due to RF interference. Is that possible? However, when I use my known working 12+ year old chips I get none of this nonsense. It all seems to point to some kind of change in the IC design if you ask me.

Phoenix

All this is a known issue with different manufacture 386's, at least I thought it was more widely known. The NJM/JRC manufactured chips seem to be the most stable, with those from TI and others often oscillating in circuits/layouts where the NJM/JRC chips behave normally.
Really, we should be using best practices (ie: local decoupling, high frequency bypassing, Zobel network, etc.) even with the NJM/JRC chips, but because we can "get away with it", we might get a little lazy with our designs or decide to save a few cents from the BOM. Production amps like the Smokey that are based on a 386 exclusively use the NJM/JRC chips, presumably for exactly that reason, to minimize BOM cost.

Paul Marossy

Quote from: Phoenix on May 21, 2018, 12:34:40 PM
All this is a known issue with different manufacture 386's, at least I thought it was more widely known. The NJM/JRC manufactured chips seem to be the most stable, with those from TI and others often oscillating in circuits/layouts where the NJM/JRC chips behave normally.
Really, we should be using best practices (ie: local decoupling, high frequency bypassing, Zobel network, etc.) even with the NJM/JRC chips, but because we can "get away with it", we might get a little lazy with our designs or decide to save a few cents from the BOM. Production amps like the Smokey that are based on a 386 exclusively use the NJM/JRC chips, presumably for exactly that reason, to minimize BOM cost.

Mine are all National Semi. I guess I won't ever get those again lol

Rob Strand

#11
QuoteI might agree with that if I didn't get the same results in two identical circuits using LM386N-1s and LM386MM-1s from two different sellers. Both had about the same results but the N-1s were far worse.

For some manufacturers the average sits closer to a boundary.  For example modern processes might result in faster devices which promotes oscillation when supply decoupling and Zobel networks aren't ideal.   Their production processes might actually be tighter which means they can reliably build devices closer to the boundaries yet all devices are still within spec.  [What I'm saying here is the statistical scatter occurs across the different manufacturers.]

It's not that uncommon.  Even in the old days some brands of 555's were faster than others, some 741's were less noisy than others.   

The 4000 CMOS gates had fast and slow brands (IIRC Philips and Harris were faster).     It wasn't uncommon for fast circuit to specify a particular brand.   The problem demanded fast chips but you simply didn't have the choice of using another device so you spec'd in a specific brand.

QuoteReally, we should be using best practices (ie: local decoupling, high frequency bypassing, Zobel network, etc.) even with the NJM/JRC chips, but because we can "get away with it", we might get a little lazy with our designs or decide to save a few cents from the BOM. Production amps like the Smokey that are based on a 386 exclusively use the NJM/JRC chips, presumably for exactly that reason, to minimize BOM cost.

That's pretty much it.   If you are doing production runs and you don't want your company to get a bad reputation, it doesn't pay to skimp.

When you design a  power supply or power amplifier and tried to stabilize it with different loads or different cap ESRs you realize how close you are to the limits.   Amplifiers oscillate very easily without a Zobel network and you can see how risky it is to leave them off!

Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

reddesert

Quote from: Paul Marossy on May 21, 2018, 10:45:33 AM

Little Gem MKII, two identical circuits (builds). Had the same problem regardless of how it was powered - used battery, wall wart and 9V voltage regulator with dedicated power supply. No series diode. At least 470uF of filtering is on the power supply, not counting the pair of 47uFs I added. Distance between power supply outlet and the chips is less than 6 inches. And of course, the Zobel network is present in that circuit. No matter what I did all I got was squealing, farting, really nasty oscillation and it would pass ZERO signal. All of this went away when I added those 47uF caps literally right underneath the chips.

I had none of this BS with my min. of 12 year old LM386s.

EDIT: At times I was picking up a radio station that I sometimes get in my wah pedals. I did not have the ceramic cap on the power supply, so I don't know, maybe I had some ultrasonic oscillation getting into the power supply due to RF interference. Is that possible? However, when I use my known working 12+ year old chips I get none of this nonsense. It all seems to point to some kind of change in the IC design if you ask me.

The Little Gem MkII is a bridged amp with two LM386s.  Schematic is here: http://www.runoffgroove.com/littlegem.html

Bridged amps are a use that is outside the datasheet examples. It may seem like it's just two of the same thing wired together, but bridged amps can be a major circuit design problem because what used to be ground isn't ground any more. I have little experience in amplifier design, but it strikes me as similar to the problem of trying to run a PNP Fuzz Face off an inverted ground circuit. By all reports, sometimes that works and sometimes it's oscillation hell.



Paul Marossy

Quote from: Rob Strand on May 21, 2018, 07:16:27 PM
QuoteI might agree with that if I didn't get the same results in two identical circuits using LM386N-1s and LM386MM-1s from two different sellers. Both had about the same results but the N-1s were far worse.

For some manufacturers the average sits closer to a boundary.  For example modern processes might result in faster devices which promotes oscillation when supply decoupling and Zobel networks aren't ideal.   Their production processes might actually be tighter which means they can reliably build devices closer to the boundaries yet all devices are still within spec.  [What I'm saying here is the statistical scatter occurs across the different manufacturers.]

It's not that uncommon.  Even in the old days some brands of 555's were faster than others, some 741's were less noisy than others. 

I get that, but in my case I had (in same circuit):

(10) new National Semi LM386N-1s - nothing but trouble
(5) new National Semi LM386MM-1s - less trouble but still a PITA
(3) 12+ year old National Semi LM386N-1s - work just fine

So if you're right, manufacturing has gotten more precise but to a fault if you ask me.

Paul Marossy

#14
Quote from: reddesert on May 22, 2018, 02:51:34 AM
The Little Gem MkII is a bridged amp with two LM386s.  Schematic is here: http://www.runoffgroove.com/littlegem.html

Bridged amps are a use that is outside the datasheet examples. It may seem like it's just two of the same thing wired together, but bridged amps can be a major circuit design problem because what used to be ground isn't ground any more. I have little experience in amplifier design, but it strikes me as similar to the problem of trying to run a PNP Fuzz Face off an inverted ground circuit. By all reports, sometimes that works and sometimes it's oscillation hell.

Yes, I am aware that is a bridged amplifier which is kind of outside of what is shown on the data sheet. The LM380 data sheet shows a bridged amplifier, and the Little Gem MKII roughly follows the same idea as the bridged LM380s. The gain of an LM380 is only 20, so that could be a factor as to why (I guess) sometimes you can have this problem with LM386s set at a gain of 200. But in my case my problems were so extreme, and frankly none of it should have even been happening as far as I can tell.

But I still have the same question: why do my 12+ year old LM386s  (National Semi) work fine and all 15 new ones (same brand) require all this extra crap in the same circuit for it to even work at all?

Rob Strand

#15
QuoteI get that, but in my case I had (in same circuit):

The circuit is the problem as it has hidden faults.    What you are seeing *is* what happens with problematic circuits.   They vary from barely working some of the time to working most of the time.     Moreover it does operate outside of the datasheet.

I'm not saying it isn't a PITA!   (I've had to debug and fix other people's designs with this type of issue a few times.)

http://www.runoffgroove.com/littlegem.html

In defense of the chips I can see the following issues:
- Bridge-mode is not specified.  (As Reddesert pointed out).
- The circuit uses a single Zobel network across the two outputs.    This can be done sometimes, eg the LM380.   From a circuit stability point of view it's not good.  You really should have separate Zobel networks on each output to ground.  Why?  because the whole purpose of the Zobel network is removed if the amplifier impedance rises (which it will.)  See,
https://i.pinimg.com/originals/53/fe/be/53febec12031bf7d81d73a4e8b206cad.png
- The circuit does not bypass pin 7.   The PSRR of the amplifier is *very* poor without this cap (see datasheet). So if your power supply bypassing isn't 100% you might see problems.

In defense of the circuit:
- The two bridge mode halves are largely independent.  They don't share any common feedback paths
  other than through the ground. (and unintended coupling through the supply)
- The datasheet has no guidelines for the size of the bypass cap *on +V*  (bypass is used in two other ways in the datasheet).
- None of the example circuits have a +V bypass cap.

However, bypassing the supply and bypassing each chip are common practices to avoid oscillations.   The longer the wires to the amps the more attention is required.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Paul Marossy

#16
Quote from: Rob Strand on May 22, 2018, 07:26:34 PM
- The circuit uses a single Zobel network across the two outputs.    This can be done sometimes, eg the LM380.   From a circuit stability point of view it's not good.  You really should have separate Zobel networks on each output to ground.  Why?  because the whole purpose of the Zobel network is removed if the amplifier impedance rises (which it will.)  See,
https://i.pinimg.com/originals/53/fe/be/53febec12031bf7d81d73a4e8b206cad.png
- The circuit does not bypass pin 7.   The PSRR of the amplifier is *very* poor without this cap (see datasheet). So if your power supply bypassing isn't 100% you might see problems.

In my case, I had 47uF caps to ground on Pin 7 (bypass) and I still had a useless circuit until I put the 47uF caps across Pin 4 & 6 right at the chip. Before I did that nothing I tried worked. Nothing.

AND, I already had a 100uF cap on the power going to the IC chips, within 2 inches of the circuit board. That did zero to alleviate the problems I had.

The dual Zobel network is an interesting idea. Not sure it would have helped in my case, but I might mess around with that idea just for kicks.

Rob Strand

#17
Quoten my case, I had 47uF caps to ground on Pin 7 (bypass) and I still had a useless circuit until I put the 47uF caps across Pin 4 & 6 right at the chip. Before I did that nothing I tried worked. Nothing.
Interesting to know.

QuoteThe dual Zobel network is an interesting idea. Not sure it would have helped in my case, but I might mess around with that idea just for kicks.
If you want to know the real cause/solution it's worth trying.

That being said, your current solution of better bypassing may be the only solution.  Bypassing carries a strong weight.  That's actually a good thing because you know the primary problem and you have fixed it.  When there's two fixes you know your dealing with an erratic beast  (For external parts I often put in both fixes in that case but for parts in the feedback loop it needs much closer attention.)

BTW, there's a few reports on the Web on unstable LM386's so maybe you will be the guy to come up with the solution - unfortunately you also had to do the hard yards.

Edit:

Quote
AND, I already had a 100uF cap on the power going to the IC chips, within 2 inches of the circuit board. That did zero to alleviate the problems I had.
That does indicate things are on the edge.   Maybe worth see how small you can go on the caps but use something bigger.  Some already mentioned this.

Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Paul Marossy

Quote from: Rob Strand on May 23, 2018, 05:22:06 PM
When there's two fixes you know your dealing with an erratic beast  (For external parts I often put in both fixes in that case but for parts in the feedback loop it needs much closer attention.)

BTW, there's a few reports on the Web on unstable LM386's so maybe you will be the guy to come up with the solution - unfortunately you also had to do the hard yards.

It was literally my last idea after basically redoing the circuit board, thinking I must have had a good looking bad solder joint. When that didn't work, I thought I'd add those caps between Pins 4 & 6 and voila! it was suddenly working exactly as expected. After the disbelief wore off, it was a relief that I figured the S.O.B. out!

Rob Strand

QuoteIt was literally my last idea after basically redoing the circuit board, thinking I must have had a good looking bad solder joint. When that didn't work, I thought I'd add those caps between Pins 4 & 6 and voila! it was suddenly working exactly as expected. After the disbelief wore off, it was a relief that I figured the S.O.B. out!
Yes, sometimes this stuff is a pain.   The good thing is your perseverance paid off.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.