Help! ESP32 burnt by Motor Drive Module.

human890209
Posts: 54
Joined: Wed Aug 15, 2018 8:56 am

Help! ESP32 burnt by Motor Drive Module.

Postby human890209 » Sun Apr 07, 2019 10:31 am

Hi, my dev board is MH-ET ESP32 Mini Kit.
I got issues by using PWM driving 2 N20 Motors(1:50, 6V).
I've found that sometimes my robot reboot when the motor start or change its direction.
So I make a simple programme to reproduce the error. Something like Blink Example, change 2 N20 Motor direction in full power.
I used L9110s Dual Moter Drive Module and the code was something like this:

Code: Select all

Motor()
{
	// ledc is 8 bit, 255 is full power
	// Direction 1
	ledcWrite(motor_1_channel_a, 255);
	ledcWrite(moter_1_channel_b, 0);
	ledcWrite(motor_2_channel_a, 255);
	ledcWrite(moter_2_channel_b, 0);
	delay(100);
	// Direction 2
	ledcWrite(motor_1_channel_a, 0);
	ledcWrite(moter_1_channel_b, 255);
	ledcWrite(motor_2_channel_a, 0);
	ledcWrite(moter_2_channel_b, 255);
	delay(100);
}
During the Motor switching directions, I also used I2C to get a MPU6050's Z angle and SPI to get a PS2 controller pad's input.(which
is needed by my robot project), I used Serial.print() to debug them.

I had an issue with my I2C MPU6050 with the motor test, the I2C communication seemed not working. The SPI PS2Controller works. And it seemed the Serial affected later.
Then, I damaged this MH-ET ESP32 Mini Kit with this motor test for about 3 minutes. The core got hot, and it's small LDO seems very hot, I couldn't touch it. No sketches could be uploaded to this damaged dev board.
I used another MH-ET ESP32 Mini Kit to continue the test, and I reproduced this I2C failure, it happened 100%, no randomness at all. This time, I didn't try another 3 minutes test.

And I switch to another drive module which using MX1508. Same result.
And I disconnect the Motor Drive Module and use 2 RGB LED to display my PWM status to check if my code is the reason.
No error was found. LEDs, MPU and SPI worked. And minutes passed, no damage to my dev board. I think it must be a hardware failure.

I'm not an expert in hardware. I know the motor is a 'dangerous' device so the motor uses a separate external power source. I got a 6V power to feed the Drive Module's Power Pins and connect only the 6V power's GND with my ESP32 Mini Kit's GND. My dev board was using USB's 5V as power. So there is only the PWM signal wires between the Drive Module and my ESP32.
I know when start or change direction, the motor will almost shortcut. That's why I make this test. Cause it's a usual situation for a robot in a race or competition. But I didn't know that move will damage the Microcontroller.

And I tried to slow down the speed. I used 10 to reproduce the I2C failure at which the motor didn't move at all.
I used 255 full power with no direction switch. Everything was fine. So there must be something in the PWM signal lines when motor's changes its direction.

Does the Motor Drive Module produce currents pulse in the Signal Lines which exceed ESP32's voltage or amp limits?
How to prevent that? The L9110s Module already gets 0.1uf capacity between the Motor Pins and 2 other capacities to the Power Pins.

username
Posts: 536
Joined: Thu May 03, 2018 1:18 pm

Re: Help! ESP32 burnt by Motor Drive Module.

Postby username » Sun Apr 07, 2019 1:13 pm

What would be more helpful it is give links to the exact modules you are using. And also what pins you have connected to them.

human890209
Posts: 54
Joined: Wed Aug 15, 2018 8:56 am

Re: Help! ESP32 burnt by Motor Drive Module.

Postby human890209 » Mon Apr 08, 2019 12:53 am

username wrote: What would be more helpful it is give links to the exact modules you are using. And also what pins you have connected to them.
ESP32 Mini Kit: https://www.aliexpress.com/item/MH-ET-L ... 07932.html
L9110s Dual Motor Driver: https://www.ebay.com/p/L9110s-2-Channel ... 812&chn=ps
MX1508 Motor Driver: https://www.aliexpress.com/item/1-5A-2- ... 83107.html
N20 Motor (6V, 300RPM , 200RPM): https://www.aliexpress.com/item/1Pc-Ele ... 66802.html

I used IO23, IO25, IO26, IO27 as PWM motor control pins.
I tried other pins, the same result. I tried LEDC at 1220Hz and SigmaDelta at 1220Hz, the same result.
I used IO22, IO21 as I2C's SCL and SDA.
I used IO18, IO17, IO16, IO19 as SPI's CLK, MISO, MOSI and CS pins.

human890209
Posts: 54
Joined: Wed Aug 15, 2018 8:56 am

Re: Help! ESP32 burnt by Motor Drive Module.

Postby human890209 » Mon Apr 08, 2019 1:05 am

