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

SCARA support in do_blocking_move_to

Scott Lahteine 8 роки тому
джерело
коміт
ad9d6870ed
1 змінених файлів з 25 додано та 1 видалено
  1. 25
    1
      Marlin/Marlin_main.cpp

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

@@ -1471,7 +1471,7 @@ inline void line_to_destination() { line_to_destination(feedrate_mm_s); }
1471 1471
 inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); }
1472 1472
 inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); }
1473 1473
 
1474
-#if ENABLED(DELTA)
1474
+#if IS_KINEMATIC
1475 1475
   /**
1476 1476
    * Calculate delta, start a line, and set current_position to destination
1477 1477
    */
@@ -1555,6 +1555,30 @@ void do_blocking_move_to(const float &x, const float &y, const float &z, const f
1555 1555
       if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< do_blocking_move_to");
1556 1556
     #endif
1557 1557
 
1558
+  #elif IS_SCARA
1559
+
1560
+    set_destination_to_current();
1561
+
1562
+    // If Z needs to raise, do it before moving XY
1563
+    if (current_position[Z_AXIS] < z) {
1564
+      feedrate_mm_s = (fr_mm_s != 0.0) ? fr_mm_s : homing_feedrate_mm_s[Z_AXIS];
1565
+      destination[Z_AXIS] = z;
1566
+      prepare_uninterpolated_move_to_destination();
1567
+    }
1568
+
1569
+    feedrate_mm_s = (fr_mm_s != 0.0) ? fr_mm_s : XY_PROBE_FEEDRATE_MM_S;
1570
+
1571
+    destination[X_AXIS] = x;
1572
+    destination[Y_AXIS] = y;
1573
+    prepare_uninterpolated_move_to_destination();
1574
+
1575
+    // If Z needs to lower, do it after moving XY
1576
+    if (current_position[Z_AXIS] > z) {
1577
+      feedrate_mm_s = (fr_mm_s != 0.0) ? fr_mm_s : homing_feedrate_mm_s[Z_AXIS];
1578
+      destination[Z_AXIS] = z;
1579
+      prepare_uninterpolated_move_to_destination();
1580
+    }
1581
+
1558 1582
   #else
1559 1583
 
1560 1584
     // If Z needs to raise, do it before moving XY

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