I have done following circuit:
The problem is that sometimes the mosfet M1 switch on continuously although at mosfet gate the signal goes from 12 to 0 V ok. Can be due a initial glitch that turn on the mosfet forever?
NOTE: L2 and L3 simulates power line parasitics, and C2 is set to avoid voltage peaks during switching off, also D1 and C1 avoids peaks at the source of the mosfet.
The problem is that sometimes the mosfet M1 switch on continuously although at mosfet gate the signal goes from 12 to 0 V ok. Can be due a initial glitch that turn on the mosfet forever?
NOTE: L2 and L3 simulates power line parasitics, and C2 is set to avoid voltage peaks during switching off, also D1 and C1 avoids peaks at the source of the mosfet.