LTSpice: IRF540

From OnnoWiki
Jump to navigation Jump to search

Sumber: http://www.diyaudio.com/forums/solid-state/16491-ltspice-subcircuits.html

I am trying to incorporate the spice models provided by IRF in my design simulated under LTSpice. the IRF models come in as sub circuits and I went through the FAQ and here is what it said about using 3rd party subcircuit spice model:

"If you want to use a subcircuit, follow the following steps:

1. Change the "Prefix" attribute of the component instance of the symbol to be an 'X'. Don’t change the symbol, just the instances of the symbol as a component on a schematic.

2. Edit the value of the component to coincide with the name of the subcircuit you wish to use.

3. Add a SPICE directive on the schematic such as ".inc filename" where filename is the name of the file containing the definition of the subcircuit."

Just precisely what I should do to incorporate a subcircuit in a file called IRF540.spi that reads like:

Thanks in advance.

=IRF540.spi====================

.SUBCKT irf540 1 2 3

  • Model Generated by MODPEX *
  • Copyright(c) Symmetry Design Systems*
  • All Rights Reserved *
  • UNPUBLISHED LICENSED SOFTWARE *
  • Contains Proprietary Information *
  • Which is The Property of *
  • SYMMETRY OR ITS LICENSORS *
  • Commercial Use or Resale Restricted *
  • by Symmetry License Agreement *
  • Model generated on Apr 24, 96
  • Model format: SPICE3
  • Symmetry POWER MOS Model (Version 1.0)
  • External Node Designations
  • Node 1 -> Drain
  • Node 2 -> Gate
  • Node 3 -> Source

M1 9 7 8 8 MM L=100u W=100u

  • Default values used in MM:
  • The voltage-dependent capacitances are
  • not included. Other default values are:
  • RS=0 RD=0 LD=0 CBD=0 CBS=0 CGBO=0

.MODEL MM NMOS LEVEL=1 IS=1e-32 +VTO=3.56362 LAMBDA=0.00291031 KP=25.0081 +CGSO=1.60584e-05 CGDO=4.25919e-07 RS 8 3 0.0317085 D1 3 1 MD .MODEL MD D IS=1.02194e-10 RS=0.00968022 N=1.21527 BV=100 +IBV=0.00025 EG=1.2 XTI=3.03885 TT=1e-07 +CJO=1.81859e-09 VJ=1.1279 M=0.449161 FC=0.5 RDS 3 1 4e+06 RD 9 1 0.0135649 RG 2 7 5.11362 D2 4 5 MD1

  • Default values used in MD1:
  • RS=0 EG=1.11 XTI=3.0 TT=0
  • BV=infinite IBV=1mA

.MODEL MD1 D IS=1e-32 N=50 +CJO=2.49697e-09 VJ=0.5 M=0.9 FC=1e-08 D3 0 5 MD2

  • Default values used in MD2:
  • EG=1.11 XTI=3.0 TT=0 CJO=0
  • BV=infinite IBV=1mA

.MODEL MD2 D IS=1e-10 N=0.4 RS=3e-06 RL 5 10 1 FI2 7 9 VFI2 -1 VFI2 4 0 0 EV16 10 0 9 7 1 CAP 11 10 2.49697e-09 FI1 7 9 VFI1 -1 VFI1 11 6 0 RCAP 6 10 1 D4 0 6 MD3

  • Default values used in MD3:
  • EG=1.11 XTI=3.0 TT=0 CJO=0
  • RS=0 BV=infinite IBV=1mA

.MODEL MD3 D IS=1e-10 N=0.4 .ENDS

====end===================
 	Reply With Quote

Old 15th June 2003, 05:18 PM #2 Christer is offline Christer Sweden diyAudio Member

Join Date: Sep 2002 Location: Sweden

Forget what they write in the FAQ and do it this way, which should work (I actually just tested since it has been a while since I did it).

1) Save the file with the subcircuit definition (the one you quoted) in the lib/sub directory and call it irf540.sub

2) in the lib/sym directory, you find all the graphical symbols. Copy the file nmos.asy and call it irf540.asy (must be the same name as the sub file above). Then click on this file to open the symbol editor where you can change the generic name NMOS to IRF540.

"Advanced course"


The asy file may be placed in a subdirectory of lib/sym. Since many MOSFET models come as subcircuits rather than just spice models, I have a directory named transistors where I put all such transistors. You will find there already are such subdirectories for opamps etc. and this ís reflected by the component selection hierarchy you see when using LTSpice. As far as I remember you cannot have a hierarchy in the mod directory on the other hand, but that matters less since the sym directory dictates the selection hierarchy.

Furthermore, in case you don't already know it, components that come as .model commands need not be handled in the above way. They are better just added to the appropriate file in the lib/cmp directory. There are files called standard.bjt standard.cap etc, with the obvious meaning




Referensi