Use home/unhome to zero unhomed axis.
authorJoseph Coffland <joseph@cauldrondevelopment.com>
Mon, 18 Jan 2021 23:47:44 +0000 (15:47 -0800)
committerJoseph Coffland <joseph@cauldrondevelopment.com>
Mon, 18 Jan 2021 23:47:44 +0000 (15:47 -0800)
CHANGELOG.md
src/py/bbctrl/Mach.py

index cf13d27564be457d9be3bb6003ab2cfb02942f82..6dbd8ffe076b134fb587093d3a6cb862fe43136f 100644 (file)
@@ -8,6 +8,7 @@ Buildbotics CNC Controller Firmware Changelog
  - Support more gamepads.
  - Added copyright to LCD boot up.
  - Fixed default units handling. #206
+ - Fix zero-all when some axes are homed and some are unhomed.
 
 ## v0.4.15
  - Set GCode variables ``#5400`` and ``#<_tool>``.
index 8a11efc41e85bdd78ef161901d64729650609d41..601e7f1ec356cda624e7d33f3e96d02589a19fa0 100644 (file)
@@ -335,14 +335,9 @@ class Mach(Comm):
             self.mdi('G92%s%f' % (axis, position))
 
         elif state.is_axis_enabled(axis):
-            if self._get_cycle() != 'idle' and not self._is_paused():
-                raise Exception('Cannot set position during ' +
-                                self._get_cycle())
-
-            # Set the absolute position both locally and via the AVR
+            # Set absolute position via planner
             target = position + state.get('offset_' + axis)
-            state.set(axis + 'p', target)
-            super().queue_command(Cmd.set_axis(axis, target))
+            self.mdi('G28.3 %s%f\nG28.2 %s0' % (axis, target, axis))
 
 
     def override_feed(self, override):