From 8d9db0f8999706b913ca48323028b9f708e6b2c7 Mon Sep 17 00:00:00 2001 From: ellensp <530024+ellensp@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:55:22 +1300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Prevent=20very=20slow=20'G29=20S?= =?UTF-8?q?{value}'=20(ABL=20Mesh)=20(#27579)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 8 ++++---- Marlin/src/core/types.h | 2 +- Marlin/src/gcode/bedlevel/abl/G29.cpp | 6 +++++- Marlin/src/inc/Conditionals-3-etc.h | 3 +++ 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index c45c75a39d..7226d337d1 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1646,15 +1646,15 @@ // with NOZZLE_AS_PROBE this can be negative for a wider probing area. #define PROBING_MARGIN 10 -// X and Y axis travel speed (mm/min) between probes. +// X and Y axis travel speed between probes. // Leave undefined to use the average of the current XY homing feedrate. -#define XY_PROBE_FEEDRATE (133*60) +#define XY_PROBE_FEEDRATE (133*60) // (mm/min) // Feedrate (mm/min) for the first approach when double-probing (MULTIPLE_PROBING == 2) -#define Z_PROBE_FEEDRATE_FAST (4*60) +#define Z_PROBE_FEEDRATE_FAST (4*60) // (mm/min) // Feedrate (mm/min) for the "accurate" probe of each point -#define Z_PROBE_FEEDRATE_SLOW (Z_PROBE_FEEDRATE_FAST / 2) +#define Z_PROBE_FEEDRATE_SLOW (Z_PROBE_FEEDRATE_FAST / 2) // (mm/min) /** * Probe Activation Switch diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index 7793f1f995..74570ced76 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -346,7 +346,7 @@ enum AxisEnum : uint8_t { #define LOOP_DISTINCT_E(VAR) for (uint8_t VAR = 0; VAR < DISTINCT_E; ++VAR) // -// feedRate_t is just a humble float +// feedRate_t is just a humble float that can represent mm/s or mm/min // typedef float feedRate_t; diff --git a/Marlin/src/gcode/bedlevel/abl/G29.cpp b/Marlin/src/gcode/bedlevel/abl/G29.cpp index be23de24b1..3b922dd54f 100644 --- a/Marlin/src/gcode/bedlevel/abl/G29.cpp +++ b/Marlin/src/gcode/bedlevel/abl/G29.cpp @@ -392,8 +392,12 @@ G29_TYPE GcodeSuite::G29() { #if ABL_USES_GRID + constexpr feedRate_t min_probe_feedrate_mm_s = XY_PROBE_FEEDRATE_MIN; xy_probe_feedrate_mm_s = MMM_TO_MMS(parser.linearval('S', XY_PROBE_FEEDRATE)); - if (xy_probe_feedrate_mm_s == 0) xy_probe_feedrate_mm_s = XY_PROBE_FEEDRATE; // Don't let "UBL Save Slot #0" break G29 + if (xy_probe_feedrate_mm_s < min_probe_feedrate_mm_s) { + xy_probe_feedrate_mm_s = min_probe_feedrate_mm_s; + SERIAL_ECHOLNPGM(GCODE_ERR_MSG("Feedrate (S) too low. (Using ", min_probe_feedrate_mm_s, ")")); + } const float x_min = probe.min_x(), x_max = probe.max_x(), y_min = probe.min_y(), y_max = probe.max_y(); diff --git a/Marlin/src/inc/Conditionals-3-etc.h b/Marlin/src/inc/Conditionals-3-etc.h index 6a1b3b7999..7f005c3539 100644 --- a/Marlin/src/inc/Conditionals-3-etc.h +++ b/Marlin/src/inc/Conditionals-3-etc.h @@ -493,6 +493,9 @@ #endif #if ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR) #define ABL_USES_GRID 1 + #ifndef XY_PROBE_FEEDRATE_MIN + #define XY_PROBE_FEEDRATE_MIN 60 // Minimum mm/min value for 'G29 S' + #endif #endif #if ANY(AUTO_BED_LEVELING_LINEAR, AUTO_BED_LEVELING_BILINEAR, AUTO_BED_LEVELING_3POINT) #define HAS_ABL_NOT_UBL 1