From b6ca15efd18e84e8e174ea38b953a21f3e3aaa44 Mon Sep 17 00:00:00 2001 From: Brian Kahl Date: Mon, 13 Sep 2021 11:46:28 -0500 Subject: [PATCH] Configuring the probe safe position --- Marlin/Configuration.h | 14 ++++++++++++++ Marlin/Configuration_adv.h | 10 +--------- Marlin/src/gcode/calibrate/M48.cpp | 16 +++------------- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 085b386f1..8af376e4c 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1570,6 +1570,20 @@ #define PROBING_MARGIN -9 #endif #endif + +//Defining a safe position to probe for M48 and PROBE_OFFSET_WIZARD +#if ANY(Sidekick_289, Sidekick_747) + #define PROBE_SAFE_POINT { X_CENTER, Y_CENTER } +#elif ENABLED(MiniV2) + #define PROBE_SAFE_POINT { -4, -4 } +#elif ENABLED(TAZ6) + #define PROBE_SAFE_POINT { -8, -8 } +#elif ENABLED(Workhorse) + #define PROBE_SAFE_POINT { -10, -10 } +#elif ANY(TAZPro, TAZProXT) + #define PROBE_SAFE_POINT { -9, -9 } +#endif + // X and Y axis travel speed (mm/min) between probes #define XY_PROBE_FEEDRATE (200*60) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 8cd83e8c3..44139e2f2 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1272,15 +1272,7 @@ #define PROBE_OFFSET_WIZARD_START_Z 1.0 // Set a convenient position to do the calibration (probing point and nozzle/bed-distance) - #if ANY(Sidekick_289, Sidekick_747) - #define PROBE_OFFSET_WIZARD_XY_POS { X_CENTER, Y_CENTER } - #elif ENABLED(MiniV2) - #define PROBE_OFFSET_WIZARD_XY_POS { -4, -4 } - #elif ENABLED(TAZ6) - #define PROBE_OFFSET_WIZARD_XY_POS { -8, -8 } - #elif ENABLED(Workhorse) - #define PROBE_OFFSET_WIZARD_XY_POS { -10, -10 } - #endif + #define PROBE_OFFSET_WIZARD_XY_POS PROBE_SAFE_POINT #endif #endif diff --git a/Marlin/src/gcode/calibrate/M48.cpp b/Marlin/src/gcode/calibrate/M48.cpp index 7afbf11ad..9ac332db2 100644 --- a/Marlin/src/gcode/calibrate/M48.cpp +++ b/Marlin/src/gcode/calibrate/M48.cpp @@ -28,6 +28,7 @@ #include "../../module/motion.h" #include "../../module/probe.h" #include "../../lcd/marlinui.h" +#include "../../../Configuration_adv.h" #include "../../feature/bedlevel/bedlevel.h" @@ -72,19 +73,8 @@ void GcodeSuite::M48() { const ProbePtRaise raise_after = parser.boolval('E') ? PROBE_PT_STOW : PROBE_PT_RAISE; - //setting tool head location to be above the front left washer if the printer uses nozzle as probe - #if ANY(Sidekick_289, Sidekick_747) - #define PROBE_OFFSET_XY_POS { X_CENTER, Y_CENTER } //place center to keep nozzle away from the edge of the bed - #elif ENABLED(MiniV2) - #define PROBE_OFFSET_XY_POS { -4, -4 } - #elif ENABLED(TAZ6) - #define PROBE_OFFSET_XY_POS { -8, -8 } - #elif ENABLED(Workhorse) - #define PROBE_OFFSET_XY_POS { -10, -10 } - #endif - - constexpr xy_pos_t probe_point = PROBE_OFFSET_XY_POS; - do_blocking_move_to_xy(probe_point); //moving toolhead to probe point + constexpr xy_pos_t probe_point = PROBE_SAFE_POINT; + do_blocking_move_to_xy(probe_point); //moving toolhead to a safe probing point // Test at the current position by default, overridden by X and Y const xy_pos_t test_position = {