Spice simulation via KiCAD

A small VDMOS output file with power transistor.

With ngspice-28 you will get some 56 A output current (Id(M1)), with ngspice-26 a default model is used, resulting in an error message
Error on line 3 :
m1 /drain /gate 0 0 ixth80n20l
Unable to find definition of model ixth80n20l - default assumed
and an output current of a mere 500µA.

start-test.7z (1.0 KB)

Thanks.
And succes! My eesched is using 28.

Now where did I store my jfet models…

m

The next one (non-inverting amplifier with OpAmp) is for checking if the PSPICE option is available
(remember setting

set ngbehavior=ps

in .spiceinit)

You have to download the OPA171 model from TI at
http://www.ti.com/lit/zip/sbom440

The input file: OpAmp_ps.sch (3.9 KB)

If ps compatibility is not enabled, a bunch of errors will be shown. If o.k., watch V(/in) and V(/out).

2 Likes

Continuing the saga.
I implemented a small model for potentiometers, inspired by this page from pspice.com.

I have the ‘ngbehavior=ps’ set, so I was assuming my pots.lib should be in PSpice lingo.

The following two definitions are in my pots.lib:

.SUBCKT LINPOT (top, tap, bottom) PARAMS: R=1k SET=0.5
RTOP top tap {R*(1-SET)+0.001}
RBOT tap bottom {R*SET+0.001}
.ENDS LINPOT

and

.SUBCKT LOGPOT (top, tap, bottom) PARAMS: R=1k RANGE=1000 SET=0.5
RTOP top tap {R-(R/RANGE)*PWR(RANGE,SET)}
RBOT tap bottom {(R/RANGE)*PWR(RANGE,SET)}
.ENDS LOGPOT

Now I needed to pass the extra parameters to my model via the gui and to do that I added the parameters to the ‘Spice_Models’ field in the gui. This usage is not documented, as far as I could tell, but it is working, and I hope this functionality will stay. It is very convenient.

As an example, in the schematic I have used the symbol for a pot, annotated it as ‘X1’, in the spice gui I used the ‘Models’ tab and set the ‘Spice_Model’ field to

LINPOT PARAMS: R=47k SET=0.1

As another example, for a logarithmic potentiometer I set the ‘Spice_Model’ field to:

LOGPOT PARAMS: R=20k RANGE=1000 SET=0.5

This is all working fine and behaves like intended.
I have not seen any documentation about this use of parameters via the gui, though.
Any comments?
m