Skip to content

Commit

Permalink
Bed mesh: add lift speed
Browse files Browse the repository at this point in the history
Toolhead moves very quickly during bed mesh calibration
and was no ability configure this speed

This commit adds ability to configure bed lift speed

Signed-off-by: Vasyl Uhlytskyi <[email protected]>
  • Loading branch information
gatools committed Feb 15, 2024
1 parent 1b24f6a commit 0be4cf5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
3 changes: 3 additions & 0 deletions docs/Config_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,9 @@ information.
#horizontal_move_z: 5
# The height (in mm) that the head should be commanded to move to
# just prior to starting a probe operation. The default is 5.
#probe_lift_speed: 5
# The speed (in mm/s) when moving from a horizontal_move_z position
# to a probe_height position. The default is 5.
```

### [bed_screws]
Expand Down
4 changes: 2 additions & 2 deletions klippy/extras/bed_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ def __init__(self, config):
self.bmc = BedMeshCalibrate(config, self)
self.z_mesh = None
self.toolhead = None
self.horizontal_move_z = config.getfloat('horizontal_move_z', 5.)
self.fade_start = config.getfloat('fade_start', 1.)
self.fade_end = config.getfloat('fade_end', 0.)
self.fade_dist = self.fade_end - self.fade_start
Expand Down Expand Up @@ -249,7 +248,8 @@ def cmd_BED_MESH_OUTPUT(self, gcmd):
gcmd.respond_info("Bed has not been probed")
else:
self.z_mesh.print_probed_matrix(gcmd.respond_info)
self.z_mesh.print_mesh(gcmd.respond_raw, self.horizontal_move_z)
self.z_mesh.print_mesh(gcmd.respond_raw,
self.bmc.probe_helper.horizontal_move_z)
cmd_BED_MESH_MAP_help = "Serialize mesh and output to terminal"
def cmd_BED_MESH_MAP(self, gcmd):
if self.z_mesh is not None:
Expand Down
11 changes: 3 additions & 8 deletions klippy/extras/probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def __init__(self, config, finalize_callback, default_points=None):
self.speed = config.getfloat('speed', 50., above=0.)
self.use_offsets = False
# Internal probing state
self.lift_speed = self.speed
self.lift_speed = config.getfloat('probe_lift_speed', 5.)
self.probe_offsets = (0., 0., 0.)
self.results = []
def minimum_points(self,n):
Expand All @@ -394,11 +394,8 @@ def get_lift_speed(self):
def _move_next(self):
toolhead = self.printer.lookup_object('toolhead')
# Lift toolhead
speed = self.lift_speed
if not self.results:
# Use full speed to first probe position
speed = self.speed
toolhead.manual_move([None, None, self.horizontal_move_z], speed)
toolhead.manual_move([None, None, self.horizontal_move_z],
self.lift_speed)
# Check if done probing
if len(self.results) >= len(self.probe_points):
toolhead.get_last_move_time()
Expand All @@ -424,12 +421,10 @@ def start_probe(self, gcmd):
def_move_z)
if probe is None or method != 'automatic':
# Manual probe
self.lift_speed = self.speed
self.probe_offsets = (0., 0., 0.)
self._manual_probe_start()
return
# Perform automatic probing
self.lift_speed = probe.get_lift_speed(gcmd)
self.probe_offsets = probe.get_offsets()
if self.horizontal_move_z < self.probe_offsets[2]:
raise gcmd.error("horizontal_move_z can't be less than"
Expand Down

0 comments on commit 0be4cf5

Please sign in to comment.