tomatix7
Posts: 2
Joined: Thu Apr 25, 2019 9:27 pm

Raspberry Pi Robot failure protection

Thu Apr 25, 2019 9:47 pm

Dear Community,

I recently built a robot with a raspberry pi 3B which is quite large (two meters long and 60 kilograms) and walks on six legs. It is language controlled by pocketsphinx and streaming live high resolution video, which means cpu is always at about 35%. Everything was working great until today. Without any specific reason, suddenly the raspberry pi crashed and shut down, but while motors where running. The motors have pushbuttons which are pressed when the legs reach the maximum amplitude, and they stop the motors. Unfortunately, at the time of the crash three motors where still running, and the pi didn't shut them down and didn't detect it when the pushbuttons where pressed. So the motors just run further happily also when they reached the maximum amplitude until I pulled the power supply one second later. The result: Several mechanical parts where bend and one motor relay doesn't work any more (before I changed it.) My question: what are good methods to prevent something like this? I have thought about using a microcontroller which gets a signal from the pi every 0.05 seconds and disconnects power with a large relay from all peripherals in case of certain circumstances which predict a failure (signal from pi does not come or accumulator voltage is not ok). Everything that happened now is reparable, but if this happens with a larger, maybe industrial machine it might cause great trouble. I have had these failures a few times, but the other times it happened when my speakers where running, so I lost contol of them, which is annoying, but not fatal. I also will transfer speecn recognition to a remote server as sooon as possible. But the RPi should really be capable of this.

Thanks in advance.

User avatar
Joel_Mckay
Posts: 289
Joined: Mon Nov 12, 2012 10:22 pm
Contact: Website

Re: Raspberry Pi Robot failure protection

Fri Apr 26, 2019 9:15 am

Several big red mushroom buttons that say "Emergency Stop" to cut the main power for a start.
;-)

The rather macabre "Dead man's switch" predates the modern computer age:
https://en.wikipedia.org/wiki/Dead_man%27s_switch

This is usually implemented with several redundant pic/atmel mcus with their own watchdog timers (0.2s to reboot), main processor CRC pings, and other hardware sanity checks. Thus,. if the brain is acting crazy or fails roll-call, the subsystems stop everything by auto-tripping an emergency-Stop (sometimes stopping a system involves breaking the machine in a controlled and safe manner).

This is why many larger platforms have a fail-locked on power-loss strategy for their drive systems.... so if something is out of spec, a system doesn't damage itself or the people nearby... Thinking about failure modes before they happen is wise.

Stay safe, as some mistakes don't offer an opportunity to learn something noteworthy for next time. ;-)
J

User avatar
Burngate
Posts: 5939
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Raspberry Pi Robot failure protection

Fri Apr 26, 2019 9:43 am

tomatix7 wrote:
Thu Apr 25, 2019 9:47 pm
... suddenly the raspberry pi crashed and shut down, but while motors where running. The motors have pushbuttons which are pressed when the legs reach the maximum amplitude, and they stop the motors. Unfortunately, at the time of the crash three motors where still running, and the pi didn't shut them down and didn't detect it when the pushbuttons where pressed.
Stopping the motors shouldn't rely on the Pi - the "pushbuttons" detecting "maximum amplitude" should directly disconnect power from the motors.
Or rather, the pushbuttons should only allow the motors to be powered if a safe condition is detected.

tomatix7
Posts: 2
Joined: Thu Apr 25, 2019 9:27 pm

Re: Raspberry Pi Robot failure protection

Fri Apr 26, 2019 8:39 pm

Thank you for your replies. I think I will go for atmels. I repaired everything today. By the way, if you want to have a look: https://youtu.be/MKo8ffhZFa0

Return to “Automation, sensing and robotics”