This project helps in extending the upper voltage rating of an SMPS (for example, 24V/1A) from 250 Vrms to 380 Vrms while increasing its lowest voltage by about 4V only (for example, 96 Vrms to 100 Vrms).
The protecting circuit is added in series with the SMPS. It acts as an active high-voltage zener in series (this could be seen, on a scope, if the load is resistive) or as a virtual zener in parallel (this could also be seen, on a scope, if the load is an SMPS; the one I tested 24V/1A).
I uploaded in ProtSMPS_01.zip:
P380V_09_1000V.pdf , Kicad schematic
ProtSMPS_01.asc , LTspice schematic
ProtSMPS_01.plt , LTspice plot, useful when running the simulation
irfp460lc.txt , model of IRFP460 MOSFET
CD4000_v.lib , for CD4093B model
4N35_AL1.asy & 4N35_AL1.asc , model of 4N35 opto coupler
ProtSMPS_01.png , screenshot of LTspice stimulation at 380Vrms
Obviously, the size of the heatsink for the power MOSFET depends on the load.
Please note that it is just the first version. There will be surely better ways to implement such protection.