Hey there, I am totally new to KiCAD simulation and SPICE in general.
Following along with different tutorials and forum post, I see people seem to interchangeably use the 0 ref from the spice library and normal GND in their circuits.
Is there a difference? I read from the ngspice simulation in KiCad/Eeschema tutorial that GND and 0 are the same while different people tell me I have to use 0 for SPICE sims. Can the 0 and GND be used at the same time or should we stick to one convention at a time?
As far as I’m aware, 0 conventionally refers to the global ground node in SPICE programs. So each time you see a 0 in the netlist, that’s ground. GND is also common but 0 is more standard.
Hey there thanks for the responses. When I was working on my circuit, if I mix match the 0v and gnd I get different simulation results.I would send the circuits but I’m currently working as an intern at a company so I will ask my supervisor for permission. Is there a reason for the circuit to be outputting different voltages?
A tiny test circuit with gobal lables
If you then do in the Eeschema window: File–>Export–>Netlist–>Spice–>Export Netlist, you will get a *.cir file which is the netlist sent from Eeschema to ngspice. The result here is
.title KiCad schematic
R1 top 0V 1k
R2 top 0V2 2k
.end
You will see that the global labels are overwriting the GND or 0 labels, so there is not ground sent to ngspice.
If you choose local lables
the netlist will be
.title KiCad schematic
R2 top 0 2k
R1 top GND 1k
.end
which is probably what one wants to have. A ground connection is a must when doing simulations (each node has to have a dc path to ground).
Two global labels with different names on the same net will treated as described in the manual: “If there are multiple labels of one type attached to a net, the names are sorted alphabetically and the first is used.”
Thank you so much! I remade your test, and it cleared up a lot of confusion.
I am sorry for bother you more but when you said ’ A ground connection is a must when doing simulations (each node has to have a dc path to ground)’ - did you mean every NGspice simulation needs at least one GND component in the schematic?
About the the global labels, I liked to use them to visually name and see them in simulator. Is there a way to show local nets in simulator as well or name a connection of interest? If not, I am happy to keep using the probing function hahaa!