Hello everyone

I'm trying to charge a capacitor from 20 uF a 500Vpp circa , in less than 1,5 seconds starting from a voltage of 12-15 Vdc . Once uploaded, I need to download it via short .

I managed to load it using the diagram I show you below .

The problem that arises is at the moment of the discharge of the capacitor C4 . The mos-fet Q1 remains in an anomalous condition that I show you via an uploaded image .

It does not get out of this condition until I turn off the power and then give it back again .

Maintaining the capacity of C3 at 22nF this anomalous condition does not present itself but , increasing this capacitance consequently reduces the capacitance reactance and therefore I can charge the capacitor C4 in the time required by me ; doing so though , the problem of the abnormal mos-fet condition comes up.

How could I solve this problem ?