Skip to content

Commit

Permalink
Multi-axis support for up to six non-extruder axes plus extruders
Browse files Browse the repository at this point in the history
NON_E_AXES benefit from endstops and homing. Axis codes are
configurable: X,Y,Z and (I,J,K or U/V/W/A/B/C). Internal axis IDs are
always X,Y,Z,I,J,K, (and E).

No Tool Center Point Control, no 5/6 DOF robot arm kinematics yet.

Issues: https://github.com/DerAndere1/Marlin/issues

Contributions:

DerAndere (26200979+DerAndere1@users.noreply.github.com): main
developer, idea, initial implementation, ASYNC_SECONDARY_AXES kinematics

Gabriel Beraldo (gabrielgbst@hotmail.com): hardware debugging, bug fixes

Olivier Briand (48122416+hobiseven@users.noreply.github.com): testing,
compile error fixes, FOAMCUTTER_XYUV kinematics

Wolverine (MohammadSDGHN@users.noreply.github.com): added compatibility
with BigTreeTech SKR Pro v1.1, Trinamic TMC drivers, STEALTHCHOP,
SENSORLESS_HOMING)

Co-authored-by: DerAndere <26200979+DerAndere1@users.noreply.github.com>
Co-authored-by: GabrielBeraldo <gabrielgbst@hotmail.com>
Co-authored-by: Olivier Briand <48122416+hobiseven@users.noreply.github.com>
Co-authored-by: Wolverine <MohammadSDGHN@users.noreply.github.com>
  • Loading branch information
4 people committed Aug 23, 2020
1 parent 434e43c commit 768e9dd
Show file tree
Hide file tree
Showing 67 changed files with 6,236 additions and 280 deletions.
240 changes: 223 additions & 17 deletions Marlin/Configuration.h

Large diffs are not rendered by default.

229 changes: 217 additions & 12 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -629,10 +629,27 @@

//#define SENSORLESS_BACKOFF_MM { 2, 2 } // (mm) Backoff from endstops before sensorless homing

#define HOMING_BUMP_MM { 5, 5, 2 } // (mm) Backoff from endstops after first bump
#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate)
#if NON_E_AXES == 6
#define HOMING_BUMP_MM { 5, 5, 2, 2, 2, 2 } // (mm) Backoff from endstops after first bump
#define HOMING_BUMP_DIVISOR { 2, 2, 4, 4, 4, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate)

//#define HOMING_BACKOFF_POST_MM { 2, 2, 2 } // (mm) Backoff from endstops after homing
//#define HOMING_BACKOFF_POST_MM { 2, 2, 2, 2, 2, 2 } // (mm) Backoff from endstops after homing
#elif NON_E_AXES == 5
#define HOMING_BUMP_MM { 5, 5, 2, 2, 2 } // (mm) Backoff from endstops after first bump
#define HOMING_BUMP_DIVISOR { 2, 2, 4, 4, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate)

//#define HOMING_BACKOFF_POST_MM { 2, 2, 2, 2, 2 } // (mm) Backoff from endstops after homing
#elif NON_E_AXES == 4
#define HOMING_BUMP_MM { 5, 5, 2, 2 } // (mm) Backoff from endstops after first bump
#define HOMING_BUMP_DIVISOR { 2, 2, 4, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate)

//#define HOMING_BACKOFF_POST_MM { 2, 2, 2, 2 } // (mm) Backoff from endstops after homing
#else
#define HOMING_BUMP_MM { 5, 5, 2 } // (mm) Backoff from endstops after first bump
#define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate)

//#define HOMING_BACKOFF_POST_MM { 2, 2, 2 } // (mm) Backoff from endstops after homing
#endif

//#define QUICK_HOME // If G28 contains XY do a diagonal move first
//#define HOME_Y_BEFORE_X // If G28 contains XY home Y before X
Expand Down Expand Up @@ -797,16 +814,31 @@
#endif

// @section motion

#define AXIS_RELATIVE_MODES { false, false, false, false }

