Jumper causes simulation crash

I had a circuit that was working, but after I added the jumper in (to control whether or not a subsection of the circuit would “be live/active”, it literally crashes the program :disappointed: Maybe I’m missing something simple? ([paulvdh’s post](<new user - link that’s not a link> forum.kicad.info/t/what-is-proper-schematic-symbol-for-solder-jumper/950/7?u=george2.0) was the only one I saw that referenced what appeared to be the same jumpers I’ve been trying to get to work.)

When I add a jumper J1 (of type GS2) to my circuit:

TestCircuitSchematic-wJumper|690x419

… the program crashes… here’s the last items in the console window:

==================================================

r0 srcpw net-_r0-pad2_ 1k

* u2 srcpw2 plot_v1

r2 gnd srcpw2 7k

r3 srcpw2 net-_r3-pad2_ 1k

v2 net-_r3-pad2_ gnd 10

j1 net-_j1-pad1_ gnd 1

Traceback (most recent call last):

File "projManagement Kicad.py", line 209, in openkicadToNgspice

File "frontEnd\DockArea.py", line 199, in kicadToNgspiceEditor

File "kicadtoNgspice\KicadtoNgspice.py", line 142, __init__

File "kicadtoNgspice\KicadtoNgspice.py", line 157, in createMainwindow

File "kicadtoNgspice\KicadtoNgspice.py", line 207, in createcreateConvertwidget

File "kicadtoNgspice\DeviceModel.py", line 209, in __init__

IndexError: list index out of range

… do I simply need correct value the jumper j1 perhaps?.. I’ve tried:

  • GS2
  • 0 / 1
  • open / closed
  • false / true

… but they all crash the program.?.

Thanks in advance for any help.

Running KiCad (as part of the suite eSim-2.1) on Windows 10 x64

Or should I just “give up” and that (in a general sense) is it the best way to just simply “fake” a jumper with a zero/infinite resistor?..

=================================================================

In response to some of the comments, here’s some further details:

@mwielgus ‘great minds’ think alike :roll_eyes: … so yes, I did try to do this in KiCAD only with a simlar circuit:

… and I get the following:

No compatibility mode selected!
Circuit: KiCad schematic
Error on line 8 :
jp1 net-jp1-pad1 net-jp1-pad2 jumper_2_open
Unable to find definition of model
Error: circuit not parsed.

… when trying to run the builtin [Spice Simulator].

So that’s why I pinged @franzee back in the hope his suggestion would fix both my problems :upside_down_face: !

Maybe specify a resistor as SPICE component for J1 (for example, set Spice_Primitive to R, and Value or Spice_Model to 0 or 1G).

1 Like

@franzee How do I do that?

This looks like a problem with eSim. I’m not aware of Kicad using Python to generate netlists anywhere. Try running the same circuit in Kicad without eSim.

1 Like

Ok, first thanks everyone for commenting, I appreciate the help. @franzee I eventually figured out a way to solve the issue (but I’m not 100% sure if it’s what you meant, since there was no “set Spice_Primitive” option, but either way your suggestion got me looking in the right space).

So I was thinking how can I maybe just “copy the model”… and that prompted me to look at the model for the basic resistors in the circuit and the “model” for the jumper… then, I just tried to add the info from the basic resistors to the J1 jumper:

And, voila! … success. I tested it with both values of 1e9 (open) && 0 (closed) and it responded correctly in both regards.

As a small aside, is this how you would have done it @franzee, et all? … i.e. was there an easier way or option I missed?

1 Like

Nice! That’s how I would do it. But I would probably use a non-zero value like 1m or 1u for the closed value. You can also use 1g as shortcut for 1e9.

Resistance value Zero is automatically set to 1 milliOhm within ngspice.

1 Like

Yes, this is exactly what I meant (you could also set Spice_Netlist_Enabled to N instead of using 1e9 for the value).

If you use 0 then ngspice replaces it with 1m and LTspice eliminates it completely, so they yield slightly different results. These are extensions to the original SPICE, which would give an error for 0 values (as an aside, for the potentiometer code model tuner support, I clamp tuner values to [1e-9, 1-1e-9] with 9 digits precision to avoid such errors).

1 Like

That’s correct, which is why I think it’s better practice to use your own non-zero value when possible.

1 Like