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:
1 parent
8967271e90
commit
7afe562124
10 files changed
+104
-10
No files matched your search
@@ -275,6 +275,13 @@ class Player:
|
||||
finally:
|
||||
c.guard = None
|
||||
c.abort = False
|
||||
if self.cfg['motion'].get('motors_off_when_done', True) and self.p.connected:
|
||||
try:
|
||||
c.motors_off() # done or stopped: let the motors rest
|
||||
self.p.homed = False # the arm can drift now, so home before the next one
|
||||
log('motors off')
|
||||
except Exception as e:
|
||||
log(f'could not switch the motors off: {e!r}')
|
||||
self.now = None
|
||||
self.state = 'idle'
|
||||
|
||||
|
||||
Reference in new issue
Block a user