Переглянути джерело

Merge pull request #4361 from AnHardt/imp-dbmt-for-delta

DELTA do_blocking_move_to() more like the Chartesian one
Scott Lahteine 8 роки тому
джерело
коміт
39caef4279
1 змінених файлів з 26 додано та 4 видалено
  1. 26
    4
      Marlin/Marlin_main.cpp

+ 26
- 4
Marlin/Marlin_main.cpp Переглянути файл

@@ -1679,14 +1679,36 @@ void do_blocking_move_to(float x, float y, float z, float fr_mm_m /*=0.0*/) {
1679 1679
 
1680 1680
     feedrate_mm_m = (fr_mm_m != 0.0) ? fr_mm_m : XY_PROBE_FEEDRATE_MM_M;
1681 1681
 
1682
+    // when in the danger zone
1683
+    if (current_position[Z_AXIS] > delta_clip_start_height) {
1684
+      if (delta_clip_start_height < z) { // staying in the danger zone
1685
+        destination[X_AXIS] = x;         // move directly
1686
+        destination[Y_AXIS] = y;
1687
+        destination[Z_AXIS] = z;
1688
+        prepare_move_to_destination_raw(); // this will also set_current_to_destination
1689
+        return;
1690
+      } else {                           // leave the danger zone
1691
+        destination[X_AXIS] = current_position[X_AXIS];
1692
+        destination[Y_AXIS] = current_position[Y_AXIS];
1693
+        destination[Z_AXIS] = delta_clip_start_height;
1694
+        prepare_move_to_destination_raw(); // this will also set_current_to_destination
1695
+      }
1696
+    }
1697
+    if (current_position[Z_AXIS] < z) {  // raise
1698
+      destination[X_AXIS] = current_position[X_AXIS];
1699
+      destination[Y_AXIS] = current_position[Y_AXIS];
1700
+      destination[Z_AXIS] = z;
1701
+      prepare_move_to_destination_raw(); // this will also set_current_to_destination
1702
+    }
1682 1703
     destination[X_AXIS] = x;
1683 1704
     destination[Y_AXIS] = y;
1684
-    destination[Z_AXIS] = z;
1705
+    destination[Z_AXIS] = current_position[Z_AXIS];
1706
+    prepare_move_to_destination(); // this will also set_current_to_destination
1685 1707
 
1686
-    if (x == current_position[X_AXIS] && y == current_position[Y_AXIS])
1708
+    if (current_position[Z_AXIS] > z) { // lower
1709
+      destination[Z_AXIS] = z;
1687 1710
       prepare_move_to_destination_raw(); // this will also set_current_to_destination
1688
-    else
1689
-      prepare_move_to_destination();     // this will also set_current_to_destination
1711
+    }
1690 1712
 
1691 1713
   #else
1692 1714
 

Завантаження…
Відмінити
Зберегти