✨ Support for up to 9 axes (linear, rotary) (#23112)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
@@ -35,8 +35,8 @@
|
||||
#endif
|
||||
|
||||
// Strings for sanity check messages
|
||||
#define _LINEAR_AXES_STR LINEAR_AXIS_GANG("X ", "Y ", "Z ", "I ", "J ", "K ")
|
||||
#define _LOGICAL_AXES_STR LOGICAL_AXIS_GANG("E ", "X ", "Y ", "Z ", "I ", "J ", "K ")
|
||||
#define _NUM_AXES_STR NUM_AXIS_GANG("X ", "Y ", "Z ", "I ", "J ", "K ", "U ", "V ", "W ")
|
||||
#define _LOGICAL_AXES_STR LOGICAL_AXIS_GANG("E ", "X ", "Y ", "Z ", "I ", "J ", "K ", "U ", "V ", "W ")
|
||||
|
||||
// Make sure macros aren't borked
|
||||
#define TEST1
|
||||
@@ -617,6 +617,8 @@
|
||||
#error "Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS is now just Z_STEPPER_ALIGN_STEPPER_XY."
|
||||
#elif defined(DWIN_CREALITY_LCD_ENHANCED)
|
||||
#error "DWIN_CREALITY_LCD_ENHANCED is now DWIN_LCD_PROUI."
|
||||
#elif defined(LINEAR_AXES)
|
||||
#error "LINEAR_AXES is now NUM_AXES (to account for rotational axes)."
|
||||
#endif
|
||||
|
||||
constexpr float arm[] = AXIS_RELATIVE_MODES;
|
||||
@@ -798,6 +800,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#error "Enable only one of ENDSTOPPULLUP_J_MAX or ENDSTOPPULLDOWN_J_MAX."
|
||||
#elif BOTH(ENDSTOPPULLUP_KMAX, ENDSTOPPULLDOWN_KMAX)
|
||||
#error "Enable only one of ENDSTOPPULLUP_K_MAX or ENDSTOPPULLDOWN_K_MAX."
|
||||
#elif BOTH(ENDSTOPPULLUP_UMAX, ENDSTOPPULLDOWN_UMAX)
|
||||
#error "Enable only one of ENDSTOPPULLUP_U_MAX or ENDSTOPPULLDOWN_U_MAX."
|
||||
#elif BOTH(ENDSTOPPULLUP_VMAX, ENDSTOPPULLDOWN_VMAX)
|
||||
#error "Enable only one of ENDSTOPPULLUP_V_MAX or ENDSTOPPULLDOWN_V_MAX."
|
||||
#elif BOTH(ENDSTOPPULLUP_WMAX, ENDSTOPPULLDOWN_WMAX)
|
||||
#error "Enable only one of ENDSTOPPULLUP_W_MAX or ENDSTOPPULLDOWN_W_MAX."
|
||||
#elif BOTH(ENDSTOPPULLUP_XMIN, ENDSTOPPULLDOWN_XMIN)
|
||||
#error "Enable only one of ENDSTOPPULLUP_X_MIN or ENDSTOPPULLDOWN_X_MIN."
|
||||
#elif BOTH(ENDSTOPPULLUP_YMIN, ENDSTOPPULLDOWN_YMIN)
|
||||
@@ -810,6 +818,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#error "Enable only one of ENDSTOPPULLUP_J_MIN or ENDSTOPPULLDOWN_J_MIN."
|
||||
#elif BOTH(ENDSTOPPULLUP_KMIN, ENDSTOPPULLDOWN_KMIN)
|
||||
#error "Enable only one of ENDSTOPPULLUP_K_MIN or ENDSTOPPULLDOWN_K_MIN."
|
||||
#elif BOTH(ENDSTOPPULLUP_UMIN, ENDSTOPPULLDOWN_UMIN)
|
||||
#error "Enable only one of ENDSTOPPULLUP_U_MIN or ENDSTOPPULLDOWN_U_MIN."
|
||||
#elif BOTH(ENDSTOPPULLUP_VMIN, ENDSTOPPULLDOWN_VMIN)
|
||||
#error "Enable only one of ENDSTOPPULLUP_V_MIN or ENDSTOPPULLDOWN_V_MIN."
|
||||
#elif BOTH(ENDSTOPPULLUP_WMIN, ENDSTOPPULLDOWN_WMIN)
|
||||
#error "Enable only one of ENDSTOPPULLUP_W_MIN or ENDSTOPPULLDOWN_W_MIN."
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -1417,16 +1431,18 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Features that require a min/max/specific LINEAR_AXES
|
||||
* Features that require a min/max/specific NUM_AXES
|
||||
*/
|
||||
#if HAS_LEVELING && !HAS_Z_AXIS
|
||||
#error "Leveling in Marlin requires three or more axes, with Z as the vertical axis."
|
||||
#elif ENABLED(CNC_WORKSPACE_PLANES) && !HAS_Z_AXIS
|
||||
#error "CNC_WORKSPACE_PLANES currently requires LINEAR_AXES >= 3"
|
||||
#elif ENABLED(DIRECT_STEPPING) && LINEAR_AXES > XYZ
|
||||
#error "DIRECT_STEPPING currently requires LINEAR_AXES 3"
|
||||
#elif ENABLED(FOAMCUTTER_XYUV) && LINEAR_AXES < 5
|
||||
#error "FOAMCUTTER_XYUV requires LINEAR_AXES >= 5."
|
||||
#error "CNC_WORKSPACE_PLANES currently requires NUM_AXES >= 3"
|
||||
#elif ENABLED(DIRECT_STEPPING) && NUM_AXES > XYZ
|
||||
#error "DIRECT_STEPPING currently requires NUM_AXES 3"
|
||||
#elif ENABLED(FOAMCUTTER_XYUV) && NUM_AXES < 5
|
||||
#error "FOAMCUTTER_XYUV requires NUM_AXES >= 5."
|
||||
#elif ENABLED(LINEAR_ADVANCE) && HAS_I_AXIS
|
||||
#error "LINEAR_ADVANCE currently requires NUM_AXES <= 3."
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -1434,33 +1450,76 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
*/
|
||||
#if HAS_I_AXIS
|
||||
#if !defined(I_MIN_POS) || !defined(I_MAX_POS)
|
||||
#error "I_MIN_POS and I_MAX_POS are required with LINEAR_AXES >= 4."
|
||||
#error "I_MIN_POS and I_MAX_POS are required with NUM_AXES >= 4."
|
||||
#elif !defined(I_HOME_DIR)
|
||||
#error "I_HOME_DIR is required with LINEAR_AXES >= 4."
|
||||
#error "I_HOME_DIR is required with NUM_AXES >= 4."
|
||||
#elif HAS_I_ENABLE && !defined(I_ENABLE_ON)
|
||||
#error "I_ENABLE_ON is required for your I driver with LINEAR_AXES >= 4."
|
||||
#error "I_ENABLE_ON is required for your I driver with NUM_AXES >= 4."
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_J_AXIS
|
||||
#if AXIS5_NAME == AXIS4_NAME
|
||||
#error "AXIS5_NAME must be unique."
|
||||
#elif ENABLED(AXIS5_ROTATES) && DISABLED(AXIS4_ROTATES)
|
||||
#error "AXIS5_ROTATES requires AXIS4_ROTATES."
|
||||
#elif !defined(J_MIN_POS) || !defined(J_MAX_POS)
|
||||
#error "J_MIN_POS and J_MAX_POS are required with LINEAR_AXES >= 5."
|
||||
#error "J_MIN_POS and J_MAX_POS are required with NUM_AXES >= 5."
|
||||
#elif !defined(J_HOME_DIR)
|
||||
#error "J_HOME_DIR is required with LINEAR_AXES >= 5."
|
||||
#error "J_HOME_DIR is required with NUM_AXES >= 5."
|
||||
#elif HAS_J_ENABLE && !defined(J_ENABLE_ON)
|
||||
#error "J_ENABLE_ON is required for your J driver with LINEAR_AXES >= 5."
|
||||
#error "J_ENABLE_ON is required for your J driver with NUM_AXES >= 5."
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_K_AXIS
|
||||
#if AXIS6_NAME == AXIS5_NAME || AXIS6_NAME == AXIS4_NAME
|
||||
#error "AXIS6_NAME must be unique."
|
||||
#elif ENABLED(AXIS6_ROTATES) && DISABLED(AXIS5_ROTATES)
|
||||
#error "AXIS6_ROTATES requires AXIS5_ROTATES."
|
||||
#elif !defined(K_MIN_POS) || !defined(K_MAX_POS)
|
||||
#error "K_MIN_POS and K_MAX_POS are required with LINEAR_AXES >= 6."
|
||||
#error "K_MIN_POS and K_MAX_POS are required with NUM_AXES >= 6."
|
||||
#elif !defined(K_HOME_DIR)
|
||||
#error "K_HOME_DIR is required with LINEAR_AXES >= 6."
|
||||
#error "K_HOME_DIR is required with NUM_AXES >= 6."
|
||||
#elif HAS_K_ENABLE && !defined(K_ENABLE_ON)
|
||||
#error "K_ENABLE_ON is required for your K driver with LINEAR_AXES >= 6."
|
||||
#error "K_ENABLE_ON is required for your K driver with NUM_AXES >= 6."
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_U_AXIS
|
||||
#if AXIS7_NAME == AXIS6_NAME || AXIS7_NAME == AXIS5_NAME || AXIS7_NAME == AXIS4_NAME
|
||||
#error "AXIS7_NAME must be unique."
|
||||
#elif ENABLED(AXIS7_ROTATES) && DISABLED(AXIS6_ROTATES)
|
||||
#error "AXIS7_ROTATES requires AXIS6_ROTATES."
|
||||
#elif !defined(U_MIN_POS) || !defined(U_MAX_POS)
|
||||
#error "U_MIN_POS and U_MAX_POS are required with NUM_AXES >= 7."
|
||||
#elif !defined(U_HOME_DIR)
|
||||
#error "U_HOME_DIR is required with NUM_AXES >= 7."
|
||||
#elif HAS_U_ENABLE && !defined(U_ENABLE_ON)
|
||||
#error "U_ENABLE_ON is required for your U driver with NUM_AXES >= 7."
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_V_AXIS
|
||||
#if AXIS8_NAME == AXIS7_NAME || AXIS8_NAME == AXIS6_NAME || AXIS8_NAME == AXIS5_NAME || AXIS8_NAME == AXIS4_NAME
|
||||
#error "AXIS8_NAME must be unique."
|
||||
#elif ENABLED(AXIS8_ROTATES) && DISABLED(AXIS7_ROTATES)
|
||||
#error "AXIS8_ROTATES requires AXIS7_ROTATES."
|
||||
#elif !defined(V_MIN_POS) || !defined(V_MAX_POS)
|
||||
#error "V_MIN_POS and V_MAX_POS are required with NUM_AXES >= 8."
|
||||
#elif !defined(V_HOME_DIR)
|
||||
#error "V_HOME_DIR is required with NUM_AXES >= 8."
|
||||
#elif HAS_V_ENABLE && !defined(V_ENABLE_ON)
|
||||
#error "V_ENABLE_ON is required for your V driver with NUM_AXES >= 8."
|
||||
#endif
|
||||
#endif
|
||||
#if HAS_W_AXIS
|
||||
#if AXIS9_NAME == AXIS8_NAME || AXIS9_NAME == AXIS7_NAME || AXIS9_NAME == AXIS6_NAME || AXIS9_NAME == AXIS5_NAME || AXIS9_NAME == AXIS4_NAME
|
||||
#error "AXIS9_NAME must be unique."
|
||||
#elif ENABLED(AXIS9_ROTATES) && DISABLED(AXIS8_ROTATES)
|
||||
#error "AXIS9_ROTATES requires AXIS8_ROTATES."
|
||||
#elif !defined(W_MIN_POS) || !defined(W_MAX_POS)
|
||||
#error "W_MIN_POS and W_MAX_POS are required with NUM_AXES >= 9."
|
||||
#elif !defined(W_HOME_DIR)
|
||||
#error "W_HOME_DIR is required with NUM_AXES >= 9."
|
||||
#elif HAS_W_ENABLE && !defined(W_ENABLE_ON)
|
||||
#error "W_ENABLE_ON is required for your W driver with NUM_AXES >= 9."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1850,49 +1909,61 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#error "Required setting HOMING_BUMP_DIVISOR is missing!"
|
||||
#else
|
||||
constexpr float hbm[] = HOMING_BUMP_MM, hbd[] = HOMING_BUMP_DIVISOR;
|
||||
static_assert(COUNT(hbm) == LINEAR_AXES, "HOMING_BUMP_MM must have " _LINEAR_AXES_STR "elements (and no others).");
|
||||
LINEAR_AXIS_CODE(
|
||||
static_assert(COUNT(hbm) == NUM_AXES, "HOMING_BUMP_MM must have " _NUM_AXES_STR "elements (and no others).");
|
||||
NUM_AXIS_CODE(
|
||||
static_assert(hbm[X_AXIS] >= 0, "HOMING_BUMP_MM.X must be greater than or equal to 0."),
|
||||
static_assert(hbm[Y_AXIS] >= 0, "HOMING_BUMP_MM.Y must be greater than or equal to 0."),
|
||||
static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal to 0."),
|
||||
static_assert(hbm[I_AXIS] >= 0, "HOMING_BUMP_MM.I must be greater than or equal to 0."),
|
||||
static_assert(hbm[J_AXIS] >= 0, "HOMING_BUMP_MM.J must be greater than or equal to 0."),
|
||||
static_assert(hbm[K_AXIS] >= 0, "HOMING_BUMP_MM.K must be greater than or equal to 0.")
|
||||
static_assert(hbm[K_AXIS] >= 0, "HOMING_BUMP_MM.K must be greater than or equal to 0."),
|
||||
static_assert(hbm[U_AXIS] >= 0, "HOMING_BUMP_MM.U must be greater than or equal to 0."),
|
||||
static_assert(hbm[V_AXIS] >= 0, "HOMING_BUMP_MM.V must be greater than or equal to 0."),
|
||||
static_assert(hbm[W_AXIS] >= 0, "HOMING_BUMP_MM.W must be greater than or equal to 0.")
|
||||
);
|
||||
static_assert(COUNT(hbd) == LINEAR_AXES, "HOMING_BUMP_DIVISOR must have " _LINEAR_AXES_STR "elements (and no others).");
|
||||
LINEAR_AXIS_CODE(
|
||||
static_assert(COUNT(hbd) == NUM_AXES, "HOMING_BUMP_DIVISOR must have " _NUM_AXES_STR "elements (and no others).");
|
||||
NUM_AXIS_CODE(
|
||||
static_assert(hbd[X_AXIS] >= 1, "HOMING_BUMP_DIVISOR.X must be greater than or equal to 1."),
|
||||
static_assert(hbd[Y_AXIS] >= 1, "HOMING_BUMP_DIVISOR.Y must be greater than or equal to 1."),
|
||||
static_assert(hbd[Z_AXIS] >= 1, "HOMING_BUMP_DIVISOR.Z must be greater than or equal to 1."),
|
||||
static_assert(hbd[I_AXIS] >= 1, "HOMING_BUMP_DIVISOR.I must be greater than or equal to 1."),
|
||||
static_assert(hbd[J_AXIS] >= 1, "HOMING_BUMP_DIVISOR.J must be greater than or equal to 1."),
|
||||
static_assert(hbd[K_AXIS] >= 1, "HOMING_BUMP_DIVISOR.K must be greater than or equal to 1.")
|
||||
static_assert(hbd[K_AXIS] >= 1, "HOMING_BUMP_DIVISOR.K must be greater than or equal to 1."),
|
||||
static_assert(hbd[U_AXIS] >= 1, "HOMING_BUMP_DIVISOR.U must be greater than or equal to 1."),
|
||||
static_assert(hbd[V_AXIS] >= 1, "HOMING_BUMP_DIVISOR.V must be greater than or equal to 1."),
|
||||
static_assert(hbd[W_AXIS] >= 1, "HOMING_BUMP_DIVISOR.W must be greater than or equal to 1.")
|
||||
);
|
||||
#endif
|
||||
|
||||
#ifdef HOMING_BACKOFF_POST_MM
|
||||
constexpr float hbp[] = HOMING_BACKOFF_POST_MM;
|
||||
static_assert(COUNT(hbp) == LINEAR_AXES, "HOMING_BACKOFF_POST_MM must have " _LINEAR_AXES_STR "elements (and no others).");
|
||||
LINEAR_AXIS_CODE(
|
||||
static_assert(COUNT(hbp) == NUM_AXES, "HOMING_BACKOFF_POST_MM must have " _NUM_AXES_STR "elements (and no others).");
|
||||
NUM_AXIS_CODE(
|
||||
static_assert(hbp[X_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.X must be greater than or equal to 0."),
|
||||
static_assert(hbp[Y_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.Y must be greater than or equal to 0."),
|
||||
static_assert(hbp[Z_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.Z must be greater than or equal to 0."),
|
||||
static_assert(hbp[I_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.I must be greater than or equal to 0."),
|
||||
static_assert(hbp[J_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.J must be greater than or equal to 0."),
|
||||
static_assert(hbp[K_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.K must be greater than or equal to 0.")
|
||||
static_assert(hbp[K_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.K must be greater than or equal to 0."),
|
||||
static_assert(hbp[U_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.U must be greater than or equal to 0."),
|
||||
static_assert(hbp[V_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.V must be greater than or equal to 0."),
|
||||
static_assert(hbp[W_AXIS] >= 0, "HOMING_BACKOFF_POST_MM.W must be greater than or equal to 0.")
|
||||
);
|
||||
#endif
|
||||
|
||||
#ifdef SENSORLESS_BACKOFF_MM
|
||||
constexpr float sbm[] = SENSORLESS_BACKOFF_MM;
|
||||
static_assert(COUNT(sbm) == LINEAR_AXES, "SENSORLESS_BACKOFF_MM must have " _LINEAR_AXES_STR "elements (and no others).");
|
||||
LINEAR_AXIS_CODE(
|
||||
static_assert(COUNT(sbm) == NUM_AXES, "SENSORLESS_BACKOFF_MM must have " _NUM_AXES_STR "elements (and no others).");
|
||||
NUM_AXIS_CODE(
|
||||
static_assert(sbm[X_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.X must be greater than or equal to 0."),
|
||||
static_assert(sbm[Y_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.Y must be greater than or equal to 0."),
|
||||
static_assert(sbm[Z_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.Z must be greater than or equal to 0."),
|
||||
static_assert(sbm[I_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.I must be greater than or equal to 0."),
|
||||
static_assert(sbm[J_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.J must be greater than or equal to 0."),
|
||||
static_assert(sbm[K_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.K must be greater than or equal to 0.")
|
||||
static_assert(sbm[K_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.K must be greater than or equal to 0."),
|
||||
static_assert(sbm[U_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.U must be greater than or equal to 0."),
|
||||
static_assert(sbm[V_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.V must be greater than or equal to 0."),
|
||||
static_assert(sbm[W_AXIS] >= 0, "SENSORLESS_BACKOFF_MM.W must be greater than or equal to 0.")
|
||||
);
|
||||
#endif
|
||||
|
||||
@@ -1915,9 +1986,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
/**
|
||||
* Make sure DISABLE_[XYZ] compatible with selected homing options
|
||||
*/
|
||||
#if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_I, DISABLE_J, DISABLE_K)
|
||||
#if ANY(DISABLE_X, DISABLE_Y, DISABLE_Z, DISABLE_I, DISABLE_J, DISABLE_K, DISABLE_U, DISABLE_V, DISABLE_W)
|
||||
#if EITHER(HOME_AFTER_DEACTIVATE, Z_SAFE_HOMING)
|
||||
#error "DISABLE_[XYZIJK] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
|
||||
#error "DISABLE_[XYZIJKUVW] is not compatible with HOME_AFTER_DEACTIVATE or Z_SAFE_HOMING."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -2431,7 +2502,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#define _PLUG_UNUSED_TEST(A,P) (DISABLED(USE_##P##MIN_PLUG, USE_##P##MAX_PLUG) \
|
||||
&& !(ENABLED(A##_DUAL_ENDSTOPS) && WITHIN(A##2_USE_ENDSTOP, _##P##MAX_, _##P##MIN_)) \
|
||||
&& !(ENABLED(A##_MULTI_ENDSTOPS) && WITHIN(A##2_USE_ENDSTOP, _##P##MAX_, _##P##MIN_)) )
|
||||
#define _AXIS_PLUG_UNUSED_TEST(A) (1 LINEAR_AXIS_GANG(&& _PLUG_UNUSED_TEST(A,X), && _PLUG_UNUSED_TEST(A,Y), && _PLUG_UNUSED_TEST(A,Z), && _PLUG_UNUSED_TEST(A,I), && _PLUG_UNUSED_TEST(A,J), && _PLUG_UNUSED_TEST(A,K) ) )
|
||||
#define _AXIS_PLUG_UNUSED_TEST(A) (1 NUM_AXIS_GANG(&& _PLUG_UNUSED_TEST(A,X), && _PLUG_UNUSED_TEST(A,Y), && _PLUG_UNUSED_TEST(A,Z), \
|
||||
&& _PLUG_UNUSED_TEST(A,I), && _PLUG_UNUSED_TEST(A,J), && _PLUG_UNUSED_TEST(A,K), \
|
||||
&& _PLUG_UNUSED_TEST(A,U), && _PLUG_UNUSED_TEST(A,V), && _PLUG_UNUSED_TEST(A,W) ) )
|
||||
|
||||
// A machine with endstops must have a minimum of 3
|
||||
#if HAS_ENDSTOPS
|
||||
@@ -2453,6 +2526,15 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#if HAS_K_AXIS && _AXIS_PLUG_UNUSED_TEST(K)
|
||||
#error "You must enable USE_KMIN_PLUG or USE_KMAX_PLUG."
|
||||
#endif
|
||||
#if HAS_U_AXIS && _AXIS_PLUG_UNUSED_TEST(U)
|
||||
#error "You must enable USE_UMIN_PLUG or USE_UMAX_PLUG."
|
||||
#endif
|
||||
#if HAS_V_AXIS && _AXIS_PLUG_UNUSED_TEST(V)
|
||||
#error "You must enable USE_VMIN_PLUG or USE_VMAX_PLUG."
|
||||
#endif
|
||||
#if HAS_W_AXIS && _AXIS_PLUG_UNUSED_TEST(W)
|
||||
#error "You must enable USE_WMIN_PLUG or USE_WMAX_PLUG."
|
||||
#endif
|
||||
|
||||
// Delta and Cartesian use 3 homing endstops
|
||||
#if NONE(IS_SCARA, SPI_ENDSTOPS)
|
||||
@@ -2476,6 +2558,18 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#error "Enable USE_KMIN_PLUG when homing K to MIN."
|
||||
#elif HAS_K_AXIS && K_HOME_TO_MAX && DISABLED(USE_KMAX_PLUG)
|
||||
#error "Enable USE_KMAX_PLUG when homing K to MAX."
|
||||
#elif HAS_U_AXIS && U_HOME_TO_MIN && DISABLED(USE_UMIN_PLUG)
|
||||
#error "Enable USE_UMIN_PLUG when homing U to MIN."
|
||||
#elif HAS_U_AXIS && U_HOME_TO_MAX && DISABLED(USE_UMAX_PLUG)
|
||||
#error "Enable USE_UMAX_PLUG when homing U to MAX."
|
||||
#elif HAS_V_AXIS && V_HOME_TO_MIN && DISABLED(USE_VMIN_PLUG)
|
||||
#error "Enable USE_VMIN_PLUG when homing V to MIN."
|
||||
#elif HAS_V_AXIS && V_HOME_TO_MAX && DISABLED(USE_VMAX_PLUG)
|
||||
#error "Enable USE_VMAX_PLUG when homing V to MAX."
|
||||
#elif HAS_W_AXIS && W_HOME_TO_MIN && DISABLED(USE_WMIN_PLUG)
|
||||
#error "Enable USE_WMIN_PLUG when homing W to MIN."
|
||||
#elif HAS_W_AXIS && W_HOME_TO_MAX && DISABLED(USE_WMAX_PLUG)
|
||||
#error "Enable USE_WMAX_PLUG when homing W to MAX."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -2959,6 +3053,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#error "An SPI driven TMC on J requires J_CS_PIN."
|
||||
#elif INVALID_TMC_SPI(K)
|
||||
#error "An SPI driven TMC on K requires K_CS_PIN."
|
||||
#elif INVALID_TMC_SPI(U)
|
||||
#error "An SPI driven TMC on U requires U_CS_PIN."
|
||||
#elif INVALID_TMC_SPI(V)
|
||||
#error "An SPI driven TMC on V requires V_CS_PIN."
|
||||
#elif INVALID_TMC_SPI(W)
|
||||
#error "An SPI driven TMC on W requires W_CS_PIN."
|
||||
#endif
|
||||
#undef INVALID_TMC_SPI
|
||||
|
||||
@@ -3004,6 +3104,13 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#error "TMC2208 or TMC2209 on J requires J_HARDWARE_SERIAL or J_SERIAL_(RX|TX)_PIN."
|
||||
#elif HAS_K_AXIS && INVALID_TMC_UART(K)
|
||||
#error "TMC2208 or TMC2209 on K requires K_HARDWARE_SERIAL or K_SERIAL_(RX|TX)_PIN."
|
||||
#elif HAS_U_AXIS && INVALID_TMC_UART(U)
|
||||
#error "TMC2208 or TMC2209 on U requires U_HARDWARE_SERIAL or U_SERIAL_(RX|TX)_PIN."
|
||||
#elif HAS_V_AXIS && INVALID_TMC_UART(V)
|
||||
#error "TMC2208 or TMC2209 on V requires V_HARDWARE_SERIAL or V_SERIAL_(RX|TX)_PIN."
|
||||
#elif HAS_W_AXIS && INVALID_TMC_UART(W)
|
||||
#error "TMC2208 or TMC2209 on W requires W_HARDWARE_SERIAL or W_SERIAL_(RX|TX)_PIN."
|
||||
|
||||
#endif
|
||||
#undef INVALID_TMC_UART
|
||||
|
||||
@@ -3033,6 +3140,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
INVALID_TMC_ADDRESS(J);
|
||||
#elif AXIS_DRIVER_TYPE_K(TMC2209)
|
||||
INVALID_TMC_ADDRESS(K);
|
||||
#elif AXIS_DRIVER_TYPE_U(TMC2209)
|
||||
INVALID_TMC_ADDRESS(U);
|
||||
#elif AXIS_DRIVER_TYPE_V(TMC2209)
|
||||
INVALID_TMC_ADDRESS(V);
|
||||
#elif AXIS_DRIVER_TYPE_W(TMC2209)
|
||||
INVALID_TMC_ADDRESS(W);
|
||||
#elif AXIS_DRIVER_TYPE_E0(TMC2209)
|
||||
INVALID_TMC_ADDRESS(E0);
|
||||
#elif AXIS_DRIVER_TYPE_E1(TMC2209)
|
||||
@@ -3094,6 +3207,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
INVALID_TMC_MS(J)
|
||||
#elif HAS_K_AXIS && !TMC_MICROSTEP_IS_VALID(K)
|
||||
INVALID_TMC_MS(K)
|
||||
#elif HAS_U_AXIS && !TMC_MICROSTEP_IS_VALID(U)
|
||||
INVALID_TMC_MS(U)
|
||||
#elif HAS_V_AXIS && !TMC_MICROSTEP_IS_VALID(V)
|
||||
INVALID_TMC_MS(V)
|
||||
#elif HAS_W_AXIS && !TMC_MICROSTEP_IS_VALID(W)
|
||||
INVALID_TMC_MS(W)
|
||||
#endif
|
||||
#undef INVALID_TMC_MS
|
||||
#undef TMC_MICROSTEP_IS_VALID
|
||||
@@ -3123,6 +3242,15 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#if HAS_K_AXIS
|
||||
#define K_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(K,TMC2209)
|
||||
#endif
|
||||
#if HAS_U_AXIS
|
||||
#define U_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(U,TMC2209)
|
||||
#endif
|
||||
#if HAS_V_AXIS
|
||||
#define V_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(V,TMC2209)
|
||||
#endif
|
||||
#if HAS_W_AXIS
|
||||
#define W_ENDSTOP_INVERTING !AXIS_DRIVER_TYPE(W,TMC2209)
|
||||
#endif
|
||||
|
||||
#if NONE(SPI_ENDSTOPS, ONBOARD_ENDSTOPPULLUPS, ENDSTOPPULLUPS)
|
||||
#if X_SENSORLESS && X_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_XMIN)
|
||||
@@ -3149,6 +3277,19 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_KMIN (or ENDSTOPPULLUPS) when homing to K_MIN."
|
||||
#elif ALL(HAS_K_AXIS, K_SENSORLESS, K_HOME_TO_MAX) && DISABLED(ENDSTOPPULLUP_KMAX)
|
||||
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_KMAX (or ENDSTOPPULLUPS) when homing to K_MAX."
|
||||
#elif HAS_U_AXIS && U_SENSORLESS && U_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_UMIN)
|
||||
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_UMIN (or ENDSTOPPULLUPS) when homing to U_MIN."
|
||||
#elif HAS_U_AXIS && U_SENSORLESS && U_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_UMAX)
|
||||
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_UMAX (or ENDSTOPPULLUPS) when homing to U_MAX."
|
||||
#elif HAS_V_AXIS && V_SENSORLESS && V_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_VMIN)
|
||||
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_VMIN (or ENDSTOPPULLUPS) when homing to V_MIN."
|
||||
#elif HAS_V_AXIS && V_SENSORLESS && V_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_VMAX)
|
||||
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_VMAX (or ENDSTOPPULLUPS) when homing to V_MAX."
|
||||
#elif HAS_W_AXIS && W_SENSORLESS && W_HOME_TO_MIN && DISABLED(ENDSTOPPULLUP_WMIN)
|
||||
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_WMIN (or ENDSTOPPULLUPS) when homing to W_MIN."
|
||||
#elif HAS_W_AXIS && W_SENSORLESS && W_HOME_TO_MAX && DISABLED(ENDSTOPPULLUP_WMAX)
|
||||
#error "SENSORLESS_HOMING requires ENDSTOPPULLUP_WMAX (or ENDSTOPPULLUPS) when homing to W_MAX."
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -3229,6 +3370,42 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#else
|
||||
#error "SENSORLESS_HOMING requires K_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to K_MAX."
|
||||
#endif
|
||||
#elif ALL(HAS_U_AXIS, U_SENSORLESS, U_HOME_TO_MIN) && U_MIN_ENDSTOP_INVERTING != U_ENDSTOP_INVERTING
|
||||
#if U_ENDSTOP_INVERTING
|
||||
#error "SENSORLESS_HOMING requires U_MIN_ENDSTOP_INVERTING = true when homing to U_MIN."
|
||||
#else
|
||||
#error "SENSORLESS_HOMING requires U_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to U_MIN."
|
||||
#endif
|
||||
#elif ALL(HAS_U_AXIS, U_SENSORLESS, U_HOME_TO_MAX) && U_MAX_ENDSTOP_INVERTING != U_ENDSTOP_INVERTING
|
||||
#if U_ENDSTOP_INVERTING
|
||||
#error "SENSORLESS_HOMING requires U_MAX_ENDSTOP_INVERTING = true when homing to U_MAX."
|
||||
#else
|
||||
#error "SENSORLESS_HOMING requires U_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to U_MAX."
|
||||
#endif
|
||||
#elif ALL(HAS_V_AXIS, V_SENSORLESS, V_HOME_TO_MIN) && V_MIN_ENDSTOP_INVERTING != V_ENDSTOP_INVERTING
|
||||
#if V_ENDSTOP_INVERTING
|
||||
#error "SENSORLESS_HOMING requires V_MIN_ENDSTOP_INVERTING = true when homing to V_MIN."
|
||||
#else
|
||||
#error "SENSORLESS_HOMING requires V_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to V_MIN."
|
||||
#endif
|
||||
#elif ALL(HAS_V_AXIS, V_SENSORLESS, V_HOME_TO_MAX) && V_MAX_ENDSTOP_INVERTING != V_ENDSTOP_INVERTING
|
||||
#if V_ENDSTOP_INVERTING
|
||||
#error "SENSORLESS_HOMING requires V_MAX_ENDSTOP_INVERTING = true when homing to V_MAX."
|
||||
#else
|
||||
#error "SENSORLESS_HOMING requires V_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to V_MAX."
|
||||
#endif
|
||||
#elif ALL(HAS_W_AXIS, W_SENSORLESS, W_HOME_TO_MIN) && W_MIN_ENDSTOP_INVERTING != W_ENDSTOP_INVERTING
|
||||
#if W_ENDSTOP_INVERTING
|
||||
#error "SENSORLESS_HOMING requires W_MIN_ENDSTOP_INVERTING = true when homing to W_MIN."
|
||||
#else
|
||||
#error "SENSORLESS_HOMING requires W_MIN_ENDSTOP_INVERTING = false when homing TMC2209 to W_MIN."
|
||||
#endif
|
||||
#elif ALL(HAS_W_AXIS, W_SENSORLESS, W_HOME_TO_MAX0) && W_MAX_ENDSTOP_INVERTING != W_ENDSTOP_INVERTING
|
||||
#if W_ENDSTOP_INVERTING
|
||||
#error "SENSORLESS_HOMING requires W_MAX_ENDSTOP_INVERTING = true when homing to W_MAX."
|
||||
#else
|
||||
#error "SENSORLESS_HOMING requires W_MAX_ENDSTOP_INVERTING = false when homing TMC2209 to W_MAX."
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -3246,6 +3423,9 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#undef I_ENDSTOP_INVERTING
|
||||
#undef J_ENDSTOP_INVERTING
|
||||
#undef K_ENDSTOP_INVERTING
|
||||
#undef U_ENDSTOP_INVERTING
|
||||
#undef V_ENDSTOP_INVERTING
|
||||
#undef W_ENDSTOP_INVERTING
|
||||
#endif
|
||||
|
||||
// Sensorless probing requirements
|
||||
@@ -3314,6 +3494,12 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#define CS_COMPARE J_CS_PIN
|
||||
#elif IN_CHAIN(K)
|
||||
#define CS_COMPARE K_CS_PIN
|
||||
#elif IN_CHAIN(U)
|
||||
#define CS_COMPARE U_CS_PIN
|
||||
#elif IN_CHAIN(V)
|
||||
#define CS_COMPARE V_CS_PIN
|
||||
#elif IN_CHAIN(W)
|
||||
#define CS_COMPARE W_CS_PIN
|
||||
#elif IN_CHAIN(E0)
|
||||
#define CS_COMPARE E0_CS_PIN
|
||||
#elif IN_CHAIN(E1)
|
||||
@@ -3334,6 +3520,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#define BAD_CS_PIN(A) (IN_CHAIN(A) && A##_CS_PIN != CS_COMPARE)
|
||||
#if BAD_CS_PIN(X ) || BAD_CS_PIN(Y ) || BAD_CS_PIN(Z ) || BAD_CS_PIN(X2) || BAD_CS_PIN(Y2) || BAD_CS_PIN(Z2) || BAD_CS_PIN(Z3) || BAD_CS_PIN(Z4) \
|
||||
|| BAD_CS_PIN(I) || BAD_CS_PIN(J) || BAD_CS_PIN(K) \
|
||||
|| BAD_CS_PIN(U) || BAD_CS_PIN(V) || BAD_CS_PIN(W) \
|
||||
|| BAD_CS_PIN(E0) || BAD_CS_PIN(E1) || BAD_CS_PIN(E2) || BAD_CS_PIN(E3) || BAD_CS_PIN(E4) || BAD_CS_PIN(E5) || BAD_CS_PIN(E6) || BAD_CS_PIN(E7)
|
||||
#error "All chained TMC drivers must use the same CS pin."
|
||||
#endif
|
||||
@@ -3347,8 +3534,8 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
/**
|
||||
* L64XX requirement
|
||||
*/
|
||||
#if HAS_L64XX && HAS_I_AXIS
|
||||
#error "L64XX requires LINEAR_AXES <= 3. Homing with L64XX is not yet implemented for LINEAR_AXES > 3."
|
||||
#if HAS_L64XX && NUM_AXES > 3
|
||||
#error "L64XX requires NUM_AXES <= 3. Homing with L64XX is not yet implemented for NUM_AXES > 3."
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -3372,7 +3559,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
||||
#if HAS_MULTI_EXTRUDER
|
||||
#define _EXTRA_NOTE " (Did you forget to enable DISTINCT_E_FACTORS?)"
|
||||
#else
|
||||
#define _EXTRA_NOTE " (Should be " STRINGIFY(LINEAR_AXES) "+" STRINGIFY(E_STEPPERS) ")"
|
||||
#define _EXTRA_NOTE " (Should be " STRINGIFY(NUM_AXES) "+" STRINGIFY(E_STEPPERS) ")"
|
||||
#endif
|
||||
|
||||
constexpr float sanity_arr_1[] = DEFAULT_AXIS_STEPS_PER_UNIT;
|
||||
@@ -3391,7 +3578,7 @@ static_assert(COUNT(sanity_arr_3) <= DISTINCT_AXES, "DEFAULT_MAX_ACCELERATION ha
|
||||
static_assert(_PLUS_TEST(3), "DEFAULT_MAX_ACCELERATION values must be positive.");
|
||||
|
||||
constexpr float sanity_arr_4[] = HOMING_FEEDRATE_MM_M;
|
||||
static_assert(COUNT(sanity_arr_4) == LINEAR_AXES, "HOMING_FEEDRATE_MM_M requires " _LINEAR_AXES_STR "elements (and no others).");
|
||||
static_assert(COUNT(sanity_arr_4) == NUM_AXES, "HOMING_FEEDRATE_MM_M requires " _NUM_AXES_STR "elements (and no others).");
|
||||
static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
|
||||
|
||||
#ifdef MAX_ACCEL_EDIT_VALUES
|
||||
@@ -3831,6 +4018,15 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
|
||||
#if _BAD_DRIVER(K)
|
||||
#error "K_DRIVER_TYPE is not recognized."
|
||||
#endif
|
||||
#if _BAD_DRIVER(U)
|
||||
#error "U_DRIVER_TYPE is not recognized."
|
||||
#endif
|
||||
#if _BAD_DRIVER(V)
|
||||
#error "V_DRIVER_TYPE is not recognized."
|
||||
#endif
|
||||
#if _BAD_DRIVER(W)
|
||||
#error "W_DRIVER_TYPE is not recognized."
|
||||
#endif
|
||||
#if _BAD_DRIVER(X2)
|
||||
#error "X2_DRIVER_TYPE is not recognized."
|
||||
#endif
|
||||
@@ -3903,7 +4099,7 @@ static_assert(_PLUS_TEST(4), "HOMING_FEEDRATE_MM_M values must be positive.");
|
||||
|
||||
// Misc. Cleanup
|
||||
#undef _TEST_PWM
|
||||
#undef _LINEAR_AXES_STR
|
||||
#undef _NUM_AXES_STR
|
||||
#undef _LOGICAL_AXES_STR
|
||||
|
||||
// JTAG support in the HAL
|
||||
|
||||
Reference in New Issue
Block a user