From bf85c61b4874a48929788c2e8030f1e59b71992c Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sat, 9 Sep 2017 14:45:10 -0400 Subject: [PATCH] corexy: Fix max_xy_halt_velocity calculation on corexy On corexy, the stepper velocity of a diagonal move could be greater than the maximum printer velocity. Account for that when setting the maximum xy halt velocity in the mcu stepper config. Signed-off-by: Kevin O'Connor --- klippy/corexy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/klippy/corexy.py b/klippy/corexy.py index b22a8dac..0bbbf910 100644 --- a/klippy/corexy.py +++ b/klippy/corexy.py @@ -3,7 +3,7 @@ # Copyright (C) 2017 Kevin O'Connor # # This file may be distributed under the terms of the GNU GPLv3 license. -import logging +import logging, math import stepper, homing StepList = (0, 1, 2) @@ -24,6 +24,7 @@ class CoreXYKinematics: self.limits = [(1.0, -1.0)] * 3 # Setup stepper max halt velocity max_xy_halt_velocity = toolhead.get_max_axis_halt(max_accel) + max_xy_halt_velocity *= math.sqrt(2.) self.steppers[0].set_max_jerk(max_xy_halt_velocity, max_accel) self.steppers[1].set_max_jerk(max_xy_halt_velocity, max_accel) max_z_halt_velocity = toolhead.get_max_axis_halt(self.max_z_accel)