Browse Source

[2.0.x] different bltouch init (#11135)

Giuliano 7 years ago
parent
commit
4237c3d9f8
3 changed files with 21 additions and 28 deletions
  1. 1
    2
      Marlin/src/gcode/calibrate/G28.cpp
  2. 20
    25
      Marlin/src/module/motion.cpp
  3. 0
    1
      Marlin/src/module/probe.h

+ 1
- 2
Marlin/src/gcode/calibrate/G28.cpp View File

@@ -218,8 +218,7 @@ void GcodeSuite::G28(const bool always_home_all) {
218 218
   #endif
219 219
 
220 220
   #if ENABLED(BLTOUCH)
221
-    bltouch_command(BLTOUCH_RESET);
222
-    set_bltouch_deployed(false);
221
+    bltouch_init();
223 222
   #endif
224 223
 
225 224
   // Always home with tool 0 active

+ 20
- 25
Marlin/src/module/motion.cpp View File

@@ -1117,16 +1117,9 @@ static void do_homing_move(const AxisEnum axis, const float distance, const floa
1117 1117
 
1118 1118
   if (is_home_dir) {
1119 1119
 
1120
-    if (axis == Z_AXIS) {
1121
-      #if HOMING_Z_WITH_PROBE
1122
-        #if ENABLED(BLTOUCH)
1123
-          set_bltouch_deployed(true);
1124
-        #endif
1125
-        #if QUIET_PROBING
1126
-          probing_pause(true);
1127
-        #endif
1128
-      #endif
1129
-    }
1120
+    #if HOMING_Z_WITH_PROBE && QUIET_PROBING
1121
+      if (axis == Z_AXIS) probing_pause(true);
1122
+    #endif
1130 1123
 
1131 1124
     // Disable stealthChop if used. Enable diag1 pin on driver.
1132 1125
     #if ENABLED(SENSORLESS_HOMING)
@@ -1152,16 +1145,9 @@ static void do_homing_move(const AxisEnum axis, const float distance, const floa
1152 1145
 
1153 1146
   if (is_home_dir) {
1154 1147
 
1155
-    if (axis == Z_AXIS) {
1156
-      #if HOMING_Z_WITH_PROBE
1157
-        #if QUIET_PROBING
1158
-          probing_pause(false);
1159
-        #endif
1160
-        #if ENABLED(BLTOUCH)
1161
-          set_bltouch_deployed(false);
1162
-        #endif
1163
-      #endif
1164
-    }
1148
+    #if HOMING_Z_WITH_PROBE && QUIET_PROBING
1149
+      if (axis == Z_AXIS) probing_pause(false);
1150
+    #endif
1165 1151
 
1166 1152
     endstops.validate_homing_move();
1167 1153
 
@@ -1336,6 +1322,10 @@ void homeaxis(const AxisEnum axis) {
1336 1322
     if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Home 1 Fast:");
1337 1323
   #endif
1338 1324
   do_homing_move(axis, 1.5f * max_length(axis) * axis_home_dir);
1325
+  #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH)
1326
+    // BLTOUCH needs to be stowed after trigger to let rearm itself
1327
+    if (axis == Z_AXIS) set_bltouch_deployed(false);
1328
+  #endif
1339 1329
 
1340 1330
   // When homing Z with probe respect probe clearance
1341 1331
   const float bump = axis_home_dir * (
@@ -1361,9 +1351,19 @@ void homeaxis(const AxisEnum axis) {
1361 1351
     #if ENABLED(DEBUG_LEVELING_FEATURE)
1362 1352
       if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Home 2 Slow:");
1363 1353
     #endif
1354
+
1355
+    #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH)
1356
+      // BLTOUCH needs to deploy everytime
1357
+      if (axis == Z_AXIS && set_bltouch_deployed(true)) return;
1358
+    #endif
1364 1359
     do_homing_move(axis, 2 * bump, get_homing_bump_feedrate(axis));
1365 1360
   }
1366 1361
 
1362
+  // Put away the Z probe
1363
+  #if HOMING_Z_WITH_PROBE
1364
+    if (axis == Z_AXIS && STOW_PROBE()) return;
1365
+  #endif
1366
+
1367 1367
   #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
1368 1368
     const bool pos_dir = axis_home_dir > 0;
1369 1369
     #if ENABLED(X_DUAL_ENDSTOPS)
@@ -1436,11 +1436,6 @@ void homeaxis(const AxisEnum axis) {
1436 1436
 
1437 1437
   #endif
1438 1438
 
1439
-  // Put away the Z probe
1440
-  #if HOMING_Z_WITH_PROBE
1441
-    if (axis == Z_AXIS && STOW_PROBE()) return;
1442
-  #endif
1443
-
1444 1439
   // Clear retracted status if homing the Z axis
1445 1440
   #if ENABLED(FWRETRACT)
1446 1441
     if (axis == Z_AXIS) fwretract.hop_amount = 0.0;

+ 0
- 1
Marlin/src/module/probe.h View File

@@ -71,7 +71,6 @@
71 71
   FORCE_INLINE void bltouch_init() {
72 72
     // Make sure any BLTouch error condition is cleared
73 73
     bltouch_command(BLTOUCH_RESET);
74
-    set_bltouch_deployed(true);
75 74
     set_bltouch_deployed(false);
76 75
   }
77 76
 #endif

Loading…
Cancel
Save