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

555 timer models working in ngspice but don't work using Qucs-S #120

Closed
2 tasks done
tomhajjar opened this issue Jul 19, 2022 · 17 comments
Closed
2 tasks done

555 timer models working in ngspice but don't work using Qucs-S #120

tomhajjar opened this issue Jul 19, 2022 · 17 comments
Assignees
Milestone

Comments

@tomhajjar
Copy link

tomhajjar commented Jul 19, 2022

As an exercise I ran some simulations using 4 different 555 timer models. I used the DuSpice GUI to confirm all worked with ngspice. Only 1 model (UA555.lib) worked when run via Qucs-S.

I suspect some of the issues are due to my Qucs-S netlists lacking the added "Steps" that the authors of the ngspice netlists used to get the models to work.

I only mention this because I would think new users might use a 555 timer and become frustrated.

555 Timer_examples_prj.zip
555 Timer ngspice netlists.zip

TODO list from @ra3xdh :

  • Add a library containing 555 timer model
  • Add example using 555 timer device
@ra3xdh
Copy link
Owner

ra3xdh commented Jul 19, 2022

Hello Tom, thank you for submitting your results. It's possible to make simulations work.

  • You need to set initialDC=no to obtain tran ... UIC the same as used in netlist. Otherwise initial conditions on C1 capacitor will be ignored and taken from DC
  • It's possible to define PWL source using red Vsource device (look attached screenshot)
    image

@ra3xdh
Copy link
Owner

ra3xdh commented Nov 7, 2022

A library and/or example containing 555 timer model should be added to Qucs-S. This will help to new users.

@tomhajjar
Copy link
Author

It's good this has come up again. I was unable to get a number of the 555 models attached above to work in Qucs-S. They came from the ngspice examples folder. Some issues are caused by not exactly duplicating the test conditions in the ngspice netlists.

At a minimum bipolar and CMOS 555 timer examples should be made to work for Astable, Monostable and PWM configurations.

@tomhajjar
Copy link
Author

I took another look at the 555 timer folders I sent above. I only included four 555 models that I got to work under ngspice. I cannot get TLC555ng.lib to work under Qucs-S but does work under ngspice. I included all the ngspice files I ran using DuSpice.

555 Timer_examples_prj.zip

@ra3xdh
Copy link
Owner

ra3xdh commented Nov 18, 2022

Hello Tom, thanks for providing examples. I will try to turn your 555 subcircuits into the library for distribution with Qucs-S.

@tomhajjar
Copy link
Author

tomhajjar commented Nov 18, 2022

Some background:

The 555 model, TLC555ng.lib is a modification by Holger of TLC555.lib supplied with ngspice. I don't understand the reason it was done since both TLC555ng.lib and TLC555.lib work with the test file 555-timer-2.cir also supplied with ngspice. I use DuSpice for verification. Neither TLC555ng.lib or TLC555.lib work using my schematics in Qucs-S.

https://sourceforge.net/p/ngspice/discussion/ngspice-tips/thread/d2048be2/
https://sourceforge.net/p/ngspice/discussion/ngspice-tips/thread/d2048be2/
https://github.com/imr/ngspice/blob/master/examples/p-to-n-examples/555-timer-2.cir

555-timer-2.cir uses two different 555 models, TLC555.lib and UA555.lib, CMOS and bipolar.

TLCng_UA555_astab.cir is my test file that removed the UA555 model from 555-timer-2.cir

2022-11-18_134407

555 Timers.zip

@tomhajjar
Copy link
Author

tomhajjar commented Nov 18, 2022

For some reason I am unable to edit the above comment. A lot of text is missing. I updated the zip file.

Lastly, whatever models are chosen it would be best if all inputs and outputs are fully functional. Some models don't have fully functional inputs and outputs. A popular model in the following link has these issues.

http://www.ecircuitcenter.com/Circuits/555_Timer1/555_timer1.htm

555 Timers.zip

@ra3xdh
Copy link
Owner

ra3xdh commented Nov 19, 2022

I cannot get TLC555ng.lib to work under Qucs-S but does work under ngspice.

The oscillator circuit started to work after I replaced the SpiceLibComp device by Spice netlist device. SpiceLibComp was designed for directly placing on schematic and may produce nested subcircuits when wrapped inside subcircuit. Look at the attached screenshots. I will provide a 555 time library based on your examples and include it in the next release.

image
image

@ra3xdh ra3xdh added this to the 1.0.1 milestone Nov 23, 2022
@ra3xdh
Copy link
Owner

ra3xdh commented Nov 25, 2022

I think the library containing two 555 models will be sufficient. I am planning to take two implementations for this library:

  • TLC555ng model from Holger
  • 555 XSPICE model from Clyde

@tomhajjar
Copy link
Author

The 555 XSpice model by Clyde is being modified to work over a wider voltage range. Presently it works for only 5 volts. Not sure when he will finish it.

@tomhajjar
Copy link
Author

tomhajjar commented Jan 13, 2023

I found a NE555 timer that seems to work pretty good and doesn't have limitations like Clyde's behavioral model. It is used by both LTSpice and ngspice users.

https://forum.kicad.info/t/simulation-of-555-timer-circuit-in-kicad/21697

NE555 LTSpice

555 Timer_examples_prj.zip

@ra3xdh
Copy link
Owner

ra3xdh commented Jan 16, 2023

Yes, I tried this 555 model. It works fine with Ngspice+Qucs-S.

@ra3xdh
Copy link
Owner

ra3xdh commented Feb 2, 2023

I have added a library containing 555 timer model and oscillator example. This will available since v1.0.1 release.

@ra3xdh ra3xdh self-assigned this Feb 2, 2023
@tomhajjar
Copy link
Author

Both CMOS and Bipolar models?

@ra3xdh
Copy link
Owner

ra3xdh commented Feb 2, 2023

A new library contains only CMOS model provided by Holger Vogt. I didn't add the bipolar model yet.

@ra3xdh
Copy link
Owner

ra3xdh commented Feb 2, 2023

I have just updated the library and added the bipolar model from KiCAD forum.

@ra3xdh
Copy link
Owner

ra3xdh commented Feb 4, 2023

A new v1.0.1 package (released today) contains 555 timer library. Closing this.

@ra3xdh ra3xdh closed this as completed Feb 4, 2023
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

2 participants