LM386 Chips and Supply Voltage - The Basics

Started by thehallofshields, September 04, 2014, 03:00:50 AM

Previous topic - Next topic

thehallofshields

Okay, I've built Ruby's, Noisy Crickets, RoG 386 Distortions and the Sonic Titan, but this chip has some unexpected quirks that are unlike Opamps, so I'm going to ask some things I should probably already know, but I'd like to be absolutely certain of.

Does increasing the Supply Voltage increase the available headroom? (and vice-versa)

The Datasheet: http://www.ti.com/lit/ds/symlink/lm386.pdf says "Input Voltage: +- 0.4V", but shows 1-3 models with a 15V Supply and the 386N-4 with a 22V Supply.

Does this mean that with a 15V Supply, the 386 Clips at 400mV?

The datasheet shows configurations from 20 to 200.

Does do changes in supply Voltage affect the Gain Feedback Loop?

Bonus Questions:

I've seen some configs taking output from the Feedback Loop (Pins 1 or 8). This seems like it a way to mitigate the huge output Volume for 386 Distortion circuits.

Would this run the Chip at a the minimum Gain of 20?

What type of Volume, Impedance or Frequency Response differences should one expect?

Can an Output be taken from either 1 or 8? Are 1 & 8 both supposed to self-bias at about a 1/2 Voltage Supply?

What would the proper way of Grounding Pin 5 be?

Mark Hammer

Just a couple of points in response to your questions:

The 1-through-4 suffixes pertain to the heat dissipation ratings of the chip.  That is, one could try to run a 386-1 at higher supply voltages into lower loads, but you'd need to provide it with exceptional cooling to prevent it from going "poof!".  The -4 designation simply means the chip "can take it".

The pins-1-to-8 path/loop is really just the two ends of an internal resistor that sets default gain.  Bridging that resistor presents a combined parallel value that will necessarily be lower than the resistor's value on its own.  So, the theoretical gain is essentially unaltered by changes to the supply voltage. 

What changes is whether one can set it up for a given gain, and achieve the voltage swing intended.  This will be true of conventional op-amps as well.  I can certainly set a humble LM741 to have a nominal gain of 10,000.  And if I feed it a +/- one-microvolt signal at its input, I may well get +/-10,000uV at the output, with a lowly 9V battery supply.  But if I feed that same chip a +/-500mv input signal, I'm going to run out of headroom and voltage swing well before that signal is amplified more than a few times, no matter what sort of nominal gain the other external components dictate the chip to operate at.

One of the qualities of the 386 that I rarely see reference to, but saw pleasingly exploited in an old Nuts & Volts project is the manner in which the pin-1-to-8 loop can be exploited to shape frequency response.  The internal resistor allows ALL frequencies to pas and be amplified.  Depending on what you do with that external loop, you can give an advantage to some frequencies.  The Nuts & Volts project was an extension speaker/amp for folks with some hearing loss to hear their TVs better.  The external loop was used with a much smaller cap-value than the 10uf we are accustomed to seeing, such that the extra gain was restricted to the upper mids and highs.  Neat trick!

thehallofshields

#2
Quote from: Mark Hammer on September 04, 2014, 08:49:20 AM
One of the qualities of the 386 that I rarely see reference to, but saw pleasingly exploited in an old Nuts & Volts project is the manner in which the pin-1-to-8 loop can be exploited to shape frequency response.  The internal resistor allows ALL frequencies to pas and be amplified.  Depending on what you do with that external loop, you can give an advantage to some frequencies.

Thanks Mark! Using the Feedback Loop to shape Frequency Response has definitely been on my mind.

EXCEPT, if I understand correctly, we are putting our circuit in parallel with about 1k of Resistance, so our normal RC Filters and other Tone Shaping circuits aren't going to work!

The Lovepedal Purple Plexi has an interesting Gain Loop setup. I wonder if it does any Tone Shaping as you increase the Gain.

I've seen many different Gain Loop Configs, but never an explanation of why you would pick one over another.


Mark Hammer

If the loop allows you to provide more gain by creating a lower combined parallel resistance, then simply linking pins 1 and 8 with a 10uf cap will provide a zero-ohm path for whatever is in the passband of that cap.  Adding a little resistance to that cap will provide less than maximum gain.  Bridging 1 and 8 with a 100nf cap(one 100th of the value of a 10uf cap) will provide max gain for whatever that cap passes (likely mids and highs), but more like the default gain for lower-frequency content. 

