|
@@ -966,6 +966,48 @@ inline float get_homing_bump_feedrate(const AxisEnum axis) {
|
966
|
966
|
return homing_feedrate(axis) / hbd;
|
967
|
967
|
}
|
968
|
968
|
|
|
969
|
+#if ENABLED(SENSORLESS_HOMING)
|
|
970
|
+
|
|
971
|
+ /**
|
|
972
|
+ * Set sensorless homing if the axis has it, accounting for Core Kinematics.
|
|
973
|
+ */
|
|
974
|
+ void sensorless_homing_per_axis(const AxisEnum axis, const bool enable/*=true*/) {
|
|
975
|
+ switch (axis) {
|
|
976
|
+ #if X_SENSORLESS
|
|
977
|
+ case X_AXIS:
|
|
978
|
+ tmc_sensorless_homing(stepperX, enable);
|
|
979
|
+ #if CORE_IS_XY && Y_SENSORLESS
|
|
980
|
+ tmc_sensorless_homing(stepperY, enable);
|
|
981
|
+ #elif CORE_IS_XZ && Z_SENSORLESS
|
|
982
|
+ tmc_sensorless_homing(stepperZ, enable);
|
|
983
|
+ #endif
|
|
984
|
+ break;
|
|
985
|
+ #endif
|
|
986
|
+ #if Y_SENSORLESS
|
|
987
|
+ case Y_AXIS:
|
|
988
|
+ tmc_sensorless_homing(stepperY, enable);
|
|
989
|
+ #if CORE_IS_XY && X_SENSORLESS
|
|
990
|
+ tmc_sensorless_homing(stepperX, enable);
|
|
991
|
+ #elif CORE_IS_YZ && Z_SENSORLESS
|
|
992
|
+ tmc_sensorless_homing(stepperZ, enable);
|
|
993
|
+ #endif
|
|
994
|
+ break;
|
|
995
|
+ #endif
|
|
996
|
+ #if Z_SENSORLESS
|
|
997
|
+ case Z_AXIS:
|
|
998
|
+ tmc_sensorless_homing(stepperZ, enable);
|
|
999
|
+ #if CORE_IS_XZ && X_SENSORLESS
|
|
1000
|
+ tmc_sensorless_homing(stepperX, enable);
|
|
1001
|
+ #elif CORE_IS_YZ && Y_SENSORLESS
|
|
1002
|
+ tmc_sensorless_homing(stepperY, enable);
|
|
1003
|
+ #endif
|
|
1004
|
+ break;
|
|
1005
|
+ #endif
|
|
1006
|
+ }
|
|
1007
|
+ }
|
|
1008
|
+
|
|
1009
|
+#endif // SENSORLESS_HOMING
|
|
1010
|
+
|
969
|
1011
|
/**
|
970
|
1012
|
* Home an individual linear axis
|
971
|
1013
|
*/
|
|
@@ -992,15 +1034,7 @@ static void do_homing_move(const AxisEnum axis, const float distance, const floa
|
992
|
1034
|
|
993
|
1035
|
// Disable stealthChop if used. Enable diag1 pin on driver.
|
994
|
1036
|
#if ENABLED(SENSORLESS_HOMING)
|
995
|
|
- #if ENABLED(X_IS_TMC2130) && defined(X_HOMING_SENSITIVITY)
|
996
|
|
- if (axis == X_AXIS) tmc_sensorless_homing(stepperX);
|
997
|
|
- #endif
|
998
|
|
- #if ENABLED(Y_IS_TMC2130) && defined(Y_HOMING_SENSITIVITY)
|
999
|
|
- if (axis == Y_AXIS) tmc_sensorless_homing(stepperY);
|
1000
|
|
- #endif
|
1001
|
|
- #if ENABLED(Z_IS_TMC2130) && defined(Z_HOMING_SENSITIVITY)
|
1002
|
|
- if (axis == Z_AXIS) tmc_sensorless_homing(stepperZ);
|
1003
|
|
- #endif
|
|
1037
|
+ sensorless_homing_per_axis(axis);
|
1004
|
1038
|
#endif
|
1005
|
1039
|
|
1006
|
1040
|
// Tell the planner the axis is at 0
|
|
@@ -1031,15 +1065,7 @@ static void do_homing_move(const AxisEnum axis, const float distance, const floa
|
1031
|
1065
|
|
1032
|
1066
|
// Re-enable stealthChop if used. Disable diag1 pin on driver.
|
1033
|
1067
|
#if ENABLED(SENSORLESS_HOMING)
|
1034
|
|
- #if ENABLED(X_IS_TMC2130) && defined(X_HOMING_SENSITIVITY)
|
1035
|
|
- if (axis == X_AXIS) tmc_sensorless_homing(stepperX, false);
|
1036
|
|
- #endif
|
1037
|
|
- #if ENABLED(Y_IS_TMC2130) && defined(Y_HOMING_SENSITIVITY)
|
1038
|
|
- if (axis == Y_AXIS) tmc_sensorless_homing(stepperY, false);
|
1039
|
|
- #endif
|
1040
|
|
- #if ENABLED(Z_IS_TMC2130) && defined(Z_HOMING_SENSITIVITY)
|
1041
|
|
- if (axis == Z_AXIS) tmc_sensorless_homing(stepperZ, false);
|
1042
|
|
- #endif
|
|
1068
|
+ sensorless_homing_per_axis(axis, false);
|
1043
|
1069
|
#endif
|
1044
|
1070
|
|
1045
|
1071
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|