Prevent sequences from hanging indefinitely when physical actuators jam or sensors fail by implementing Step Watchdogs.
Every step that waits for physical sensor feedback must attach a TON (On-Delay Timer) action instruction alongside an alternative transition:
[Step 10: Lower Drill]
| Action 1: cmd_Drill_Down (N)
| Action 2: tDrill_Watchdog (TON, 4000ms)
|
+------------+------------+
| |
(sDrill_Bottom) (tDrill_Watchdog.Q)
v v
[Step 11: Retract] [Step 99: Drill Jam Alarm]
Step 10).tDrill_WatchdogTON4000 (in milliseconds)sDrill_Bottom_Sensor -> leads to normal next step.tDrill_Watchdog.Q -> leads to Alarm Step.s10 = self.add_step(name="Lower_Drill")
s_alarm = self.add_step(name="Drill_Jam_Alarm")
self.add_transition(s10, s11, condition="sDrill_Bottom_Sensor")
self.add_transition(s10, s_alarm, condition="tDrill_Watchdog.Q")
s10.add_action("cmd_Drill_Down", "Engage drilling cylinder")
s10.add_action("tDrill_Watchdog", "Drill stroke watchdog", instruction=ActionInstruction.TON, duration=4000)