Skip to content

Commit

Permalink
添加ztil_retry变量, 记录Ztilt retry的次数.在retry时降低Z轴的运动距离.提高速度.
Browse files Browse the repository at this point in the history
  • Loading branch information
GuoGeTiertime committed Dec 6, 2024
1 parent 1c59a23 commit 3f3028c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion klippy/extras/probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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')
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions klippy/extras/z_tilt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3f3028c

Please sign in to comment.