Support for up to 9 axes (linear, rotary) (#23112)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
DerAndere
2022-04-01 07:10:38 +02:00
committed by GitHub
parent 2786592b62
commit e5b651f407
103 changed files with 4539 additions and 800 deletions

View File

@@ -677,22 +677,31 @@
#endif
/**
* Number of Linear Axes (e.g., XYZ)
* Number of Linear Axes (e.g., XYZIJKUVW)
* All the logical axes except for the tool (E) axis
*/
#ifndef LINEAR_AXES
#define LINEAR_AXES XYZ
#ifndef NUM_AXES
#define NUM_AXES XYZ
#endif
#if LINEAR_AXES >= XY
#if NUM_AXES >= XY
#define HAS_Y_AXIS 1
#if LINEAR_AXES >= XYZ
#if NUM_AXES >= XYZ
#define HAS_Z_AXIS 1
#if LINEAR_AXES >= 4
#if NUM_AXES >= 4
#define HAS_I_AXIS 1
#if LINEAR_AXES >= 5
#if NUM_AXES >= 5
#define HAS_J_AXIS 1
#if LINEAR_AXES >= 6
#if NUM_AXES >= 6
#define HAS_K_AXIS 1
#if NUM_AXES >= 7
#define HAS_U_AXIS 1
#if NUM_AXES >= 8
#define HAS_V_AXIS 1
#if NUM_AXES >= 9
#define HAS_W_AXIS 1
#endif
#endif
#endif
#endif
#endif
#endif
@@ -700,14 +709,58 @@
#endif
/**
* Number of Logical Axes (e.g., XYZE)
* All the logical axes that can be commanded directly by G-code.
* Number of Primary Linear Axes (e.g., XYZ)
* X, XY, or XYZ axes. Excluding duplicate axes (X2, Y2. Z2. Z3, Z4)
*/
#if HAS_I_AXIS
#define PRIMARY_LINEAR_AXES 3
#else
#define PRIMARY_LINEAR_AXES NUM_AXES
#endif
/**
* Number of Secondary Axes (e.g., IJKUVW)
* All linear/rotational axes between XYZ and E.
*/
#define SECONDARY_AXES SUB3(NUM_AXES)
/**
* Number of Rotational Axes (e.g., IJK)
* All axes for which AXIS*_ROTATES is defined.
* For these axes, positions are specified in angular degrees.
*/
#if ENABLED(AXIS9_ROTATES)
#define ROTATIONAL_AXES 6
#elif ENABLED(AXIS8_ROTATES)
#define ROTATIONAL_AXES 5
#elif ENABLED(AXIS7_ROTATES)
#define ROTATIONAL_AXES 4
#elif ENABLED(AXIS6_ROTATES)
#define ROTATIONAL_AXES 3
#elif ENABLED(AXIS5_ROTATES)
#define ROTATIONAL_AXES 2
#elif ENABLED(AXIS4_ROTATES)
#define ROTATIONAL_AXES 1
#else
#define ROTATIONAL_AXES 0
#endif
/**
* Number of Secondary Linear Axes (e.g., UVW)
* All secondary axes for which AXIS*_ROTATES is not defined.
* Excluding primary axes and excluding duplicate axes (X2, Y2, Z2, Z3, Z4)
*/
#define SECONDARY_LINEAR_AXES (NUM_AXES - PRIMARY_LINEAR_AXES - ROTATIONAL_AXES)
/**
* Number of Logical Axes (e.g., XYZIJKUVWE)
* All logical axes that can be commanded directly by G-code.
* Delta maps stepper-specific values to ABC steppers.
*/
#if HAS_EXTRUDERS
#define LOGICAL_AXES INCREMENT(LINEAR_AXES)
#define LOGICAL_AXES INCREMENT(NUM_AXES)
#else
#define LOGICAL_AXES LINEAR_AXES
#define LOGICAL_AXES NUM_AXES
#endif
/**
@@ -725,7 +778,7 @@
* distinguished.
*/
#if ENABLED(DISTINCT_E_FACTORS) && E_STEPPERS > 1
#define DISTINCT_AXES (LINEAR_AXES + E_STEPPERS)
#define DISTINCT_AXES (NUM_AXES + E_STEPPERS)
#define DISTINCT_E E_STEPPERS
#define E_INDEX_N(E) (E)
#else
@@ -955,6 +1008,21 @@
#elif K_HOME_DIR < 0
#define K_HOME_TO_MIN 1
#endif
#if U_HOME_DIR > 0
#define U_HOME_TO_MAX 1
#elif U_HOME_DIR < 0
#define U_HOME_TO_MIN 1
#endif
#if V_HOME_DIR > 0
#define V_HOME_TO_MAX 1
#elif V_HOME_DIR < 0
#define V_HOME_TO_MIN 1
#endif
#if W_HOME_DIR > 0
#define W_HOME_TO_MAX 1
#elif W_HOME_DIR < 0
#define W_HOME_TO_MIN 1
#endif
/**
* Conditionals based on the type of Bed Probe
@@ -1228,6 +1296,15 @@
#if HAS_K_AXIS && !defined(INVERT_K_DIR)
#define INVERT_K_DIR false
#endif
#if HAS_U_AXIS && !defined(INVERT_U_DIR)
#define INVERT_U_DIR false
#endif
#if HAS_V_AXIS && !defined(INVERT_V_DIR)
#define INVERT_V_DIR false
#endif
#if HAS_W_AXIS && !defined(INVERT_W_DIR)
#define INVERT_W_DIR false
#endif
#if HAS_EXTRUDERS && !defined(INVERT_E_DIR)
#define INVERT_E_DIR false
#endif