From 772ad53e20d224475949a441781266f2c1bdf142 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 24 May 2019 22:54:35 -0400 Subject: [PATCH] manual_probe: Make sure the nozzle has moved during a manual probe Make sure the TESTZ procedure is followed prior to accepting a manual probe. Signed-off-by: Kevin O'Connor --- klippy/extras/manual_probe.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/klippy/extras/manual_probe.py b/klippy/extras/manual_probe.py index b816d6c8..bd17eccb 100644 --- a/klippy/extras/manual_probe.py +++ b/klippy/extras/manual_probe.py @@ -71,6 +71,7 @@ class ManualProbeHelper: self.gcode.respond_info( "Starting manual Z probe. Use TESTZ to adjust position.\n" "Finish with ACCEPT or ABORT command.") + self.start_z_position = self.toolhead.get_position()[2] self.report_z_status() def get_kinematics_pos(self): toolhead_pos = self.toolhead.get_position() @@ -115,6 +116,12 @@ class ManualProbeHelper: prev_str, z_pos, next_str)) cmd_ACCEPT_help = "Accept the current Z position" def cmd_ACCEPT(self, params): + if self.toolhead.get_position()[2] >= self.start_z_position: + self.gcode.respond_info( + "Manual probe failed! Use TESTZ commands to position the\n" + "nozzle prior to running ACCEPT.") + self.finalize(False) + return self.finalize(True) cmd_ABORT_help = "Abort manual Z probing tool" def cmd_ABORT(self, params):