Excessive voltage and current peaks

Reducing the time step improves the picture, but this may not be acceptable. On top of that, if you replace the diode built into Qspice, the calculation gets stuck.
BV.qsch (4.6 KB)

If you look for a result similar to LTspice, delete TT from your diode model to remove Qspice reverse recovery formula.

Did you try changing your solver to Gear?

Strange proposal. You don’t understand that I test Qspice and specifically come up with difficult problems for it.
In turn, I recommend that you replace the 1N4007D diode with a library 1N4007 and you will crash. I didn’t like the library model and I was right.

It does not help! The only thing that helps is reducing the maximum time step to 1 ns (.tran 0 240µ 180µ 1n ). This solution is not suitable in many cases.

In theory, where you expect your inductor energy should go when the switch is off?

Will it work better if you add TTOL=1n attribute to the switch? I have no computer access at this moment and not test this yet.

Of course, the inductive energy is dissipated by the diode during its breakdown. I counted this energy. I do not know the thermal capacity of the diode and therefore did not calculate overheating. Adding TTOL didn’t help.

As 1ns max step help, and I expect you don’t want 1ns max step other than switching moment, this is what to consider in Qspice.
Add a buffer in front of switch. You can define a TTOL for buffer if you need more timestep at switching moment. (In default, ¥-Device with TTOL=1us)
Default model Diode 1N4007 still not simulate in this setup, but model likes MURS160 can work. By far this is something I can think of.

I have a post about a study of TTOL device to interface analog and digital in Qspice. I am not sure why, but with a ¥-Device in front of a Switch normally work better with a Switch defines with a TTOL parameter.

TTOL device to Interface analog and digital - QSPICE - Qorvo Tech Forum

1 Like

Yes, you cleverly forced Qspice to do the calculation with a small step when switching. Regarding the 1N4007 model, it is worth thinking about replacing it with the correct one.

Sorry I didn’t realize this is time step issue at the beginning until you mentioned about 1ns can work. I found that for switching circuit in Qspice, where to have TTOL is very important or it can generate weird thing.