KiCad Spice netlist generation fails when using a pulsed voltage source

I’ve posted my question in the electrical engineering stack exchange (Easier to upload pictures there):

I’m able to simulate a simple circuit with a voltage source. When I try to use a pulsed voltage, the netlist generation fails. Is this a known problem?

I’m getting this error, which is also quite strange:

Error on line 5 :
v1 pulse(0 1 2u 2u 2u 5m 10m)
unknown parameter (2u)

Why would it not recognize the pulse voltage source?

I recommend filing a bug report for this. I’m not 100% sure it’s a bug, but the simulation functionality is still fairly new and so it could be one.

The correct syntax should read
v1 node1 node2 pulse(0 1 2u 2u 2u 5m 10m)

I can’t reproduce your findings. It is o.k. for me (5.1.0 on MS Windows 10).

1 Like

That’s what I would expect, but KiCad doesn’t generate the right net list, for some reason reason it deletes the node entries. I’ll post my exact version.

These are my current versions:

kicad version: 5.1.1 release build
platform: linux 5.0.6-arch1-1-ARCH x86_64
ngspice-30

Can somebody reproduce this? It happens with all the different voltage source options, pulse, sine, etc. The generated netlist doesn’t include the node1 and node2.

I reproduced this on 5.1.1 on Ubuntu. The voltage source(pulse) is not netlisting correctly. I’ll dig in a little and see what I can figure out. If it is a bug I’ll submit a bug report.

.title KiCad schematic
V1 pulse(0 5 0 100n 100n 5u 10u)
R1 “/node2” NC_01 1K
C1 “/node2” 0 0.1u
.end

Application: kicad
Version: 5.1.1-8be2ce7~80~ubuntu18.04.1, release build
Libraries:
wxWidgets 3.0.4
libcurl/7.58.0 OpenSSL/1.1.0g zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Platform: Linux 4.18.0-17-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.22
Boost: 1.65.1
OpenCASCADE Community Edition: 6.9.1
Curl: 7.58.0
Compiler: GCC 7.3.0 with C++ ABI 1011

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=ON
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

Hmmm. Saved the schematic, then reopened at home. Different machine but same versions of Ubuntu and KiCad. It now netlists correctly. I’ll experiment some more.

.title KiCad schematic
V1 “/node1” 0 pulse(0 5 0 100n 100n 5u 10u)
R1 “/node2” “/node1” 1K
C1 “/node2” 0 0.1u
.end

I don’t know if this extra data point helps, but I’m on Windows 7 and KiCad 5.0.2 and I’m unable to duplicate the issue.

I wonder if the saving of the schematic had something to do with it? Maybe try opening it again on the non-home PC?

Hi Ste,

I think there is a problem here. Here’s how to recreate it:

  1. create a new project - in my case it is spice_test2
  2. open eeschema
  3. place a voltage source, resistor, capacitor and 0-GND from the pspice library. Connect them.
  4. edit the spice parameters of the voltage source to make it a pulse source. Add values for the R and C.
  5. annotate
  6. create spice netlist. The voltage source will not netlist correctly.
  7. save and exit eeschema
  8. restart eeschema. It throws an error and automatically fixes the schematic. Save the file.
  9. create the spice netlist. The voltage source now netlists correctly.

I just tried this with my Windows 7 & KiCad 5.0.2. Step #6 resulted in a correct netlist and upon Step #8 it did not throw any error. Could be either an Ubuntu or KiCad 5.1.1 problem. Maybe it’s time to move this over to the bug tracker since you can now consistently recreate on your end?

@jgroves9 are you using 5.1.1? There is a bug that causes this symptom that is fixed in 5.1.2. If you see this message in 5.1.2 please open a bug report

1 Like

@craftyjon, I was. I’m now on 5.1.2 and can not recreate the issue. I updated Juan’s bug report ( https://bugs.launchpad.net/kicad/+bug/1825818) earlier today.

I’ll probably meet you tomorrow night in Chicago…

Jim

1 Like