Spice and KiCad


#1

lately the road map v5 has been updated and the simulation part is still there, cern-devs have a fork of kicad on github in which they do there hacks, seems like ngspice and spice simulation are coming!


#2

You are right Anastien.


#3

Very impressive,

There is also this comment already on eevblog

[quote=“janoc”]
Wow nice! I will try to build it over the weekend.
However, that user interface for the probe and tune tools are really Kicad-ish - ass-backwards! Select a button in one window so that you can then click with it in another (schematic) window, instead of having the tools there on a specialized toolbar [/quote]

I get the impression some of this ‘cross probe’ behaviour comes from using a separate ngspice, so it acts along similar lines to PCB Cross-probing.

Is it possible to have the tools there on a specialized toolbar ?


#4

Very good news for analog-man like me, congratulations for this clear demo! :blush:
Is there a way to try this demo on V5 somewhere ? Thanks.


#5

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.


#6

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.


#7

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


#8

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


#9

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?


#10

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


#11

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


#12

Is it the same situation for OSX?


#13

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


#14

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.


#15

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?


#16

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


#17

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!


#18

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


#19

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.


#20

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…