aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/bed_mesh.py
diff options
context:
space:
mode:
authorArksine <arksine.code@gmail.com>2018-08-17 12:08:37 -0400
committerKevinOConnor <kevin@koconnor.net>2018-08-19 16:52:23 -0400
commit52df40dfbb5596c3190ba4a5cd79fd3af87a71b3 (patch)
treece0de0c00e5d91881563152a7647714c110eebb1 /klippy/extras/bed_mesh.py
parent08aacec0b2616c9b836feb4c22c6e121595bb29e (diff)
downloadkutter-52df40dfbb5596c3190ba4a5cd79fd3af87a71b3.tar.gz
kutter-52df40dfbb5596c3190ba4a5cd79fd3af87a71b3.tar.xz
kutter-52df40dfbb5596c3190ba4a5cd79fd3af87a71b3.zip
bed_mesh: update z_offset check
Only check the probe's z_offset against the stepper_z endstop position if the probe is used as a virtual endstop. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Diffstat (limited to 'klippy/extras/bed_mesh.py')
-rw-r--r--klippy/extras/bed_mesh.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/klippy/extras/bed_mesh.py b/klippy/extras/bed_mesh.py
index 4c006ea2..9752030f 100644
--- a/klippy/extras/bed_mesh.py
+++ b/klippy/extras/bed_mesh.py
@@ -136,10 +136,11 @@ class BedMeshCalibrate:
points = self._generate_points(config)
self._init_probe_params(config, points)
self.probe_helper = probe.ProbePointsHelper(config, self, points)
- self.z_offset_check = None
+ self.z_endstop_pos = None
if config.has_section('stepper_z'):
zconfig = config.getsection('stepper_z')
- self.z_offset_check = zconfig.getfloat('position_endstop', None)
+ self.z_endstop_pos = zconfig.getfloat(
+ 'position_endstop', None)
self.gcode = self.printer.lookup_object('gcode')
self.gcode.register_command(
'BED_MESH_CALIBRATE', self.cmd_BED_MESH_CALIBRATE,
@@ -230,13 +231,16 @@ class BedMeshCalibrate:
else:
print_func("bed_mesh: bed has not been probed")
def finalize(self, z_offset, positions):
- if self.z_offset_check is not None:
- if self.z_offset_check != z_offset:
+ if self.probe_helper.get_last_xy_home_positon() is not None \
+ and self.z_endstop_pos is not None:
+ # Using probe as a virtual endstop, warn user if the
+ # stepper_z position_endstop is different
+ if self.z_endstop_pos != z_offset:
z_msg = "bed_mesh: WARN - probe z_offset is not" \
" equal to Z position_endstop\n"
z_msg += "[probe] z_offset: %.4f\n" % z_offset
z_msg += "[stepper_z] position_endstop: %.4f" \
- % self.z_offset_check
+ % self.z_endstop_pos
logging.info(z_msg)
self.gcode.respond_info(z_msg)
x_cnt = self.probe_params['x_count']