Dynamic Braking resistor chopper circuit
What you are presenting is an extremely common method to deal with the regenerative energy. It is a simple chopper circuit to regulate the DClink voltage via dissipating the energy in the resistor
Whether the hysteresis is done in the hardware domain (your comparator) or in software comes down to system architecture.  I have personally done both
Two additional considerations

Please place a diode across the brake resistor.
The inductance of such a resistor &amp; leads can produce a destructive voltage. There is always stray inductance, but aspects of power electronics can cause the &quot;inductive kick&quot; to be a real problem. Lead lengths tend to be longer &amp; equally the current involved higher. Both these contribute to a higher V due to \$L\frac{\Delta I}{\Delta t}\$

Consider a second comparator for an over-voltage.


If the brake circuit fails you could cascade a failure during deceleration. Overvolting power-electronics has a habit of exploding.
Imagine the situation where your brake circuit failed (undersized resistor, random failure of the resistor, FET, comparator etc...). Your controller will still decelerate transfering the inductive and rotational energy to the DClink. Normally this would be regulated by the chopper, however this no longer exists &amp; the DClink will carry on rising as long as there is energy to be transferred. At some point something will reach its avalanche voltage: Inverter or Capacitor. The energy stored in the capacitor, \$\frac{1}{2}CV^2\$ will now rapidly dissipate &amp; further failures can &amp; do occur.