Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

LM386 audio amp Spice model?

4,458 views
Skip to first unread message

Richard DeWilde

unread,
May 16, 1995, 3:00:00 AM5/16/95
to

Good day all!

I am looking for a LM386 audio amp spice model. I have checked the cookbook
ftp site and although there is a ton of op amps there, this one does not
seem to have made it in... I don't know if it is a commonly used op amp (or
maybe its outdated), but this is one that has been available for school
projects, and I'd like to be able to simulate it Pspice.

I was also curious to know if there is a Pspice Schematics (windows graphical
circuit designer/simulator) ftp site of circuits. If not, maybe some of
us should get together and start a collection (I don't have much, but I
think schematics is the way to go :-)

Thanks for your time!


--
****************************************************************************
dew...@titan.ucs.umass.edu
****************************************************************************

Dave Dilatush

unread,
May 29, 1995, 3:00:00 AM5/29/95
to
dew...@joyce.oit.umass.edu (Richard DeWilde) wrote:

>I am looking for a LM386 audio amp spice model. I have checked the cookbook
>ftp site and although there is a ton of op amps there, this one does not
>seem to have made it in... I don't know if it is a commonly used op amp (or
>maybe its outdated), but this is one that has been available for school
>projects, and I'd like to be able to simulate it Pspice.

The reason you can't find a SPICE model for the LM386 is that
it's an audio power amplifier, not an opamp. Opamp SPICE models
are a dime a dozen, as the semiconductor manufacturers give them
out free; but specialty ICs are a different story. I looked in
my own stuff, but didn't find anything.

I've encountered this situation before, and ended up either
resorting to non-SPICE circuit analysis methods or else hacking
my own model and accepting it's limitations.

>I was also curious to know if there is a Pspice Schematics (windows graphical
>circuit designer/simulator) ftp site of circuits. If not, maybe some of
>us should get together and start a collection (I don't have much, but I
>think schematics is the way to go :-)

See Filip M Gieszczykiewicz's 5/28 post for a really good list of
these.

Dave Dilatush


Dave Dilatush

unread,
May 30, 1995, 3:00:00 AM5/30/95
to
dew...@joyce.oit.umass.edu (Richard DeWilde) wrote:

>I am looking for a LM386 audio amp spice model. I have checked the cookbook
>ftp site and although there is a ton of op amps there, this one does not
>seem to have made it in... I don't know if it is a commonly used op amp (or
>maybe its outdated), but this is one that has been available for school
>projects, and I'd like to be able to simulate it Pspice.

When I answered this post yesterday, I commented that that the
LM386 is an audio power amplifier, not an opamp, and that finding
PSPICE models for anything other than opamps is difficult. I
also commented that it's necessary sometimes to hack your own
model.

After posting that reply I got curious and looked at the National
Semiconductor data sheet for the LM386: lo and behold, like most
of the older National data sheets it shows a device schematic.
No doubt the diagram is somewhat simplified (for instance, none
of the internal bias circuitry is shown), but it's complete
enough to make a useful PSPICE model.

Some notes on the home-made LM386 model which follows:

1. This is a circuit-based model, not one of the so-called
"macromodels" which try to emulate device behavior while
concealing the device construction. A macromodel would simulate
a lot faster and use less memory, but would miss some behavioral
features. Most of the macromodels I've used leave a lot to be
desired.

2. There are models, and then there are models. While they are
***ALL*** approximations, some are better than others and the
more time you put into developing a model the more nuances of
actual device behavior you can get it to emulate. This one was
lashed together in about an hour, so don't expect fidelity down
to the last little detail. In particular, watch out for
significant departures from reality when operating under extreme
conditions or when operating in an oddball circuit hookup.

3. What follows was written for MicroSim's PSPICE, and runs OK
on my PSPICE 5.0 Evaluation version. But it might not run on any
other brand of SPICE, and it might not run on any other eval
version of PSPICE without choking up: it's got 14 transistors in
it, which is about the limit for these freebie SPICEs.

4. The transistor device models used are copies of models I
generated for some long-forgotten project at work using
MicroSim's PARTS utility. They're pretty "generic" and I've made
no attempt at fiddling with them other than tweaking the forward
beta (Bf) parameter.

5. The following model behavior showed good agreement with the
LM386 data sheet values:

a) Quiescent power supply current;
b) High frequency response at low gain setting;
c) Power-supply rejection ratio, both bypassed and unbypassed;
d) Voltage gain, both with pins 1&8 shorted and open; and
e) Total harmonic distortion.

6. I saw the following discrepancies:

f) High-gain frequency response looks somewhat more wideband
than the actual device;
g) Peak-to-peak output voltage swing is a bit more than the
data sheet value- in other words, the PSPICE model drives
closer to the rails; and
h) Input bias current in this model is only about 7 nA,
compared with the 250 nA "typical" value mentioned in
the data sheet.

7. The frequency response characteristics of this LM386 model
can be adjusted somewhat by changing C1, the rolloff capacitor in
the voltage gain stage. It could also be made more realistic by
tweaking transistor model parameters Cjc, Cje, Tr and Tf,
although this can get pretty hairy.

8. Likewise, output drive capability could be made more
realistic by tweaking transistor model parameters; again, this is
hairy.

So here's the model. Enjoy, but use with caution.

*--------------------------------------------
* NO-FRILLS LM386 MODEL
* Dave Dilatush 5/30/95

* PSPICE analysis statements:

.probe
.ac dec 20 1 1e7
.tran 1u 3m 0 5u

* circuit to test the lm386 model:

vsupply vcc 0 dc 9
vsignal input 0 ac 1 sin 0 .05 1k
csnub output snub .05uf
rsnub snub 0 10
ccoupling output speaker 1000uf
rspeaker speaker 0 8
xamp input nc1 nc2 nc3 nc4 output vcc 0 lm386
*cgain nc3 nc4 10uf ;gain boost capacitor
*cbypass nc2 0 50uf ;bypass cap for PSRR

* lm386 subcircuit model follows:

* IC pins: 2 3 7 1 8 5 6 4
* | | | | | | | |
.subckt lm386 inn inp byp g1 g8 out vs gnd

* input emitter-follower buffers:

q1 gnd inn 10011 ddpnp
r1 inn gnd 50k
q2 gnd inp 10012 ddpnp
r2 inp gnd 50k

* differential input stage, gain-setting
* resistors, and internal feedback resistor:

q3 10013 10011 10008 ddpnp
q4 10014 10012 g1 ddpnp
r3 vs byp 15k
r4 byp 10008 15k
r5 10008 g8 150
r6 g8 g1 1.35k
r7 g1 out 15k

* input stage current mirror:

q5 10013 10013 gnd ddnpn
q6 10014 10013 gnd ddnpn

* voltage gain stage & rolloff cap:

q7 10017 10014 gnd ddnpn
c1 10014 10017 15pf

* current mirror source for gain stage:

i1 10002 vs dc 5m
q8 10004 10002 vs ddpnp
q9 10002 10002 vs ddpnp

* Sziklai-connected push-pull output stage:

q10 10018 10017 out ddpnp
q11 10004 10004 10009 ddnpn 100
q12 10009 10009 10017 ddnpn 100
q13 vs 10004 out ddnpn 100
q14 out 10018 gnd ddnpn 100

* generic transistor models generated
* with MicroSim's PARTs utility, using
* default parameters except Bf:

.model ddnpn NPN(Is=10f Xti=3 Eg=1.11 Vaf=100
+ Bf=400 Ise=0 Ne=1.5 Ikf=0 Nk=.5 Xtb=1.5 Var=100
+ Br=1 Isc=0 Nc=2 Ikr=0 Rc=0 Cjc=2p Mjc=.3333
+ Vjc=.75 Fc=.5 Cje=5p Mje=.3333 Vje=.75 Tr=10n
+ Tf=1n Itf=1 Xtf=0 Vtf=10)

.model ddpnp PNP(Is=10f Xti=3 Eg=1.11 Vaf=100
+ Bf=200 Ise=0 Ne=1.5 Ikf=0 Nk=.5 Xtb=1.5 Var=100
+ Br=1 Isc=0 Nc=2 Ikr=0 Rc=0 Cjc=2p Mjc=.3333
+ Vjc=.75 Fc=.5 Cje=5p Mje=.3333 Vje=.75 Tr=10n
+ Tf=1n Itf=1 Xtf=0 Vtf=10)

.ends
*----------end of subcircuit model-----------
.end

Regards,

Dave Dilatush


0 new messages