#if NON_E_AXES == 6
#define AXIS_RELATIVE_MODES { false, false, false, false, false, false, false }
#elif NON_E_AXES == 5
#define AXIS_RELATIVE_MODES { false, false, false, false, false, false }
#elif NON_E_AXES == 4
#define AXIS_RELATIVE_MODES { false, false, false, false, false }
#else
#define AXIS_RELATIVE_MODES { false, false, false, false }
#endif
// Add a Duplicate option for well-separated conjoined nozzles
//#define MULTI_NOZZLE_DUPLICATION

// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.
#define INVERT_X_STEP_PIN false
#define INVERT_Y_STEP_PIN false
#define INVERT_Z_STEP_PIN false
#if NON_E_AXES > 3
#define INVERT_I_STEP_PIN false
#endif
#if NON_E_AXES > 4
#define INVERT_J_STEP_PIN false
#endif
#if NON_E_AXES > 5
#define INVERT_K_STEP_PIN false
#endif
#define INVERT_E_STEP_PIN false

/**
Expand All @@ -818,6 +850,15 @@
#define DISABLE_INACTIVE_X true
#define DISABLE_INACTIVE_Y true
#define DISABLE_INACTIVE_Z true // Set 'false' if the nozzle could fall onto your printed part!
#if NON_E_AXES > 3
#define DISABLE_INACTIVE_I true
#endif
#if NON_E_AXES > 4
#define DISABLE_INACTIVE_J true
#endif
#if NON_E_AXES > 5
#define DISABLE_INACTIVE_K true
#endif
#define DISABLE_INACTIVE_E true

// If the Nozzle or Bed falls when the Z stepper is disabled, set its resting position here.
Expand Down Expand Up @@ -863,7 +904,15 @@
#if ENABLED(BACKLASH_COMPENSATION)
// Define values for backlash distance and correction.
// If BACKLASH_GCODE is enabled these values are the defaults.
#define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm)
#if NON_E_AXES == 6
#define BACKLASH_DISTANCE_MM { 0, 0, 0, 0, 0, 0 } // (mm)
#elif NON_E_AXES == 5
#define BACKLASH_DISTANCE_MM { 0, 0, 0, 0, 0 } // (mm)
#elif NON_E_AXES == 4
#define BACKLASH_DISTANCE_MM { 0, 0, 0, 0 } // (mm)
#else
#define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm)
#endif
#define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction

// Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments
Expand Down Expand Up @@ -930,6 +979,18 @@
#define CALIBRATION_MEASURE_FRONT
#define CALIBRATION_MEASURE_LEFT
#define CALIBRATION_MEASURE_BACK
#if NON_E_AXES > 3
#define CALIBRATION_MEASURE_IMIN
#define CALIBRATION_MEASURE_IMAX
#endif
#if NON_E_AXES > 4
#define CALIBRATION_MEASURE_JMIN
#define CALIBRATION_MEASURE_JMAX
#endif
#if NON_E_AXES > 5
#define CALIBRATION_MEASURE_KMIN
#define CALIBRATION_MEASURE_KMAX
#endif

// Probing at the exact top center only works if the center is flat. If
// probing on a screwhead or hollow washer, probe near the edges.
Expand Down Expand Up @@ -964,7 +1025,15 @@
//#define MICROSTEP32 HIGH,LOW,HIGH

// Microstep settings (Requires a board with pins named X_MS1, X_MS2, etc.)
#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16]
#if NON_E_AXES == 6
#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16]
#elif NON_E_AXES == 5
#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16]
#elif NON_E_AXES == 4
#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16]
#else
#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16]
#endif

/**
* @section stepper motor current
Expand All @@ -986,9 +1055,23 @@
* M908 - BQ_ZUM_MEGA_3D, RAMBO, PRINTRBOARD_REVF, RIGIDBOARD_V2 & SCOOVO_X9H
* M909, M910 & LCD - only PRINTRBOARD_REVF & RIGIDBOARD_V2
*/
//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps
//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
#if NON_E_AXES == 6
//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250, 1250, 1250, 1250 } // Values in milliamps
//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 90, 90, 90, 80 } // Default drive percent - X, Y, Z, I, J, K, E axis
#elif NON_E_AXES == 5
//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250, 1250, 1250 } // Values in milliamps
//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 90, 90, 80 } // Default drive percent - X, Y, Z, I, J, E axis
#elif NON_E_AXES == 4
//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250, 1250 } // Values in milliamps
//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 90, 80 } // Default drive percent - X, Y, Z, I, E axis
#else
//#define PWM_MOTOR_CURRENT { 1300, 1300, 1250 } // Values in milliamps
//#define DIGIPOT_MOTOR_CURRENT { 135,135,135,135,135 } // Values 0-255 (RAMBO 135 = ~0.75A, 185 = ~1A)
//#define DAC_MOTOR_CURRENT_DEFAULT { 70, 80, 90, 80 } // Default drive percent - X, Y, Z, E axis
#endif

