Skip to content

Commit 179e344

Browse files
espr14thinkyhead
authored and
Omkar Dhekne
committed
🩹 Simplify quick homing feedrate (MarlinFirmware#23714)
Co-authored-by: Scott Lahteine <[email protected]>
1 parent a9df6c2 commit 179e344

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Marlin/src/gcode/calibrate/G28.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,9 @@
7676

7777
const int x_axis_home_dir = TOOL_X_HOME_DIR(active_extruder);
7878

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

8483
#if ENABLED(SENSORLESS_HOMING)
8584
sensorless_t stealth_states {
@@ -95,7 +94,7 @@
9594
};
9695
#endif
9796

98-
do_blocking_move_to_xy(1.5 * mlx * x_axis_home_dir, 1.5 * mly * Y_HOME_DIR, fr_mm_s);
97+
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);
9998

10099
endstops.validate_homing_move();
101100

0 commit comments

Comments
 (0)