Spice and KiCad

First post evaaar!
I just found this feature! It’s amazing all the good work that all of you are making! Keep it up! Thank you!

The only “disadvantage” that I found (but I think that is general to KiCAD as a whole) is what @PCB_Wiz stated. The menus, option, toolbars are not that great integrated. It’s ok I think, maybe I’m just too picky.

You can download nightly builds for some systems here:

If a nightly build isn’t available for your specific system then you will need to build the source yourself; on Linux, with the exception of Arch Linux, you will also need to build ngspice as a shared library.

Thanks cbernardo, I know this download page but nothing related to V5 only V4.0.4 looks available for many OS.

4.0.4 is the latest official release. For the Spice enabled version you need a recent Nightly build. The Ubuntu nightly is in a PPA. There is nothing out there claiming to be v5 yet and probably won’t be for a long time

1 Like

I downloaded latest nightly build for OSX (r7009) but can’t find the simulator feature. Was it removed again or do I need to configure something?

Hi, I try to find on the nightly for Windows : kicad-r7179.6edee2a-i686 No simulator inside.

There have been a few issues with building ngspice on Windows. The Windows nightlies may have the simulation included in a week or two.

1 Like

Is it the same situation for OSX?

Good to know, I’m probably not the only one happy to see that !!!

Spice for osx builds was only enabled the other day, but right now they are in the testing/c4osx folder on the download server. They are soon to be moved to the official nightlies dir. Please test.

EDIT: Bug reports belong to the launchpad.net bug tracker.

1 Like

I tried the latest (kicad-20160928-222523.904ae20-c4osx) but it freezes every now and then, requiring a force quit, so it’s a bit unusable. In the few minutes before freezing I couldn’t find how to create voltage/signal sources, also do one need to assign spice models manually for every component or can there be default models associated with symbols?

Please file a report on Launchpad
https://launchpad.net/kicad is NOT just for Ubuntu Linux builds

1 Like

Sorry, bugs reported on launchpad!

I found the add signal / probe in the simulator window, however when trying to add a signal to a component or netlabel nothing happens, it is not added to the signal list. Same problem with probes, trying to add a probe but no matter where I click with the probe - nothing happens. This was also reported as a bug, just bringing it up here just in case it’s something I’m missing!

2 Likes

Thanks
The signal probes is https://bugs.launchpad.net/kicad/+bug/1628882
The OSX crash is https://bugs.launchpad.net/kicad/+bug/1628879

Any other OSX are welcome to comment on them

1 Like

Some updates:

The reason simulation wasn’t working as expected was because ngspice did not read the standard init file, and thus didn’t load the codemodels.
On OSX you need to download and install ngspice, even though the dynamic library is bundled with kicad.
To make it find the init file and codemodels, kicad must be started in the terminal like this:

$ export SPICE_LIB_DIR=/Applications/ngspice/share/ngspice/
$ /Applications/Kicad/kicad.app/Contents/MacOS/kicad

Regarding multi-part components, it did not work as I thought, because all symbols of the same component are mapped to one single spice device. The solution is to make a TL074_CHIP subckt that has all the pins of the full chip, mapping them to 4 opamp devices internally:

.SUBCKT TL074_CHIP   1 2 3 4 5 6 7 8 9 10 11 12 13 14
*
  X1  3  2 4 11  1 TL074
  X2  5  6 4 11  7 TL074
  X3 10  9 4 11  8 TL074
  X4 12 13 4 11 14 TL074
.ENDS

This works fine, but beware that you must terminate any unused op-amps of the chip.

Is there a way to debug and view the actual netlist/circuit sent to ngspice? Let me know if this is not the right place to ask these questions…

Found a way. Add the following to your ngspice text comment in the schematic:

.control
listing
.endc

The full circuit text will be displayed in the simulator log window, very useful to see what’s going on under the hood.

3 Likes

FYI spice has ben enabled for the windows nightlies from now on. And as mentioned last week, they are also enabled for OS X.

Remember – bug reports are not to be posed here, but on the bug tracker on launchpad.net.

2 Likes

Bugtracker direct link:

Ok, I’ve installed the 4505896 from 05-10-2016 and ngspice is included, now I want to know where I can find the ngspice library working with it and if they are a very simple example demo (AC_Gen/R/C) to make some trail with this tool ? Thanks ! Vince.