Controlling heater with PWM through MOSFET

It's probably not mostly from the inductance.

More likely, pulling close to 8 Amps from the battery has a significant effect on the battery voltage, and this changes the switching thresholds around the comparator generating the PWM signal.

You probably need to feed the LM393 and R3 from a lower noise supply, either R-C filtered (say 50 ohms and 1000 uf) from the battery, or perhaps better, from a 5V LDO regulator (with decoupling).

You can keep the pullup resistor R1 connected to the full battery voltage to turn on the FET as hard as possible, even with the LM393 supplied from 5V.

And as the voltage peaks exceed the battery voltage, inductance must be having some effect so the flyback diode is definitely recommended.


It's very probably the inductance. The mosfet turns off really fast and you get a V = L(di/dt) voltage spike. This turns on the zener protection in your mosfet and then the current runs around the rest of your circuit

A fly-back diode might do the trick.

Put the diode in parallel with the heater element with the cathode connected to the positive terminal.

Now when it is turned off the current will find a harmless path via the diode.

Careful. The diode will heat up with each cycle.

From your oscilloscope trace the oscillation time is about 100us

Current = about 10A

V of diode forward biased = 0.7V

E = VIT = 700 uJ ( I know this calc is cheating, it probably less than half this amount)

P = E*F (F = switching frequency)

if F = 1kHZ then P = 700mW

To select you diode multiply its power rating in Watts by your switching frequency in kHz.


I can see a very significant flaw in your circuit: The LM393 has an open collector output. So when the output goes "high" it effectively goes only "not low" and is pulled up via the R1=10k. The charge current flow into the MOSFET gate is also provided via R1, thus the turn-on is extremely slow. This is not a problem for the 1k dummy load, but with significant load current the MOSFET parasitics (e.g. Miller effect) can cause trouble of the kind you observe.

You need to modify your circuit to charge the MOSFET gate much faster via a low-impedance path, maybe via a bipolar totem-pole driver, see the TI Application Note "Design And Application Guide For High Speed MOSFET Gate Drive Circuits" (SLUP169) for reference.