aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/toolhead.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-02-12 14:33:06 -0500
committerKevin O'Connor <kevin@koconnor.net>2017-02-12 17:20:40 -0500
commit0ca96e543c1a00239e3c3818476c68898099a23e (patch)
tree35efbd169c0a09e18b2bcbdc72bbf305416d739b /klippy/toolhead.py
parentacb0b8f59967ff03e0b6eb1a98379eaaf1e27126 (diff)
downloadkutter-0ca96e543c1a00239e3c3818476c68898099a23e.tar.gz
kutter-0ca96e543c1a00239e3c3818476c68898099a23e.tar.xz
kutter-0ca96e543c1a00239e3c3818476c68898099a23e.zip
toolhead: Increase maximum stepper halt velocity
Do a better job of calculating the maximum halt velocity for the stepper motors. The maximum cornering velocity is related to both the maximum acceleration and the junction_deviation, so both should be in the formula. Tests show that "math.sqrt(8. * self.junction_deviation * self.max_accel)" very closely fits the maximum on cartesian robots. This fixes potential "no next step" shutdowns that could occur on some print moves. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/toolhead.py')
-rw-r--r--klippy/toolhead.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/klippy/toolhead.py b/klippy/toolhead.py
index 75ffe52b..1ab5b839 100644
--- a/klippy/toolhead.py
+++ b/klippy/toolhead.py
@@ -198,7 +198,9 @@ class ToolHead:
self.motor_off_time = self.reactor.NEVER
self.flush_timer = self.reactor.register_timer(self._flush_handler)
def build_config(self):
- xy_halt = 0.005 * self.max_accel # XXX
+ # Determine the maximum velocity a cartesian axis could have
+ # before cornering. The 8. was determined experimentally.
+ xy_halt = math.sqrt(8. * self.junction_deviation * self.max_accel)
self.kin.set_max_jerk(xy_halt, self.max_speed, self.max_accel)
self.extruder.set_max_jerk(xy_halt, self.max_speed, self.max_accel)
self.kin.build_config()