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
@@ -212,7 +212,8 @@ class Panel:
|
||||
|
||||
def status(self):
|
||||
st = self.c.status
|
||||
return {'state': 'Disconnected' if not self.connected else self.busy or (st.state + (':' + st.sub if st.sub else '')),
|
||||
state = 'Motors off' if st.state == 'Sleep' else st.state + (':' + st.sub if st.sub else '')
|
||||
return {'state': 'Disconnected' if not self.connected else self.busy or state,
|
||||
'connected': self.connected,
|
||||
'theta': st.wpos[0], 'rho': st.wpos[1], 'switch': 'Y' in st.pins, 'pins': st.pins,
|
||||
'homed': self.homed, 'steps': self.steps, 'error': self.error}
|
||||
@@ -224,6 +225,9 @@ class Panel:
|
||||
feed = 1200 if axis == 'X' else 600 # 20 deg/s, 10 mm/s
|
||||
with self.lock:
|
||||
st = self.c.query()
|
||||
if st.state == 'Sleep': # motors switched off after a design: wake them
|
||||
self.c.unlock()
|
||||
st = self.c.query()
|
||||
if st.state == 'Alarm':
|
||||
return False, 'alarm: press Unlock first'
|
||||
inward = axis == 'Y' and d < 0
|
||||
@@ -263,6 +267,7 @@ class Panel:
|
||||
|
||||
def unlock(self):
|
||||
with self.lock:
|
||||
self.c.unlock() # also wakes the motors after a design
|
||||
self.c.command('$X')
|
||||
return True, 'unlocked'
|
||||
|
||||
|
||||
Reference in new issue
Block a user