/**
* I2C-based DIGIPOTs (e.g., Azteeg X3 Pro)
Expand Down Expand Up @@ -1025,7 +1108,15 @@
// @section lcd

#if EITHER(ULTIPANEL, EXTENSIBLE_UI)
#define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // (mm/min) Feedrates for manual moves along X, Y, Z, E from panel
#if NON_E_AXES == 6
#define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 4*60, 4*60, 4*60, 2*60 } // (mm/min) Feedrates for manual moves along X, Y, Z, I, J, K, E from panel
#elif NON_E_AXES == 5
#define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 4*60, 4*60, 2*60 } // (mm/min) Feedrates for manual moves along X, Y, Z, I, J, E from panel
#elif NON_E_AXES == 4
#define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 4*60, 2*60 } // (mm/min) Feedrates for manual moves along X, Y, Z, I, E from panel
#else
#define MANUAL_FEEDRATE { 50*60, 50*60, 4*60, 2*60 } // (mm/min) Feedrates for manual moves along X, Y, Z, E from panel
#endif
#define SHORT_MANUAL_Z_MOVE 0.025 // (mm) Smallest manual Z move (< 0.1mm)
#if ENABLED(ULTIPANEL)
#define MANUAL_E_MOVES_RELATIVE // Display extruder move distance rather than "position"
Expand Down Expand Up @@ -2146,6 +2237,30 @@
#define Z4_MICROSTEPS 16
#endif

#if NON_E_AXES > 3
#if AXIS_DRIVER_TYPE_I(TMC26X)
#define I_MAX_CURRENT 1000
#define I_SENSE_RESISTOR 91
#define I_MICROSTEPS 16
#endif
#endif

#if NON_E_AXES > 4
#if AXIS_DRIVER_TYPE_J(TMC26X)
#define J_MAX_CURRENT 1000
#define J_SENSE_RESISTOR 91
#define J_MICROSTEPS 16
#endif
#endif

#if NON_E_AXES > 5
#if AXIS_DRIVER_TYPE_K(TMC26X)
#define K_MAX_CURRENT 1000
#define K_SENSE_RESISTOR 91
#define K_MICROSTEPS 16
#endif
#endif

#if AXIS_DRIVER_TYPE_E0(TMC26X)
#define E0_MAX_CURRENT 1000
#define E0_SENSE_RESISTOR 91
Expand Down Expand Up @@ -2283,6 +2398,36 @@
#define Z4_CHAIN_POS -1
#endif

#if NON_E_AXES > 3
#if AXIS_IS_TMC(I)
#define I_CURRENT 800
#define I_CURRENT_HOME I_CURRENT
#define I_MICROSTEPS 16
#define I_RSENSE 0.11
#define I_CHAIN_POS -1
#endif
#endif

#if NON_E_AXES > 4
#if AXIS_IS_TMC(J)
#define J_CURRENT 800
#define J_CURRENT_HOME J_CURRENT
#define J_MICROSTEPS 16
#define J_RSENSE 0.11
#define J_CHAIN_POS -1
#endif
#endif

#if NON_E_AXES > 5
#if AXIS_IS_TMC(K)
#define K_CURRENT 800
#define K_CURRENT_HOME K_CURRENT
#define K_MICROSTEPS 16
#define K_RSENSE 0.11
#define K_CHAIN_POS -1
#endif
#endif

#if AXIS_IS_TMC(E0)
#define E0_CURRENT 800
#define E0_MICROSTEPS 16
Expand Down Expand Up @@ -2350,6 +2495,9 @@
//#define Y2_CS_PIN -1
//#define Z2_CS_PIN -1
//#define Z3_CS_PIN -1
//#define I_CS_PIN -1
//#define J_CS_PIN -1
//#define K_CS_PIN -1
//#define E0_CS_PIN -1
//#define E1_CS_PIN -1
//#define E2_CS_PIN -1
Expand Down Expand Up @@ -2389,6 +2537,15 @@
#define Z2_SLAVE_ADDRESS 0
#define Z3_SLAVE_ADDRESS 0
#define Z4_SLAVE_ADDRESS 0
#if NON_E_AXES > 3
#define I_SLAVE_ADDRESS 0
#endif
#if NON_E_AXES > 4
#define J_SLAVE_ADDRESS 0
#endif
#if NON_E_AXES > 5
#define K_SLAVE_ADDRESS 0
#endif
#define E0_SLAVE_ADDRESS 0
#define E1_SLAVE_ADDRESS 0
#define E2_SLAVE_ADDRESS 0
Expand All @@ -2413,6 +2570,15 @@
*/
#define STEALTHCHOP_XY
#define STEALTHCHOP_Z
#if NON_E_AXES > 3
#define STEALTHCHOP_I
#endif
#if NON_E_AXES > 4
#define STEALTHCHOP_J
#endif
#if NON_E_AXES > 5
#define STEALTHCHOP_K
#endif
#define STEALTHCHOP_E

