🐛 Fix CoreXY plus extra axes

See #22490
2.0.x
Scott Lahteine 3 years ago
parent 166324fc7b
commit 0c0f84b659

@ -1379,6 +1379,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#if LINEAR_AXES >= 4
#if AXIS4_NAME != 'A' && AXIS4_NAME != 'B' && AXIS4_NAME != 'C' && AXIS4_NAME != 'U' && AXIS4_NAME != 'V' && AXIS4_NAME != 'W'
#error "AXIS4_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
#elif !defined(I_MIN_POS) || !defined(I_MAX_POS)
#error "I_MIN_POS and I_MAX_POS are required with LINEAR_AXES >= 4."
#elif !defined(I_HOME_DIR)
#error "I_HOME_DIR is required with LINEAR_AXES >= 4."
#elif HAS_I_ENABLE && !defined(I_ENABLE_ON)
#error "I_ENABLE_ON is required for your I driver with LINEAR_AXES >= 4."
#endif
#endif
#if LINEAR_AXES >= 5
@ -1386,6 +1392,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "AXIS5_NAME must be different from AXIS4_NAME and AXIS6_NAME"
#elif AXIS5_NAME != 'A' && AXIS5_NAME != 'B' && AXIS5_NAME != 'C' && AXIS5_NAME != 'U' && AXIS5_NAME != 'V' && AXIS5_NAME != 'W'
#error "AXIS5_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
#elif !defined(J_MIN_POS) || !defined(J_MAX_POS)
#error "J_MIN_POS and J_MAX_POS are required with LINEAR_AXES >= 5."
#elif !defined(J_HOME_DIR)
#error "J_HOME_DIR is required with LINEAR_AXES >= 5."
#elif HAS_J_ENABLE && !defined(J_ENABLE_ON)
#error "J_ENABLE_ON is required for your J driver with LINEAR_AXES >= 5."
#endif
#endif
#if LINEAR_AXES >= 6
@ -1393,6 +1405,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "AXIS6_NAME must be different from AXIS5_NAME and AXIS4_NAME."
#elif AXIS6_NAME != 'A' && AXIS6_NAME != 'B' && AXIS6_NAME != 'C' && AXIS6_NAME != 'U' && AXIS6_NAME != 'V' && AXIS6_NAME != 'W'
#error "AXIS6_NAME can only be one of 'A', 'B', 'C', 'U', 'V', or 'W'."
#elif !defined(K_MIN_POS) || !defined(K_MAX_POS)
#error "K_MIN_POS and K_MAX_POS are required with LINEAR_AXES >= 6."
#elif !defined(K_HOME_DIR)
#error "K_HOME_DIR is required with LINEAR_AXES >= 6."
#elif HAS_K_ENABLE && !defined(K_ENABLE_ON)
#error "K_ENABLE_ON is required for your K driver with LINEAR_AXES >= 6."
#endif
#endif

@ -1877,6 +1877,15 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
" A:", target.a, " (", da, " steps)"
" B:", target.b, " (", db, " steps)"
" C:", target.c, " (", dc, " steps)"
#if LINEAR_AXES >= 4
" " AXIS4_STR ":", target.i, " (", di, " steps)"
#endif
#if LINEAR_AXES >= 5
" " AXIS5_STR ":", target.j, " (", dj, " steps)"
#endif
#if LINEAR_AXES >= 6
" " AXIS6_STR ":", target.k, " (", dk, " steps)"
#endif
#if HAS_EXTRUDERS
" E:", target.e, " (", de, " steps)"
#endif
@ -1953,6 +1962,19 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
if (dk < 0) SBI(dm, K_AXIS)
);
#endif
#if IS_CORE
#if LINEAR_AXES >= 4
if (di < 0) SBI(dm, I_AXIS);
#endif
#if LINEAR_AXES >= 5
if (dj < 0) SBI(dm, J_AXIS);
#endif
#if LINEAR_AXES >= 6
if (dk < 0) SBI(dm, K_AXIS);
#endif
#endif
#if HAS_EXTRUDERS
if (de < 0) SBI(dm, E_AXIS);
#endif
@ -2004,7 +2026,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
*/
struct DistanceMM : abce_float_t {
#if EITHER(IS_CORE, MARKFORGED_XY)
xyz_pos_t head;
struct { float x, y, z; } head;
#endif
} steps_dist_mm;
#if IS_CORE
@ -2027,6 +2049,15 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
steps_dist_mm.b = (db + dc) * steps_to_mm[B_AXIS];
steps_dist_mm.c = CORESIGN(db - dc) * steps_to_mm[C_AXIS];
#endif
#if LINEAR_AXES >= 4
steps_dist_mm.i = di * steps_to_mm[I_AXIS];
#endif
#if LINEAR_AXES >= 5
steps_dist_mm.j = dj * steps_to_mm[J_AXIS];
#endif
#if LINEAR_AXES >= 6
steps_dist_mm.k = dk * steps_to_mm[K_AXIS];
#endif
#elif ENABLED(MARKFORGED_XY)
steps_dist_mm.head.x = da * steps_to_mm[A_AXIS];
steps_dist_mm.head.y = db * steps_to_mm[B_AXIS];

Loading…
Cancel
Save