How to add a new MOSFET in LTspiceXVII - Page 1
Forum section: electronics / beginners

author: Martin72
author_rank: Super Contributor
timestamp: August 28, 2021, 08:29:50 pm
content: Hi,I´m simulating a electronic load circuit and want to use the original FET for it.It´s the IRFP064N, there´s a SPICE model for download avaible (*.spi).Question:How can I integrate this model into my simulation ?Found an older description (LTspice4), where you have to change the *.spi file into *.lib, save it into the library, then open a new symbol, open nmos, edit etc etc...but doesn´t work or/and I´m too dumb for it...Martin

author: Ian.M
author_rank: Super Contributor
timestamp: August 28, 2021, 09:19:02 pm
content: Your problem is that isn't a SPICE 3 MOSFET model its a SPICE3 subcircuit model of a MOSFET!Put the file "irfp064n.spi" in the same folder as your sim. Don't rename it, LTspice doesn't care! Include it as:Code:.lib irfp064n.spiplaced as a spice dot command on your schematic. Place a component of typenmosand change its value fromNMOStoirfp064n(the exact subcircuit name from the model). As the pin order of the symbol and the subcircuit are the same you don't need to do anything tricky*. Finally to make LTspice use a subcircuit instead of a SPICE3 MOSFET model, Ctrl-Right_Click the component to open the Component Attribute Editor, and change the attribute 'Prefix' fromMNtoX.Demo sim attached.If the pin order was wrong you could put a .subckt 'wrapper' to fix the pin order directly on the sim as a dot command, changing the name slightly so the two subcircuits are distinct, and using the new name as the MOSFET symbol value:Code:.subckt my_irfp064n d g sXM1 d g s irfp064n ; <= scramble pin order to match here.endsTo check the symbol's pin order, open it from the Component Attribute Editor and do 'View' => 'Pin Table', make a note of it then cancel/close all the way back out of it.

author: Martin72
author_rank: Super Contributor
timestamp: August 29, 2021, 09:13:57 am
content: Hi!QuoteCan´t change it, see pic below..Edit: This menu appears, when I´m right clicking on the nmos.

author: magic
author_rank: Super Contributor
timestamp: August 29, 2021, 09:16:08 am
content: Quote from: Ian.M on August 28, 2021, 09:19:02 pmIOW, hold CTRL, then click.

author: Martin72
author_rank: Super Contributor
timestamp: August 29, 2021, 09:50:03 am
content: Argh...OK, now it works - How can I proof it, that now the irfp was taken instead of the standard nmos ?

author: Ian.M
author_rank: Super Contributor
timestamp: August 29, 2021, 10:29:10 am
content: Look at the netlist. If the MOSFET line starts with X you can be certain its trying to use a subcircuit model, which is totally different from the default SPICE3 NMOS MOSFET model. If it does so without immediate error, its getting a valid model from *somewhere* and unless you've done something really strange/dumb, its gotta be the one of the same name you .lib included.

author: StillTrying
author_rank: Super Contributor
timestamp: August 29, 2021, 11:04:23 am
content: For a small circuit you can always copy the whole lot and have 2 (or more) identical versions of it on the same schem. so then you can plot the differences of changing one value or one component on the same plot.If you've named any of the wires such as "output" remember to change the copied one to "output2" or both of the "output"'s will be shorted together.

author: Ian.M
author_rank: Super Contributor
timestamp: August 29, 2021, 12:30:50 pm
content: You can also step the model, though the method of doing so is rather arcane and downright obtuse when subcircuits are involved. Seehttp://ltwiki.org/index.php?title=Undocumented_LTspice#Stepping_a_Modelfor the basic idea, and the attached sim for a practical subcircuit implementation.The result will be clearly visible, as the default NMOS model is for a 100um x 100um MOSFET typical of a 1970 10um process IC, saturating at about 250uA @5V Vgs, and the IRFP064N is a fairly large power MOSFET that will pass nearly 50A under the same conditions!

author: magic
author_rank: Super Contributor
timestamp: August 29, 2021, 12:43:35 pm
content: That's a possibility that hasn't quite occurred to me

author: Martin72
author_rank: Super Contributor
timestamp: August 29, 2021, 01:34:12 pm
content: I´ve checked it in another way, putting in the circuit the nmos model nothing will happen, no current will flow, g-s voltage is nearly 15V.With irfp064n, it works.Thankyou at all

author: Ian.M
author_rank: Super Contributor
timestamp: August 29, 2021, 01:45:29 pm
content: Not "no current", but nearly no current. At 15V Vgs, the saturation Id of the default LTspice 'NMOS' MOSFET is only 2.25mA.