diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2021-01-08 11:52:28 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2021-01-08 11:52:28 -0500 |
commit | c8434ec54b0517503af4aeee9016783d508118b0 (patch) | |
tree | 7229f2ea5c4f63a7fad9c46ef6f84adc614b96fa /klippy/kinematics/rotary_delta.py | |
parent | f79187d726d00c7215448e5953cdb0dd8d490683 (diff) | |
download | kutter-c8434ec54b0517503af4aeee9016783d508118b0.tar.gz kutter-c8434ec54b0517503af4aeee9016783d508118b0.tar.xz kutter-c8434ec54b0517503af4aeee9016783d508118b0.zip |
kinematics: Calculate axis_minimum/axis_maximum in advance
Calculate the get_status() axis_minimum and axis_maximum fields in
advance so that they don't need to be calculated on each get_status()
call.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/kinematics/rotary_delta.py')
-rw-r--r-- | klippy/kinematics/rotary_delta.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/klippy/kinematics/rotary_delta.py b/klippy/kinematics/rotary_delta.py index 2901ca60..39a28789 100644 --- a/klippy/kinematics/rotary_delta.py +++ b/klippy/kinematics/rotary_delta.py @@ -1,10 +1,10 @@ # Code for handling the kinematics of rotary delta robots # -# Copyright (C) 2019 Kevin O'Connor <kevin@koconnor.net> +# Copyright (C) 2019-2021 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. import math, logging -import stepper, mathutil, chelper, homing +import stepper, mathutil, chelper class RotaryDeltaKinematics: def __init__(self, toolhead, config): @@ -76,6 +76,9 @@ class RotaryDeltaKinematics: logging.info( "Delta max build height %.2fmm (radius tapered above %.2fmm)" % (self.max_z, self.limit_z)) + max_xy = math.sqrt(self.max_xy2) + self.axes_min = toolhead.Coord(-max_xy, -max_xy, self.min_z, 0.) + self.axes_max = toolhead.Coord(max_xy, max_xy, self.max_z, 0.) self.set_position([0., 0., 0.], ()) def get_steppers(self): return [s for rail in self.rails for s in rail.get_steppers()] @@ -122,13 +125,10 @@ class RotaryDeltaKinematics: limit_xy2 = -1. self.limit_xy2 = limit_xy2 def get_status(self, eventtime): - max_xy = math.sqrt(self.max_xy2) - axes_min = [-max_xy, -max_xy, self.min_z, 0.] - axes_max = [max_xy, max_xy, self.max_z, 0.] return { 'homed_axes': '' if self.need_home else 'XYZ', - 'axis_minimum': homing.Coord(*axes_min), - 'axis_maximum': homing.Coord(*axes_max) + 'axis_minimum': self.axes_min, + 'axis_maximum': self.axes_max, } def get_calibration(self): return self.calibration |