I'm having trouble simulating what should be a simple circuit in LTspice. I am designing a simple PWM-regulated power supply, but I'm running into problems when I try to simulate it.
When I simulate it in Falstad circuit simulator I get a result I expect, that is that voltage is regulated proportionally to the PWM of the generator.
However, in LTspice I can't simulate this circuit with same and consistent result.
I tried constructing this circuit without ground connection, but LTspice gives me an error that it needs a ground connection. Then if I try to connect ground somewhere in this circuit, I am running into problems. If I connect it before the diode bridge, the diode bridge itself stops working and only works as a half-wave rectifier. If I try to connect it after the bridge, the simulation stops working correctly at all. It can slow down to simulating only a few us in one minute, I start getting either huge GV or small nV readings on the probe, lots of transients and artifacts.
How can I fix this to get correct simulation results in LTspice?