Stick a 1k pot in series with a small-value cap like that, and you can control the amount of HF boost.  Connect a 10uf cap to pin 1, as in fig 5, and a 100nf cap on pin 1 as well.  Connect the free end of each cap to the outside lug of a 5k pot, and tie the pot wiper to pin 8, and you can adjust how much full-bandwidth or high-end gain you want to add, by rotating the pot in the one direction or the other.

thehallofshields

Boosting the Treble via a Bass-Blocking Cap is pretty straightforward. I was a little more... perplexed by setups like the Purple Plexi which keep 1 and 8 connected, then Cap-> Pot-> Ground to bring the gain from 200 to 20. I was brainstorming how to do a Mid-Boost in that section, even though I realize it would probably be easier to just place a standard Tone-Control at the Output of Pin5. Anyway, I'm getting off topic.




thehallofshields

So as I understand it, devices like the Krank Distortus Maximus, DAM Sonic Titan, RoG Grace Overdrive, Lovepedal Purple Plexi and all of the 386 distortion circuits from the community, do not push the Gain to the Power Supply Rails, they Clip at the devices fixed Input threshold of 0.4V.

In a sense, they do not saturate the entire device, just the Input Transistors, so the Gain Loop doesn't affect the amount of distortion. Am I way off here?


PRR

#7
> do not push the Gain to the Power Supply Rails, they Clip at the devices fixed Input threshold of 0.4V.

Huh??

The "0.4V" is the maximum Signal to the Input pin. More than that will back-bias something and it won't amplify. It might even burn-up, though we know that lots of folks beat these things and they rarely die.

The maximum CLEAN input is the maximum clean Output divided by the gain.

There's really no point running these things over 12V. They really aimed at 9V work.

At 9V power supply, you get not-quite 9V peak-to-peak output, about 3V RMS output, no more.

If gain is set at 20, then max clean input is 3V/20= 0.15V. This is a fairly strong guitar level.

If gain is set at 200, then max clean input is 3V/200= 0.015V. This is a fairly small guitar level.

If you do NOT want distortion, keep gain down around 20.

If you DO want distortion, set gain up around 200. Then fairly small guitar levels will slam the output, beat-up the signal.

The impedance across the two emitters, against 15K, sets the gain. For audio -or- for DC. We probably do NOT want high DC gain. It upsets the output DC level. Therefore all the factory idea-sketches (I hope you have read them) show a capacitor in series with the gain-set network, to roll-off gain below ~~~50Hz (sub-audio). However we are small and cheap, so we often omit that cap, and let the DC level fall where it may.

Remember that you can also fool with EQ with a network from pin 5 to pin 1. This network *must not* pass DC (needs a series cap; or take output from after the output cap). Page 6 of TI's copy of the LM386 data-sheet shows a "bass boost" network this way.

Very advanced techniques include AC-shorting (big cap) pin 1 to ground. This tries to let gain go to infinity (probably a few thousand). The cap must be <100 Ohms reactance at the lowest frequency of interest (try 47uFd).

Most of the gain-math, and general system stability, assumes pin 7 is well bypassed. Pin 7 *IS* an input, low-gain but not dead. If this is lacking, it may run fine on one power source not on another (power supply wobble gets back into the input).
  • SUPPORTER

thehallofshields

Thanks for straightening me out PRR.

I had read some stuff that made me think that the 386 Distortions sounded different that Opamp Clipping because the the 386 was just clipping at the Input. Not Gain pushing to the Rails of the whole device.

thehallofshields

Quote from: PRR on September 05, 2014, 01:43:16 AM
The impedance across the two emitters, against 15K, sets the gain. For audio -or- for DC. We probably do NOT want high DC gain. It upsets the output DC level. Therefore all the factory idea-sketches (I hope you have read them) show a capacitor in series with the gain-set network, to roll-off gain below ~~~50Hz (sub-audio). However we are small and cheap, so we often omit that cap, and let the DC level fall where it may.

Ahh. It finally makes sense! I've been wondering why some schematics show Pin 1 and 8 connected with a Cap and others without since I first built a Ruby a couple years ago. Thank you.

duck_arse

