From fdee2be49c5258145e269bf2588afa5cc9aae738 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 11 Apr 2016 00:06:33 -0700 Subject: [PATCH] More logging of matrix behavior --- Marlin/Marlin_main.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 23f1c2ba36..69fcc07048 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1351,8 +1351,14 @@ static void setup_for_endstop_move() { #if DISABLED(DELTA) static void set_bed_level_equation_lsq(double* plane_equation_coefficients) { + #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("BEFORE set_bed_level_equation_lsq", current_position); + plan_bed_level_matrix.set_to_identity(); + if (DEBUGGING(LEVELING)) { + vector_3 uncorrected_position = plan_get_position(); + DEBUG_POS(">>> set_bed_level_equation_lsq", uncorrected_position); + DEBUG_POS(">>> set_bed_level_equation_lsq", current_position); + } #endif vector_3 planeNormal = vector_3(-plane_equation_coefficients[0], -plane_equation_coefficients[1], 1); @@ -1371,7 +1377,7 @@ static void setup_for_endstop_move() { current_position[Z_AXIS] = corrected_position.z; #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("AFTER set_bed_level_equation_lsq", current_position); + if (DEBUGGING(LEVELING)) DEBUG_POS("<<< set_bed_level_equation_lsq", current_position); #endif sync_plan_position(); @@ -3059,7 +3065,11 @@ inline void gcode_G28() { #else //!DELTA #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("BEFORE matrix.set_to_identity", current_position); + if (DEBUGGING(LEVELING)) { + vector_3 corrected_position = plan_get_position(); + DEBUG_POS("BEFORE matrix.set_to_identity", corrected_position); + DEBUG_POS("BEFORE matrix.set_to_identity", current_position); + } #endif //vector_3 corrected_position = plan_get_position(); @@ -3071,7 +3081,7 @@ inline void gcode_G28() { current_position[Z_AXIS] = uncorrected_position.z; #if ENABLED(DEBUG_LEVELING_FEATURE) - if (DEBUGGING(LEVELING)) DEBUG_POS("AFTER matrix.set_to_identity", current_position); + if (DEBUGGING(LEVELING)) DEBUG_POS("AFTER matrix.set_to_identity", uncorrected_position); #endif sync_plan_position();