proficnc / The-Cube

home of the cube Autopilot
https://www.cubePilot.com
122 stars 273 forks source link

The Cube: SAFETY is not 5V tolerant #56

Closed kh4 closed 3 years ago

kh4 commented 4 years ago

Describe the bug I recently got my hands on two Cube which both had issues with safety button acting up, analysis of the problem revealed that both of them had the IO pin for the safety (PB5 on IOMCU) shorted to ground on the MCU i.e. the drive circuit on the MCU itself was burnt.

Analysis of the schematic revealed that the pin used is not 5V tolerant (as per ST datasheet) and it is directly wired to the GPS1 port on the carrier (with 1k5 pulldown). Both the supplied safety button wire and (as far as I see) the HERE GPS connects the safety signal directly to 5V rail which causes excessive current thru the CPU which in long term will cause the pin to malfunction.

The easiest solution would be to add a 820R resistor in series to act as a voltage divider.

kh4 commented 4 years ago

Actually HERE GPS is OK since it provides 3v3 to the safety signal from internal regulator.

As furher details I have measured current of 35mA on a brand new cube when button pulls to 5V rail (which of 3.3mA is sinked by the 1k5 resistor). This leaves over 30mA to the IO pin which is six times the injection limit of +-5mA in the CPU datasheet. (STM32F103 datasheet, table 7, Iinj for non 5V tolerant pins).

proficnc commented 4 years ago

My personal recommendations is to not use this as a “safety” button

It’s a stupid idea to put your hands near a live vehicle to push a single pole momentary button and to expect that the vehicle is now safe.

The only effective method to ensure safety is to unplug your batteries