EMF crash when cutting power to motors driven by H bridge relay

I'm building a new brain for a broken pool cleaning robot. It has two motors to move the thing and one for suction. I'm using an esp32 and five relays, one of the suction motor, and two for each of the drive motors in h bridge arrangements to provide forward and reverse. 5v for the ESP32 and relay coils is supplied by a voltage regulator that uses the same 24v that powers the motors. The supply claims to be a 400w unit (an LED PSU from AliExpress) and I think total load from all motors is under 200w.

When the motors start, all is well, but when they are stopped, the system usually crashes with the serial monitor showing that the last thing to happen was cutting the power to the motors.

I'm assuming I have some kind of EMF or power spike causing the microcontroller to crash. It does not reboot by itself so it doesn't seem to be simply loosing power. I could try a large PSU (1000w borrowed from my 3d printer) or try doing something to smooth the output from the 5v regulator. Or perhaps add a permanent load to the 24v supply so it's not dropping back to zero when motors stop. I also read about something called snubbing to address the EMF but I'm unclear on how to go about this.

Any advice?

Ps. I previously tried mosfet H bridge pwm modules which allowed me to gradually apply and withdraw power but these all blew up after a few minutes of use so I switched to using relays.

You can install kick back diodes across the motor connections if it's a DC motor.

All H-bridges for motors need those free-wheel diodes, whether semiconductor or relay. They should be rated for full current and voltage of the motor ideally.

Can't put diodes direct across motor terminals because I use them in forwards and reverse, switching polarity using the H bridge arrangement of relays.

However I found the following solution...

Good!

Using solid state bridges minimizes this problem as there is no arcing.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.