Browse Source

SCARA support in do_blocking_move_to

Scott Lahteine 8 years ago
parent
commit
ad9d6870ed
1 changed files with 25 additions and 1 deletions
  1. 25
    1
      Marlin/Marlin_main.cpp

+ 25
- 1
Marlin/Marlin_main.cpp View File

1471
 inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); }
1471
 inline void set_current_to_destination() { memcpy(current_position, destination, sizeof(current_position)); }
1472
 inline void set_destination_to_current() { memcpy(destination, current_position, sizeof(destination)); }
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
    * Calculate delta, start a line, and set current_position to destination
1476
    * Calculate delta, start a line, and set current_position to destination
1477
    */
1477
    */
1555
       if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< do_blocking_move_to");
1555
       if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< do_blocking_move_to");
1556
     #endif
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
   #else
1582
   #else
1559
 
1583
 
1560
     // If Z needs to raise, do it before moving XY
1584
     // If Z needs to raise, do it before moving XY

Loading…
Cancel
Save