Friday, October 16, 2009

Adding a LM741 Op Amp Model to LTSpice

Simulating operational amplifiers in LTSpice using non-ideal characteristics is desirable for students to understand op amp AC and DC limitations. Many student projects require the use of the classic LM741 op amp. The following steps can be followed to get the LM741 model into LTSpice for simulation.

Step 1: Obtain the spice model for the LM741 (see complete model below)

Step 2: Copy this model into the LTSpice sub directory. The file must be given a *.sub extension and not a *.txt extension. Make sure to save the file as “all file types” with the .sub extension. Save the file as LM741.sub. The directory is typically: C:\Program Files\LTC\LTspiceIV\lib\sub

Step 3: Start up LTSpice, insert the op amp2 component. Right click on the symbol and change the value to LM741.

















Step 4: Add the spice directive to the schematic using the .op. Add “.lib LM741.sub” to the schematic.

















Step 5: You are now ready to run simulations with the LM741.













Spice model below:


*//////////////////////////////////////////////////////////////////////
* (C) National Semiconductor, Inc.
* Models developed and under copyright by:
* National Semiconductor, Inc.

*/////////////////////////////////////////////////////////////////////
* Legal Notice: This material is intended for free software support.
* The file may be copied, and distributed; however, reselling the
* material is illegal

*////////////////////////////////////////////////////////////////////
* For ordering or technical information on these models, contact:
* National Semiconductor's Customer Response Center
* 7:00 A.M.--7:00 P.M. U.S. Central Time
* (800) 272-9959
* For Applications support, contact the Internet address:
* amps-apps@galaxy.nsc.com

*//////////////////////////////////////////////////////////
*LM741 OPERATIONAL AMPLIFIER MACRO-MODEL
*//////////////////////////////////////////////////////////
*
* connections: non-inverting input
* | inverting input
* | | positive power supply
* | | | negative power supply
* | | | | output
* | | | | |
* | | | | |
.SUBCKT LM741 1 2 99 50 28
*
*Features:
*Improved performance over industry standards
*Plug-in replacement for LM709,LM201,MC1439,748
*Input and output overload protection
*
****************INPUT STAGE**************
*
IOS 2 1 20N
*^Input offset current
R1 1 3 250K
R2 3 2 250K
I1 4 50 100U
R3 5 99 517
R4 6 99 517
Q1 5 2 4 QX
Q2 6 7 4 QX
*Fp2=2.55 MHz
C4 5 6 60.3614P
*
***********COMMON MODE EFFECT***********
*
I2 99 50 1.6MA
*^Quiescent supply current
EOS 7 1 POLY(1) 16 49 1E-3 1
*Input offset voltage.^
R8 99 49 40K
R9 49 50 40K
*
*********OUTPUT VOLTAGE LIMITING********
V2 99 8 1.63
D1 9 8 DX
D2 10 9 DX
V3 10 50 1.63
*
**************SECOND STAGE**************
*
EH 99 98 99 49 1
G1 98 9 5 6 2.1E-3
*Fp1=5 Hz
R5 98 9 95.493MEG
C3 98 9 333.33P
*
***************POLE STAGE***************
*
*Fp=30 MHz
G3 98 15 9 49 1E-6
R12 98 15 1MEG
C5 98 15 5.3052E-15
*
*********COMMON-MODE ZERO STAGE*********
*
*Fpcm=300 Hz
G4 98 16 3 49 3.1623E-8
L2 98 17 530.5M
R13 17 16 1K
*
**************OUTPUT STAGE**************
*
F6 50 99 POLY(1) V6 450U 1
E1 99 23 99 15 1
R16 24 23 25
D5 26 24 DX
V6 26 22 0.65V
R17 23 25 25
D6 25 27 DX
V7 22 27 0.65V
V5 22 21 0.18V
D4 21 15 DX
V4 20 22 0.18V
D3 15 20 DX
L3 22 28 100P
RL3 22 28 100K
*
***************MODELS USED**************
*
.MODEL DX D(IS=1E-15)
.MODEL QX NPN(BF=625)
*
.ENDS
*$[/url]

11 comments:

Unknown said...

The model Mr. Eastham is using has just G*=28dB at open loop.

Mine has 106dB like you find at other sources:

*Sngl GenPurpose OpAmp pkgIP8 3,2,7,4,6
..SUBCKT XUA741 1 2 3 4 5
C1 11 12 4.664E-12
C2 6 7 20E-12
DC 5 53 DX
DE 54 5 DX
DLP 90 91 DX
DLN 92 90 DX
DP 4 3 DX
BGND 99 0 V=V(3)*.5 + V(4)*.5
BB 7 99 I=I(VB)*10.61E6 - I(VC)*10E6 + I(VE)*10E6 +
+ I(VLP)*10E6 - I(VLN)*10E6
GA 6 0 11 12 137.7E-6
GCM 0 6 10 99 2.574E-9
IEE 10 4 DC 10.16E-6
HLIM 90 0 VLIM 1K
Q1 11 2 13 QX
Q2 12 1 14 QX
R2 6 9 100E3
RC1 3 11 7.957E3
RC2 3 12 7.957E3
RE1 13 10 2.74E3
RE2 14 10 2.74E3
REE 10 99 19.69E6
RO1 8 5 150
RO2 7 99 150
RP 3 4 18.11E3
VB 9 0 DC 0
VC 3 53 DC 2.6
VE 54 4 DC 2.6
VLIM 7 8 DC 0
VLP 91 0 DC 25
VLN 0 92 DC 25
..MODEL DX D(IS=800E-18)
..MODEL QX NPN(IS=800E-18 BF=62.5)
..ENDS XUA741

Miller said...
This comment has been removed by a blog administrator.
Unknown said...

Grreat. Thanks

Unknown said...

When I obtained the opa 625 op amp SPICE file from TI website it only had opa625.lib, OPA625.tld and OPA625.TSM files in it. Neither .sub or .txt files were evident. I really don't know which one to save as a .sub extension, as per your tutorial. I would appreciate a steer in the right direction please?

Norberto said...

Hi James:
I followed the steps you described for adding LM741 model to LTspice. When I run the simulation, I ge3t the error message "Could not open library file .lib LM741.sub".
What's wrong?
Norberto

yosabrams0918 said...

It’s arduous to seek out knowledgeable individuals on this topic, however you sound like you recognize what you’re talking about! Thanks casino blackjack

Mudassar said...

Am getting the same error... Are you still getting this

Unknown said...

It's not working at all
Somebody please stop this web site

Unknown said...

step2 wrong directory,it need to put the LM741.sub file into C:\Users\YOU NAME\Documents\LTspiceXVII\lib\sub not ltspice's own sub folder.

Unknown said...

Thank you Unknown, changing the directory worked for me

New User said...

Thank you for your instructions. Somehow between TI files (from download of snom211b.zip) and the LM741.sub that you provided I ended up with files or data that had uA741 name. Once all read LM741 the latest LTspice 17.1.15 worked fine.