From: Joseph Coffland Date: Mon, 18 Jan 2021 23:47:44 +0000 (-0800) Subject: Use home/unhome to zero unhomed axis. X-Git-Url: https://git.buildbotics.com/?a=commitdiff_plain;h=fb918af5f6851520e7d37385f9841cf2ac4ea774;p=bbctrl-firmware Use home/unhome to zero unhomed axis. --- diff --git a/CHANGELOG.md b/CHANGELOG.md index cf13d27..6dbd8ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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>``. diff --git a/src/py/bbctrl/Mach.py b/src/py/bbctrl/Mach.py index 8a11efc..601e7f1 100644 --- a/src/py/bbctrl/Mach.py +++ b/src/py/bbctrl/Mach.py @@ -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):