From baf017b2d8f55a18174b837815b06cd679709691 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Mon, 9 Sep 2024 16:46:09 -0400 Subject: [PATCH 1/2] swap PLANNER_XY_FEEDRATE_MM_S w/ XY_PROBE_FEEDRATE_MM_S --- Marlin/src/gcode/bedlevel/G26.cpp | 6 +++--- Marlin/src/inc/Conditionals-5-post.h | 6 +++--- Marlin/src/lcd/marlinui.cpp | 2 +- Marlin/src/module/motion.cpp | 2 +- Marlin/src/module/motion.h | 27 ++++++++++++++------------- Marlin/src/module/planner.h | 8 -------- 6 files changed, 22 insertions(+), 29 deletions(-) diff --git a/Marlin/src/gcode/bedlevel/G26.cpp b/Marlin/src/gcode/bedlevel/G26.cpp index e4272c1a7b46..cb6354047bce 100644 --- a/Marlin/src/gcode/bedlevel/G26.cpp +++ b/Marlin/src/gcode/bedlevel/G26.cpp @@ -132,11 +132,11 @@ #endif #ifndef G26_XY_FEEDRATE - #define G26_XY_FEEDRATE (PLANNER_XY_FEEDRATE_MM_S / 3.0) + #define G26_XY_FEEDRATE (XY_PROBE_FEEDRATE_MM_S / 3.0) #endif #ifndef G26_XY_FEEDRATE_TRAVEL - #define G26_XY_FEEDRATE_TRAVEL (PLANNER_XY_FEEDRATE_MM_S / 1.5) + #define G26_XY_FEEDRATE_TRAVEL (XY_PROBE_FEEDRATE_MM_S / 1.5) #endif #if CROSSHAIRS_SIZE >= INTERSECTION_CIRCLE_RADIUS @@ -783,7 +783,7 @@ void GcodeSuite::G26() { g26.recover_filament(destination); - { REMEMBER(fr, feedrate_mm_s, PLANNER_XY_FEEDRATE_MM_S * 0.1f); + { REMEMBER(fr, feedrate_mm_s, XY_PROBE_FEEDRATE_MM_S * 0.1f); plan_arc(endpoint, arc_offset, false, 0); // Draw a counter-clockwise arc destination = current_position; } diff --git a/Marlin/src/inc/Conditionals-5-post.h b/Marlin/src/inc/Conditionals-5-post.h index df6efb1ed630..dce72f5aa21f 100644 --- a/Marlin/src/inc/Conditionals-5-post.h +++ b/Marlin/src/inc/Conditionals-5-post.h @@ -3148,13 +3148,13 @@ #if ALL(ENDSTOPPULLUPS, USE_Z_MIN_PROBE) #define ENDSTOPPULLUP_ZMIN_PROBE #endif - #ifndef XY_PROBE_FEEDRATE - #define XY_PROBE_FEEDRATE ((homing_feedrate_mm_m.x + homing_feedrate_mm_m.y) / 2) - #endif #ifndef NOZZLE_TO_PROBE_OFFSET #define NOZZLE_TO_PROBE_OFFSET { 0, 0, 0 } #endif #endif +#ifndef XY_PROBE_FEEDRATE + #define XY_PROBE_FEEDRATE ((homing_feedrate_mm_m.x + homing_feedrate_mm_m.y) / 2) +#endif /** * XYZ Bed Skew Correction diff --git a/Marlin/src/lcd/marlinui.cpp b/Marlin/src/lcd/marlinui.cpp index d618440cb208..8160faae1cd5 100644 --- a/Marlin/src/lcd/marlinui.cpp +++ b/Marlin/src/lcd/marlinui.cpp @@ -816,7 +816,7 @@ void MarlinUI::init() { // Add a manual move to the queue? if (axis == NO_AXIS_ENUM || PENDING(millis(), start_time) || planner.is_full()) return; - const feedRate_t fr_mm_s = (axis < LOGICAL_AXES) ? manual_feedrate_mm_s[axis] : PLANNER_XY_FEEDRATE_MM_S; + const feedRate_t fr_mm_s = (axis < LOGICAL_AXES) ? manual_feedrate_mm_s[axis] : XY_PROBE_FEEDRATE_MM_S; /** * For a rotational axis apply the "inch" to "mm" conversion factor. This mimics behaviour of the G-code G1 diff --git a/Marlin/src/module/motion.cpp b/Marlin/src/module/motion.cpp index abac11771944..01694b88d9fc 100644 --- a/Marlin/src/module/motion.cpp +++ b/Marlin/src/module/motion.cpp @@ -2056,7 +2056,7 @@ float get_move_distance(const xyze_pos_t &diff OPTARG(HAS_ROTATIONAL_AXES, bool if (planner.buffer_line(raised, fr_zfast)) { // 2. Move to the current native XY and raised Z. Presumably this is a null move. xyze_pos_t curpos = current_position; curpos.z = raised_parked_position.z; - if (planner.buffer_line(curpos, PLANNER_XY_FEEDRATE_MM_S)) { + if (planner.buffer_line(curpos, XY_PROBE_FEEDRATE_MM_S)) { // 3. Lower Z back down line_to_current_position(fr_zfast); } diff --git a/Marlin/src/module/motion.h b/Marlin/src/module/motion.h index 420b18f32a85..b166e1aa8a17 100644 --- a/Marlin/src/module/motion.h +++ b/Marlin/src/module/motion.h @@ -62,19 +62,6 @@ extern xyz_pos_t cartes; extern abce_pos_t delta; #endif -#if HAS_ABL_NOT_UBL - extern feedRate_t xy_probe_feedrate_mm_s; - #define XY_PROBE_FEEDRATE_MM_S xy_probe_feedrate_mm_s -#elif defined(XY_PROBE_FEEDRATE) - #define XY_PROBE_FEEDRATE_MM_S MMM_TO_MMS(XY_PROBE_FEEDRATE) -#else - #define XY_PROBE_FEEDRATE_MM_S PLANNER_XY_FEEDRATE_MM_S -#endif - -#if HAS_BED_PROBE - constexpr feedRate_t z_probe_fast_mm_s = MMM_TO_MMS(Z_PROBE_FEEDRATE_FAST); -#endif - /** * Feed rates are often configured with mm/m * but the planner and stepper like mm/s units. @@ -98,6 +85,20 @@ FORCE_INLINE feedRate_t homing_feedrate(const AxisEnum a) { return MMM_TO_MMS(v); } +#if HAS_ABL_NOT_UBL + extern feedRate_t xy_probe_feedrate_mm_s; + #define XY_PROBE_FEEDRATE_MM_S xy_probe_feedrate_mm_s +#elif defined(XY_PROBE_FEEDRATE) + #define XY_PROBE_FEEDRATE_MM_S MMM_TO_MMS(XY_PROBE_FEEDRATE) +#endif + +#if HAS_BED_PROBE + constexpr feedRate_t z_probe_fast_mm_s = MMM_TO_MMS(Z_PROBE_FEEDRATE_FAST); +#endif + +/** + * Homing bump feedrate (mm/s) + */ feedRate_t get_homing_bump_feedrate(const AxisEnum axis); /** diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index 5b37d7fdda5b..795661a98fdc 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -1112,14 +1112,6 @@ class Planner { #endif // HAS_JUNCTION_DEVIATION }; -#if HAS_Y_AXIS - #define PLANNER_XY_FEEDRATE_MM_S _MIN(planner.settings.max_feedrate_mm_s[X_AXIS], planner.settings.max_feedrate_mm_s[Y_AXIS]) -#elif HAS_X_AXIS - #define PLANNER_XY_FEEDRATE_MM_S planner.settings.max_feedrate_mm_s[X_AXIS] -#else - #define PLANNER_XY_FEEDRATE_MM_S 60.0f -#endif - #define ANY_AXIS_MOVES(BLOCK) \ (false NUM_AXIS_GANG( \ || BLOCK->steps.a, || BLOCK->steps.b, || BLOCK->steps.c, \ From afe70345399a0fbff859ef33bada13abe0ab65a5 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Mon, 9 Sep 2024 17:30:09 -0400 Subject: [PATCH 2/2] fix for no X/Y axis --- Marlin/src/inc/Conditionals-5-post.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Marlin/src/inc/Conditionals-5-post.h b/Marlin/src/inc/Conditionals-5-post.h index dce72f5aa21f..e3def7277d4c 100644 --- a/Marlin/src/inc/Conditionals-5-post.h +++ b/Marlin/src/inc/Conditionals-5-post.h @@ -3153,7 +3153,11 @@ #endif #endif #ifndef XY_PROBE_FEEDRATE - #define XY_PROBE_FEEDRATE ((homing_feedrate_mm_m.x + homing_feedrate_mm_m.y) / 2) + #if ALL(HAS_X_AXIS, HAS_Y_AXIS) + #define XY_PROBE_FEEDRATE ((homing_feedrate_mm_m.x + homing_feedrate_mm_m.y) / 2) + #else + #define XY_PROBE_FEEDRATE 60.0f + #endif #endif /**