quick_home_xy sensorless homing

This commit is contained in:
Scott Lahteine 2018-02-20 20:09:10 -06:00
parent e1fc89c83f
commit 1d78bdac82

View File

@ -3618,10 +3618,26 @@ inline void gcode_G4() {
mlratio = mlx > mly ? mly / mlx : mlx / mly,
fr_mm_s = min(homing_feedrate(X_AXIS), homing_feedrate(Y_AXIS)) * SQRT(sq(mlratio) + 1.0);
#if ENABLED(SENSORLESS_HOMING)
#if ENABLED(X_IS_TMC2130) && defined(X_HOMING_SENSITIVITY)
tmc_sensorless_homing(stepperX);
#endif
#if ENABLED(Y_IS_TMC2130) && defined(Y_HOMING_SENSITIVITY)
tmc_sensorless_homing(stepperY);
#endif
#endif
do_blocking_move_to_xy(1.5 * mlx * x_axis_home_dir, 1.5 * mly * home_dir(Y_AXIS), fr_mm_s);
endstops.hit_on_purpose(); // clear endstop hit flags
current_position[X_AXIS] = current_position[Y_AXIS] = 0.0;
#if ENABLED(SENSORLESS_HOMING)
#if ENABLED(X_IS_TMC2130) && defined(X_HOMING_SENSITIVITY)
tmc_sensorless_homing(stepperX, false);
#endif
#if ENABLED(Y_IS_TMC2130) && defined(Y_HOMING_SENSITIVITY)
tmc_sensorless_homing(stepperY, false);
#endif
safe_delay(500); // Short delay needed to settle
#endif
}