Simulation examples for KiCad8/Eeschema/ngspice

Hi guys
Was anyone able to run the ibis.test.7z project from holger (see above)?
I run only into a couple of error messages

Can't open viewport for graphics.
\Users\***********
ngspice-42 done
Note: 'quit' asks for detaching ngspice.dll.
Note: can't find the initialization file spinit.
******
** ngspice-42 shared library
** Creation Date: Dec 31 2023   07:13:41
******
Note: No compatibility mode selected!
Circuit: *
Note: No compatibility mode selected!
Circuit: KiCad schematic
Error on line:
v.xu1.vku xu1.ku 0 pwl ( )
parameter value out of range or the wrong type
Error: circuit not parsed.
Error: vector time not found!
Error: vector time not found!

With today’s nightly I do not see any problems (two different machines running MS Windows). My previous nightly from Jan. 3rd seemed to have some problem.

No way for me to run the ibis example. Other projects work fine.

I created a new schematic from the scratch and it fails with the same errors.
Do you need some more informations? Shall I open a ticket in gitlab?

Btw.
Is it intentional that you share KICAD6 files?

Another point…
I would expect to see real values from the ibis file here.
grafik

Typ, Min or max could be chosed in a separate box

grafik

just an idea…

In this thread: no.

I have presented KiCad6 examples in Simulation examples for KiCad/Eeschema/ngspice .

4 posts were split to a new topic: Falstad simulator fo simple tasks

@holger, FYI I have created a repository on GitHub containing the simulation projects from this post and embedded the documentation and screenshots in README files.

See https://github.com/labtroll/KiCad-Simulations

PS: I have added your GitHub profile @holvo as a maintainer on the repository.

1 Like

many thanks for your efforts.

Unfortunately I will not have any resources to act as maintainer of your GitHub repository. This should be your task, and I hope that you are able to run this for some time.

I have made an update on the QEI project.

@holger, I had no expectations of you maintaining my repository with your content. But I didn’t want to prevent you from doing so, which is why I gave you maintenance privileges to the repo.
I will do my best to keep my KiCad Simulations repository up to date with your good work.
If you ping me of any changes, updates or new simulations I will make sure to update.

Thanks,

Morten

PS: I have updated the QEI simulation (799 → 8)

@hatte , I have posted a new circuit with an old device, still interesting for newcomers, the 555 with a model which I have derived from the bipolar circuit diagram in https://forum.kicad.info/uploads/short-url/vd016SrcYFrWfWgNdIcwl5Y8EfC.7z.

2 Likes

@holger, I have added 555-bipolar at https://github.com/labtroll/KiCad-Simulations/tree/main/555-bipolar

1 Like

I have made an update to the LLC converter and added aa example of a logic simulation, a full adder comparison.

I have updated LLC files and README in https://github.com/labtroll/KiCad-Simulations/tree/main/LLC

2 Likes

I have lost the ‘Edit’ button for the primary post of this thread

I would still like to use ‘Edit’ to upgrade examples or to add new ones in the top post.

Could somebody with access rights please re-instate the editing capability for me?

I have promoted you to “leader”, maybe it helps.

I also made the first post a wiki.

I like the Idea of turning this into a Wiki.
Wiki pages are also editable by a lot more people. (This forum logs changes in GIT or similar, so vandalism can be reversed).
I think it’s also a good idea to clean up this thread a bit. Delete all posts not directly showing examples and such.

2 Likes

Better yet: store KiCad simulation example source files in a Git repository, so they can easily be maintained, downloaded, synched and tagged and checked for changes. And documentation can follow along in associated markdown files.
Like any other source code :wink:

3 Likes

A new circuit at the top: A recently published high efficiency, high power RF generator for 13.56 MHz.

Thanks for making the examples. It is delightful to be able to model circuits this way.

While testing your “Step down converter with LM2576” with the nightly build from docker, I found a problem. The LM2576.7z file contains a pspice model in LM2576_TRANS.LIB.

On line 27 there are some non-UTF8 characters that will cause KiCad to fail to read the spice files. It won’t say much about the problem. The first sign that something is wrong is that no models will appear in the UI after you select the .LIB file. If you try to simulate the netlist will be empty.

I suspect the issue is with the definition of the spice parser in kicad. I suspect SafeReadFile() in common/richio.cpp is returning a blank string without giving the user feedback about the bad characters or their location.

Until this can be fixed it might be good to tell simulation users to check their spice files for non-UTF8 characters if they have problems simulating.

You can see there are two bytes with the value 0x96 on line 27.

$ (echo; cat -n LM2576_TRANS.LIB | grep -a Datash ; echo; cat -n LM2576_TRANS.LIB | grep -a Datash | hexdump -C )

27	* Datasheet: SNVS107D JUNE 1999REVISED MAY 2016

00000000 20 20 20 20 32 37 09 2a 20 44 61 74 61 73 68 65 | 27.* Datashe|
00000010 65 74 3a 20 53 4e 56 53 31 30 37 44 20 96 4a 55 |et: SNVS107D .JU|
00000020 4e 45 20 31 39 39 39 96 52 45 56 49 53 45 44 20 |NE 1999.REVISED |
00000030 4d 41 59 20 32 30 31 36 0d 0a |MAY 2016…|
0000003a

I tried to track down the files from TI to see if they had this problem. I was not able to find anything from TI.

Once I fixed the file the simulation worked nicely.