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

Library extension #846

Open
4 of 7 tasks
ra3xdh opened this issue Jul 17, 2024 · 19 comments · Fixed by #855
Open
4 of 7 tasks

Library extension #846

ra3xdh opened this issue Jul 17, 2024 · 19 comments · Fixed by #855
Assignees
Labels
Milestone

Comments

@ra3xdh
Copy link
Owner

ra3xdh commented Jul 17, 2024

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:

  • Vacuum tube models
  • PWM controller models

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 ra3xdh added the library label Jul 17, 2024
@ra3xdh
Copy link
Owner Author

ra3xdh commented Jul 18, 2024

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
Copy link

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

@ra3xdh
Copy link
Owner Author

ra3xdh commented Jul 18, 2024

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
Copy link
Owner Author

ra3xdh commented Jul 18, 2024

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
Copy link
Owner Author

ra3xdh commented Jul 19, 2024

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
Copy link
Owner Author

ra3xdh commented Jul 19, 2024

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

image

@tomhajjar
Copy link

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
Copy link
Owner Author

ra3xdh commented Jul 19, 2024

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
Copy link
Owner Author

ra3xdh commented Jul 19, 2024

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

@ra3xdh
Copy link
Owner Author

ra3xdh commented Jul 19, 2024

I have added TODO list to this issue.

@tomhajjar
Copy link

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 ra3xdh added this to the 24.4.0 milestone Jul 21, 2024
@ra3xdh
Copy link
Owner Author

ra3xdh commented Jul 22, 2024

PWM controller library implemented by #855.

@ra3xdh ra3xdh linked a pull request Jul 22, 2024 that will close this issue
@tomhajjar
Copy link

tomhajjar commented Jul 22, 2024

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
Copy link

tomhajjar commented Jul 23, 2024

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
Copy link
Owner Author

ra3xdh commented Jul 23, 2024

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
Copy link

tomhajjar commented Jul 23, 2024

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

@ra3xdh ra3xdh self-assigned this Aug 20, 2024
@ra3xdh ra3xdh mentioned this issue Sep 3, 2024
@tomhajjar
Copy link

tomhajjar commented Sep 3, 2024

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
Copy link
Owner Author

ra3xdh commented Sep 4, 2024

I have added ACPLK30T model as the part of #927

@tomhajjar
Copy link

tomhajjar commented Sep 4, 2024

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

@ra3xdh ra3xdh added this to the 25.2.0 milestone Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants