Mosfet simulation ends with error [SOLVED]


Hi all

I’m trying to simulate an AC switch, also called Solid State Relay (SSR) with KiCAD nightly: 6.0.0-rc1-dev.
I couldn’t get the default NMOS to simulate, but in the end I wanted to simulate with a real Mosfet, so I downloaded the OptiMOS3 PSpice library from Infineon.
It seemed to work just fine, until I set Vgs=0V, and the simulation ends with the message:

Analyses: TRAN: Timestep too small; time = 7.29982e-005, timestep = 1.25e-018: trouble with node “net-q1-pad1
run simulation(s) aborted

I’m using the transient simulation with step=1us and time=100us.
Any clue on what is happening would be greatly appreciated!

Project attached. (9.6 KB)


The default MNMOS in the pspice library wouldn’t simulate, I understand there is no model attached. What is the reason? Is there a standard model shipped with KiCAD I could use? If not, where should a pspice beginner go get one?

As a good beginner, I tried to RTFM! :slight_smile:

See below the circuit. Is there something wrong with it, or the Spice model maybe?



Not at this point in time. If somebody wants to contribute some we can find a place to put them. The contributor must however show that they made the model from their own measurements as copying a model made by somebody else might create problems with licenses. (All models i have seen so far where under a very restrictive license. Some where even encrypted to further protect the creator of the model.)


You intend to use a PSPICE compatible lib, are reading the LTSPICE manual and are going to use ngspice. All these are flavors of SPICE, similar but not identical. So there might be subtle differences in the syntax.

To make it short: You will need ngspice-28 to run the PSPICE Power MOS libs from Infineon. Actiual KiCad comes with ngspice-26, that cannot read PSPICE device libs. ngspice-28 can do so, having a PSPICE compatibility mode. Please have a look at how to switch from ngspice-26 to ngspice-28 and enable the compatibility mode.


Thanks for the help holger, that starts to make sense.
I’ve installed ngspice-28 and… the result is the same! So I took a minimalistic approach and managed to get a “default?” NMOS model to run, however the gate voltage doesn’t seem to do anything. Only the body diode conducts (the current is null when the voltage is positive).

This helped too: Generic mosfets? [solved]


The generic MOSFET has a W/L=1 and a low specific conductance. It will drive some µA of current only.

Could you please list the complete error log, not just the final phrase?

For checking if the install (including enabling PSPICE compatibility) is o.k., pleas have a look at Spice simulation via KiCAD

I will think of an even simpler test just to ensure proper checking of the installation.


I checked the install and the current was around 56A with the Power MOS simulation, so it seems ngspice-28 is working well.
However the Op-Amp simulation causes KiCAD to crash. How to get the crashlog on windows?

Here is the simple simulation with only 1 MOS which shows the same error.

See attached schematic and lib: (8.2 KB)

And the simulation result:

(note that the pins 4 and 5 are left unconnected as they map to Tj and Tcase of the model).

The full simulation log:

Circuit: KiCad schematic
Background thread stopped with timeout = 0
Doing analysis at TEMP = 27.000000 and TNOM = 27.000000
Initial Transient Solution
Node                                   Voltage
----                                   -------
/vac                                         0
/vgate                                       0
net-_m1-pad1_                    -2.30754e-026
xm1.x1.d                         -2.30755e-026
xm1.x1.ox                        -2.30755e-026
xm1.x1.e_edg1_int1                           0
xm1.g                              2.4641e-039
xm1.x1.ox1                       -2.30755e-026
xm1.x1.e_edg2_int1                           0
xm1.x1.ox2                       -2.30755e-026
xm1.x1.edep                       2.17929e-014
xm1.x1.e_eds_int1                -2.17929e-014
xm1.x1.s                          1.64274e-030
xm1.x1.g_chan_int1                 2.4951e-032
nc_01                              -4.784e-039
xm1.x1.d1                        -2.30755e-026
xm1.x1.g_rmos_int1                2.49047e-032
xm1.d1                           -2.30755e-026
xm1.x1.d3                        -2.30787e-026
xm1.x1.g_diode_int1              -2.30751e-027
xm1.x1.d2                        -2.30787e-026
xm1.x1.g_rdio_int1               -2.30751e-027
xm1.x1.a                                     0
xm1.x1.c                                     0
xm1.x1.b                          2.30751e-027
xm1.x1.e_e001_int1                2.30751e-027
xm1.x1.e                          4.54559e-023
xm1.x1.e_e002_int1                4.54559e-023
xm1.s                             9.27399e-031
xm1.x1.g_th_int1                 -5.32497e-053
xm1.g1                                       0
xm1.s1                           -6.31583e-042
xm1.gs_int1                      -2.30754e-027
xm1.source_vmeas                             0
xm1.d2                           -2.30754e-026
xm1.tb                             -4.784e-039
xm1.g_th_int1                     3.81797e-057
nc_02                              -4.784e-039
xm1.t1                             -4.784e-039
xm1.t2                             -4.784e-039
xm1.t3                             -4.784e-039
xm1.t4                             -4.784e-039
b.xm1.bg_th#branch                           0
v.xm1.v_ls#branch                -2.30754e-027
b.xm1.bgs#branch                             0
b.xm1.x1.bg_th#branch                        0
v.xm1.x1.v_sense2#branch          2.30751e-027
v.xm1.x1.v_sense#branch           2.30754e-027
e.xm1.x1.e_edg1#branch            3.46736e-040
e.xm1.x1.e_edg2#branch                       0
v.xm1.x1.vx#branch                           0
e.xm1.x1.e_eds#branch                        0
b.xm1.x1.be_e002#branch                      0
b.xm1.x1.be_e001#branch                      0
b.xm1.x1.bg_rdio#branch                      0
b.xm1.x1.bg_diode#branch                     0
b.xm1.x1.bg_rmos#branch                      0
b.xm1.x1.bg_chan#branch                      0
b.xm1.x1.be_eds#branch                       0
v.xm1.x1.v_sense3#branch          4.54559e-023
b.xm1.x1.be_edg2#branch                      0
b.xm1.x1.be_edg1#branch                      0
l.xm1.ld#branch                   2.30754e-027                  -2.30754e-027
l.xm1.lg#branch                  -1.64274e-039
l.xm1.x1.l_l001#branch            6.92254e-035
e.xm1.x1.e_e002#branch           -4.54559e-023
e.xm1.x1.e_e001#branch           -6.92254e-035
v2#branch                         1.64274e-039
v1#branch                        -2.30754e-027
 Reference value :  0.00000e+000
doAnalyses: TRAN:  Timestep too small; time = 5.02514e-005, timestep = 1.25e-018: trouble with node "net-_m1-pad1_"
run simulation(s) aborted


You are specifiying a gate voltage rise time of 1n. This is unrealistic for a power transistor. Your transient resolution is 1u, much to large for the specified rise time.

Try 10n rise time with ‘dc 5 pulse(0 5 0 10n 10n 40u 80u)’ and ‘.tran 5n 100u’, then the simulation comes to a good end.


Thanks holger!

With these settings the simulation of a single Mosfet ends with no errors!
Do you have a rule of thumb for setting the ratio between “events” such as a transient, and the simulation time?

The same settings would still not get the initial circuit to simulate successfully so I decreased again the time step and increased the gate voltage rise time to 1us: ‘dc 5 pulse(0 5 0 1u 1u 40u 80u)’ and ‘.tran 1n 100u’ and it worked! :+1:

The last step was to set the simulation voltage back up to 100V, but I had to lower the step to 100ps to get it to run. The simulation takes several minutes. Is this the nature of the beast?

Many thanks for getting me started with this!