gcode: Apply SET_GCODE_OFFSET to next move command

Apply the changes made by a SET_GCODE_OFFSET command to the next move,
even if the move is relative to the last movement.  This allows the
command to implement "babystepping" requests.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2018-05-29 14:09:04 -04:00
parent b93fd5b1b5
commit 1b1d2adb31
1 changed files with 3 additions and 1 deletions

View File

@ -533,7 +533,9 @@ class GCodeParser:
offset += self.get_float(axis + '_ADJUST', params) offset += self.get_float(axis + '_ADJUST', params)
else: else:
continue continue
self.base_position[pos] += offset - self.homing_position[pos] delta = offset - self.homing_position[pos]
self.last_position[pos] += delta
self.base_position[pos] += delta
self.homing_position[pos] = offset self.homing_position[pos] = offset
def cmd_M206(self, params): def cmd_M206(self, params):
# Offset axes # Offset axes