Browse Source

🐛 Fix CoreXY plus extra axes

See #22490
Scott Lahteine 4 years ago
parent
commit
cc109c1802
2 changed files with 50 additions and 1 deletions
  1. 18
    0
      Marlin/src/inc/SanityCheck.h
  2. 32
    1
      Marlin/src/module/planner.cpp

+ 18
- 0
Marlin/src/inc/SanityCheck.h View File

@@ -1383,6 +1383,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1383 1383
 #if LINEAR_AXES >= 4
1384 1384
   #if AXIS4_NAME != 'A' && AXIS4_NAME != 'B' && AXIS4_NAME != 'C' && AXIS4_NAME != 'U' && AXIS4_NAME != 'V' && AXIS4_NAME != 'W'
1385 1385
     #error "AXIS4_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
1386
+  #elif !defined(I_MIN_POS) || !defined(I_MAX_POS)
1387
+    #error "I_MIN_POS and I_MAX_POS are required with LINEAR_AXES >= 4."
1388
+  #elif !defined(I_HOME_DIR)
1389
+    #error "I_HOME_DIR is required with LINEAR_AXES >= 4."
1390
+  #elif HAS_I_ENABLE && !defined(I_ENABLE_ON)
1391
+    #error "I_ENABLE_ON is required for your I driver with LINEAR_AXES >= 4."
1386 1392
   #endif
1387 1393
 #endif
1388 1394
 #if LINEAR_AXES >= 5
@@ -1390,6 +1396,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1390 1396
     #error "AXIS5_NAME must be different from AXIS4_NAME and AXIS6_NAME"
1391 1397
   #elif AXIS5_NAME != 'A' && AXIS5_NAME != 'B' && AXIS5_NAME != 'C' && AXIS5_NAME != 'U' && AXIS5_NAME != 'V' && AXIS5_NAME != 'W'
1392 1398
     #error "AXIS5_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
1399
+  #elif !defined(J_MIN_POS) || !defined(J_MAX_POS)
1400
+    #error "J_MIN_POS and J_MAX_POS are required with LINEAR_AXES >= 5."
1401
+  #elif !defined(J_HOME_DIR)
1402
+    #error "J_HOME_DIR is required with LINEAR_AXES >= 5."
1403
+  #elif HAS_J_ENABLE && !defined(J_ENABLE_ON)
1404
+    #error "J_ENABLE_ON is required for your J driver with LINEAR_AXES >= 5."
1393 1405
   #endif
1394 1406
 #endif
1395 1407
 #if LINEAR_AXES >= 6
@@ -1397,6 +1409,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
1397 1409
     #error "AXIS6_NAME must be different from AXIS5_NAME and AXIS4_NAME."
1398 1410
   #elif AXIS6_NAME != 'A' && AXIS6_NAME != 'B' && AXIS6_NAME != 'C' && AXIS6_NAME != 'U' && AXIS6_NAME != 'V' && AXIS6_NAME != 'W'
1399 1411
     #error "AXIS6_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
1412
+  #elif !defined(K_MIN_POS) || !defined(K_MAX_POS)
1413
+    #error "K_MIN_POS and K_MAX_POS are required with LINEAR_AXES >= 6."
1414
+  #elif !defined(K_HOME_DIR)
1415
+    #error "K_HOME_DIR is required with LINEAR_AXES >= 6."
1416
+  #elif HAS_K_ENABLE && !defined(K_ENABLE_ON)
1417
+    #error "K_ENABLE_ON is required for your K driver with LINEAR_AXES >= 6."
1400 1418
   #endif
1401 1419
 #endif
1402 1420
 

+ 32
- 1
Marlin/src/module/planner.cpp View File

@@ -1877,6 +1877,15 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
1877 1877
       " A:", target.a, " (", da, " steps)"
1878 1878
       " B:", target.b, " (", db, " steps)"
1879 1879
       " C:", target.c, " (", dc, " steps)"
1880
+      #if LINEAR_AXES >= 4
1881
+        " " AXIS4_STR ":", target.i, " (", di, " steps)"
1882
+      #endif
1883
+      #if LINEAR_AXES >= 5
1884
+        " " AXIS5_STR ":", target.j, " (", dj, " steps)"
1885
+      #endif
1886
+      #if LINEAR_AXES >= 6
1887
+        " " AXIS6_STR ":", target.k, " (", dk, " steps)"
1888
+      #endif
1880 1889
       #if HAS_EXTRUDERS
1881 1890
         " E:", target.e, " (", de, " steps)"
1882 1891
       #endif
@@ -1953,6 +1962,19 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
1953 1962
       if (dk < 0) SBI(dm, K_AXIS)
1954 1963
     );
1955 1964
   #endif
1965
+
1966
+  #if IS_CORE
1967
+    #if LINEAR_AXES >= 4
1968
+      if (di < 0) SBI(dm, I_AXIS);
1969
+    #endif
1970
+    #if LINEAR_AXES >= 5
1971
+      if (dj < 0) SBI(dm, J_AXIS);
1972
+    #endif
1973
+    #if LINEAR_AXES >= 6
1974
+      if (dk < 0) SBI(dm, K_AXIS);
1975
+    #endif
1976
+  #endif
1977
+
1956 1978
   #if HAS_EXTRUDERS
1957 1979
     if (de < 0) SBI(dm, E_AXIS);
1958 1980
   #endif
@@ -2004,7 +2026,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2004 2026
    */
2005 2027
   struct DistanceMM : abce_float_t {
2006 2028
     #if EITHER(IS_CORE, MARKFORGED_XY)
2007
-      xyz_pos_t head;
2029
+      struct { float x, y, z; } head;
2008 2030
     #endif
2009 2031
   } steps_dist_mm;
2010 2032
   #if IS_CORE
@@ -2027,6 +2049,15 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
2027 2049
       steps_dist_mm.b      = (db + dc) * steps_to_mm[B_AXIS];
2028 2050
       steps_dist_mm.c      = CORESIGN(db - dc) * steps_to_mm[C_AXIS];
2029 2051
     #endif
2052
+    #if LINEAR_AXES >= 4
2053
+      steps_dist_mm.i = di * steps_to_mm[I_AXIS];
2054
+    #endif
2055
+    #if LINEAR_AXES >= 5
2056
+      steps_dist_mm.j = dj * steps_to_mm[J_AXIS];
2057
+    #endif
2058
+    #if LINEAR_AXES >= 6
2059
+      steps_dist_mm.k = dk * steps_to_mm[K_AXIS];
2060
+    #endif
2030 2061
   #elif ENABLED(MARKFORGED_XY)
2031 2062
     steps_dist_mm.head.x = da * steps_to_mm[A_AXIS];
2032 2063
     steps_dist_mm.head.y = db * steps_to_mm[B_AXIS];

Loading…
Cancel
Save