quick_home_xy sensorless homing

This commit is contained in:
Scott Lahteine 2018-02-20 19:44:02 -06:00
parent eb182c08af
commit 1d7f5be0ff

View file

@ -35,6 +35,10 @@
#include "../../feature/bedlevel/bedlevel.h"
#endif
#if ENABLED(SENSORLESS_HOMING)
#include "../../feature/tmc_util.h"
#endif
#include "../../lcd/ultralcd.h"
#if ENABLED(QUICK_HOME)
@ -58,10 +62,26 @@
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
}