Forums

LM386 & Spice

Started by Unknown April 19, 2015
On Mon, 20 Apr 2015 11:56:39 -0700, tabbypurr wrote:

> On Monday, 20 April 2015 18:08:11 UTC+1, bitrex wrote: >> Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> >> Wrote in message: >> > On Sun, 19 Apr 2015 05:08:15 -0700 (PDT), nt wrote: >> > >> >>I need to sim an LM386 amp to see what decoupling caps are neded for >> >>stability on end of life batteries. Is there a Spice model for this >> >>anywhere? My LTSpice seems to lack any of the IC models I'm likely to >> >>use. >> >> >> >> >> >>NT >> > >> > Untested, so I don't know its quality... >> > >> > <http://www.electro-tech-online.com/threads/lm386-model-in-
ltspice.29096/>
>> >> I believe the Yahoo LTSpice users group has an improved model and >> subcircuit drawing for the LM386, I will look... > > thank you both. I now have to learn what to .name these files and where > to put them, and what else I need to do. And where the 'spice' folder is > - most apps seems to turn up in multiple locations on this debian based > system. I'll go look for a FAQ.
For your purposes you need to make sure that the IC model you use correctly models both the chip's sensitivity to power supply variation AND the chip's propensity draw current proportional to the audio. I would breadboard something and spend some quality time with an oscilloscope and a signal generator figuring this out. You also need to make sure that you have a good model of the increasing battery impedance as the voltage dies. A model that is semi-realistic in a very conservative (safe, not Obama-hating) sort of way is use a voltage source that's 1.5V/cell, with enough series resistance to bring the voltage under load to about 0.9V/cell. Real dry-cell batteries act like they have that much series resistance in there, but the effective series resistance is bypassed by a bunch of effective capacitors. Pretending that those caps aren't there will make life harder for your circuit; if you can make it work under that circumstance, you probably have it made in the shade. I'm pretty sure that the power supply bypassing that you need is proportional to the series cap from the audio out to the speaker, but I have absolutely no clue what that constant of proportionality is. If you're having people make this from found parts you need to figure out how to tell them that "using a big C3 means you need a big C8" or whatever. -- www.wescottdesign.com
On Monday, 20 April 2015 21:31:25 UTC+1, Tim Wescott  wrote:
> On Mon, 20 Apr 2015 13:08:49 -0400, bitrex wrote: > > > Tim Wescott <seemywebsite@myfooter.really> Wrote in message: > >> On Sun, 19 Apr 2015 05:08:15 -0700, tabbypurr wrote: > >> > >>> I need to sim an LM386 amp to see what decoupling caps are neded for > >>> stability on end of life batteries. Is there a Spice model for this > >>> anywhere? My LTSpice seems to lack any of the IC models I'm likely to > >>> use. > >>> > >>> > >>> NT > >> > >> Wow -- is that still being used in new production, or is it just used > >> when people are reading old project magazines? > >> > >> At any rate -- from experience the answer is "lots and lots". You'd > >> need an unusually detailed Spice model to find this out, and you'd need > >> to accurately characterize the behavior of the battery at end-of-life. > >> I'm pretty sure that the issue isn't the low voltage, but rather the > >> fact that the battery's internal impedance goes up, which allows the > >> voltage rail to flop around in response to current demands, which the > >> LM386 then responds to and feeds back in the form of current demand. > >> > >> You may end up with a lower BOM cost and less board space with a > >> rail-rail op-amp and a NPN-PNP transistor pair, assuming that there's > >> not a more modern audio amp chip that'll do ya. > >> > >> -- > >> > >> Tim Wescott Wescott Design Services http://www.wescottdesign.com > >> > >> > > The LM386 is about ~20 cents in singles from some suppliers, so > > yeah I bet it is still being used... > > About the only time they don't oscillate is when you want them to. > > Big electrolytics cost $$, though.
386s mostly use not big lytics, they're only driving a 2" speaker after all. Not going to be much bass there. NT
On Monday, 20 April 2015 21:39:26 UTC+1, Tim Wescott  wrote:
> On Mon, 20 Apr 2015 11:56:39 -0700, tabbypurr wrote: > > > On Monday, 20 April 2015 18:08:11 UTC+1, bitrex wrote: > >> Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> > >> Wrote in message: > >> > On Sun, 19 Apr 2015 05:08:15 -0700 (PDT), nt wrote: > >> > > >> >>I need to sim an LM386 amp to see what decoupling caps are neded for > >> >>stability on end of life batteries. Is there a Spice model for this > >> >>anywhere? My LTSpice seems to lack any of the IC models I'm likely to > >> >>use. > >> >> > >> >> > >> >>NT > >> > > >> > Untested, so I don't know its quality... > >> > > >> > <http://www.electro-tech-online.com/threads/lm386-model-in- > ltspice.29096/> > >> > >> I believe the Yahoo LTSpice users group has an improved model and > >> subcircuit drawing for the LM386, I will look... > > > > thank you both. I now have to learn what to .name these files and where > > to put them, and what else I need to do. And where the 'spice' folder is > > - most apps seems to turn up in multiple locations on this debian based > > system. I'll go look for a FAQ. > > For your purposes you need to make sure that the IC model you use > correctly models both the chip's sensitivity to power supply variation > AND the chip's propensity draw current proportional to the audio. I
yup, 2 things I totally don't know.
> would breadboard something and spend some quality time with an > oscilloscope and a signal generator figuring this out.
I am somewhat tempted to do it oldschool. Feed it audio, find out when it goes unstable & double that.
> You also need to make sure that you have a good model of the increasing > battery impedance as the voltage dies. A model that is semi-realistic in > a very conservative (safe, not Obama-hating) sort of way is use a voltage > source that's 1.5V/cell, with enough series resistance to bring the > voltage under load to about 0.9V/cell. Real dry-cell batteries act like
I'd rather use 0.8v/cell to wring the last drops out
> they have that much series resistance in there, but the effective series > resistance is bypassed by a bunch of effective capacitors. Pretending > that those caps aren't there will make life harder for your circuit; if > you can make it work under that circumstance, you probably have it made > in the shade.
I'd rather be as realistic as possible, but like you say is the best model I can do for now.
> I'm pretty sure that the power supply bypassing that you need is > proportional to the series cap from the audio out to the speaker, but I > have absolutely no clue what that constant of proportionality is. If > you're having people make this from found parts you need to figure out > how to tell them that "using a big C3 means you need a big C8" or > whatever.
that last bit's easy enough. I'll try it with different C_outs. I can try 4&16 ohm speakers too, which will change it again. Thanks NT
On 20/04/15 18.21, Tim Wescott wrote:
> On Sun, 19 Apr 2015 05:08:15 -0700, tabbypurr wrote: > >> I need to sim an LM386 amp to see what decoupling caps are neded for >> stability on end of life batteries. Is there a Spice model for this >> anywhere? My LTSpice seems to lack any of the IC models I'm likely to >> use. >> >> >> NT > > Wow -- is that still being used in new production, or is it just used when > people are reading old project magazines?
Some time I looked for a LM386 replacement - found this: TDA7052A DIL8 1W 7mA , 8 ohm bridged 4.5-max.18V Has: Depop, Short-Circuit and Thermal Protection - and is bridged so an output capacitor is not needed:. - LM386 DIL8 4mA 4-12V As you can see, the quiescent current is lower than the bridged TDA7052A. Glenn
On Mon, 20 Apr 2015 14:06:25 -0700, tabbypurr wrote:

