A safe shutdown was not just another command.
The actuator documentation required a particular power-down sequence, but the controller did not enforce it. I added a configuration-gated shutdown path: an explicit state machine in the control thread, with a guard and a bounded wait on every transition.
| From | Event | To | Guard / timeout |
|---|---|---|---|
| OPERATIONAL | shutdown requested | SHUTDOWN_PENDING | motion stopped, confirmed by feedback |
| SHUTDOWN_PENDING | step acknowledged | DISABLED | bounded wait per step; timeout raises a fault |
| any state | fault detected | FAULTED | immediate; never runs the orderly sequence |
Fault shutdown stays a separate path because disabling a brakeless arm changes the hazard: remove drive power and gravity takes over, so "disabled" is not "safe", and the fault response must not share code with the orderly sequence. Then I checked the actual frames on a bench: gtest pins the transitions, packet captures confirm the frames leave in the documented order. The useful result was not only the feature; it was making the assumptions, exception, and evidence visible.
Evidence: state-transition tests, fault-path tests, packet captures, bench handover.