Spice simulation not working, cryptic error messages

Hi,

I am trying to use the simulation capability built into KiCad. So far for every design, the tool fails to run and produces either of two error messages , as listed below.

How do I resolve these problems? Please provide step by step instructions.

Also, where on the KiCad web site can we find a step by step tutorial for using the spice simulator and adding parts models from files that we might download from digikey, TI, nexperia, analog, etc.?

Thank you

Error Message A:

Note: Codel model file loading path is /home/nelson/Projects/TeensyDataAcquistion/SPI_Instrumenation_Project/Instrumentation_Input_SPI/
Note: Compatibility modes selected: ps lt a
Error in line ic1 __ic1
Not enough parameters
line no. 31 from file circbyline
Error: ngspice.dll cannot recover and awaits to be reset or detached

Error Message B:

Cannot open file ‘/home/nelson/KiCad/models/BGA2870/BGA2870_2.5V_1_25C.lib’.
Error loading simulation model: no ‘Sim.Name’ field

Kicad uses the ngSpice simulator, and that is a separate project from KiCad. You can find a tutorial for working with ngSpice on the ngSpice website:

There are also several threads on this user forum with working ngSpice simulations. You can download projects as zipfiles and experiment with them.

https://forum.kicad.info/search?q=simulation%20examples

There is also my series of introductory videos available at https://www.youtube.com/@holger8105/videos.

Thank you, I really need written step by step instructions. Videos take too much time to watch.

For example:

There seem to be some useful collections of parts models in zip files.

But what seems to be missing in all of the (written) tutorials is where to put the collections of parts models on a linux machine, and how to let KiCad (or ngspice) know where they are located.

All I get are these cryptic messages like the two listed above and not a clue what is missing or where to go to find further instructions.

You can put the models anywhere. And then in KiCad, edit the symbol properties and browse to the location you put them. This is also mentioned in the (written!) tutorial I linked to, although that tutorial suggest to put (downloaded) models in your project directory.

Point well taken. I found the tutorial a bit overwhelming.

Anyway, the information on how to add the models to ngspice is only three redirects aware (after finding the tutorial).

… which take us to

And voila!

Oops! Still a little mysterious, and nothing about where to put the models listed on the previous page. So, there I was stuck.

I guess I still haven’t seen where the information is on what to do with those zip files on any of those pages. Perhaps I just perused a little too fast. (There is a lot of information there and not a lot of headings or a TOC)

It seems to me the information about what to do with zip files might be more clear if spelled out right there where it says (paraphrasing) here are some collections, before it begins the list.

But thank you, it is an impressive effort to make all of this available. I’ll probably be up an running in a short while.

No need to go there. the section about the BC546.lib model (even shown in your screenshot) should have been enough I guess. Right after the “copy into your project directory” you can read how to add the model to the symbol.

Okay, I’ll look again. Thanks.

Maybe a standalone section, using third party model files in eeschema (kicad).

And a TOC

Aha! I see it. Just one line further. Thank you.

But that is not great file management. There are quite a few parts that I use over and over again in different projects.

Perhaps with the files in the myparts directory under KiCAD, might make sense.

I feel like what we really need is a default search tree, for each or all of symbols, footprints and models.

Do you mean something like: ~/.local/share/kicad/8.0/ (On my Linux box) Hmm, yes that’s a great Idea. I wonder why no one else has thought about that.

Touche’

But do you mean to say that if I unpack those zip files somewhere in that tree (as of yet unspecified exactly where), then when I run the simulator in the kicad schematic editor, it will automatically find the model file for each part?

That’s more or less what I meant by a default search tree (for all of the models, symbols footprints, etc, that I add to kicad).

Even for the symbols and footprints, we are still at the stage where we have to manually add every symbol and every footprint. (And it is still not very smooth.)

For the 3d models it is even less automatic, we have to add the 3d model to every added footprint every time we use it.

It sounds like the spice model has a similar relationship as the 3d models, in that we have to manually add the spice model to the symbol every time we use it.

So it seems like there is a little more integration work to do on both. But anyway, at least now I have some idea where and how to start.

Thank you

Sigh.

I give up, you win.
But I do confess, that directory I mentioned does not have a predefined sub directory for spice models. Maybe that should be added?

Sorry, I dont want to win. I just want to figure out how to use it in a convenient way.

ECAD and spice software have been super tedious for a very long time, regardless of how much they cost.

Everything works great until the first moment when you have to add a part. For me that happens about 5 seconds into a project.

The way most people handle this is by defining their own global symbol library. You can then copy in symbols that you’d like to use regularly, and associate the simulation models (stored somewhere central outside of your project directories) with them in the symbol editor. That way, every time you use those symbols, the simulation stuff will be set up for you.

See here for symbol library / editor documentation: Schematic Editor | 9.0 | English | Documentation | KiCad