ThunderBorg watchdog timer?
Forums:
I was test-driving my MonsterBorg with a Python program using the SetMotor1() and SetMotor2() functions. While the robot was in motion, the Linux O/S on the Raspberry Pi crashed and I lost control. The robot continued to move forward, however, and I could not stop it except by picking it up and turning off the power switch.
Do you currently have a watchdog timer or hearbeat function available in the ThunderBorg, or can you add one? I think this functionality has to be in the firmware on the ThunderBorg, then made available by functions in ThunderBorg.py.
piborg
Mon, 02/26/2018 - 18:28
Permalink
Communications failsafe
We do have a function on the ThunderBorg for this which will stop both motors if the Raspberry Pi stops sending commands. The command you will need is
TB.SetCommsFailsafe(True)
.What this does is turn on a watchdog in the ThunderBorg which counts how long it has been since it last heard from the Raspberry Pi. If it has been more than a third of a second it stops both motors and the LED starts flashing red and yellow to indicate it has disabled the motors.
Our
monsterJoy.py
example enables the failsafe and gets a confirmation that it is enabled towards the top of the script:Remember the motors will be turned off unless something is sent to the ThunderBorg regularly. This could be setting the motor speeds or similar at a regular interval (which our example does), or it could be reading something from the board (e.g.
TB.GetBatteryReading()
).You can turn the functionality off again using
TB.SetCommsFailsafe(False)
. The ThunderBorg will power on with it turned off.