More test, I narrow the error down to the power source and the motor.
I got 4 N20 motors in hand, 2 are 300 rpm and the other 2 is 200rpm.
I measure the electric resistance of them. One 300 rpm motor is 5.8Ω, the other motors are around 10.8~12.8Ω which explains why this 5.8Ω one is the fastest and the most powerful one in practice.
And I tested this 1st motor with an LED. I got the error!
I tested two of the weaker motors (one 300 rpm and one 200 rpm). No error.
I tested three of the weaker motors (1 300 rpm and 2 200rpm). I got the error.
I tested three of the weaker motors, but use my 6v to feed the 300rpm and 200rpm and use another 5v to feed the other 200rpm. No error.

It seems if the motor total instantaneous power exceeds the 6V power source, the error will happen.

I'm wondering why it will affect the ESP32, there is only one GND line between the 6V source and the ESP32.
Can anyone explain the laws of physics to me?

username
Posts: 536
Joined: Thu May 03, 2018 1:18 pm

Re: Help! ESP32 burnt by Motor Drive Module.

Postby username » Mon Apr 08, 2019 2:02 am

There is something that does not make sense here. I have done exactly the same thing as you. Not using the exact same parts mind you.
But basically the same motor driver and motor. I never had a issue when I would reverse the motor direction. The control lines and PWM signal are input only to the motor driver module. So i cannot see how it would reset your ESP32. If you are trully running the DC motor from a separate power source. the only thing that I can think of is what is your current capability of your 6v power source.
When you reverse the motor abruptly, you will get VERY high current demand. It may be crashing your 6v power source, and if so at that moment your ESP32 will try to inject a current into the board through its control lines, which might be then causing its 3.3.v power supply to crash causing the reset.

human890209
Posts: 54
Joined: Wed Aug 15, 2018 8:56 am

Re: Help! ESP32 burnt by Motor Drive Module.

Postby human890209 » Mon Apr 08, 2019 2:11 pm

username wrote: There is something that does not make sense here. I have done exactly the same thing as you. Not using the exact same parts mind you.
But basically the same motor driver and motor. I never had a issue when I would reverse the motor direction. The control lines and PWM signal are input only to the motor driver module. So i cannot see how it would reset your ESP32. If you are trully running the DC motor from a separate power source. the only thing that I can think of is what is your current capability of your 6v power source.
When you reverse the motor abruptly, you will get VERY high current demand. It may be crashing your 6v power source, and if so at that moment your ESP32 will try to inject a current into the board through its control lines, which might be then causing its 3.3.v power supply to crash causing the reset.
Hi, I believe your theory is right. My 6v power is a 6V 2A regulator module which source is a 7.4V battery. Today, the battery is about 7.4v, and the error gets some randomness, I could hardly reproduce the error. Then, I used a fully charged 8.4v battery and the error could be 100% reproduced. And then, I paralleled 2 regulator module to double the max current (not recommend to do so though), and the error can't be reproduced by test 4 motors together.
I'm now planning to switch to another Motor Driving IC HR9110s which got a logic VIN and a Motor VIN. If I power the Logic VIN with 3.3V and the Moter VIN with 6V when 6V is crashed, could the control line survive the shortcut?
HR9110.pdf
(1.13 MiB) Downloaded 669 times

username
Posts: 536
Joined: Thu May 03, 2018 1:18 pm

Re: Help! ESP32 burnt by Motor Drive Module.

Postby username » Mon Apr 08, 2019 2:54 pm

I have used this one, may not be what your looking for but it could prove out the issue because it has opto Isolators as inputs to protect your device.
https://www.amazon.com/gp/product/B078T ... UTF8&psc=1

human890209
Posts: 54
Joined: Wed Aug 15, 2018 8:56 am

Re: Help! ESP32 burnt by Motor Drive Module.

Postby human890209 » Tue Apr 09, 2019 12:09 am

username wrote: I have used this one, may not be what your looking for but it could prove out the issue because it has opto Isolators as inputs to protect your device.
https://www.amazon.com/gp/product/B078T ... UTF8&psc=1
Thanks. This one seems to be a much bigger one.
If I add an inductor behind my 6V regulator, will it help to limit the sudden HIGH current to maintain a more even current to prevent the power crash?

username
Posts: 536
Joined: Thu May 03, 2018 1:18 pm

Re: Help! ESP32 burnt by Motor Drive Module.

Postby username » Tue Apr 09, 2019 1:01 am

It all depends on how far it crashes. Best way is to protect the outputs from the ESP32

human890209
Posts: 54
Joined: Wed Aug 15, 2018 8:56 am

Re: Help! ESP32 burnt by Motor Drive Module.

Postby human890209 » Tue Apr 09, 2019 11:08 am

I connect the L9110s Drive board directly to my 7.2v Battery(8.4v) to test. L9110s can handle 12V in its datasheet.
Test about 3 minutes, the MPU and PS2Controller are good, but something wrong with the PWM controlling and my ESP32 is very hot.
I disconnect the power immediately to save my ESP32. I think maybe the L9110s got a shortcut in the extreme test.

Who is online

Users browsing this forum: No registered users and 122 guests