Skip to content

Commit

Permalink
always 45° move, so simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Feb 10, 2022
1 parent 9a216e3 commit e78de17
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Marlin/src/gcode/calibrate/G28.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,9 @@

const int x_axis_home_dir = TOOL_X_HOME_DIR(active_extruder);

const float hfx = homing_feedrate(X_AXIS), hfy = homing_feedrate(Y_AXIS),
r_xy = hfx / hfy, r_yx = hfy / hfx,
r_length = max_length(X_AXIS) / max_length(Y_AXIS),
mlx = r_length < r_xy ? max_length(Y_AXIS) * r_xy : max_length(X_AXIS),
mly = r_length > r_xy ? max_length(X_AXIS) * r_yx : max_length(Y_AXIS),
fr_mm_s = HYPOT(hfx, hfy);
// 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 = SQRT(sq(minfr) * 2);

#if ENABLED(SENSORLESS_HOMING)
sensorless_t stealth_states {
Expand Down

0 comments on commit e78de17

Please sign in to comment.