aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/kinematics
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-11-06 08:41:50 -0500
committerKevin O'Connor <kevin@koconnor.net>2019-11-06 15:51:51 -0500
commit86121ff79ef730a0a7a4d2d35f40cc01f7e1b9e7 (patch)
tree0bd56060e88f145b419b48b4aeeaf8ca5e6c1151 /klippy/kinematics
parent257058981eff9b0944029c101de5f18af2fbf914 (diff)
downloadkutter-86121ff79ef730a0a7a4d2d35f40cc01f7e1b9e7.tar.gz
kutter-86121ff79ef730a0a7a4d2d35f40cc01f7e1b9e7.tar.xz
kutter-86121ff79ef730a0a7a4d2d35f40cc01f7e1b9e7.zip
toolhead: Calculate and store axes_r in move class
Calculate the ratio of axis distance to total move distance (axis_d / move_d) and store in a new member variable axes_r. This avoids needing to recalculate the value in other code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/kinematics')
-rw-r--r--klippy/kinematics/extruder.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/klippy/kinematics/extruder.py b/klippy/kinematics/extruder.py
index 6b9245d4..7d702280 100644
--- a/klippy/kinematics/extruder.py
+++ b/klippy/kinematics/extruder.py
@@ -90,7 +90,7 @@ class PrinterExtruder:
def motor_off(self, print_time):
self.stepper.motor_enable(print_time, 0)
def check_move(self, move):
- move.extrude_r = move.axes_d[3] / move.move_d
+ move.extrude_r = move.axes_r[3]
move.extrude_max_corner_v = 0.
if not self.heater.can_extrude:
raise homing.EndstopError(
@@ -111,7 +111,7 @@ class PrinterExtruder:
# Permit extrusion if amount extruded is tiny
move.extrude_r = self.max_extrude_ratio
return
- area = move.axes_d[3] * self.filament_area / move.move_d
+ area = move.axes_r[3] * self.filament_area
logging.debug("Overextrude: %s vs %s (area=%.3f dist=%.3f)",
move.extrude_r, self.max_extrude_ratio,
area, move.move_d)
@@ -172,7 +172,7 @@ class PrinterExtruder:
return flush_count
def move(self, print_time, move):
axis_d = move.axes_d[3]
- axis_r = axis_d / move.move_d
+ axis_r = move.axes_r[3]
accel = move.accel * axis_r
start_v = move.start_v * axis_r
cruise_v = move.cruise_v * axis_r