From 224574da4a623e3f37ebfe8082a546a9df697638 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Wed, 13 Nov 2019 17:59:40 -0500 Subject: stepper: Add get/set_tag_position() and convert calc_position() Rename calc_position() to calc_tag_position() and have it calculate the value of the position from the last stepper set_tag_position() call. This enables the calc_tag_position() code to be more flexible as it can be run with arbitrary positions. Signed-off-by: Kevin O'Connor --- klippy/kinematics/corexy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'klippy/kinematics/corexy.py') diff --git a/klippy/kinematics/corexy.py b/klippy/kinematics/corexy.py index 21901720..aa88406d 100644 --- a/klippy/kinematics/corexy.py +++ b/klippy/kinematics/corexy.py @@ -43,8 +43,8 @@ class CoreXYKinematics: if flags == "Z": return self.rails[2].get_steppers() return [s for rail in self.rails for s in rail.get_steppers()] - def calc_position(self): - pos = [rail.get_commanded_position() for rail in self.rails] + def calc_tag_position(self): + pos = [rail.get_tag_position() for rail in self.rails] return [0.5 * (pos[0] + pos[1]), 0.5 * (pos[0] - pos[1]), pos[2]] def set_position(self, newpos, homing_axes): for i, rail in enumerate(self.rails): -- cgit v1.2.3-70-g09d2