Quote from: PRR on September 05, 2014, 01:43:16 AM
Pin 7 *IS* an input, low-gain but not dead. If this is lacking, it may run fine on one power source not on another (power supply wobble gets back into the input).

does this mean we can do something stupid here, like inject lfo for tremolo or something? headroom squashing?
You hold the small basket while I strain the gnat.

Hatredman

I know everyone here knows that, but I will post it for the sake of the newbies reading this thread.

The LM386 is NOT an op amp. It is a POWER amp. Half Watt of pure silicon power.

People use it in distortion pedals because it distorts nicely - it is a way of achieving an SS power amp distortion (wich is a little different than the clipping or overloading distortion of preamps, input stages & stuff) in a small package, but you have to keep in mind that, not being an op amp, maybe it will behave a little different, and you have to think differently when thinking of the feedback network (the "gain" leads).

It is NOT fit for mic preamps, hi-fi applications, clean guitar sounds and stuff like that.
Kirk Hammet invented the Burst Box.

teemuk

#12
QuoteThe LM386 is NOT an op amp. It is a POWER amp. Half Watt of pure silicon power.

What's an opamp anyway?

Most power amps are in fact nothing but traditional opamp designs: differential input driving a voltage amplifier stage buffered by a current amplifying stage in the output. Difference is that opamp circuits of power amps can amplify a lot of power while small signal low voltage opamps are usually configured for loads of min. 600 ohms, load currents of few milliampers and supply voltages of about +-15V.

But if you look at the overall circuit architecture most power amps are nothing but opamps by design. They are just configured so that they can amplify more power than those tiny integrated circuits.

Where opamps become "power amps" is a grey area. Isn't 1 mW power too?

Circuit wise LM386 is an opamp as well. But difference to generic opamps is that it has features omitted from generic all-purpose op amp chips; like internally set DC offset bias for inputs, internal input resistors, internal negative feedback loop, etc. A lot of stuff that is usually added to opamps externally with discrete components. IN LM386 all is just built in to make a chip that functions with minimum parts count. The crudest LM386 circuit requires a mere output coupling cap because everything else is already integrated to the chip. But basically it's an opamp with some of additional stuff integrated in it.

thehallofshields

Quote from: teemuk on September 07, 2014, 09:48:35 AM
Circuit wise LM386 is an opamp as well.

So... The clipping we get from the distortion circuits is from the Signal being pushed towards the Power Supply Rails? Or does a single part of the chip bottle-neck the headroom?

Hatredman

You are right, teemuk.

I just wanted to point that out because there are some things we have to keep in mind with IC Power Amp designs, even if it's used otherwise.

First, it's easier to oscillate, if you forget to include an output filter. Also, there is not really an "open loop gain" because there is already an internal feedback loop wich may be too much for certain applications. Besides that, a power amp IC is a lot noisier. It does not make sense to use a LM386 for (say) a mic preamp, when you are a lot better served with a TL08x or a 5532.

Kirk Hammet invented the Burst Box.

R.G.

Quote from: thehallofshields on September 07, 2014, 04:11:46 PM
So... The clipping we get from the distortion circuits is from the Signal being pushed towards the Power Supply Rails? Or does a single part of the chip bottle-neck the headroom?
Circuits can clip at input or output. Both ends have limits on swings. There may be unspecified bottlenecks inside, but you cannot know this unless the maker shows you the inside and you're good at reasoning about how the circuit will work internally from its schematic.

Which limit you hit first depends on the gain. If the closed-loop gain is more than the output clipping voltage divided by the input clipping voltage, the first clipping to appear will be at the output, and this will mask any further changes due to the input clipping with even larger signals.  If the gain is lower than that, you will hit input clipping first, and the output will never clip - although that's very hard to tell unless you are good with a scope and already know what the output clipping limits are and can calculate that it's clipping but not at a level that the output alone would do.

The same reasoning would apply to internal bottlenecks, except we have no way to figure out what they are. Perhaps inside the package/pinout diagram of all ICs there should be the old map note "Here be dragons".

So the answers to the two questions are:
(1) Not necessarily
and
(2) No.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

thehallofshields

Excellent explanation R.G. I'm satisfied.

I'm glad that the clipping doesn't all take place at the input, because that can give the Gain Loop control over which frequency bands get distorted. If I develop a good Variable Upper-Mid Boost design, I'll be sure to share it.

Thanks everyone.