diff options
author | janherich <jan.herich@gmail.com> | 2022-11-30 23:33:24 +0100 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2022-12-30 21:39:32 -0500 |
commit | 29ba5ab05af87a4cab88da0157a97fc3b97354ae (patch) | |
tree | 9cebcf14801b3473c34c216e0aca72bfee3bdd2a /klippy/kinematics | |
parent | 1ff0a5494aba59cffb3a912c82e474aa5eebdd03 (diff) | |
download | kutter-29ba5ab05af87a4cab88da0157a97fc3b97354ae.tar.gz kutter-29ba5ab05af87a4cab88da0157a97fc3b97354ae.tar.xz kutter-29ba5ab05af87a4cab88da0157a97fc3b97354ae.zip |
delta: Better delta build volume constraint check
Existing code uses very restrictive build volume constraint checking
with just narrow cone on top of fully cylinder for delta printers.
Code here implements more permissive and still safe build volume
constraint checks.
Signed-off-by: Jan Herich <jan.herich@gmail.com>
Diffstat (limited to 'klippy/kinematics')
-rw-r--r-- | klippy/kinematics/delta.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/klippy/kinematics/delta.py b/klippy/kinematics/delta.py index 2278dbca..bb81ab18 100644 --- a/klippy/kinematics/delta.py +++ b/klippy/kinematics/delta.py @@ -65,6 +65,8 @@ class DeltaKinematics: self.min_z = config.getfloat('minimum_z_position', 0, maxval=self.max_z) self.limit_z = min([ep - arm for ep, arm in zip(self.abs_endstops, arm_lengths)]) + self.min_arm_length = min_arm_length = min(arm_lengths) + self.min_arm2 = min_arm_length**2 logging.info( "Delta max build height %.2fmm (radius tapered above %.2fmm)" % (self.max_z, self.limit_z)) @@ -123,7 +125,11 @@ class DeltaKinematics: end_z = end_pos[2] limit_xy2 = self.max_xy2 if end_z > self.limit_z: - limit_xy2 = min(limit_xy2, (self.max_z - end_z)**2) + above_z_limit = end_z - self.limit_z + allowed_radius = self.radius - math.sqrt( + self.min_arm2 - (self.min_arm_length - above_z_limit)**2 + ) + limit_xy2 = min(limit_xy2, allowed_radius**2) if end_xy2 > limit_xy2 or end_z > self.max_z or end_z < self.min_z: # Move out of range - verify not a homing move if (end_pos[:2] != self.home_position[:2] |