Open Rmano opened 4 hours ago
One of the schematics is missing the device.
You're right. Forgot to make save/all before creating the zip... I have re-loaded it above. Thanks and sorry for the problem...
Updated Files: INA826_v1.1e.lib created
I created a new project for you. It will also show you how to make sub-circuits and symbols.
There are v1 and v1.1 of the Spice model INA826 and you modified v1. I tested all 3 versions. I didn't dig into which model works under ngspice. The cleaned up project will make it easier for @ra3xdh to make a judgement.
The v1.1 model tests the same as v1. I assume your modified v1e model works but more testing needs to be done to confirm how well.
The v1.1 model is supposed to be less "cluttered". It removed a number of unused sub-circuits. The pin order is totally different.
Very nice, thanks! Is there a tutorial somewhere on how did you do it? I tried but got stuck... even if I authored a simple tutorial for QUCS subcircuits (see attached), I got lost when trying to integrate the external libraries ...
BTW, if this could be of interest for the documentation project, I'll be happy to contribute (adapting to qucs-s, that is, with also spice simulation).
Your tutorial is a start.
It's easier for beginners to make sub-circuits from manufacturer Spice models if one looks at the many examples I posted in the Discussion area or examples included in the Qucs-S distribution. Finding Spice models compatible with ngspice is the most difficult thing. There is no guarantee a model that woks in LTspice or PSpice will work in ngspice. The ngspice guys can help determine if a model can be altered to work in ngspice or a modification to ngspice is justified.
I also posted Symbol examples that you can copy-paste into your subcircuit. I generally copy an existing symbol from the symbol examples into "symbols_blank.sch" and clean it up prior to placing it into the sub-circuit. You generally want the Centroid of the symbol to be 0,0.
Hi --- this is a quite complex thing to explain, so please bear with me...
The following project, opened with qucs 24.3.2 on a Manjaro system, with
ngspice-43
, behave in a very strange way.strangesub_prj.zip
Notice that the project has the "LT" compatibility flag on.
I downloaded the INA826 library from the TI site; this is a very popular instrumentation amplifier. It works ok "as is" in LTspice (under Windows or Wine in Linux). If I use it directly in my circuit by picking it like this:
it does not work at all: my results are the following:
As you can see, the amplifier is basically dead.
Now, I edited the text
.lib
file and changed all the occurrences of "GND" to "VSS" with a simple global search and replace, and to avoid clashes, I changed the name of the device to INA826E. And now...It works flawlessly!!! So basically, the subcircuit node named "GND" is conflated with the external "GND" node name...
So this seems to be an encapsulation problem, and I do not know if the problem is in
qucs-s
or inngspice
. Node names in the subcircuit should be private, don't they? At least, they behave in the LTspice app.