Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove + swap PLANNER_XY_FEEDRATE_MM_S w/ XY_PROBE_FEEDRATE_MM_S #27411

Open
wants to merge 4 commits into
base: bugfix-2.1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Marlin/src/gcode/bedlevel/G26.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down
10 changes: 7 additions & 3 deletions Marlin/src/inc/Conditionals-5-post.h
Original file line number Diff line number Diff line change
Expand Up @@ -3148,13 +3148,17 @@
#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
#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

/**
* XYZ Bed Skew Correction
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/marlinui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/module/motion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
27 changes: 14 additions & 13 deletions Marlin/src/module/motion.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);

/**
Expand Down
8 changes: 0 additions & 8 deletions Marlin/src/module/planner.h
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down