aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-03-08 12:34:13 -0500
committerKevin O'Connor <kevin@koconnor.net>2019-03-08 12:34:13 -0500
commit1b1d3f15d8fc23b24ed8235aed1dc6326d947b1e (patch)
tree975325c7cd19bfbc7c01d41032e0f847b688cc19
parenteac22df7cbe0e7058e12a2f1700319353943a5cf (diff)
downloadkutter-1b1d3f15d8fc23b24ed8235aed1dc6326d947b1e.tar.gz
kutter-1b1d3f15d8fc23b24ed8235aed1dc6326d947b1e.tar.xz
kutter-1b1d3f15d8fc23b24ed8235aed1dc6326d947b1e.zip
probe: Fix PROBE_CALIBRATE command
The z_offset calculation should have been calculated from the probe height to the measured bed position. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--klippy/extras/probe.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/klippy/extras/probe.py b/klippy/extras/probe.py
index f82a3a6e..3426ddb5 100644
--- a/klippy/extras/probe.py
+++ b/klippy/extras/probe.py
@@ -21,6 +21,7 @@ class PrinterProbe:
self.x_offset = config.getfloat('x_offset', 0.)
self.y_offset = config.getfloat('y_offset', 0.)
self.z_offset = config.getfloat('z_offset')
+ self.probe_calibrate_z = 0.
# Infer Z position to move to during a probe
if config.has_section('stepper_z'):
zconfig = config.getsection('stepper_z')
@@ -147,13 +148,13 @@ class PrinterProbe:
def probe_calibrate_finalize(self, kin_pos):
if kin_pos is None:
return
- z_pos = self.z_offset - kin_pos[2]
+ z_offset = self.probe_calibrate_z - kin_pos[2]
self.gcode.respond_info(
"%s: z_offset: %.3f\n"
"The SAVE_CONFIG command will update the printer config file\n"
- "with the above and restart the printer." % (self.name, z_pos))
+ "with the above and restart the printer." % (self.name, z_offset))
configfile = self.printer.lookup_object('configfile')
- configfile.set(self.name, 'z_offset', "%.3f" % (z_pos,))
+ configfile.set(self.name, 'z_offset', "%.3f" % (z_offset,))
cmd_PROBE_CALIBRATE_help = "Calibrate the probe's z_offset"
def cmd_PROBE_CALIBRATE(self, params):
# Perform initial probe
@@ -161,6 +162,7 @@ class PrinterProbe:
# Move away from the bed
toolhead = self.printer.lookup_object('toolhead')
curpos = toolhead.get_position()
+ self.probe_calibrate_z = curpos[2]
curpos[2] += 5.
self._move(curpos, self.speed)
# Move the nozzle over the probe point