From 3f3028cf48e98ed6480bf2428449b84f4cbd4ada Mon Sep 17 00:00:00 2001 From: guoge Date: Fri, 6 Dec 2024 18:32:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0ztil=5Fretry=E5=8F=98?= =?UTF-8?q?=E9=87=8F,=20=E8=AE=B0=E5=BD=95Ztilt=20retry=E7=9A=84=E6=AC=A1?= =?UTF-8?q?=E6=95=B0.=E5=9C=A8retry=E6=97=B6=E9=99=8D=E4=BD=8EZ=E8=BD=B4?= =?UTF-8?q?=E7=9A=84=E8=BF=90=E5=8A=A8=E8=B7=9D=E7=A6=BB.=E6=8F=90?= =?UTF-8?q?=E9=AB=98=E9=80=9F=E5=BA=A6.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- klippy/extras/probe.py | 7 ++++++- klippy/extras/z_tilt.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/klippy/extras/probe.py b/klippy/extras/probe.py index 51b3e5d569ef..d703658e1057 100644 --- a/klippy/extras/probe.py +++ b/klippy/extras/probe.py @@ -473,6 +473,7 @@ def __init__(self, config, finalize_callback, default_points=None): self.lift_speed = self.speed self.probe_offsets = (0., 0., 0.) self.manual_results = [] + self.ztil_retry = 0 def minimum_points(self,n): if len(self.probe_points) < n: raise self.printer.config_error( @@ -491,7 +492,10 @@ def _raise_tool(self, is_first=False): if is_first: # Use full speed to first probe position speed = self.speed - self._move([None, None, self.horizontal_move_z], speed) + move_z = self.default_horizontal_move_z #add for ztilt retry, reduce the move_z distance when retry. 20241206 + if self.ztil_retry: + move_z = move_z * 0.3 + self._move([None, None, move_z], speed) def _invoke_callback(self, results): # Flush lookahead queue toolhead = self.printer.lookup_object('toolhead') @@ -514,6 +518,7 @@ def start_probe(self, gcmd): def_move_z = self.default_horizontal_move_z self.horizontal_move_z = gcmd.get_float('HORIZONTAL_MOVE_Z', def_move_z) + self.ztil_retry = 0 if probe is None or method == 'manual': # Manual probe self.lift_speed = self.speed diff --git a/klippy/extras/z_tilt.py b/klippy/extras/z_tilt.py index 8a6ff45bdf61..2b9fb4edff4b 100644 --- a/klippy/extras/z_tilt.py +++ b/klippy/extras/z_tilt.py @@ -149,6 +149,7 @@ def cmd_Z_TILT_ADJUST(self, gcmd): self.retry_helper.start(gcmd) self.probe_helper.start_probe(gcmd) def probe_finalize(self, offsets, positions): + self.probe_helper.ztil_retry = self.retry_helper.current_retry + 1 # Setup for coordinate descent analysis z_offset = offsets[2] logging.info("Calculating bed tilt with: %s", positions)