Dumb LTSpice question - subckt model

Feb 24, 2015 12 Replies

I've never used a mfr model that was a subckt before; I've always added the .MODEL to the LTSpice library file, or edited an existing device.



This Vishay MOSFET has a more complex model though, and she ain't loadin' Jim. LTSpice says it can't find the model for M1.



I even tried putting the definition right in the .asc, still no joy.



I followed the LTSpice help info, as best I could. Any obvious goofs?



Thanks, James Arthur



-------------- Version 4 SHEET 1 2188 1188 WIRE 752 144 304 144 WIRE 304 160 304 144 WIRE 304 176 304 160 WIRE 752 192 752 144 WIRE 304 272 304 256 WIRE 752 304 752 272 WIRE 576 384 496 384 WIRE 704 384 656 384 WIRE 752 448 752 400 WIRE 496 464 496 384 WIRE 496 592 496 544 FLAG 304 272 0 FLAG 304 160 IN FLAG 752 448 0 FLAG 496 592 0 SYMBOL voltage 304 160 R0 WINDOW 123 24 146 Left 2 WINDOW 39 24 125 Left 2 SYMATTR InstName V1 SYMATTR Value 15 SYMBOL nmos 704 304 R0 SYMATTR InstName M1 SYMATTR Value SiR422DP SYMBOL voltage 496 448 R0 WINDOW 123 24 146 Left 2 WINDOW 39 24 125 Left 2 SYMATTR InstName V2 SYMATTR Value PULSE(0 5 0 10n 20n 1uS 10uS) SYMBOL res 736 176 R0 SYMATTR InstName R1 SYMATTR Value 10 SYMBOL res 672 368 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R2 SYMATTR Value 100 TEXT 512 704 Left 2 !.tran 2m startup TEXT 928 24 Left 2 !.SUBCKT SiR422DP D G S \nM1 3 GX S S NMOS W= 4003899u L= 0.25u \nM2 S GX S D PMOS W= 4003899u L= 2.884e-07 \nR1 D 3 4.815e



-03 TC=6.773e-03 1.956e-05 \nCGS GX S 1.113e-09 \nCGD GX D 1.026e-11 \nRG G GY 0.80 \nRTCV 100 S 1e6 TC=3.299e-04 -8.364e-08 \nETCV GX GY 100 200



1 \nITCV S 100 1u \nVTCV 200 S 1 \nDBD S D DBD \n**************************
************************************** \n.MODEL NMOS NMOS ( LEVEL = 3 TOX = 5e-8 \n+ RS = 5.351e-04 KP = 2.943e-05 NSUB = 1.192e+17 \n+ KAPP A = 1.000e-06 ETA = 1.067e-06 NFS = 6.312e+11 \n+ LD = 0 IS = 0 T PG = 1) \n*************************************************************** \n.MODEL PMOS PMOS ( LEVEL = 3 TOX = 5e-8 \n+NSUB = 2.525e+16 IS = 0 TPG = -1 ) \n*********************************************************
******* \n.MODEL DBD D ( \n+FC = 0.1 TT = 1.093e-08 T_MEASURED = 25 B V = 42 \n+RS = 1.636e-03 N = 1.139e+00 IS = 3.280e-11 \n+EG = 1.0
93e+00 XTI = 2.937e+00 TRS1 = 5.039e-04 \n+CJO = 8.653e-10 VJ = 9.0
00e-01 M = 5.484e-01 ) \n.ENDS

[snip]

"TEXT" doesn't read as netlist, just as commentary.

You want to add a "Spice directive"...

.LIB C:\Path1\Path2\etc\library_filename.lib

(Extension doesn't matter, I just tend to use .lib)

Put all your models in that file.

See "LTspiceTutorials.zip" on the Simulation Tools & Macros Page of my website for lots of helpful hints. ...Jim Thompson

| James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

You also have to right-click on the symbol and change the prefix to "X". Otherwise it's looking for a .model statement.

Cheers

Phil Hobbs

Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net

ctrl-right-click to change prefix ;-) ...Jim Thompson

| James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

Plain right click works for me.

Cheers

Phil Hobbs

Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net

I have Version 4.22w, takes ctrl-right-click to change prefix, right-click alone doesn't show "prefix", shows ?? ...Jim Thompson

| James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

I'm at 4.22s. I double-checked--plain right click works fine if the prefix has already been changed, but weirdly it needs ctrl-right-click if it hasn't.

Cheers

Phil Hobbs

Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net

;-) ...Jim Thompson

| James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

Thanks Jim, but it's in the LTSpice file as a .subckt SPICE directive.

I also tried that, using a .LIB statement. Didn't work. That's why I'm confused--it looks like it couldn't find the file, which was in the same directory as the .ASC file. It still didn't work when I have a full path either.

Since I tried the obvious things, I figure I'm missing something simple. Maybe I made a typo or so such.

Will do. Thanks.

James Arthur

I've been trying to break Mikey of this "same directory" bull-s*it... to no avail. ...Jim Thompson

| James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

That was it Phil. Thanks!

With that change the model works as a .SUBCKT in the .ASC file itself, and also as a .LIB file with the .LIB command.

James Arthur

Everybody hits that snag at some point. I think it was Joerg who clued me in.

Cheers

Phil Hobbs

Hey, Mike's a star! LTSpice has done more for the planet than .

I was simulating a Linear Tech dc-dc converter and wanted an easy check on the FET losses.

It didn't work. Once I got the model recognized, LTSpice broke to a micro-crawl flashing "defcon 1" in the status line when I ran the converter in the one mode I was chasing. (It simulates rapidly and cleanly in 'buck', but 'boost' makes it panic and freeze-crawl.

Oh well. I can 'scope it on the hardware. I'd just wanted to explore a few alternate FETs--these are getting a bit hot for the sealed box these puppies will be bedding down in.

Thanks Jim, James Arthur

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required