i currently attend a Powerelectronics course as Part of my Bachelor-Studies.
We did some basic Simulations of a Step-Down Converter in LT-Spice.
When i tried to replicate this Simulation in KiCad with ngspice i noticed some unexpected curves.
The current through the Transistor and the Diode seems to oscillate heavily.
The Oscillation seems to depend on the timestep(tstep) of the transient simulation in matters of amplitude and frequency.
When i chose a timestep of 50ns at a 50ms simulation window the oscillation fades out noticable.
On a timestep of 10^-4 of the simulation window like in one of the KiCad-Examples the oscillation stays large until the end of the 5ms switchmode halfperiod.
Just when i set the optional tmax to a amount of about tstep/10^2 or tstep/10^3 the results lock more simmilar to what i expected.
When i changed the models of the diode and the n-fet from the manufacturer-provided models to the ng-spice standard models the oscillation was also noticable but not that heavy.
(I also did a short test in Qspice to validate the LT-Spice result.)
Can someone please help me here or explain what is going on?
(My bad? wrong simulation settings?)
thanks for your Reply, seems like you are right.
with .options method=gear i got a Result that looks like expected and similar to the Results from LTspice.
Now i also noticed that not all parameters of the FET-Model were recognized by ngspice.
There is nothing you can do about the model parameters mentioned above, as they are not part of the ngspice MOS model MOS level=3, which has been used by Rohm. Externally you could add a resistor between drain and source RDS, which is 45 Meg Ohm according to the model parameter file you have provided. rg and rb don’t matter, as in the model there are some resistors serving this purpose already. I don’t know about n, which is not part of the PSPICE specification. LTSPICE say its the Bulk diode emission coefficient. This again is probably not that important and can be omitted…
If you are not sure, you should compare simulated data with the data sheet, e.g. with Figs. 5 and 6.
shame ngspice doesn’t have the trapdamp .option
gear is all well and good but it artificially suppressed these oscillations which does help with the simulation converging BUT sometimes these oscillations are real. for SMPS type sims this can be bad thing to suppress