> On Monday, 20 April 2015 21:39:26 UTC+1, Tim Wescott wrote: >> On Mon, 20 Apr 2015 11:56:39 -0700, tabbypurr wrote: >> >> > On Monday, 20 April 2015 18:08:11 UTC+1, bitrex wrote: >> >> Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> >> >> Wrote in message: >> >> > On Sun, 19 Apr 2015 05:08:15 -0700 (PDT), nt wrote: >> >> > >> >> >>I need to sim an LM386 amp to see what decoupling caps are neded >> >> >>for stability on end of life batteries. Is there a Spice model for >> >> >>this anywhere? My LTSpice seems to lack any of the IC models I'm >> >> >>likely to use. >> >> >> >> >> >> >> >> >>NT >> >> > >> >> > Untested, so I don't know its quality... >> >> > >> >> > <http://www.electro-tech-online.com/threads/lm386-model-in- >> ltspice.29096/> >> >> >> >> I believe the Yahoo LTSpice users group has an improved model and >> >> subcircuit drawing for the LM386, I will look... >> > >> > thank you both. I now have to learn what to .name these files and >> > where to put them, and what else I need to do. And where the 'spice' >> > folder is - most apps seems to turn up in multiple locations on this >> > debian based system. I'll go look for a FAQ. >> >> For your purposes you need to make sure that the IC model you use >> correctly models both the chip's sensitivity to power supply variation >> AND the chip's propensity draw current proportional to the audio. I > > yup, 2 things I totally don't know. > >> would breadboard something and spend some quality time with an >> oscilloscope and a signal generator figuring this out. > > I am somewhat tempted to do it oldschool. Feed it audio, find out when > it goes unstable & double that. > >> You also need to make sure that you have a good model of the increasing >> battery impedance as the voltage dies. A model that is semi-realistic >> in a very conservative (safe, not Obama-hating) sort of way is use a >> voltage source that's 1.5V/cell, with enough series resistance to bring >> the voltage under load to about 0.9V/cell. Real dry-cell batteries act >> like > > I'd rather use 0.8v/cell to wring the last drops out
I don't think there will be many drops to wring out between 0.9 and 0.8V, but for your intended market it's good to try. Keep in mind that if you use that really conservative model of mine it'll probably work down a lot farther than 0.9V/cell, at least for the part that's due to battery internal impedance. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
On Monday, 20 April 2015 22:17:20 UTC+1, Glenn  wrote:
> On 20/04/15 18.21, Tim Wescott wrote: > > On Sun, 19 Apr 2015 05:08:15 -0700, tabbypurr wrote: > > > >> I need to sim an LM386 amp to see what decoupling caps are neded for > >> stability on end of life batteries. Is there a Spice model for this > >> anywhere? My LTSpice seems to lack any of the IC models I'm likely to > >> use. > >> > >> > >> NT > > > > Wow -- is that still being used in new production, or is it just used when > > people are reading old project magazines? > > Some time I looked for a LM386 replacement - found this: > > TDA7052A DIL8 1W 7mA , 8 ohm bridged 4.5-max.18V > Has: Depop, Short-Circuit and Thermal Protection - and is bridged so an > output capacitor is not needed:. > > - > > LM386 DIL8 4mA 4-12V > > As you can see, the quiescent current is lower than the bridged TDA7052A. > > Glenn
Some unnecessary features there for its typical use. TDA7052A @ Farnell: 1 - 9 &#2013266083;1.06 10 - 99 &#2013266083;0.81 100+ &#2013266083;0.65 LM386 same seller: 1+ &#2013266083;0.742 10+ &#2013266083;0.609 25+ &#2013266083;0.585 50+ &#2013266083;0.565 NT
On Monday, 20 April 2015 22:24:24 UTC+1, tabb...@gmail.com  wrote:
> On Monday, 20 April 2015 22:17:20 UTC+1, Glenn wrote: > > On 20/04/15 18.21, Tim Wescott wrote: > > > On Sun, 19 Apr 2015 05:08:15 -0700, tabbypurr wrote: > > > > > >> I need to sim an LM386 amp to see what decoupling caps are neded for > > >> stability on end of life batteries. Is there a Spice model for this > > >> anywhere? My LTSpice seems to lack any of the IC models I'm likely to > > >> use. > > >> > > >> > > >> NT > > > > > > Wow -- is that still being used in new production, or is it just used when > > > people are reading old project magazines? > > > > Some time I looked for a LM386 replacement - found this: > > > > TDA7052A DIL8 1W 7mA , 8 ohm bridged 4.5-max.18V > > Has: Depop, Short-Circuit and Thermal Protection - and is bridged so an > > output capacitor is not needed:. > > > > - > > > > LM386 DIL8 4mA 4-12V > > > > As you can see, the quiescent current is lower than the bridged TDA7052A. > > > > Glenn > > Some unnecessary features there for its typical use. > TDA7052A @ Farnell: > 1 - 9 &#2013266083;1.06 > 10 - 99 &#2013266083;0.81 > 100+ &#2013266083;0.65 > > LM386 same seller: > 1+ &#2013266083;0.742 > 10+ &#2013266083;0.609 > 25+ &#2013266083;0.585 > 50+ &#2013266083;0.565
1000+ &#2013266083;0.245 NT
On Mon, 20 Apr 2015 13:50:31 -0700 (PDT), tabbypurr@gmail.com wrote:

