Switch the motors off when the designs are done or stopped

After the last design (or a Stop), the player sends $SLP (GRBL and FluidNC
sleep), so the motors stop holding and the table is quiet. The page shows
"Motors off"; the next design wakes the controller (reset + unlock) and homes
first, since the arm can be moved by hand while the motors are off. The jog
panel wakes it too. Setting: motion.motors_off_when_done (default true).

Checked on the real Uno: Idle -> $SLP -> Sleep -> reset -> Alarm -> $X -> Idle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ckochandClaude Opus 5.5 committed 2026-11-01 14:19:12 -05:00
1 parent 8967271e90
commit 7afe562124
10 files changed
+104 -10

No files matched your search

+12
View File
@@ -353,6 +353,18 @@ def cmd_play(cfg, args):
def _play(c, cfg, args, items):
try:
_play_list(c, cfg, args, items)
finally:
if cfg['motion'].get('motors_off_when_done', True):
try:
c.motors_off() # done, stopped or failed: let the motors rest
print(' motors off')
except Exception:
pass # e.g. the USB link has gone
def _play_list(c, cfg, args, items):
if not args.no_home:
print(' homing rho ...', flush=True)
c.home_rho(cfg)