Преглед на файлове

Fix home_delta for SENSORLESS_HOMING (#10145)

Scott Lahteine преди 7 години
родител
ревизия
93af8aa157
No account linked to committer's email address
променени са 1 файла, в които са добавени 17 реда и са изтрити 10 реда
  1. 17
    10
      Marlin/src/module/delta.cpp

+ 17
- 10
Marlin/src/module/delta.cpp Целия файл

229
   cartes[Z_AXIS] =             z1 + ex[2] * Xnew + ey[2] * Ynew - ez[2] * Znew;
229
   cartes[Z_AXIS] =             z1 + ex[2] * Xnew + ey[2] * Ynew - ez[2] * Znew;
230
 }
230
 }
231
 
231
 
232
+#if ENABLED(SENSORLESS_HOMING)
233
+  inline void delta_sensorless_homing(const bool on=true) {
234
+    sensorless_homing_per_axis(A_AXIS, on);
235
+    sensorless_homing_per_axis(B_AXIS, on);
236
+    sensorless_homing_per_axis(C_AXIS, on);
237
+  }
238
+#endif
239
+
232
 /**
240
 /**
233
  * A delta can only safely home all axes at the same time
241
  * A delta can only safely home all axes at the same time
234
  * This is like quick_home_xy() but for 3 towers.
242
  * This is like quick_home_xy() but for 3 towers.
243
 
251
 
244
   // Disable stealthChop if used. Enable diag1 pin on driver.
252
   // Disable stealthChop if used. Enable diag1 pin on driver.
245
   #if ENABLED(SENSORLESS_HOMING)
253
   #if ENABLED(SENSORLESS_HOMING)
246
-    sensorless_homing_per_axis(A_AXIS);
247
-    sensorless_homing_per_axis(B_AXIS);
248
-    sensorless_homing_per_axis(C_AXIS);
254
+    delta_sensorless_homing();
249
   #endif
255
   #endif
250
 
256
 
251
   // Move all carriages together linearly until an endstop is hit.
257
   // Move all carriages together linearly until an endstop is hit.
254
   line_to_current_position();
260
   line_to_current_position();
255
   stepper.synchronize();
261
   stepper.synchronize();
256
 
262
 
257
-  // Re-enable stealthChop if used. Disable diag1 pin on driver.
258
-  #if ENABLED(SENSORLESS_HOMING)
259
-    sensorless_homing_per_axis(A_AXIS, false);
260
-    sensorless_homing_per_axis(B_AXIS, false);
261
-    sensorless_homing_per_axis(C_AXIS, false);
262
-  #endif
263
-
264
   // If an endstop was not hit, then damage can occur if homing is continued.
263
   // If an endstop was not hit, then damage can occur if homing is continued.
265
   // This can occur if the delta height not set correctly.
264
   // This can occur if the delta height not set correctly.
266
   if (!(Endstops::endstop_hit_bits & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX)))) {
265
   if (!(Endstops::endstop_hit_bits & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX)))) {
267
     LCD_MESSAGEPGM(MSG_ERR_HOMING_FAILED);
266
     LCD_MESSAGEPGM(MSG_ERR_HOMING_FAILED);
268
     SERIAL_ERROR_START();
267
     SERIAL_ERROR_START();
269
     SERIAL_ERRORLNPGM(MSG_ERR_HOMING_FAILED);
268
     SERIAL_ERRORLNPGM(MSG_ERR_HOMING_FAILED);
269
+    #if ENABLED(SENSORLESS_HOMING)
270
+      delta_sensorless_homing(false);
271
+    #endif
270
     return false;
272
     return false;
271
   }
273
   }
272
 
274
 
278
   HOMEAXIS(B);
280
   HOMEAXIS(B);
279
   HOMEAXIS(C);
281
   HOMEAXIS(C);
280
 
282
 
283
+  // Re-enable stealthChop if used. Disable diag1 pin on driver.
284
+  #if ENABLED(SENSORLESS_HOMING)
285
+    delta_sensorless_homing(false);
286
+  #endif
287
+
281
   // Set all carriages to their home positions
288
   // Set all carriages to their home positions
282
   // Do this here all at once for Delta, because
289
   // Do this here all at once for Delta, because
283
   // XYZ isn't ABC. Applying this per-tower would
290
   // XYZ isn't ABC. Applying this per-tower would

Loading…
Отказ
Запис