diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2020-09-03 16:22:54 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2020-09-03 16:22:54 -0400 |
commit | 1f3a160f47175c44722a3ce1e58e90c359b99c99 (patch) | |
tree | b3dec7de83cea37073ffafa557b8b28b3304b8d3 /klippy/kinematics/polar.py | |
parent | d0ed6e57050d280a412f82e17d2de56a5b8280ad (diff) | |
download | kutter-1f3a160f47175c44722a3ce1e58e90c359b99c99.tar.gz kutter-1f3a160f47175c44722a3ce1e58e90c359b99c99.tar.xz kutter-1f3a160f47175c44722a3ce1e58e90c359b99c99.zip |
toolhead: Add a move.move_error() helper
Move the EndstopMoveError() code from homing.py to a new method in the
toolhead Move class.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/kinematics/polar.py')
-rw-r--r-- | klippy/kinematics/polar.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/klippy/kinematics/polar.py b/klippy/kinematics/polar.py index 904ccf55..93ab59d2 100644 --- a/klippy/kinematics/polar.py +++ b/klippy/kinematics/polar.py @@ -94,18 +94,17 @@ class PolarKinematics: xy2 = end_pos[0]**2 + end_pos[1]**2 if xy2 > self.limit_xy2: if self.limit_xy2 < 0.: - raise homing.EndstopMoveError(end_pos, "Must home axis first") - raise homing.EndstopMoveError(end_pos) + raise move.move_error("Must home axis first") + raise move.move_error() if move.axes_d[2]: if end_pos[2] < self.limit_z[0] or end_pos[2] > self.limit_z[1]: if self.limit_z[0] > self.limit_z[1]: - raise homing.EndstopMoveError( - end_pos, "Must home axis first") - raise homing.EndstopMoveError(end_pos) + raise move.move_error("Must home axis first") + raise move.move_error() # Move with Z - update velocity and accel for slower Z axis z_ratio = move.move_d / abs(move.axes_d[2]) - move.limit_speed( - self.max_z_velocity * z_ratio, self.max_z_accel * z_ratio) + move.limit_speed(self.max_z_velocity * z_ratio, + self.max_z_accel * z_ratio) def get_status(self, eventtime): xy_home = "xy" if self.limit_xy2 >= 0. else "" z_home = "z" if self.limit_z[0] <= self.limit_z[1] else "" |