EEVblog Electronics Community Forum

Electronics => PCB/EDA/CAD => KiCad => Topic started by: rhenry74 on December 10, 2022, 07:00:01 am

Title: doAnalyses: TRAN: Timestep too small
Post by: rhenry74 on December 10, 2022, 07:00:01 am
Total noob here... first circuit. It's an oscillator that I'm trying to kick start in spice.
It won't simulate, fails with "doAnalyses: TRAN:  Timestep too small"
Any ideas?
Title: Re: doAnalyses: TRAN: Timestep too small
Post by: Slh on December 10, 2022, 07:39:42 am
Possible things:

Your maximum timestep could be too big on your trams command. Set it to 1n and try again.

Add a .cshunt=10e-15 and or rshunt=10e15 These add tiny parasitics to 0V that help it solve.

Q2B has a rather high initial condition. I don't think that's helping. Either bring it down to around 0.4-0.6V or get rid of the initial conditions and vary all of the resistors by 5% to unbalance it so it starts.
Title: Re: doAnalyses: TRAN: Timestep too small
Post by: Doctorandus_P on December 10, 2022, 02:42:55 pm
There is a working example of an astable multivibrator (and many more) on the KiCad forum:

https://forum.kicad.info/t/simulation-examples-for-kicad-eeschema-ngspice/34443
Title: Re: doAnalyses: TRAN: Timestep too small
Post by: Benta on December 10, 2022, 08:09:10 pm
KiCAD/ngspice errors have mostly nothing to do with the actual problem. Irritating, but live with it.
You need to fix a couple of things:
Your power supply is incorrect.
The 2N3904 pin sequence is incorrect for simulation.
You seem to generally use the "pspice" library for your schematic. Don't, there's no need and the symbols are ugly. Don't; just use the standard symbols.
Where did you place the 2N3904 Spice model?
Title: Re: doAnalyses: TRAN: Timestep too small
Post by: rhenry74 on December 12, 2022, 05:32:55 pm
The fatal flaw was I thought the 0 in the ground reference was a pad. My wire didn't actually connect to it.  :-\
But... it still wouldn't oscillate... i tried many of yall's suggestions.
I downloaded the astable.7z example and it just worked right out of the starting gate.
I'm not sure what the flaw is in my schematic but I'm now in a place where I can move forward.
Thanks for the help!
Title: Re: doAnalyses: TRAN: Timestep too small
Post by: TimFox on December 12, 2022, 06:57:51 pm
In Spice simulations, "0" is a reserved node number for ground, common, etc.
Each node must have a DC route to "0" for the simulation to work, since it starts by calculating the DC voltages to ground.
(When necessary, put a 100 G resistor from a floating node to 0.)