Skip to content

Commit

Permalink
🩹 Simplify quick homing feedrate (MarlinFirmware#23714)
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Lahteine <[email protected]>
  • Loading branch information
2 people authored and tomek2k1 committed Jan 13, 2023
1 parent fa052e2 commit 8b8c0ab
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Marlin/src/gcode/calibrate/G28.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@

const int x_axis_home_dir = TOOL_X_HOME_DIR(active_extruder);

const float mlx = max_length(X_AXIS),
mly = max_length(Y_AXIS),
mlratio = mlx > mly ? mly / mlx : mlx / mly,
fr_mm_s = _MIN(homing_feedrate(X_AXIS), homing_feedrate(Y_AXIS)) * SQRT(sq(mlratio) + 1.0);
// Use a higher diagonal feedrate so axes move at homing speed
const float minfr = _MIN(homing_feedrate(X_AXIS), homing_feedrate(Y_AXIS)),
fr_mm_s = HYPOT(minfr, minfr);

#if ENABLED(SENSORLESS_HOMING)
sensorless_t stealth_states {
Expand All @@ -95,7 +94,7 @@
};
#endif

do_blocking_move_to_xy(1.5 * mlx * x_axis_home_dir, 1.5 * mly * Y_HOME_DIR, fr_mm_s);
do_blocking_move_to_xy(1.5 * max_length(X_AXIS) * x_axis_home_dir, 1.5 * max_length(Y_AXIS) * Y_HOME_DIR, fr_mm_s);

endstops.validate_homing_move();

Expand Down

0 comments on commit 8b8c0ab

Please sign in to comment.