Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking some ideal functions blocks #258

Closed
cmat21 opened this issue Apr 12, 2023 · 9 comments
Closed

Checking some ideal functions blocks #258

cmat21 opened this issue Apr 12, 2023 · 9 comments

Comments

@cmat21
Copy link

cmat21 commented Apr 12, 2023

Hello everyone, i'm checking some ideal functions blocks for a small project simulation. But i can't make them work properly. Please can you help me. thanks in advance
git
Ideal_01.zip

@ra3xdh
Copy link
Owner

ra3xdh commented Apr 13, 2023

These devices are represented as the Qucsator netlists that are stored in the library. Qucs-S converts them back to SPICE and uses qucs2spice.cpp converter. It supports only a limited subset of the Qucsator syntax and may not support mathematical functions necessary for these blocks operations. I am aware about qucs2spice problems but I am inclined not to fix it, but provide a library containing true SPICE netlists instead. Don't expect a quick fix here because of low demand on this library. I would advice to use B-type SPICE sources instead of these library if you need these block functions. See also https://ngspice.sourceforge.io/docs/ngspice-html-manual/manual.xhtml#magicparlabel-5564

@tomhajjar
Copy link

Vadim

I did a lot of work on the Ideal library back in 2021 so it would work with ngspice. I recreated the schematics of the functions and modified most of them to work with ngspice. In a few cases there are two variations for the same functions. There is still functions like VCO, Integrator, Quantizer etc to modify but not as many as starting from scratch.

I made a new Ideal library with cleaned up graphics placed in user_lib. It needs to be updated as functions get updated.

bpf2 function
diff function
lpf1 function

Ideal Library.zip

@tomhajjar
Copy link

tomhajjar commented Oct 27, 2023

I dug up my work from 2021 on ideal.lib. I have fixes for many of the functions to work with ngspice. After these are finished, I will work on the rest of the functions. I need to convert my test schematics into subcircuits.

I also reordered the library by function and redid the graphics. user_lib folder holds the modified ideal.lib used for testing. It is missing functions I haven't worked on. It will eventually updated to its final form.

I made 2 versions of LPF1. Either is OK.

I tried to multiple ways to create "Delay". My lack of experience in ngspice led to using a TLine to create the delay.

Here are a few problems with Int, Diff, AP1 and AP2.

The Int and Diff test schematics I made have output amplitudes that look odd. I need a test input signal with a known output to confirm.

AP1 and AP2 never worked in Qucs. AP1 and AP2 use "ModelIncludes" which I can't find details on. HP1.sch, LP1.sch, BP2.sch and VSub.sch don't exist anywhere I can see.

AP1:
<ModelIncludes "HP1.sch.lst" "LP1.sch.lst" "VSub.sch.lst">

AP2:
<ModelIncludes "BP2.sch.lst" "VSub.sch.lst">

Attached is my ideal function test folder and two "ideal" test libraries placed in the "user_lib" folder. I modify these libraries to avoid corruption of the main library.

Ideal Library Test_prj.zip

@tomhajjar
Copy link

tomhajjar commented Oct 27, 2023

The following functions have not been worked on:

SQRT, QNT, LIM, HardLimiter, DIV, SUM, VCO and OpAmp.

OpAmp is different than in the original Qucs ideal.lib.

@ra3xdh
Copy link
Owner

ra3xdh commented Oct 28, 2023

@tomhajjar Thanks for providing fixed library. I will try to correct the SPICE entries for Ideal devices where possible by the next release (planned in January or February next year).

@ra3xdh ra3xdh added this to the 24.1.0 milestone Oct 28, 2023
@tomhajjar
Copy link

tomhajjar commented Oct 30, 2023

Here is the first cut at a new Ideal.lib. A number of functions haven't been worked on yet.

Qucs-S won't let you create and name a new library the same name as in C:....share\qucs-s\library even though it is stored in user_lib. I made the mistake of naming the file Ideal_modified.lib and Qucs-S appends "Ideal_modified" like a hundred times throughout the file....

Old
2023-10-30_160650

New
2023-10-30_233500

Ideal Library Files.zip

@tomhajjar
Copy link

More ideal functions like VCO, Limiter, Quantizer... could probably be made to work in ngspice if the syntax for the formulas used in the EDD function are corrected. I don't know what changes to make to the formulas.

As seen in "AnalogueCM.lib issues #152" there are issues that cause formulas to be processed improperly.

@tomhajjar
Copy link

tomhajjar commented Jan 2, 2024

Ideal.lib is finished for now. @Radvall fixed a number of broken models. 21 of the original 22 models now work. Only VCO is missing. Ideal.lib is in both project folders.

Attached are the files used to create and test the models and library.

2024-01-01_234306

Ideal_Library_projects.zip

@ra3xdh ra3xdh closed this as completed in 12be148 Jan 2, 2024
@ra3xdh
Copy link
Owner

ra3xdh commented Jan 2, 2024

Fixed by #428

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants