.SUBCKT BSD214SN_L1 drain gate source PARAMS: dVth=0 dRdson=0 dgfs=0 dC=0 Ls=1n Ld=0.5n Lg=1n
.PARAM Rs=16.37m Rg=11.3 Rd=240u Rm=600u
.PARAM Inn=1.5 Unn=4.5 Rmax=140m gmin=2.1
.PARAM act=0.122
X1 d1 g s Tj S3_20_s_var PARAMS: a={act} dVth={dVth} dR={dRdson} dgfs={dgfs} Inn={Inn} Unn={Unn}
+Rmax={Rmax} gmin={gmin} Rs={Rs} Rp={Rd} dC={dC} Rm={Rm}
Rg g1 g {Rg}
Lg gate g1 {Lg*if(dgfs==99,0,1)}
Gs s1 s VALUE={V(s1,s)/(Rs*(1+(limit(V(Tj),-200,999)-25)*4m)-Rm)}
Rsa s1 s 1Meg
Ls source s1 {Ls*if(dgfs==99,0,1)}
Rda d1 d2 {Rd}
Ld drain d2 {Ld*if(dgfs==99,0,1)}
E1 Tj w VALUE={TEMP}
R1 w 0 1u
.ENDS
When I try to simulate, the program simply crashes, no errors no reports… What is the strategy to simulate a NMOS? I would really like to use the model provided by the namufacturer.
kicad version: 5.1.2 release build
Platform: Linux 5.1.14-arch1-1-ARCH x86_64 64 bit
I’ve checked that the ngspice version is 30. I’ll check the tutorial, but that the whole program crashes is a quite exaggerated response to a miss use of a model (In case I did something wrong, I haven’t check the tutorial yet)
The model BSD214SN_L1 is not supported by the eeschema/ngspice interface. Currently it is not possible to transfer parameters into a subcircuit. See bug report https://bugs.launchpad.net/kicad/+bug/1829618
For now use BSD214SN_L0 instead.
You may support the bug report by stating that this bug effects you as well.
Edit: This is probably not correct. BSD214SN_L1 is running well in discrete ngspice-30. So please attach your *.sch file here to allow me to check your case in detail.
Yes, with L1 is not crashing, thank you for that! But it doesn’t converge, is it working for you? Are you able to simulate something? No matter what I try it just doesn’t converge to anything, it always ends the simulation with:
doAnalyses: TRAN: Timestep too small; time = 1e-19, timestep = 1.25e-20: trouble with xq1:dbt-instance d.xq1.dbd
run simulation(s) aborted
There was a bug in ngspice, preventing convergence in special cases. A fix has been uploaded to the ngspice development branch pre-master. It will become effective in the next release (ngspice-31). A release date has not yet been fixed.
Concerning ngspice, it’s not “they”, it’s me. But still no schedule. When ngspice-31 was available, it would be tested by the KiCad devs, and finally appear in KiCad 6.
Of course, as always, as you are on Linux, you may download the ngspice pre-master sources from https://sourceforge.net/p/ngspice/ngspice/ci/pre-master/tree/ (snapshot button on the top right), expand the tar.gz file and compile ngspice yourself. A short how-to is in file INSTALL, sections 1.1 and 1.2 or in the ngspice manual, chapt. 32.1.1 and 32.1.3.