From 2febd8ec82fb65d3e3a0a0fc669b445895cddba7 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 28 Sep 2016 14:01:59 -0500 Subject: [PATCH] Double-touch debugging --- Marlin/Marlin_main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d6045438a3..2eec565212 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2027,6 +2027,12 @@ static void clean_up_after_endstop_or_probe_move() { // Do a first probe at the fast speed do_probe_move(-(Z_MAX_LENGTH) - 10, Z_PROBE_SPEED_FAST); + #if ENABLED(DEBUG_LEVELING_FEATURE) + float first_probe_z = current_position[Z_AXIS]; + if (DEBUGGING(LEVELING)) + SERIAL_ECHOPAIR("1st Probe Z:", first_probe_z); + #endif + // move up by the bump distance do_blocking_move_to_z(current_position[Z_AXIS] + home_bump_mm(Z_AXIS), MMM_TO_MMS(Z_PROBE_SPEED_FAST)); @@ -2047,6 +2053,13 @@ static void clean_up_after_endstop_or_probe_move() { if (DEBUGGING(LEVELING)) DEBUG_POS("<<< run_z_probe", current_position); #endif + // Debug: compare probe heights + #if ENABLED(PROBE_DOUBLE_TOUCH) && ENABLED(DEBUG_LEVELING_FEATURE) + if (DEBUGGING(LEVELING)) { + SERIAL_ECHOPAIR("2nd Probe Z:", current_position[Z_AXIS]); + SERIAL_ECHOLNPAIR(" Discrepancy:", first_probe_z - current_position[Z_AXIS]); + } + #endif return current_position[Z_AXIS]; }