ソースを参照

Cleanup do_blocking_move_to for DELTA

Scott Lahteine 9年前
コミット
311c7dadb6
1個のファイルの変更15行の追加15行の削除
  1. 15
    15
      Marlin/Marlin_main.cpp

+ 15
- 15
Marlin/Marlin_main.cpp ファイルの表示

@@ -1679,35 +1679,35 @@ 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
+    set_destination_to_current();          // sync destination at the start
1683
+
1682 1684
     // when in the danger zone
1683 1685
     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
+      if (z > delta_clip_start_height) {   // staying in the danger zone
1687
+        destination[X_AXIS] = x;           // move directly (uninterpolated)
1686 1688
         destination[Y_AXIS] = y;
1687 1689
         destination[Z_AXIS] = z;
1688
-        prepare_move_to_destination_raw(); // this will also set_current_to_destination
1690
+        prepare_move_to_destination_raw(); // set_current_to_destination
1689 1691
         return;
1690
-      } else {                           // leave the danger zone
1691
-        destination[X_AXIS] = current_position[X_AXIS];
1692
-        destination[Y_AXIS] = current_position[Y_AXIS];
1692
+      }
1693
+      else {
1693 1694
         destination[Z_AXIS] = delta_clip_start_height;
1694
-        prepare_move_to_destination_raw(); // this will also set_current_to_destination
1695
+        prepare_move_to_destination_raw(); // set_current_to_destination
1695 1696
       }
1696 1697
     }
1697
-    if (current_position[Z_AXIS] < z) {  // raise
1698
-      destination[X_AXIS] = current_position[X_AXIS];
1699
-      destination[Y_AXIS] = current_position[Y_AXIS];
1698
+
1699
+    if (z > current_position[Z_AXIS]) {    // raising?
1700 1700
       destination[Z_AXIS] = z;
1701
-      prepare_move_to_destination_raw(); // this will also set_current_to_destination
1701
+      prepare_move_to_destination_raw();   // set_current_to_destination
1702 1702
     }
1703
+
1703 1704
     destination[X_AXIS] = x;
1704 1705
     destination[Y_AXIS] = y;
1705
-    destination[Z_AXIS] = current_position[Z_AXIS];
1706
-    prepare_move_to_destination(); // this will also set_current_to_destination
1706
+    prepare_move_to_destination();         // set_current_to_destination
1707 1707
 
1708
-    if (current_position[Z_AXIS] > z) { // lower
1708
+    if (z < current_position[Z_AXIS]) {    // lowering?
1709 1709
       destination[Z_AXIS] = z;
1710
-      prepare_move_to_destination_raw(); // this will also set_current_to_destination
1710
+      prepare_move_to_destination_raw();   // set_current_to_destination
1711 1711
     }
1712 1712
 
1713 1713
   #else

読み込み中…
キャンセル
保存