NGSpice learning curve


#1

Hi,
I’ve been using kicad for years, since BZR4022 in fact, I just migrated to 5.12 and discovered the power of NGSpice. Not to say that I’m at the very bottom of the simulator learning curve!
The NGspice user’s manual doesn’t cover the kicad interface and that is normal. The gap is partly filled by some useful tutorials (Holger Vogt, “Initiation à la simulation avec KiCad” from sitelec.org) that I read with attention and successfully tested the examples.
Despite my intense harvesting, I didn’t manage to find more in relation with kicad. Youtube is no use for me (hearing issues).
At this step, I have several questions, mainly the way to pass instructions to NGspice. It’s not clear for me what to put in the value field, in the spice_model field, in the text directive list and possibly in some other fields.
May someone reply to my current questions and point me to the documentation I’m looking for ?
Lot of more questions are arrriving soon !
TIA.


#2

To start with the simulator, in my opinion there is no need initially to fill any of these fields directly. Please have a look at http://ngspice.sourceforge.net/ngspice-eeschema.html for an introduction how to use ngspice from within Eeschema. The KiCad simulator manual is at http://docs.kicad-pcb.org/5.1.2/en/eeschema/eeschema.html#simulator


Simulating Quiescent Bias Point
#3

hi,
Thanks a lot for the help. I completely forgot about the http.//docs.kicad… documentation pages and completely missed them. Very helpful.

The simulator chapter almost replies to my questions, I understand that dialog box inputs take precedence over the text directives in eeschema as well as the value field for the sources. However, I’m still wandering what the contents of the source value field is. I’m confused with NGspice manual. Does it only concerns AC and DC with 0 or 1 values only or something more ?

I also tried to sweep the source frequency using “dc 0 ac 0 sffm(0 2 200 30 2)” into the spice_model field. It worked but I don’t really understand the difference regarding the source parameters in the ‘source’ tab of the spice model editor nor if some dialog box inputs of the NGspice settings would take precedence.

Sorry for questions, which for a skilled guy, replies are evident. At the moment there’s a lot of fog in my mind ! What I’m looking for is a kind of overview of the simulator menus/boxes and the eeschema model parameters. I think that this would put everything in the right place.
Thanks again for the help.


#4

There is probably no other documentation describing these details.

So it might be reasonable that you try to answer the questions yourself.

If you make any change, run the simulator and then have a look at the resulting ngspice netlist. This will tell you about what data are sent to ngspice.


#5

That’s exactly what I dis but there are some limits …


#6

I’ve used LTSpice IV a bit in the past, but I really like the idea of having an all in one solution for both simulation and schematic capture/PCB layout.

However, there’s a huge amount of support for LTSpice on the forum that I frequent the most (DiyAudio forums), is there a similar place to get support for ngspice? I like the friendly, no question is too stupid, mentality of the LTSpice community on DiyAudio. So, I’m looking for something like that.


#7

Hi,
Unfortunately, I have no more than the links posted by Holger, the ngspice documentation from Github and some vids from youtube that you’ll easily find with google.
I’m neebie both to Ngspice and to simulation in general.
Should you find some additional information or forum, please, share, I’d be glad to read them.
Regards


#8

KiCad/Eeschema/ngspice related questions may be posted in this forum.

ngspice related questions are quickly answered in https://sourceforge.net/p/ngspice/discussion/

There is even a thread about ngspice in DiyAudio https://www.diyaudio.com/forums/software-tools/331656-installing-using-ngspice-opensource-simulator.html that is useful when discussing audio releated questions. People at DiyAudio probably have not yet become too much acquainted with the KiCad/ngspice setup.

And there is our ngspice web site http://ngspice.sourceforge.net/index.html with lots of information and some tutorials at http://ngspice.sourceforge.net/tutorials.html .


#9

LTSpice has benefited from a full time developer and a large number of users for decades. Linear and later AD have test equipment to characterize ICs and validate models that we can only dream of.
Ngspice has a lot of catching up to do, but i is worth it to get control. As an example, LTSpice recently removed a load of obsolete jfets from their library - the sort of thing the DiyAudio crowd would be likely to want to use in simulations of vintage circuits.