LTspice: "Time Step Too Small" error with switch

Thread Starter

Anini_G

Joined Nov 11, 2023
2
Hello,

I am building a flyback converter in LTspice and I am doing an experiment of disconnecting the input power source and the transformer if the input voltage source exceeds 500 V. When I try to simulate the circuit, I get an error saying, "Analysis: Time step too small; time = 1e-005, timestep = 1.25e-019; trouble with mysw2-instance s2." I have attached my schematic below for reference. I don't know if it has anything to do with the behavioral voltage source causing the switch to alternate positions too quickly where the simulation just can't handle or it what. Guidance would be greatly appreciated. All components besides S2 are non-ideal. Thanks!
 

Attachments

eetech00

Joined Jun 8, 2013
3,820
Hello,

I am building a flyback converter in LTspice and I am doing an experiment of disconnecting the input power source and the transformer if the input voltage source exceeds 500 V. When I try to simulate the circuit, I get an error saying, "Analysis: Time step too small; time = 1e-005, timestep = 1.25e-019; trouble with mysw2-instance s2." I have attached my schematic below for reference. I don't know if it has anything to do with the behavioral voltage source causing the switch to alternate positions too quickly where the simulation just can't handle or it what. Guidance would be greatly appreciated. All components besides S2 are non-ideal. Thanks!
Three things:
1. B1 equation should be V = if (V(input) > 500,0,1) so the sim can converge at startup. This fixed the timestep problem.
2. Set the switches to reasonable values. SW2 Ron should be at least 1m or greater, assuming its a simulating a mosfet switch.
I set it to 20m ohms.
3. Add a reasonable serial resistance value to each voltage source.

I hope you realize that SW will turn off when the AC voltage crosses zero in the positive direction due to the 500vdc offset.
 
Top