Skip to content

Commit

Permalink
✨ Support for up to 9 axes (#23112, #24036, #24231)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jun 6, 2022
1 parent 8d00884 commit 8772c40
Show file tree
Hide file tree
Showing 103 changed files with 4,552 additions and 798 deletions.
116 changes: 95 additions & 21 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@
//#define I_DRIVER_TYPE A4988
//#define J_DRIVER_TYPE A4988
//#define K_DRIVER_TYPE A4988
//#define U_DRIVER_TYPE A4988
//#define V_DRIVER_TYPE A4988
//#define W_DRIVER_TYPE A4988
#define E0_DRIVER_TYPE A4988
//#define E1_DRIVER_TYPE A4988
//#define E2_DRIVER_TYPE A4988
Expand All @@ -186,20 +189,25 @@
//#define E7_DRIVER_TYPE A4988

/**
* Axis codes for additional axes:
* This defines the axis code that is used in G-code commands to
* reference a specific axis.
* 'A' for rotational axis parallel to X
* 'B' for rotational axis parallel to Y
* 'C' for rotational axis parallel to Z
* 'U' for secondary linear axis parallel to X
* 'V' for secondary linear axis parallel to Y
* 'W' for secondary linear axis parallel to Z
* Regardless of the settings, firmware-internal axis IDs are
* I (AXIS4), J (AXIS5), K (AXIS6).
* Additional Axis Settings
*
* Define AXISn_ROTATES for all axes that rotate or pivot.
* Rotational axis coordinates are expressed in degrees.
*
* AXISn_NAME defines the letter used to refer to the axis in (most) G-code commands.
* By convention the names and roles are typically:
* 'A' : Rotational axis parallel to X
* 'B' : Rotational axis parallel to Y
* 'C' : Rotational axis parallel to Z
* 'U' : Secondary linear axis parallel to X
* 'V' : Secondary linear axis parallel to Y
* 'W' : Secondary linear axis parallel to Z
*
* Regardless of these settings the axes are internally named I, J, K, U, V, W.
*/
#ifdef I_DRIVER_TYPE
#define AXIS4_NAME 'A' // :['A', 'B', 'C', 'U', 'V', 'W']
#define AXIS4_ROTATES
#endif
#ifdef J_DRIVER_TYPE
#define AXIS5_NAME 'B' // :['B', 'C', 'U', 'V', 'W']
Expand All @@ -209,6 +217,18 @@
#define AXIS6_NAME 'C' // :['C', 'U', 'V', 'W']
#define AXIS6_ROTATES
#endif
#ifdef U_DRIVER_TYPE
#define AXIS7_NAME 'U' // :['U', 'V', 'W']
//#define AXIS7_ROTATES
#endif
#ifdef V_DRIVER_TYPE
#define AXIS8_NAME 'V' // :['V', 'W']
//#define AXIS8_ROTATES
#endif
#ifdef W_DRIVER_TYPE
#define AXIS9_NAME 'W' // :['W']
//#define AXIS9_ROTATES
#endif

// @section extruder

Expand Down Expand Up @@ -860,12 +880,18 @@
//#define USE_IMIN_PLUG
//#define USE_JMIN_PLUG
//#define USE_KMIN_PLUG
//#define USE_UMIN_PLUG
//#define USE_VMIN_PLUG
//#define USE_WMIN_PLUG
//#define USE_XMAX_PLUG
//#define USE_YMAX_PLUG
//#define USE_ZMAX_PLUG
//#define USE_IMAX_PLUG
//#define USE_JMAX_PLUG
//#define USE_KMAX_PLUG
//#define USE_UMAX_PLUG
//#define USE_VMAX_PLUG
//#define USE_WMAX_PLUG

// Enable pullup for all endstops to prevent a floating state
#define ENDSTOPPULLUPS
Expand All @@ -877,12 +903,18 @@
//#define ENDSTOPPULLUP_IMIN
//#define ENDSTOPPULLUP_JMIN
//#define ENDSTOPPULLUP_KMIN
//#define ENDSTOPPULLUP_UMIN
//#define ENDSTOPPULLUP_VMIN
//#define ENDSTOPPULLUP_WMIN
//#define ENDSTOPPULLUP_XMAX
//#define ENDSTOPPULLUP_YMAX
//#define ENDSTOPPULLUP_ZMAX
//#define ENDSTOPPULLUP_IMAX
//#define ENDSTOPPULLUP_JMAX
//#define ENDSTOPPULLUP_KMAX
//#define ENDSTOPPULLUP_UMAX
//#define ENDSTOPPULLUP_VMAX
//#define ENDSTOPPULLUP_WMAX
//#define ENDSTOPPULLUP_ZMIN_PROBE
#endif

Expand All @@ -896,12 +928,18 @@
//#define ENDSTOPPULLDOWN_IMIN
//#define ENDSTOPPULLDOWN_JMIN
//#define ENDSTOPPULLDOWN_KMIN
//#define ENDSTOPPULLDOWN_UMIN
//#define ENDSTOPPULLDOWN_VMIN
//#define ENDSTOPPULLDOWN_WMIN
//#define ENDSTOPPULLDOWN_XMAX
//#define ENDSTOPPULLDOWN_YMAX
//#define ENDSTOPPULLDOWN_ZMAX
//#define ENDSTOPPULLDOWN_IMAX
//#define ENDSTOPPULLDOWN_JMAX
//#define ENDSTOPPULLDOWN_KMAX
//#define ENDSTOPPULLDOWN_UMAX
//#define ENDSTOPPULLDOWN_VMAX
//#define ENDSTOPPULLDOWN_WMAX
//#define ENDSTOPPULLDOWN_ZMIN_PROBE
#endif

Expand All @@ -912,12 +950,18 @@
#define I_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define J_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define K_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define U_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define V_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define W_MIN_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define I_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define J_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define K_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define U_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define V_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define W_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the probe.

// Enable this feature if all enabled endstop pins are interrupt-capable.
Expand Down Expand Up @@ -962,16 +1006,16 @@
//#define DISTINCT_E_FACTORS

/**
* Default Axis Steps Per Unit (steps/mm)
* Default Axis Steps Per Unit (linear=steps/mm, rotational=steps/°)
* Override with M92
* X, Y, Z [, I [, J [, K]]], E0 [, E1[, E2...]]
* X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]]
*/
#define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 400, 500 }

/**
* Default Max Feed Rate (mm/s)
* Default Max Feed Rate (linear=mm/s, rotational=°/s)
* Override with M203
* X, Y, Z [, I [, J [, K]]], E0 [, E1[, E2...]]
* X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]]
*/
#define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 }

Expand All @@ -981,10 +1025,10 @@
#endif

/**
* Default Max Acceleration (change/s) change = mm/s
* Default Max Acceleration (speed change with time) (linear=mm/(s^2), rotational=°/(s^2))
* (Maximum start speed for accelerated moves)
* Override with M201
* X, Y, Z [, I [, J [, K]]], E0 [, E1[, E2...]]
* X, Y, Z [, I [, J [, K...]]], E0 [, E1[, E2...]]
*/
#define DEFAULT_MAX_ACCELERATION { 3000, 3000, 100, 10000 }

Expand All @@ -994,7 +1038,7 @@
#endif

/**
* Default Acceleration (change/s) change = mm/s
* Default Acceleration (speed change with time) (linear=mm/(s^2), rotational=°/(s^2))
* Override with M204
*
* M204 P Acceleration
Expand All @@ -1007,7 +1051,7 @@

/**
* Default Jerk limits (mm/s)
* Override with M205 X Y Z E
* Override with M205 X Y Z . . . E
*
* "Jerk" specifies the minimum speed change that requires acceleration.
* When changing speed and direction, if the difference is less than the
Expand All @@ -1021,6 +1065,9 @@
//#define DEFAULT_IJERK 0.3
//#define DEFAULT_JJERK 0.3
//#define DEFAULT_KJERK 0.3
//#define DEFAULT_UJERK 0.3
//#define DEFAULT_VJERK 0.3
//#define DEFAULT_WJERK 0.3

//#define TRAVEL_EXTRA_XYJERK 0.0 // Additional jerk allowance for all travel moves

Expand Down Expand Up @@ -1359,6 +1406,9 @@
//#define I_ENABLE_ON 0
//#define J_ENABLE_ON 0
//#define K_ENABLE_ON 0
//#define U_ENABLE_ON 0
//#define V_ENABLE_ON 0
//#define W_ENABLE_ON 0

// Disable axis steppers immediately when they're not being stepped.
// WARNING: When motors turn off there is a chance of losing position accuracy!
Expand All @@ -1368,6 +1418,9 @@
//#define DISABLE_I false
//#define DISABLE_J false
//#define DISABLE_K false
//#define DISABLE_U false
//#define DISABLE_V false
//#define DISABLE_W false

// Turn off the display blinking that warns about possible accuracy reduction
//#define DISABLE_REDUCED_ACCURACY_WARNING
Expand All @@ -1386,6 +1439,9 @@
//#define INVERT_I_DIR false
//#define INVERT_J_DIR false
//#define INVERT_K_DIR false
//#define INVERT_U_DIR false
//#define INVERT_V_DIR false
//#define INVERT_W_DIR false

// @section extruder

Expand Down Expand Up @@ -1424,14 +1480,17 @@
//#define I_HOME_DIR -1
//#define J_HOME_DIR -1
//#define K_HOME_DIR -1
//#define U_HOME_DIR -1
//#define V_HOME_DIR -1
//#define W_HOME_DIR -1

// @section machine

// The size of the printable area
#define X_BED_SIZE 200
#define Y_BED_SIZE 200

// Travel limits (mm) after homing, corresponding to endstop positions.
// Travel limits (linear=mm, rotational=°) after homing, corresponding to endstop positions.
#define X_MIN_POS 0
#define Y_MIN_POS 0
#define Z_MIN_POS 0
Expand All @@ -1444,6 +1503,12 @@
//#define J_MAX_POS 50
//#define K_MIN_POS 0
//#define K_MAX_POS 50
//#define U_MIN_POS 0
//#define U_MAX_POS 50
//#define V_MIN_POS 0
//#define V_MAX_POS 50
//#define W_MIN_POS 0
//#define W_MAX_POS 50

/**
* Software Endstops
Expand All @@ -1463,6 +1528,9 @@
#define MIN_SOFTWARE_ENDSTOP_I
#define MIN_SOFTWARE_ENDSTOP_J
#define MIN_SOFTWARE_ENDSTOP_K
#define MIN_SOFTWARE_ENDSTOP_U
#define MIN_SOFTWARE_ENDSTOP_V
#define MIN_SOFTWARE_ENDSTOP_W
#endif

// Max software endstops constrain movement within maximum coordinate bounds
Expand All @@ -1474,6 +1542,9 @@
#define MAX_SOFTWARE_ENDSTOP_I
#define MAX_SOFTWARE_ENDSTOP_J
#define MAX_SOFTWARE_ENDSTOP_K
#define MAX_SOFTWARE_ENDSTOP_U
#define MAX_SOFTWARE_ENDSTOP_V
#define MAX_SOFTWARE_ENDSTOP_W
#endif

#if EITHER(MIN_SOFTWARE_ENDSTOPS, MAX_SOFTWARE_ENDSTOPS)
Expand Down Expand Up @@ -1788,6 +1859,9 @@
//#define MANUAL_I_HOME_POS 0
//#define MANUAL_J_HOME_POS 0
//#define MANUAL_K_HOME_POS 0
//#define MANUAL_U_HOME_POS 0
//#define MANUAL_V_HOME_POS 0
//#define MANUAL_W_HOME_POS 0

/**
* Use "Z Safe Homing" to avoid homing with a Z probe outside the bed area.
Expand All @@ -1803,7 +1877,7 @@
#define Z_SAFE_HOMING_Y_POINT Y_CENTER // Y point for Z homing
#endif

// Homing speeds (mm/min)
// Homing speeds (linear=mm/min, rotational=°/min)
#define HOMING_FEEDRATE_MM_M { (50*60), (50*60), (4*60) }

// Validate that endstops are triggered on homing moves
Expand Down
Loading

0 comments on commit 8772c40

Please sign in to comment.