Models and Modeling Aids

Status
Not open for further replies.
[wiki=Main Page]return to diyAudio Wiki Main Page[/wiki]
[wiki=LTSpice and What the New User Should Know]back up[/wiki]

[h=How to Add Models to LTSpice]%2[/h]
(original text by unclejed613, edited, formatted, and expanded by mightydub)

[h=Device models]%3[/h]
Models for most devices such as transistors, diodes, etc. start with the .model statement. There are libraries of various devices in

C:\Program Files\LTC\LTSpiceIV\lib\cmp​

For example, BJT transistor models are in .\standard.bjt. MOSFET models are in standard.mos.

You can open the standard.xxx files from within LTspice which has the advantage of context aware color coding, or as text files with notepad, wordpad, or another text editor. Add the .model statement to the appropriate file. This can be either as one long line, or split into multiple lines by using the + symbol at the start of each continuation line. Comments can be inserted by starting a line with an asterisk *.

After adding the lines to the model files, the part number will show up in the device selection list (if you have LTSpice open when you add a .model statement, you must exit and restart the program for the new model to show up).

[h=Subcircuits]%3[/h]

Subcircuits are a way to create hierarchy in a Spice netlist. A subcircuit is just a Spice netlist that describes the operation of a device. Some vendors' device models are subcircuits (for example some Fairchild MOSFETs.)
To add 3rd party models of subcircuit components (like op amps, etc., that start with .subckt)

1) Use the LTSpice editor, Notepad, or other text editor
2) copy and paste the text of the model
3) save the text file into
a) "C:\Program Files\LTC\LTSpiceIV\lib\sub\whatever.sub​
-or-
b) the directory of your choice. (Some users organize their files by keeping the .asc and all extra device models and subciruits used in the schematic in the same directory.)

In either case, you have to tell LTSpice where to find the subcircuit by adding a ".include" statement on the schematic, and by setting the Value parameter of the device symbol. See LTSpice Help for details.

[h=Model Sources]%2[/h]
Many vendors have spice models available on their websites. Find the page for the device of interest, and look for "Design Support" or "Technical Information." Often there will be multiple model types available - PSpice, Spice2, Spice3, and Saber. You want the PSpice model.

Some people are confused when LTSpice isn't mentioned in the model types - Never fear, LTSPice is compatible with PSpice models.

[h=OnSemi]%3[/h]
OnSemi has models for most devices, though there is debate on their accuracy.

[h=Fairchild]%3[/h]
Models for most devices, they seem to be pretty accurate. Some MOSFET models are .subckt models that contain individual .model statements for the FET, body diode, and parasitic R, L, and C.

[h=NXP]%3[/h]
NXP (formerly Philips) has models for most devices.

[h=Yahoo LTspice group]%3[/h]
You can find models for just about anything here. A great resource.

[h=Models Contributed by diyAudio members]%3[/h]
[wiki=Spice Models - diyAudio Contributions]%[/wiki]

[h=Creating Spice Models]%2[/h]
Some information and links on creating BJT models is here: [wiki=Creating_Spice_Models]%[/wiki]
 
Last edited:
Status
Not open for further replies.