ra3xdh / qucs_s

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

Library extension #846

Open ra3xdh opened 1 month ago

ra3xdh commented 1 month ago

I have recently discovered this website containing SPICE models for different devices: https://fotoelektronika.com/spice-models/ The most of these models could be converted to Qucs-S libraries. The models requires porting to Ngspice notation (replace IF by ternary operator etc.).

The following models are especially interesting:

The presented PWM controller models (UC3844, TL494 etc.) don't contain LTspice digital gates extensions and should work with Ngspice after minor tweaks.

TODO list from @ra3xdh:

ra3xdh commented 1 month ago

I have tested the provided PWM controllers models, and it doesn't work with Ngspice. The Ngspice reads the model without error but then fails to converge or gives kilovolt outputs. Theses models requires significant effort to port them to Ngspice syntax.

tomhajjar commented 1 month ago

Can you post your project? The ngspice guys have made many changes to improve compatibility. They also have recommended changes to models.

ra3xdh commented 1 month ago

Here is the project. It is done using the latest snapshot build. The MC34063 device is taken from another place and works as expected. The both UC3483 and TL494 gives either zero or kilovolt output. I suppose the problem may come from the following line in the models:

.IC V(QINT,GND) 0

I have tried replacing this by setting IC on the capacitor connected to this node, but no result. I also see nested IF conditions in one source. I am not sure if NGspice supports this.

GQ  GND  QINT VALUE {IF(V(CLKI,GND)>{V(VCC,GND)/2},IF(V(D,GND)>{V(VCC,GND)/2},{V(VCC,GND)},-5),0)}

PWM_controller_prj.zip

ra3xdh commented 1 month ago

I have used testbench schematics from PDF documents from this page: https://fotoelektronika.com/spice-models/

TL494-spice-model.pdf UC3843-spice-model.pdf

ra3xdh commented 1 month ago

I finally managed to get TL494 operational. The .IC directive required correction. Also setting InitialDC=no helps. The UC3843A model still be no result.

image

PWM_controller_prj.zip

ra3xdh commented 1 month ago

I have added MixerIC library containing SA612 model as part of #850. Everything works as expected with default Ngspice settings.

image

tomhajjar commented 1 month ago

I will make a symbol for the Tl494.

I worked on the SA612 many years ago. Attached is my project. I made two different SA612 symbols but the colors and line widths don't conform to what we are using today.

2024-07-19_074736 2024-07-19_075244 2024-07-19_075323

SA612_prj.zip

ra3xdh commented 1 month ago

I have fixed the UC3843A model. There was a mistake in testbench schematic in PDF. The supply voltage should be in range from 9 to 15V. Also the DX diode model required a correction. The default BV value caused convergence error for Ngspice. The fixed model is attached. The other UC384x devices may be fixed in a similar way.

image

UC3843A.cir.txt

ra3xdh commented 1 month ago

Summarizing all above, the PWM controller models could be assembled in a library. This library could be added in the upcoming release.

ra3xdh commented 1 month ago

I have added TODO list to this issue.

tomhajjar commented 1 month ago

First cut of the TL494 symbol. Since the device can be used to make multiple regulator topologies, no obvious way to make the symbol.

2024-07-19_152511

TL494.zip

ra3xdh commented 1 month ago

PWM controller library implemented by #855.

tomhajjar commented 1 month ago

I made a small change to the TL494 symbol. PIN3, CMP->FBK

CMP was on an old schematic. FBK is on data sheet...

I updated the library as well.

2024-07-22_104941 2024-07-22_111143

PWM_Controller_prj.zip

tomhajjar commented 1 month ago

There is a KiCad example using the UC1825. I haven't tested it in Qucs-S but trying to confirm why I can't get it to work under KiCad. I made a preliminary symbol and modified the model.

2024-07-22_225943

UC1825.zip UC1825 model and symbol.zip

ra3xdh commented 1 month ago

UC1825 device seems to be obsolete and available for purchase only as CerDIP variant. It presents a little interest for inclusion in the library.

tomhajjar commented 1 month ago

SG1525A/SG3525A is very similar and made by many companies.

I found an PSpice/OrCAD SG1525A model. It might be usable.

Page has a lot of models. https://robustdesignconcepts.com/files/pspice/libs/

swit_reg.zip

tomhajjar commented 1 week ago

I have updated the Avago ACPLK30T Photo Voltaic Isolator. It would make a good addition to Optocoupler.lib

2024-09-03_193936 2024-09-03_193951

ACPLK30T_Photo_Voltaic_Isolator.zip

ra3xdh commented 1 week ago

I have added ACPLK30T model as the part of #927

tomhajjar commented 1 week ago

I did some preliminary work on a Neon bulb library.

Goal was to use the Zabb Csaba model as-is. Use the LTspice model and have all parameters available for modification. I also tested a simple model I found in the web that was tested in Qucs-S and have all parameters available for modification.

The Zabb Csaba model "Neon_65.cir" doesn't work at all unless I use "uic". Changing parameters not straightforward.

The LTspice model "NeonBulb.cir" "works" at T=0 but the data is wrong elsewhere. When the bulb turns on the volatge drops to 0 instead of 40-50 volts. I assume this is caused by the Warning that "vser" is not recognized. ngspice doesn't support the "level 2" LTspice switch model. https://ltwiki.org/LTspiceHelp/LTspiceHelp/S_Voltage_Controlled_Switch.htm

The model "Neon_60_SW.cir" doesn't work at T=0 unless I use "uic". It does "work" elsewhere. This model could have user defined parameters so it would mimic other neon bulbs. https://wigglewave.wordpress.com/2015/03/29/adventures-in-neon-discharge-bulbs/

2024-09-04_200409 2024-09-04_105439 2024-09-04_195832 2024-09-04_195708

Neon_Bulb_prj.zip