Avalanche breakdown in BLDC controller mosfets

When the motor power supply of controller suddenly falls from 50V to 24V,Then due to sudden change in voltage avalanche occurs in the mosfets and causes them to break apart.
Using a free wheeling diode can help avoid avalanche 

bootstrap builder

Why does avalanche occur in power mosfet

The diagram shows the processes involved.

1

Diode breakdown

 the p-n junction acting as a diode no longer
blocks voltage

3

Resistance increase

The power dissipation increases temperature, thus
increasing RB, since silicon resistivity increases with
temperature. 

2

High electric field

This strong electric field causes maximum current flow in close proximity to the parasitic BJT, 

4

Sufficient voltage drop
When the voltage drop is sufficient to forward bias the parasitic BJT, it will turn on with potentially catastrophic results, as control of the switch is lost.

Mobirise

Calculations

During avalanch the energy produced should be below 13 mJ for IRF540N(from the datasheet).From the above graph and below eq-1 we have avalanch energy (assuming motor inductance to be 3mH and current to be 10Amps measured during experiment).
This equals to 16mJouls, which is bigger than13mJouls as ber datasheet.Hence the mosfet avalanche

Mobirise