Browse Source

quick_home_xy sensorless homing

Scott Lahteine 6 years ago
parent
commit
1d7f5be0ff
1 changed files with 20 additions and 0 deletions
  1. 20
    0
      Marlin/src/gcode/calibrate/G28.cpp

+ 20
- 0
Marlin/src/gcode/calibrate/G28.cpp View File

@@ -35,6 +35,10 @@
35 35
   #include "../../feature/bedlevel/bedlevel.h"
36 36
 #endif
37 37
 
38
+#if ENABLED(SENSORLESS_HOMING)
39
+  #include "../../feature/tmc_util.h"
40
+#endif
41
+
38 42
 #include "../../lcd/ultralcd.h"
39 43
 
40 44
 #if ENABLED(QUICK_HOME)
@@ -58,10 +62,26 @@
58 62
                 mlratio = mlx > mly ? mly / mlx : mlx / mly,
59 63
                 fr_mm_s = min(homing_feedrate(X_AXIS), homing_feedrate(Y_AXIS)) * SQRT(sq(mlratio) + 1.0);
60 64
 
65
+    #if ENABLED(SENSORLESS_HOMING)
66
+      #if ENABLED(X_IS_TMC2130) && defined(X_HOMING_SENSITIVITY)
67
+        tmc_sensorless_homing(stepperX);
68
+      #endif
69
+      #if ENABLED(Y_IS_TMC2130) && defined(Y_HOMING_SENSITIVITY)
70
+        tmc_sensorless_homing(stepperY);
71
+      #endif
72
+    #endif
73
+
61 74
     do_blocking_move_to_xy(1.5 * mlx * x_axis_home_dir, 1.5 * mly * home_dir(Y_AXIS), fr_mm_s);
62 75
     endstops.hit_on_purpose(); // clear endstop hit flags
63 76
     current_position[X_AXIS] = current_position[Y_AXIS] = 0.0;
77
+
64 78
     #if ENABLED(SENSORLESS_HOMING)
79
+      #if ENABLED(X_IS_TMC2130) && defined(X_HOMING_SENSITIVITY)
80
+        tmc_sensorless_homing(stepperX, false);
81
+      #endif
82
+      #if ENABLED(Y_IS_TMC2130) && defined(Y_HOMING_SENSITIVITY)
83
+        tmc_sensorless_homing(stepperY, false);
84
+      #endif
65 85
       safe_delay(500); // Short delay needed to settle
66 86
     #endif
67 87
   }

Loading…
Cancel
Save