Newbie help with simulation

Hi all,

Super impressed by KiCAD, learned a lot in a short time and succesfully outsourced my first board in China!

I’m trying out spice simulation in KiCAD 6.0.6 windows.

Running a simple simulation with only a resistor connected to an AC supply works (top and middle image below).
Then when replacing the resistor with a spice compatible diode (bottom image)

Results in the following error:

Note: No compatibility mode selected!
warning, can’t find model ‘diode’ from line
d1 net-v1-pad1 net-v1-pad2 diode
Circuit: KiCad schematic
Error on line 3 or its substitute:
d1 net-v1-pad1 net-v1-pad2 diode
could not find a valid modelname
Background thread stopped with timeout = 0
Error: circuit not parsed.

I tried boty the spice compatible diode and the pspice compatible diode. Both are not working.

What am I doing wrong? (sorry, cannot upload the model as a new user).

Thanks!

HenkJan

Please have a look at the tutorial KiCad Eeschema as GUI for ngspice, tutorial for setting up the simulation .

1 Like

Thanks holger! I managed to rework the examples, and it clearifies a lot. I also got my original scheme working. It still requires some practice to find suitable spice models online and get them to work in KiCad, but I definitely made progress. Can you recommend source of information about the .lib scripting language?
HenkJan

There is more available about tutorials at Ngspice circuit simulator - Tutorials .

The netlist language (*.lib files are made of it) is found in the ngspice manual at https://ngspice.sourceforge.io/docs/ngspice-manual.pdf, about the netlist’s instance (device) lines in chapters 3-12, general constructs (e.g. subcircuits) in chapt. 2.

In addition to the devices you will find the simulation commands (dot commands) in chapt. 15 and the control language commands in chapter 17. The control language has got its own tutorial at ngspice control language tutorial.

Device models (either comprising of .model lines or complete subcircuits) are found at Spice models and model parameters for ngspice circuit simulator .

KiCad/Eeschema has its own manual, a chapter about the simulation with ngspice is available at Schematic Editor | 6.0 | English | Documentation | KiCad .

Basic simulation examples are part of the KiCad installation at .\KiCad\6.0\share\kicad\demos\simulation. Some more advances simulation examples are found here: Simulation examples for KiCad/Eeschema/ngspice .

Thanks for the great overview of information Holger. Looks like I have a lot of reading to do, but very interesting and super valuable. I will not cease to be amazed what is possible with open source software.
HenkJan