Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > General Electronics Chat


General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion?

Reply
 
LinkBack Thread Tools Display Modes
Old 9th August 2006, 11:01 AM   (permalink)
Question Spice model LM386

Hi looking for a spice model for the LM386 can't locate it on the web can anyone help.
habbott is offline  
Old 9th August 2006, 04:39 PM   (permalink)
Default

No guarantees:
Code:
* lm386 subcircuit model follows:

************************************original* IC pins:     2   3   7   1   8   5   6   4
* IC pins:     1   2   3   4   5   6   7   8
*              |   |   |   |   |   |   |   |
.subckt lm386 g1  inn inp gnd out  vs byp g8
************************************original*.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-----------
__________________
Ron

Roff is offline  
Old 9th August 2006, 05:48 PM   (permalink)
Default

FYI on that model

* 1. The following model behavior shows 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.
*
* 2. The model has 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 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.
*
* 3. 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.
*
* 4. Likewise, output drive capability could be made more
* realistic by tweaking transistor model parameters; again, this is
* hairy.
*
Optikon is offline  
Old 9th August 2006, 07:31 PM   (permalink)
Smile Thanks

Hi , thanks for the help but I am new to this. Has anyone got a complete model ready to go so I can just us it in my software program
habbott is offline  
Old 10th August 2006, 05:36 PM   (permalink)
Default

Quote:
Originally Posted by habbott
Hi , thanks for the help but I am new to this. Has anyone got a complete model ready to go so I can just us it in my software program
You were given a complete model that is ready to use by RonH.

If you don't know how to connect the model, that's a different problem but the model is as complete as it'll ever be.
Optikon is offline  
Old 10th August 2006, 06:47 PM   (permalink)
Default

maybe the question should be what spice program are you using?
philba is offline  
Old 29th December 2008, 03:21 PM   (permalink)
Default

I'm having a couple of problems using this model.

I tried simulating it and got the following error:

Fatal Error: Unknown subcircuit called in:
xu1 n002 0 n007 0 n004 n001 n008 n003 lm386.sub

I'm using exactly the model posted by Roff, the symbol and schematic are attached.

Have I made an error with the symbol or schematic?

I've never drawn a sybol in LTSpice before so I just edited the generic op-amp file accordingly.

Symbol file:
Code:
Version 4
SymbolType CELL
LINE Normal -64 -63 64 0
LINE Normal -64 65 64 0
LINE Normal -64 -63 -64 65
LINE Normal -60 -48 -52 -48
LINE Normal -60 48 -52 48
LINE Normal -56 52 -56 44
LINE Normal -48 -80 -48 -55
LINE Normal -48 80 -48 57
LINE Normal -44 -68 -36 -68
LINE Normal -40 -72 -40 -64
LINE Normal -44 68 -36 68
LINE Normal -16 -39 -16 -64
LINE Normal 0 32 0 48
LINE Normal 48 -8 48 -32
TEXT -51 1 Left 0 LM386
SYMATTR Prefix X
SYMATTR Description Low power audio amplifier
SYMATTR ModelFile LM386.sub
SYMATTR SpiceModel LM386.sub
PIN -16 -64 LEFT 8
PINATTR PinName g1
PINATTR SpiceOrder 1
PIN -64 -48 NONE 0
PINATTR PinName In-
PINATTR SpiceOrder 2
PIN -64 48 NONE 0
PINATTR PinName In+
PINATTR SpiceOrder 3
PIN -48 80 NONE 0
PINATTR PinName V-
PINATTR SpiceOrder 4
PIN 64 0 NONE 0
PINATTR PinName OUT
PINATTR SpiceOrder 5
PIN -48 -80 NONE 0
PINATTR PinName V+
PINATTR SpiceOrder 6
PIN 0 48 LEFT 8
PINATTR PinName bp
PINATTR SpiceOrder 7
PIN 48 -32 LEFT 8
PINATTR PinName g8
PINATTR SpiceOrder 8
Attached Files
File Type: asc LM386 amplifier.asc (1.6 KB, 4 views)
__________________
I also post at the following sites:
http://www.stop-microsoft.org http://www.heated-debates.com
Screen name: Aloone_Jonez
And http://www.silicontronics.com, same screen name as here.
Hero999 is offline  
Old 29th December 2008, 04:38 PM   (permalink)
Default

This seems to work:
Code:
Version 4
SymbolType CELL
LINE Normal -64 -63 64 0
LINE Normal -64 65 64 0
LINE Normal -64 -63 -64 65
LINE Normal -60 -48 -52 -48
LINE Normal -60 48 -52 48
LINE Normal -56 52 -56 44
LINE Normal -48 -80 -48 -55
LINE Normal -48 80 -48 57
LINE Normal -44 -68 -36 -68
LINE Normal -40 -72 -40 -64
LINE Normal -44 68 -36 68
LINE Normal -16 -39 -16 -64
LINE Normal 0 32 0 48
LINE Normal 48 -8 48 -32
SYMATTR Value LM386
SYMATTR Prefix X
SYMATTR ModelFile LM386.sub
SYMATTR Value2 LM386
SYMATTR Description Low power audio amplifier
PIN -16 -64 LEFT 8
PINATTR PinName g1
PINATTR SpiceOrder 1
PIN -64 -48 NONE 0
PINATTR PinName In-
PINATTR SpiceOrder 2
PIN -64 48 NONE 0
PINATTR PinName In+
PINATTR SpiceOrder 3
PIN -48 80 NONE 0
PINATTR PinName V-
PINATTR SpiceOrder 4
PIN 64 0 NONE 0
PINATTR PinName OUT
PINATTR SpiceOrder 5
PIN -48 -80 NONE 0
PINATTR PinName V+
PINATTR SpiceOrder 6
PIN 0 48 LEFT 8
PINATTR PinName bp
PINATTR SpiceOrder 7
PIN 48 -32 LEFT 8
PINATTR PinName g8
PINATTR SpiceOrder 8
You can also do it as in the attached file if you don't want to create a symbol. The 8 pin symbol is in the Misc library.
Attached Files
File Type: asc LM386 application.asc (169 Bytes, 6 views)
__________________
Ron

Roff is offline  
Old 29th December 2008, 09:08 PM   (permalink)
Default

Thanks Roff.

Do you know where I had gone wrong (apart from not including a value for C4 which shouldn't have given me that error)?
__________________
I also post at the following sites:
http://www.stop-microsoft.org http://www.heated-debates.com
Screen name: Aloone_Jonez
And http://www.silicontronics.com, same screen name as here.
Hero999 is offline  
Old 29th December 2008, 09:14 PM   (permalink)
Default

Hi,


I think what he meant was that he wants a model that actually models
all of the characteristics, not just some of them.
MrAl is offline  
Old 29th December 2008, 09:47 PM   (permalink)
Default

I think this is close enough for now.

The main discrepancy I've noticed is that this model only has a gain of about 168 rather than the 200 suggested on the datasheet.
__________________
I also post at the following sites:
http://www.stop-microsoft.org http://www.heated-debates.com
Screen name: Aloone_Jonez
And http://www.silicontronics.com, same screen name as here.
Hero999 is offline  
Old 30th December 2008, 12:05 AM   (permalink)
Default

Quote:
Originally Posted by Hero999 View Post
Thanks Roff.

Do you know where I had gone wrong (apart from not including a value for C4 which shouldn't have given me that error)?
Compare the file I gave you with the file you posted. I took yours and edited it until it looked like LM555.asy.
__________________
Ron

Roff is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 10:36 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

eXTReMe Tracker