>On Monday, 20 April 2015 21:31:25 UTC+1, Tim Wescott wrote: >> On Mon, 20 Apr 2015 13:08:49 -0400, bitrex wrote: >> >> > Tim Wescott <seemywebsite@myfooter.really> Wrote in message: >> >> On Sun, 19 Apr 2015 05:08:15 -0700, tabbypurr wrote: >> >> >> >>> I need to sim an LM386 amp to see what decoupling caps are neded for >> >>> stability on end of life batteries. Is there a Spice model for this >> >>> anywhere? My LTSpice seems to lack any of the IC models I'm likely to >> >>> use. >> >>> >> >>> >> >>> NT >> >> >> >> Wow -- is that still being used in new production, or is it just used >> >> when people are reading old project magazines? >> >> >> >> At any rate -- from experience the answer is "lots and lots". You'd >> >> need an unusually detailed Spice model to find this out, and you'd need >> >> to accurately characterize the behavior of the battery at end-of-life. >> >> I'm pretty sure that the issue isn't the low voltage, but rather the >> >> fact that the battery's internal impedance goes up, which allows the >> >> voltage rail to flop around in response to current demands, which the >> >> LM386 then responds to and feeds back in the form of current demand. >> >> >> >> You may end up with a lower BOM cost and less board space with a >> >> rail-rail op-amp and a NPN-PNP transistor pair, assuming that there's >> >> not a more modern audio amp chip that'll do ya. >> >> >> >> -- >> >> >> >> Tim Wescott Wescott Design Services http://www.wescottdesign.com >> >> >> >> >> > The LM386 is about ~20 cents in singles from some suppliers, so >> > yeah I bet it is still being used... >> >> About the only time they don't oscillate is when you want them to. >> >> Big electrolytics cost $$, though. > >386s mostly use not big lytics, they're only driving a 2" speaker after all. Not going to be much bass there. > > >NT
What? No long-throw 2" speakers ?>:-} ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.
On 20/04/15 18.21, Tim Wescott wrote:
...
> You may end up with a lower BOM cost and less board space with a rail-rail > op-amp and a NPN-PNP transistor pair, assuming that there's not a more > modern audio amp chip that'll do ya. >
Something like this: @article{, author = "Chris Toumazou, John Lidgey", title = "Current amplifiers from voltage op-amps", journal = "Electronics World & Wireless World", pages = "568--573", month = "7", year = "1990", publisher = "Reed Elsevier group", keywords = "CA3096" } http://www.ti.com/ww/en/bobpease/assets/AN-31.pdf Something like on page 27 lower schematic, with e.g LF356 or TL071? Removing C2. Use output from collector 2N2219,2N2905 for feedback. What is this circuit called? The bandwidth will be hugely increased. - Another circuits that comes to mind: Art of Electronics, 3rd edition page 318: The Monticelli circuit. Patent 5. jul 1984: http://www.google.com/patents/US4570128 [4] D. M. Monticelli, &ldquo;A quad CMOS single-supply op amp with rail-to-rail output swing,&rdquo; IEEE J. Solid-State Circuits, vol. SC-21, no. 6, pp. 1026-1034, Dec. 1986. http://repository.tamu.edu/bitstream/handle/1969.1/ETD-TAMU-2011-08-9896/KRISHNAN-THESIS.pdf?sequence=2 Glenn
On 20/04/15 23.24, tabbypurr@gmail.com wrote:
...
> Some unnecessary features there for its typical use. > TDA7052A @ Farnell: > 1 - 9 &#2013266083;1.06 > 10 - 99 &#2013266083;0.81 > 100+ &#2013266083;0.65 > > LM386 same seller: > 1+ &#2013266083;0.742 > 10+ &#2013266083;0.609 > 25+ &#2013266083;0.585 > 50+ &#2013266083;0.565 > > > NT
Then how about this "high-power" low voltage: LM4871MX 2-5.5V 3W 6.5mA soic-8, bridged: http://www.digikey.com/product-detail/en/LM4871MX%2FNOPB/LM4871MX%2FNOPBCT-ND/3526988 http://www.ti.com/lit/ds/symlink/lm4871.pdf Quote: "... No Output Coupling Capacitors, Bootstrap Capacitors, or Snubber Circuits Required ..." Glenn