Hello,
i am having some issues with the NGspice tool and would like to find out which end KiCAD or NGspice is causing the problem. Naturally getting in touch with the right person would help a lot. Since i am not sure if it is a issue with kicad or NGspice it does not feel right to raise an issue on the launchpad…or is it the right way?
Lets be clear i don’t want a private session with a dev just the right place to put this to raise awareness.
Yes, thats what i did.
I pulled the above link out of my history so it points to the helpdesk section but if you select issue on the left sidebar you’ll end up in the exact spot you point to.
Thank you very much for your reply. In the NGspice forum was already confirmed that it has to be the opAmp’s Model.
Just to make it absolutely clear, to prevent misunderstandings: The symbol and spice model that was used is the default spice model that does come with the KiCAD libraries,Its reference is: Simulation_SPICE:OPAMP . To be traceable it did setup a clean Fedora 31 VM with freshly installed KiCAD 5.1.5-1.fc31 , did no changes to it and did the setup with only default supplied components.
If there is no opamp or B-source, the simulation will produce the characteristic of a R-R-C phaseshift network.
It would have been nice that NG or KiCAD raised a warning telling me that it found no OpAmp Model for simulation before replacing it with something.
So i would say it is arguable if its a bug or not but i am also not yet sure if in KiCAD or in NGspice.
To make matters worse: the KiCad setups in the simulation lib are not meant to represent any particular part. They are just there as an example how to fill out the parameters without getting a critical error. (we kind of argued if we should fill it with something illegal to ensure users know that the need to fill the info with their parts specifications but opted against it because we did not want to deal with the bug reports we would get that way)
@Evan_Shultz can probably give more insight into this as he was the one who made most of the simulation symbols.
I did not expected it so i tested it. But i do not see how i could have tested better to prevent me from assuming it is fine. If i put the amp in the schematic and look at it’s values there is no reference to any simulation model whatsoever neither in the ‘values’ nor in the ‘edit spice model’ is listed a single parameter nor a pointer to where i can find them. Even now i yet dont know that.
If that is the intended behaviour thats fine with me. You guys have to decide how your software interacts with the users. I just gave my opinion.
That is also totally fine with me if you guys decide that’s the way it should be. But again the amp has no value in its mask whatsoever from which i can assume a phaseshift network.
And it can’t be that easy to find either since it took me three topics to get to know what it does.
Ok sorry i think i confused the symbols for ngspice sources with the opamp. Yes the opamp is not assigned a model. I am not sure why there is a special opamp symbol in the simulation lib then.
Typically there are no simulation models available in KiCad symbol libraries. So the user has to take care to find and attach a suitable model.
The symbol Simulation_SPICE:OPAMP however has a bug. The entry for Spice_Primitive is V in the current version. This is wrong because an OpAmp never will be just a voltage source (aka V).
If the entry was X, that is an OpAmp subcircuit model is required (as is usually the case with OpAmps), and the user did not attach such a ngspice model, the simulator would have answered:
Circuit: KiCad schematic
Error: unknown subckt: xu1 nc_01 nc_02 nc_03 nc_04 nc_05 opamp
Error: there aren't any circuits loaded.
or simular, just bailing out and telling what is missing.
With Spice_Primitive V, ngspice is told to add a voltage source, which it does, and it moves on (with difficult to understand error messages because of the strange voltage source parameters, so setting them to 0) and thus yielding strange simulation results.
The OPAMP symbol was submitted by me, and we were in a rush to submit the symbol because the existing opamps symbols typically have their power pins in a separate unit and don’t simulate. I had always picked a SPICE model and didn’t come across this before. Thanks for catching this issue.
The DIODE symbol was a copy and paste of the existing diode symbol and didn’t have a proper SPICE primitive assigned so I fixed that too.