aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/kinematics/hybrid_corexz.py
diff options
context:
space:
mode:
authorFrans-willem Hardijzer <fw@hardijzer.nl>2024-02-07 20:25:36 +0100
committerKevinOConnor <kevin@koconnor.net>2024-05-16 12:08:13 -0400
commitb7f7b8a346388cc32d80b6e6f60e5fdb4cbd3ce6 (patch)
tree5952b984887e0b6ce6aa7bb8f74eedb436518f3f /klippy/kinematics/hybrid_corexz.py
parent694d38c79105f2d33242487faa0532d1291ee7b6 (diff)
downloadkutter-b7f7b8a346388cc32d80b6e6f60e5fdb4cbd3ce6.tar.gz
kutter-b7f7b8a346388cc32d80b6e6f60e5fdb4cbd3ce6.tar.xz
kutter-b7f7b8a346388cc32d80b6e6f60e5fdb4cbd3ce6.zip
idex_modes: Bugfix for kinematic position calculation.
idex_mode would swap the X and dual-carriage rail in some cases (homing), but not in others. As such, the position calculation was correct while homing, but incorrect for the second carriage during normal moves. This commit fixes homing to work without swapped rails, removes the swapping of rails while homing, and removes the ability to swap rails (as it is now no longer used). Fix has been tested in a Hybrid_CoreXY IDEX printer (Voron Double Dragon). Hybrid_CoreXZ has identical changes and is similar enough that I am confident it will work as intended. Changes to cartesion seem simple enough, but would benefit from someone running a couple of tests. Signed-off-by: Frans-Willem Hardijzer <fw@hardijzer.nl>
Diffstat (limited to 'klippy/kinematics/hybrid_corexz.py')
-rw-r--r--klippy/kinematics/hybrid_corexz.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/klippy/kinematics/hybrid_corexz.py b/klippy/kinematics/hybrid_corexz.py
index 0eaea117..58e6b0d3 100644
--- a/klippy/kinematics/hybrid_corexz.py
+++ b/klippy/kinematics/hybrid_corexz.py
@@ -57,7 +57,7 @@ class HybridCoreXZKinematics:
pos = [stepper_positions[rail.get_name()] for rail in self.rails]
if (self.dc_module is not None and 'PRIMARY' == \
self.dc_module.get_status()['carriage_1']):
- return [pos[0] - pos[2], pos[1], pos[2]]
+ return [pos[3] - pos[2], pos[1], pos[2]]
else:
return [pos[0] + pos[2], pos[1], pos[2]]
def update_limits(self, i, range):
@@ -66,13 +66,15 @@ class HybridCoreXZKinematics:
# otherwise leave in un-homed state.
if l <= h:
self.limits[i] = range
- def override_rail(self, i, rail):
- self.rails[i] = rail
def set_position(self, newpos, homing_axes):
for i, rail in enumerate(self.rails):
rail.set_position(newpos)
- if i in homing_axes:
- self.limits[i] = rail.get_range()
+ for axis in homing_axes:
+ if self.dc_module and axis == self.dc_module.axis:
+ rail = self.dc_module.get_primary_rail().get_rail()
+ else:
+ rail = self.rails[axis]
+ self.limits[axis] = rail.get_range()
def note_z_not_homed(self):
# Helper for Safe Z Home
self.limits[2] = (1.0, -1.0)