I’m trying to test out Qspice doing a ramp generator.but I don’t know why I get such different results when doing 100ms vs 1000ms.
What am I doing wrong here.
(Also at time 0 is the voltage supposed to be at 0.65V?)
I’m trying to test out Qspice doing a ramp generator.but I don’t know why I get such different results when doing 100ms vs 1000ms.
ensure to add maxstep
.tran 0 100m 0 1u uic
Yes, you better assign maxstep for self oscillation circuit, as SPICE may not able to adjust its timestep for such circuit as there is no timestep modification devices in this circuit, and maxstep just by default using Tstop/1024.
Thanks @physicboy, this made the results sane. Also reading the documents the 0 at the start does nothing am I correct?
Hi, @KSKelvin just trying to learn what are/is timestep modification devices? And how does it help with the simulations (Also if it also can cause failures). Thanks for the help. Not an expert in SPICE but hope to be good enough. .
I uploaded my timestep study note in my Github. This is a direct download link.
Right the first part of the .tran command does nothing.
Anyway, I just wanna add a short example
I have digital SMPS simulation (I set the maxstep from C-block).
In that sim, I somehow decided to just write
.tran 100m uic
And out of nowhere the circuit always have timestep too small error.
I just replace it with
.tran 0 100m 0 10u uic
And the convergence issue disappear.
@Raiser ,
By default, QSpice uses a MAXTIMESTEP = Maximum simulation time/1024 as @KSKelvin stated.
Therefore when Maximum sim time =
QSpice’s default MAXTIMESTEP is adaptive based on the max timestep allowed by other components in the circuit. For example, some of my CBlock function set the MAXTIMESTEP to lower values for the needed resolution of that circuit element. Other non-CBlock components might have similar time resolution values that could be invoked.
In the circuit you posted, I believe the only way to define the MAXTIMESTEP is globally for the simulation using the .tran statement with the MAXSTEP value set
Syntax: .tran IGNORED TSTOP [TSTART [MAXSTEP]] [UIC|SKIPBP]
Or you can use the directive
.option MAXSTEP=1u // with 1us as the desired MAXTIMESTEP value.
Good luck.
Thanks everyone
. Appreciate you guys.