m5stack / M5StickC

M5StickC Arduino Library
MIT License
476 stars 221 forks source link

RoverC motor direction change causes ESP32 shutdown #140

Closed efeuentertainment closed 3 years ago

efeuentertainment commented 3 years ago

RoverC fast ( <0.5s ) motor direction change on battery charge of estimated 50% or less, causes ESP32 shutdown. (edit: happens on full battery too. does not happen when charging/plugged in)

it could be caused by a quick drop in voltage when motors have to change direction, that is when the motors require the most current. I can't seem to find the schematic for RoverC as that would help figure out from what power rail the motors are powered (Vbat on RoverC or 5V StickC out)

Will try a capacitor on the M5StickC Groove port next.

edit: Groove ports on StickC and RoverC are both 5V and a capacitor (4700uF or 10000uF) does not help. Servo ports on RoverC are Vbat 3.7V, same capacitor does not help either.

From noticing that there's no charge controller on the RoverC (only IC's are STM and 4x H-Bridge), i deduct that the Battery inside the StickC and RoverC are coupled together, and the StickC charges the RoverC together in a 1S2P configuration. There's probably some current protection in case the Charge states of both Cells aren't the same, possibly the thermal Fuse "A -".

This would explain how the Motors can crash/halt the StickC. Possible solutions could be: •higher coupling resistance or inductance (filter) between the 2 cells. •Capacitors on StickC 3.3V or Vbat. neither of which easily achievable. Ideas welcome

efeuentertainment commented 3 years ago

ok the 2 cells are indeed connected together. A high current draw from the motors will cause a voltage drop causing the ESP32 to crash.

i tried: •inline 10 Ohm resistance, didn't help. •inline small LC filter, didn't help. •inline LC filter + 10 Ohm resistance, didn't help. •Large 10'000uF Capacitor on 3.3V, 5V or Vbat. didn't help. •lower Axp Vbat cutoff and reducing LCD Brightness. setVOff(2.6V); screenbreath(9);. didn't help.

WHAT WORKED: •A current limiting FET P-CH set to 100mA using a 10 kOhm trim potentiometer. It's a IRF9504 P-Channel FET. source to VbatStick; Gate to middle pin of trim pot connected to VbatStick and GND; drain connected to VbatRover directly at the battery holders terminal to keep the Rover's power switch working. The Vbat header pin where the StickC is plugged into needs to be removed and routed to the FET. IMG_20210823_094104 IMG_20210818_184128 IMG_20210822_215916 edit to add: IMG_20210902_194445