ra3xdh / qucs_s

Qucs-S is a circuit simulation program with Qt-based GUI
https://ra3xdh.github.io/
GNU General Public License v2.0
862 stars 111 forks source link

Adding new devices to existing Libraries #1010

Open tomhajjar opened 15 hours ago

tomhajjar commented 15 hours ago

In reference to #1007 @rmano @csrabak

I created INA826 for SpiceOpamp.lib. I got warnings but the device seems to work. You can decide if the warnings are relevant.

1) Once again I accidently used "SPICE library device" instead of "SPICE netlist" so sub-circuits worked but the Library device didn't. I found my error by looking at the Library with a text editor and saw no Spice info.

2) When new library is made you must close/reopen Qucs-S to access it. Can this be resolved?

3) This could be used as an example/tutorial how to add devices to existing Libraries. There are many pitfalls to creating, editing Libraries or adding devices that would trip up a User. The revised Create Library utility is better than the original but could be improved.

2024-10-20_124152 2024-10-20_111458 2024-10-20_110146 2024-10-20_110735

OpAmp_INA826_lib_prj.zip

Rmano commented 14 hours ago

The result seems correct, but what I pointed out in #1007 is that it should not needed to change the name of the .lib node from "GND" to "VSS"--- or am I wrong? I mean, the node names should be "insulated" by the external connections, no?

I'll try to check this model. The warnings are a bit scary... they are not there in #1007 in the circuit that works.

ra3xdh commented 13 hours ago

This could be used as an example/tutorial how to add devices to existing Libraries.

This guide about libraries and subcircuits needs a translation: https://habr.com/ru/articles/805963/ See #554 Unfortunately nobody helps with rewrite the documentation.

When new library is made you must close/reopen Qucs-S to access it. Can this be resolved

I will look what could be done.

tomhajjar commented 13 hours ago

Google Translate seems to work OK.

Also one can copy-paste the translated text into a new document.

2024-10-20_124349

Rmano commented 13 hours ago

This guide about libraries and subcircuits needs a translation: https://habr.com/ru/articles/805963/ See #554 Unfortunately nobody helps with rewrite the documentation.

I know zero of russian, but google can autotranslate the thing and I can volunteer (with a bit of patience, I have not a lot of time on my hand --- fortunately later circuitikz seems to be quite quiet) to adapt it.

Is there a framework/style/master document to adhere to? I've looked at #554 but it seems a bit confused. Should the documentation be written in LaTeX (no problem, I'll be happy to do it).

ra3xdh commented 13 hours ago

The repository for documentation is here: https://github.com/ra3xdh/qucs_s_docs/ This link could be found in #554 There is no style guide. It uses standard report style. I have also created Overleaf project for Windows users: https://www.overleaf.com/project/65ed52fbd51e0623f11e285a So one can contribute ti the documentation without Github account.

Rmano commented 13 hours ago

I do not see those warning... and it seems to work well with mixed supplies and saturations.

But with two INA826 I have this warning:

 Warning: redefinition of .subckt ina826, ignored

Ah, this should be called InstrAmp --- it's an instrumentation amplifier, not an OpAmp 😉

image

tomhajjar commented 12 hours ago

The warnings are for the subcircuit made using "SPICE netlist".

"Warning: redefinition" ngspice doesn't like the spice file name to be the same as the internal device name. It doesn't cause problems. This goes away if you change either the file name or internal .SUBCKT name.

If you look at the attached library, it's called Instrumentation Amplifier