qucs_s icon indicating copy to clipboard operation
qucs_s copied to clipboard

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

Open tomhajjar opened this issue 2 years ago • 1 comments

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

tomhajjar avatar Jul 19 '22 14:07 tomhajjar

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 avatar Jul 19 '22 14:07 ra3xdh

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

ra3xdh avatar Nov 07 '22 10:11 ra3xdh

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 avatar Nov 07 '22 12:11 tomhajjar

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

tomhajjar avatar Nov 17 '22 21:11 tomhajjar

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

ra3xdh avatar Nov 18 '22 16:11 ra3xdh

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 avatar Nov 18 '22 18:11 tomhajjar

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

tomhajjar avatar Nov 18 '22 19:11 tomhajjar

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 avatar Nov 19 '22 15:11 ra3xdh

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

ra3xdh avatar Nov 25 '22 17:11 ra3xdh

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 avatar Nov 26 '22 00:11 tomhajjar

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

tomhajjar avatar Jan 13 '23 02:01 tomhajjar

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

ra3xdh avatar Jan 16 '23 13:01 ra3xdh

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

ra3xdh avatar Feb 02 '23 11:02 ra3xdh

Both CMOS and Bipolar models?

tomhajjar avatar Feb 02 '23 14:02 tomhajjar

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

ra3xdh avatar Feb 02 '23 15:02 ra3xdh

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

ra3xdh avatar Feb 02 '23 16:02 ra3xdh

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

ra3xdh avatar Feb 04 '23 14:02 ra3xdh