LM308 Spice model?

Started by the_floyd, August 31, 2011, 10:52:53 AM

Previous topic - Next topic

the_floyd

I've been fooling around with LTSpice lately, and I'm working on putting together a Rat model to help me with my bootweaking exploits. ;D I've found a LIB file for the LM308, however I don't know where to find an appropriate circuit symbol. Any suggestions? Help would be much appreciated.

CynicalMan

I'm assuming that you're using the model here: http://www.linear.com/product/lm308. Open the LT1028.asy symbol packaged with LTSpice (lib/sym/Opamps) and do the following:

Right-click the name and change it to LM308A.
Press Ctrl-A to open the Attribute menu.
Change the SpiceModel and Value boxes to LM308A.
Erase the Value2 box.
Put a description in the Description box.
Put the location of the .txt model file in the ModelFile box.
Save as LM308A.asy.
Restart LTSpice.

And it should be available in the component menu under Opamps.

the_floyd

#2
Great, thanks! I've done that now - but there's no pins for the compensation cap on the symbol. Is that taken care of by the model file already?

EDIT: Just tried to run the sim, and it gave me: "Port (pin) count mismatch between the definition of subcircuit "lm308a" and instance: "xu4." The instance has fewer connection terminals than the definition. Sounds like there is something wrong, then...

CynicalMan

Did you use LT1028.asy? It has compensation pins. It sounds to me like you used a different symbol that didn't have them.

If you'd prefer to not have compensation pins at all, use a normal op amp symbol, and replace the LM308 model file with this:

* Version 2.0 Copyright © Linear Technology Corp. 10/19/04. All rights reserved.
*
* NODES 1 AND 8 = COMPENSATION PINS
*
.SUBCKT LM308A 3 2 7 4 6
* USE C=30 PF IN MAIN CIRCUIT (CA TO CB).
C2 30p 1 8
* INPUT
RC1 7 80 8.842E+03
RC2 7 90 8.842E+03
Q1 80 2 10 QM1
Q2 90 3 11 QM2
DDM1 2 3 DM2
DDM2 3 2 DM2
C1 80 90 5.460E-12
RE1 10 12 2.245E+02
RE2 11 12 2.245E+02
IEE 12 4 6.003E-06
RE 12 0 3.332E+07
CE 12 0 1.579E-12
* INTERMEDIATE
GCM 0 8 12 0 3.576E-10
GA 8 0 80 90 1.131E-04
R2 8 0 1.000E+05
* EXTERNAL COMP CAP USED FOR C2 (SEE NOTE ABOVE).
GB 1 0 8 0 3.146E+01
* OUTPUT
RO1 1 6 1.111E+02
RO2 1 0 8.889E+02
RC 17 0 3.533E-04
GC 0 17 6 0 2.830E+03
D1 1 17 DM1
D2 17 1 DM1
D3 6 13 DM2
D4 14 6 DM2
VC 7 13 1.766E+00
VE 14 4 1.766E+00
IP 7 4 2.940E-04
DSUB 4 7 DM2
* MODELS
.MODEL QM1 NPN (IS=8.000E-16 BF=1.875E+03)
.MODEL QM2 NPN (IS=8.093E-16 BF=2.143E+03)
.MODEL DM1 D (IS=1.192E-10)
.MODEL DM2 D (IS=8.000E-16)
.ENDS LM308A

the_floyd

#4
I opened up all three LT1028 ASY files - LT1028, LT1028A, LT1028CS - and they all just look like the standard opamp2.asy. I would like to have the compensation pins - that's my main reason for seeking out this model - but so far, I haven't seen any opamp symbols that have them. Unless there's some hidden option somewhere that I need to enable? (I really have no idea.)

EDIT: I Googled "LT externally compensated" and came up with the LT1222, which, sure enough, has a pin on its symbol marked "C." Perhaps this might work?

CynicalMan

That's weird, LT1028 has compensation pins on my version. Maybe I missed an update. Here's the symbol that I had. You'll need to put in your model file location in the Attribute menu.
http://sites.google.com/site/distorque/home/files/LM308A.asy

the_floyd

That did the trick. Once again, thanks for your help!