/**
Expand Down Expand Up @@ -2468,6 +2634,15 @@
#define Z2_HYBRID_THRESHOLD 3
#define Z3_HYBRID_THRESHOLD 3
#define Z4_HYBRID_THRESHOLD 3
#if NON_E_AXES > 3
#define I_HYBRID_THRESHOLD 3
#endif
#if NON_E_AXES > 4
#define J_HYBRID_THRESHOLD 3
#endif
#if NON_E_AXES > 5
#define K_HYBRID_THRESHOLD 3
#endif
#define E0_HYBRID_THRESHOLD 30
#define E1_HYBRID_THRESHOLD 30
#define E2_HYBRID_THRESHOLD 30
Expand Down Expand Up @@ -2512,6 +2687,9 @@
//#define Z2_STALL_SENSITIVITY Z_STALL_SENSITIVITY
//#define Z3_STALL_SENSITIVITY Z_STALL_SENSITIVITY
//#define Z4_STALL_SENSITIVITY Z_STALL_SENSITIVITY
//#define I_STALL_SENSITIVITY 8
//#define J_STALL_SENSITIVITY 8
//#define K_STALL_SENSITIVITY 8
//#define SPI_ENDSTOPS // TMC2130 only
//#define IMPROVE_HOMING_RELIABILITY
#endif
Expand Down Expand Up @@ -2652,6 +2830,33 @@
#define Z4_SLEW_RATE 1
#endif

#if AXIS_DRIVER_TYPE_I(L6470)
#define I_MICROSTEPS 128
#define I_OVERCURRENT 2000
#define I_STALLCURRENT 1500
#define I_MAX_VOLTAGE 127
#define I_CHAIN_POS -1
#define I_SLEW_RATE 1
#endif

#if AXIS_DRIVER_TYPE_J(L6470)
#define J_MICROSTEPS 128
#define J_OVERCURRENT 2000
#define J_STALLCURRENT 1500
#define J_MAX_VOLTAGE 127
#define J_CHAIN_POS -1
#define J_SLEW_RATE 1
#endif

#if AXIS_DRIVER_TYPE_K(L6470)
#define K_MICROSTEPS 128
#define K_OVERCURRENT 2000
#define K_STALLCURRENT 1500
#define K_MAX_VOLTAGE 127
#define K_CHAIN_POS -1
#define K_SLEW_RATE 1
#endif

#if AXIS_IS_L64XX(E0)
#define E0_MICROSTEPS 128
#define E0_OVERCURRENT 2000
Expand Down
Loading

0 comments on commit 768e9dd

Please sign in to comment.