From 4ca3c0bc8634e68f47b96173bde83c0c08f95820 Mon Sep 17 00:00:00 2001 From: swissnorp <67485708+swissnorp@users.noreply.github.com> Date: Wed, 9 Dec 2020 10:06:50 +0100 Subject: [PATCH] Allow positive Z nozzle to probe offset (#20344) * Allow a positive value for z offset from nozzle to probe without sanity checks * Simplify menu_probe_offset.cpp (HOMING_Z_WITH_PROBE) * Add some more explanation to Configuration Files * Raise after probe_at_point as if homed Co-authored-by: Scott Lahteine Co-authored-by: Jason Smith --- Marlin/Configuration.h | 14 ++++++++++++-- Marlin/Configuration_adv.h | 3 ++- Marlin/src/inc/SanityCheck.h | 6 ------ Marlin/src/lcd/menu/menu_probe_offset.cpp | 8 ++++---- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 0f92f11418..d528a97bf7 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -954,10 +954,20 @@ /** * Nozzle-to-Probe offsets { X, Y, Z } * - * - Use a caliper or ruler to measure the distance from the tip of + * X and Y offset + * Use a caliper or ruler to measure the distance from the tip of * the Nozzle to the center-point of the Probe in the X and Y axes. + * + * Z offset * - For the Z offset use your best known value and adjust at runtime. - * - Probe Offsets can be tuned at runtime with 'M851', LCD menus, babystepping, etc. + * - Common probes trigger below the nozzle and have negative values for Z offset. + * - Probes triggering above the nozzle height are uncommon but do exist. When using + * probes such as this, carefully set Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES + * to avoid collisions during probing. + * + * Tune and Adjust + * - Probe Offsets can be tuned at runtime with 'M851', LCD menus, babystepping, etc. + * - PROBE_OFFSET_WIZARD (configuration_adv.h) can be used for setting the Z offset. * * Assuming the typical work area orientation: * - Probe to RIGHT of the Nozzle has a Positive X offset diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 92de09eec9..f49749c045 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1084,7 +1084,8 @@ #if ENABLED(PROBE_OFFSET_WIZARD) // // Enable to init the Probe Z-Offset when starting the Wizard. - // Use the estimated nozzle-to-probe Z offset, plus a little more. + // Use a height slightly above the estimated nozzle-to-probe Z offset. + // For example, with an offset of -5, consider a starting height of -4. // //#define PROBE_OFFSET_WIZARD_START_Z -4.0 diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index eec9ff0844..36dc373ecc 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -1357,12 +1357,6 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS static_assert(sanity_nozzle_to_probe_offset.x == 0 && sanity_nozzle_to_probe_offset.y == 0, "NOZZLE_AS_PROBE requires the XY offsets in NOZZLE_TO_PROBE_OFFSET to both be 0."); #else - static_assert(sanity_nozzle_to_probe_offset.z <= 0.25, - "Are you sure your Probe triggers above the nozzle? Set a negative Z value in the NOZZLE_TO_PROBE_OFFSET."); - #ifdef PROBE_OFFSET_WIZARD_START_Z - static_assert(PROBE_OFFSET_WIZARD_START_Z <= 0.25, - "Are you sure your Probe triggers above the nozzle? Set a negative value for PROBE_OFFSET_WIZARD_START_Z."); - #endif static_assert(PROBING_MARGIN >= 0, "PROBING_MARGIN must be >= 0."); static_assert(PROBING_MARGIN_BACK >= 0, "PROBING_MARGIN_BACK must be >= 0."); static_assert(PROBING_MARGIN_FRONT >= 0, "PROBING_MARGIN_FRONT must be >= 0."); diff --git a/Marlin/src/lcd/menu/menu_probe_offset.cpp b/Marlin/src/lcd/menu/menu_probe_offset.cpp index f2b08afd79..8f87e82ae0 100644 --- a/Marlin/src/lcd/menu/menu_probe_offset.cpp +++ b/Marlin/src/lcd/menu/menu_probe_offset.cpp @@ -107,8 +107,8 @@ void probe_offset_wizard_menu() { ACTION_ITEM(MSG_BUTTON_CANCEL, []{ set_offset_and_go_back(z_offset_backup); - // If wizard-homing was done by probe with with PROBE_OFFSET_WIZARD_START_Z - #if EITHER(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, USE_PROBE_FOR_Z_HOMING) && defined(PROBE_OFFSET_WIZARD_START_Z) + // If wizard-homing was done by probe with PROBE_OFFSET_WIZARD_START_Z + #if HOMING_Z_WITH_PROBE && defined(PROBE_OFFSET_WIZARD_START_Z) set_axis_never_homed(Z_AXIS); // On cancel the Z position needs correction queue.inject_P(PSTR("G28Z")); #else // Otherwise do a Z clearance move like after Homing @@ -122,7 +122,7 @@ void probe_offset_wizard_menu() { void prepare_for_probe_offset_wizard() { if (ui.wait_for_move) return; - #if defined(PROBE_OFFSET_WIZARD_XY_POS) || NONE(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, USE_PROBE_FOR_Z_HOMING) + #if defined(PROBE_OFFSET_WIZARD_XY_POS) || !HOMING_Z_WITH_PROBE if (ui.should_draw()) MenuItem_static::draw(1, GET_TEXT(MSG_PROBE_WIZARD_PROBING)); #ifndef PROBE_OFFSET_WIZARD_XY_POS @@ -133,7 +133,7 @@ void prepare_for_probe_offset_wizard() { // Probe for Z reference ui.wait_for_move = true; - z_offset_ref = probe.probe_at_point(wizard_pos, PROBE_PT_STOW, 0, true); + z_offset_ref = probe.probe_at_point(wizard_pos, PROBE_PT_RAISE, 0, true); ui.wait_for_move = false; #endif