diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 0fffc08e5a..350348c8a8 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -731,6 +731,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 4730ab2514..5da03d3d6a 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -389,6 +389,11 @@ void report_current_position(); #if HAS_BED_PROBE extern float zprobe_zoffset; bool set_probe_deployed(const bool deploy); + #ifdef Z_AFTER_PROBING + void move_z_after_probing(); + #else + inline void move_z_after_probing() {} + #endif #define DEPLOY_PROBE() set_probe_deployed(true) #define STOW_PROBE() set_probe_deployed(false) #else diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 2d8e2235c4..f8ecaddae7 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3839,6 +3839,15 @@ inline void gcode_G4() { #endif // DELTA +#ifdef Z_AFTER_PROBING + void move_z_after_probing() { + if (current_position[Z_AXIS] != Z_AFTER_PROBING) { + do_blocking_move_to_z(Z_AFTER_PROBING); + current_position[Z_AXIS] = Z_AFTER_PROBING; + } + } +#endif + #if ENABLED(Z_SAFE_HOMING) inline void home_z_safely() { @@ -4068,6 +4077,11 @@ inline void gcode_G28(const bool always_home_all) { #else HOMEAXIS(Z); #endif + + #if HOMING_Z_WITH_PROBE + move_z_after_probing(); + #endif + } // home_all || homeZ #endif // Z_HOME_DIR < 0 @@ -5015,7 +5029,7 @@ void home_all_axes() { gcode_G28(true); } #endif // AUTO_BED_LEVELING_3POINT - // Raise to _Z_CLEARANCE_DEPLOY_PROBE. Stow the probe. + // Stow the probe. No raise for FIX_MOUNTED_PROBE. if (STOW_PROBE()) { set_bed_leveling_enabled(abl_should_enable); measured_z = NAN; @@ -5249,12 +5263,16 @@ void home_all_axes() { gcode_G28(true); } if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< G29"); #endif - report_current_position(); - KEEPALIVE_STATE(IN_HANDLER); if (planner.leveling_active) SYNC_PLAN_POSITION_KINEMATIC(); + + #if HAS_BED_PROBE + move_z_after_probing(); + #endif + + report_current_position(); } #endif // OLDSCHOOL_ABL @@ -5283,7 +5301,8 @@ void home_all_axes() { gcode_G28(true); } setup_for_endstop_or_probe_move(); - const float measured_z = probe_pt(xpos, ypos, parser.boolval('E'), 1); + const bool do_stow = parser.boolval('E'); + const float measured_z = probe_pt(xpos, ypos, do_stow, 1); if (!isnan(measured_z)) { SERIAL_PROTOCOLPAIR("Bed X: ", FIXFLOAT(xpos)); @@ -5293,6 +5312,8 @@ void home_all_axes() { gcode_G28(true); } clean_up_after_endstop_or_probe_move(); + if (do_stow) move_z_after_probing(); + report_current_position(); } @@ -7600,6 +7621,7 @@ inline void gcode_M42() { set_bed_leveling_enabled(was_enabled); #endif + move_z_after_probing(); report_current_position(); } @@ -9665,12 +9687,19 @@ inline void gcode_M400() { stepper.synchronize(); } /** * M401: Deploy and activate the Z probe */ - inline void gcode_M401() { DEPLOY_PROBE(); } + inline void gcode_M401() { + DEPLOY_PROBE(); + report_current_position(); + } /** * M402: Deactivate and stow the Z probe */ - inline void gcode_M402() { STOW_PROBE(); } + inline void gcode_M402() { + STOW_PROBE(); + move_z_after_probing(); + report_current_position(); + } #endif // HAS_BED_PROBE diff --git a/Marlin/SanityCheck.h b/Marlin/SanityCheck.h index 15e49ddf91..078038d4fe 100644 --- a/Marlin/SanityCheck.h +++ b/Marlin/SanityCheck.h @@ -162,7 +162,7 @@ #elif defined(MIN_Z_HEIGHT_FOR_HOMING) #error "MIN_Z_HEIGHT_FOR_HOMING is now Z_HOMING_HEIGHT. Please update your configuration." #elif defined(Z_RAISE_BEFORE_PROBING) || defined(Z_RAISE_AFTER_PROBING) - #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_CLEARANCE_DEPLOY_PROBE instead." + #error "Z_RAISE_(BEFORE|AFTER)_PROBING are deprecated. Use Z_CLEARANCE_DEPLOY_PROBE and Z_AFTER_PROBING instead." #elif defined(Z_RAISE_PROBE_DEPLOY_STOW) || defined(Z_RAISE_BETWEEN_PROBINGS) #error "Z_RAISE_PROBE_DEPLOY_STOW and Z_RAISE_BETWEEN_PROBINGS are now Z_CLEARANCE_DEPLOY_PROBE and Z_CLEARANCE_BETWEEN_PROBES. Please update your configuration." #elif defined(Z_PROBE_DEPLOY_HEIGHT) || defined(Z_PROBE_TRAVEL_HEIGHT) @@ -762,6 +762,8 @@ static_assert(1 >= 0 #error "Probes need Z_CLEARANCE_DEPLOY_PROBE >= 0." #elif Z_CLEARANCE_BETWEEN_PROBES < 0 #error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0." + #elif Z_AFTER_PROBING < 0 + #error "Probes need Z_AFTER_PROBING >= 0." #endif #if MULTIPLE_PROBING && MULTIPLE_PROBING < 2 diff --git a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h index 4d24de9c18..6027f10e19 100644 --- a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h +++ b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h @@ -751,6 +751,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/AliExpress/CL-260/Configuration.h b/Marlin/example_configurations/AliExpress/CL-260/Configuration.h index 2f9f4be260..6120b9f579 100644 --- a/Marlin/example_configurations/AliExpress/CL-260/Configuration.h +++ b/Marlin/example_configurations/AliExpress/CL-260/Configuration.h @@ -731,6 +731,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Anet/A6/Configuration.h b/Marlin/example_configurations/Anet/A6/Configuration.h index eb93b617f1..2b11d4927a 100644 --- a/Marlin/example_configurations/Anet/A6/Configuration.h +++ b/Marlin/example_configurations/Anet/A6/Configuration.h @@ -801,8 +801,10 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done //#define Z_CLEARANCE_DEPLOY_PROBE 5 // Z Clearance for Deploy/Stow //#define Z_CLEARANCE_BETWEEN_PROBES 3 // Z Clearance between probe points +//#define Z_AFTER_PROBING 3 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Anet/A8/Configuration.h b/Marlin/example_configurations/Anet/A8/Configuration.h index 0271b89db2..6ee71d1127 100644 --- a/Marlin/example_configurations/Anet/A8/Configuration.h +++ b/Marlin/example_configurations/Anet/A8/Configuration.h @@ -738,6 +738,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/BIBO/TouchX/Cyclops/Configuration.h b/Marlin/example_configurations/BIBO/TouchX/Cyclops/Configuration.h index 60a624c9cb..cf10c24816 100644 --- a/Marlin/example_configurations/BIBO/TouchX/Cyclops/Configuration.h +++ b/Marlin/example_configurations/BIBO/TouchX/Cyclops/Configuration.h @@ -731,6 +731,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 10 // Z Clearance between probe points +//#define Z_AFTER_PROBING 10 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/BIBO/TouchX/default/Configuration.h b/Marlin/example_configurations/BIBO/TouchX/default/Configuration.h index 3c5e976556..51cae158ca 100644 --- a/Marlin/example_configurations/BIBO/TouchX/default/Configuration.h +++ b/Marlin/example_configurations/BIBO/TouchX/default/Configuration.h @@ -731,6 +731,7 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = true; // set to true to invert the lo */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 10 // Z Clearance between probe points +//#define Z_AFTER_PROBING 10 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/BQ/Hephestos/Configuration.h b/Marlin/example_configurations/BQ/Hephestos/Configuration.h index 84cd8e8672..78d4e3b410 100644 --- a/Marlin/example_configurations/BQ/Hephestos/Configuration.h +++ b/Marlin/example_configurations/BQ/Hephestos/Configuration.h @@ -719,6 +719,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h b/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h index 3c8167dcb8..a80b2d84f6 100644 --- a/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h @@ -732,6 +732,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 0 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 2 // Z Clearance between probe points +//#define Z_AFTER_PROBING 2 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -2 diff --git a/Marlin/example_configurations/BQ/WITBOX/Configuration.h b/Marlin/example_configurations/BQ/WITBOX/Configuration.h index 623e1c841f..cf6ebe33cb 100644 --- a/Marlin/example_configurations/BQ/WITBOX/Configuration.h +++ b/Marlin/example_configurations/BQ/WITBOX/Configuration.h @@ -719,6 +719,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index 728c4e37e5..1a16877cdc 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -730,6 +730,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Creality/CR-10/Configuration.h b/Marlin/example_configurations/Creality/CR-10/Configuration.h index f24f8f1cc8..89b900c2fc 100755 --- a/Marlin/example_configurations/Creality/CR-10/Configuration.h +++ b/Marlin/example_configurations/Creality/CR-10/Configuration.h @@ -741,6 +741,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 10 // Z Clearance between probe points +//#define Z_AFTER_PROBING 10 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Creality/CR-10S/Configuration.h b/Marlin/example_configurations/Creality/CR-10S/Configuration.h index a955a02359..f411f82e08 100644 --- a/Marlin/example_configurations/Creality/CR-10S/Configuration.h +++ b/Marlin/example_configurations/Creality/CR-10S/Configuration.h @@ -731,6 +731,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Creality/CR-10mini/Configuration.h b/Marlin/example_configurations/Creality/CR-10mini/Configuration.h index 4d814b7764..bbb613f47d 100644 --- a/Marlin/example_configurations/Creality/CR-10mini/Configuration.h +++ b/Marlin/example_configurations/Creality/CR-10mini/Configuration.h @@ -750,6 +750,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Creality/Ender-2/Configuration.h b/Marlin/example_configurations/Creality/Ender-2/Configuration.h index d1db0c747b..bdf4827e46 100644 --- a/Marlin/example_configurations/Creality/Ender-2/Configuration.h +++ b/Marlin/example_configurations/Creality/Ender-2/Configuration.h @@ -735,6 +735,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Creality/Ender-4/Configuration.h b/Marlin/example_configurations/Creality/Ender-4/Configuration.h index 3bfc8be7bd..0be832c09a 100644 --- a/Marlin/example_configurations/Creality/Ender-4/Configuration.h +++ b/Marlin/example_configurations/Creality/Ender-4/Configuration.h @@ -741,6 +741,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 1ce29eec7b..32d3041402 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -713,6 +713,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index eaaa467065..d66ac54adc 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -713,6 +713,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/FolgerTech/i3-2020/Configuration.h b/Marlin/example_configurations/FolgerTech/i3-2020/Configuration.h index 552a692d01..2dbe02185a 100644 --- a/Marlin/example_configurations/FolgerTech/i3-2020/Configuration.h +++ b/Marlin/example_configurations/FolgerTech/i3-2020/Configuration.h @@ -737,6 +737,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 3 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 3 // Z Clearance between probe points +//#define Z_AFTER_PROBING 3 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Geeetech/GT2560/Configuration.h b/Marlin/example_configurations/Geeetech/GT2560/Configuration.h index bc57d0ae2f..17f85ba09d 100644 --- a/Marlin/example_configurations/Geeetech/GT2560/Configuration.h +++ b/Marlin/example_configurations/Geeetech/GT2560/Configuration.h @@ -746,6 +746,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h b/Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h index 7548493f38..4864e46c58 100644 --- a/Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h +++ b/Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h @@ -731,6 +731,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 6 // Z Clearance between probe points +//#define Z_AFTER_PROBING 6 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h b/Marlin/example_configurations/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h index 0bdd9d6275..e6e712203f 100644 --- a/Marlin/example_configurations/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h +++ b/Marlin/example_configurations/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h @@ -747,6 +747,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h b/Marlin/example_configurations/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h index ddc1fc173c..4f396a6185 100644 --- a/Marlin/example_configurations/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h +++ b/Marlin/example_configurations/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h @@ -746,6 +746,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Infitary/i3-M508/Configuration.h b/Marlin/example_configurations/Infitary/i3-M508/Configuration.h index c460f08f86..e4dbd3cf5d 100644 --- a/Marlin/example_configurations/Infitary/i3-M508/Configuration.h +++ b/Marlin/example_configurations/Infitary/i3-M508/Configuration.h @@ -735,6 +735,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/JGAurora/A5/Configuration.h b/Marlin/example_configurations/JGAurora/A5/Configuration.h index 68081bc38e..dedd5e15ff 100644 --- a/Marlin/example_configurations/JGAurora/A5/Configuration.h +++ b/Marlin/example_configurations/JGAurora/A5/Configuration.h @@ -743,6 +743,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Malyan/M150/Configuration.h b/Marlin/example_configurations/Malyan/M150/Configuration.h index 23881ea7fe..9659f470bd 100644 --- a/Marlin/example_configurations/Malyan/M150/Configuration.h +++ b/Marlin/example_configurations/Malyan/M150/Configuration.h @@ -755,6 +755,7 @@ */ //#define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow //#define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset //#define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Micromake/C1/basic/Configuration.h b/Marlin/example_configurations/Micromake/C1/basic/Configuration.h index df1bef3e5c..23d8aa66d6 100644 --- a/Marlin/example_configurations/Micromake/C1/basic/Configuration.h +++ b/Marlin/example_configurations/Micromake/C1/basic/Configuration.h @@ -735,6 +735,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Micromake/C1/enhanced/Configuration.h b/Marlin/example_configurations/Micromake/C1/enhanced/Configuration.h index 5b535271ba..058fb02d56 100644 --- a/Marlin/example_configurations/Micromake/C1/enhanced/Configuration.h +++ b/Marlin/example_configurations/Micromake/C1/enhanced/Configuration.h @@ -735,6 +735,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index 2e81555a40..b6b3edf9e8 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -731,6 +731,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 5c331436c3..dd4b407a56 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -729,6 +729,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index 3ee74ea9a5..b9f6659417 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -742,6 +742,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Sanguinololu/Configuration.h b/Marlin/example_configurations/Sanguinololu/Configuration.h index 3b37a3b2f5..f992fc5e45 100644 --- a/Marlin/example_configurations/Sanguinololu/Configuration.h +++ b/Marlin/example_configurations/Sanguinololu/Configuration.h @@ -762,6 +762,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/TinyBoy2/Configuration.h b/Marlin/example_configurations/TinyBoy2/Configuration.h index 037c0a6ce7..215faf30cc 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration.h @@ -782,6 +782,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Tronxy/X1/Configuration.h b/Marlin/example_configurations/Tronxy/X1/Configuration.h index 1e140bde6f..6d1021eefb 100644 --- a/Marlin/example_configurations/Tronxy/X1/Configuration.h +++ b/Marlin/example_configurations/Tronxy/X1/Configuration.h @@ -731,6 +731,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Tronxy/X5S/Configuration.h b/Marlin/example_configurations/Tronxy/X5S/Configuration.h index f2b92d27e6..4fcb77d310 100644 --- a/Marlin/example_configurations/Tronxy/X5S/Configuration.h +++ b/Marlin/example_configurations/Tronxy/X5S/Configuration.h @@ -731,6 +731,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Tronxy/XY100/Configuration.h b/Marlin/example_configurations/Tronxy/XY100/Configuration.h index 1f914b2b3d..4b6aad28af 100644 --- a/Marlin/example_configurations/Tronxy/XY100/Configuration.h +++ b/Marlin/example_configurations/Tronxy/XY100/Configuration.h @@ -742,6 +742,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Velleman/K8200/Configuration.h b/Marlin/example_configurations/Velleman/K8200/Configuration.h index 45fa0d0b47..b0190f78be 100644 --- a/Marlin/example_configurations/Velleman/K8200/Configuration.h +++ b/Marlin/example_configurations/Velleman/K8200/Configuration.h @@ -760,6 +760,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Velleman/K8400/Configuration.h b/Marlin/example_configurations/Velleman/K8400/Configuration.h index 3489546a5b..956014ee99 100644 --- a/Marlin/example_configurations/Velleman/K8400/Configuration.h +++ b/Marlin/example_configurations/Velleman/K8400/Configuration.h @@ -731,6 +731,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h index 9cc2dce48f..75a305e8a6 100644 --- a/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h @@ -731,6 +731,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration.h b/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration.h index 5c6359a4e3..de438bb6ba 100644 --- a/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration.h +++ b/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration.h @@ -741,6 +741,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index c85852c371..f755bdf042 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -731,6 +731,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h index f576fa4b4f..b513b9a28b 100644 --- a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h +++ b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h @@ -861,6 +861,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 5 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 2 // Z Clearance between probe points +//#define Z_AFTER_PROBING 2 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/delta/FLSUN/kossel/Configuration.h b/Marlin/example_configurations/delta/FLSUN/kossel/Configuration.h index b6de20e4f5..a9145e3574 100644 --- a/Marlin/example_configurations/delta/FLSUN/kossel/Configuration.h +++ b/Marlin/example_configurations/delta/FLSUN/kossel/Configuration.h @@ -861,6 +861,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 5 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 2 // Z Clearance between probe points +//#define Z_AFTER_PROBING 2 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h index afd62edf56..c122bdd24a 100644 --- a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h @@ -861,6 +861,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 50 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/delta/Hatchbox_Alpha/Configuration.h b/Marlin/example_configurations/delta/Hatchbox_Alpha/Configuration.h index 9be4765dcc..4cc2751166 100644 --- a/Marlin/example_configurations/delta/Hatchbox_Alpha/Configuration.h +++ b/Marlin/example_configurations/delta/Hatchbox_Alpha/Configuration.h @@ -863,6 +863,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 1877a2b17d..0d95ec78b8 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -848,6 +848,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index eefc9ba269..cdf891d62b 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -851,6 +851,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 50 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index 8c93c39f9c..74c022efd4 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -850,6 +850,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 100 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 940d91ee9b..2970d75651 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -860,6 +860,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 20 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 10 // Z Clearance between probe points +//#define Z_AFTER_PROBING 10 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h index 76f1492afc..cb1417df5e 100644 --- a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h +++ b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h @@ -744,6 +744,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 6 // Z Clearance between probe points +//#define Z_AFTER_PROBING 6 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index bd2518e224..e422c8caa4 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -734,6 +734,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index 52e0d8f352..2edddcdc13 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -726,6 +726,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 15 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/example_configurations/wt150/Configuration.h b/Marlin/example_configurations/wt150/Configuration.h index 09cf3b0de9..03b33e27d5 100644 --- a/Marlin/example_configurations/wt150/Configuration.h +++ b/Marlin/example_configurations/wt150/Configuration.h @@ -736,6 +736,7 @@ */ #define Z_CLEARANCE_DEPLOY_PROBE 10 // Z Clearance for Deploy/Stow #define Z_CLEARANCE_BETWEEN_PROBES 5 // Z Clearance between probe points +//#define Z_AFTER_PROBING 5 // Z position after probing is done // For M851 give a range for adjusting the Z probe offset #define Z_PROBE_OFFSET_RANGE_MIN -20 diff --git a/Marlin/ubl_G29.cpp b/Marlin/ubl_G29.cpp index cdca64c765..7abe183f84 100644 --- a/Marlin/ubl_G29.cpp +++ b/Marlin/ubl_G29.cpp @@ -387,6 +387,7 @@ restore_ubl_active_state_and_leave(); } do_blocking_move_to_xy(0.5 * (MESH_MAX_X - (MESH_MIN_X)), 0.5 * (MESH_MAX_Y - (MESH_MIN_Y))); + report_current_position(); } #endif // HAS_BED_PROBE @@ -424,6 +425,8 @@ } probe_entire_mesh(g29_x_pos + X_PROBE_OFFSET_FROM_EXTRUDER, g29_y_pos + Y_PROBE_OFFSET_FROM_EXTRUDER, parser.seen('T'), parser.seen('E'), parser.seen('U')); + + report_current_position(); break; #endif // HAS_BED_PROBE @@ -471,6 +474,8 @@ SERIAL_PROTOCOLLNPGM("G29 P2 finished."); + report_current_position(); + #else SERIAL_PROTOCOLLNPGM("?P2 is only available when an LCD is present."); @@ -754,6 +759,8 @@ } while (location.x_index >= 0 && --max_iterations); STOW_PROBE(); + move_z_after_probing(); + restore_ubl_active_state_and_leave(); do_blocking_move_to_xy(