Quad Z stepper support (#16277)

This commit is contained in:
InsanityAutomation
2020-01-20 00:35:07 -05:00
committed by Scott Lahteine
parent f36f084465
commit 0fcf2b1110
52 changed files with 1198 additions and 415 deletions

View File

@ -1153,7 +1153,7 @@
#endif
// The Z2 axis, if any, should be the next open extruder port
#if Z_MULTI_STEPPER_DRIVERS
#if NUM_Z_STEPPER_DRIVERS >= 2
#ifndef Z2_STEP_PIN
#define Z2_STEP_PIN _EPIN(Z2_E_INDEX, STEP)
#define Z2_DIR_PIN _EPIN(Z2_E_INDEX, DIR)
@ -1200,7 +1200,7 @@
#define Z2_MS3_PIN -1
#endif
#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS)
#if NUM_Z_STEPPER_DRIVERS >= 3
#ifndef Z3_STEP_PIN
#define Z3_STEP_PIN _EPIN(Z3_E_INDEX, STEP)
#define Z3_DIR_PIN _EPIN(Z3_E_INDEX, DIR)
@ -1231,6 +1231,7 @@
#define Z3_SERIAL_RX_PIN _EPIN(Z3_E_INDEX, SERIAL_RX)
#endif
#endif
#define Z4_E_INDEX INCREMENT(Z3_E_INDEX)
#endif
#ifndef Z3_CS_PIN
@ -1246,6 +1247,52 @@
#define Z3_MS3_PIN -1
#endif
#if NUM_Z_STEPPER_DRIVERS >= 4
#ifndef Z4_STEP_PIN
#define Z4_STEP_PIN _EPIN(Z4_E_INDEX, STEP)
#define Z4_DIR_PIN _EPIN(Z4_E_INDEX, DIR)
#define Z4_ENABLE_PIN _EPIN(Z4_E_INDEX, ENABLE)
#if Z4_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z4_STEP)
#error "No E stepper plug left for Z4!"
#endif
#endif
#if AXIS_HAS_SPI(Z4)
#ifndef Z4_CS_PIN
#define Z4_CS_PIN _EPIN(Z4_E_INDEX, CS)
#endif
#endif
#ifndef Z4_MS1_PIN
#define Z4_MS1_PIN _EPIN(Z4_E_INDEX, MS1)
#endif
#ifndef Z4_MS2_PIN
#define Z4_MS2_PIN _EPIN(Z4_E_INDEX, MS2)
#endif
#ifndef Z4_MS3_PIN
#define Z4_MS3_PIN _EPIN(Z4_E_INDEX, MS3)
#endif
#if AXIS_HAS_UART(Z4)
#ifndef Z4_SERIAL_TX_PIN
#define Z4_SERIAL_TX_PIN _EPIN(Z4_E_INDEX, SERIAL_TX)
#endif
#ifndef Z4_SERIAL_RX_PIN
#define Z4_SERIAL_RX_PIN _EPIN(Z4_E_INDEX, SERIAL_RX)
#endif
#endif
#endif
#ifndef Z4_CS_PIN
#define Z4_CS_PIN -1
#endif
#ifndef Z4_MS1_PIN
#define Z4_MS1_PIN -1
#endif
#ifndef Z4_MS2_PIN
#define Z4_MS2_PIN -1
#endif
#ifndef Z4_MS3_PIN
#define Z4_MS3_PIN -1
#endif
#if HAS_GRAPHICAL_LCD
#if !defined(ST7920_DELAY_1) && defined(BOARD_ST7920_DELAY_1)
#define ST7920_DELAY_1 BOARD_ST7920_DELAY_1

View File

@ -90,6 +90,15 @@
#if !PIN_EXISTS(Z3_MS3)
#undef Z3_MS3_PIN
#endif
#if !PIN_EXISTS(Z4_MS1)
#undef Z4_MS1_PIN
#endif
#if !PIN_EXISTS(Z4_MS2)
#undef Z4_MS2_PIN
#endif
#if !PIN_EXISTS(Z4_MS3)
#undef Z4_MS3_PIN
#endif
#if !PIN_EXISTS(E0_MS1)
#undef E0_MS1_PIN
#endif
@ -1335,6 +1344,27 @@
#if PIN_EXISTS(Z3_STEP)
REPORT_NAME_DIGITAL(__LINE__, Z3_STEP_PIN)
#endif
#if PIN_EXISTS(Z4_CS)
REPORT_NAME_DIGITAL(__LINE__, Z4_CS_PIN)
#endif
#if PIN_EXISTS(Z4_DIR)
REPORT_NAME_DIGITAL(__LINE__, Z4_DIR_PIN)
#endif
#if PIN_EXISTS(Z4_ENABLE)
REPORT_NAME_DIGITAL(__LINE__, Z4_ENABLE_PIN)
#endif
#if PIN_EXISTS(Z4_MS1)
REPORT_NAME_DIGITAL(__LINE__, Z4_MS1_PIN)
#endif
#if PIN_EXISTS(Z4_MS2)
REPORT_NAME_DIGITAL(__LINE__, Z4_MS2_PIN)
#endif
#if PIN_EXISTS(Z4_MS3)
REPORT_NAME_DIGITAL(__LINE__, Z4_MS3_PIN)
#endif
#if PIN_EXISTS(Z4_STEP)
REPORT_NAME_DIGITAL(__LINE__, Z4_STEP_PIN)
#endif
#if PIN_EXISTS(ZRIB_V20_D6)
REPORT_NAME_DIGITAL(__LINE__, ZRIB_V20_D6_PIN)
#endif
@ -1383,6 +1413,12 @@
#if PIN_EXISTS(Z3_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, Z3_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(Z4_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, Z4_SERIAL_TX_PIN)
#endif
#if PIN_EXISTS(Z4_SERIAL_RX)
REPORT_NAME_DIGITAL(__LINE__, Z4_SERIAL_RX_PIN)
#endif
#if PIN_EXISTS(E0_SERIAL_TX)
REPORT_NAME_DIGITAL(__LINE__, E0_SERIAL_TX_PIN)
#endif

View File

@ -31,13 +31,9 @@
#if HOTENDS > 2 || E_STEPPERS > 2
#error "RL200v1 supports up to 2 hotends / E-steppers. Comment out this line to continue."
#endif
#if DISABLED(Z_DUAL_STEPPER_DRIVERS)
#error "RL200 uses dual Z stepper motors. Update Configuration_adv.h or comment out this line to continue."
#endif
#if !(AXIS_DRIVER_TYPE_X(DRV8825) && AXIS_DRIVER_TYPE_Y(DRV8825) && AXIS_DRIVER_TYPE_Z(DRV8825) && AXIS_DRIVER_TYPE_Z2(DRV8825) && AXIS_DRIVER_TYPE_E0(DRV8825))
#elif NUM_Z_STEPPER_DRIVERS != 2
#error "RL200 uses dual Z stepper motors. Set NUM_Z_STEPPER_DRIVERS to 2 or comment out this line to continue."
#elif !(AXIS_DRIVER_TYPE_X(DRV8825) && AXIS_DRIVER_TYPE_Y(DRV8825) && AXIS_DRIVER_TYPE_Z(DRV8825) && AXIS_DRIVER_TYPE_Z2(DRV8825) && AXIS_DRIVER_TYPE_E0(DRV8825))
#error "You must set ([XYZ]|Z2|E0)_DRIVER_TYPE to DRV8825 in Configuration.h for RL200."
#endif

View File

@ -423,7 +423,7 @@
#define _Y2_PINS
#endif
#if Z_MULTI_STEPPER_DRIVERS
#if NUM_Z_STEPPER_DRIVERS >= 2
#if PIN_EXISTS(Z2_CS) && AXIS_HAS_SPI(Z2)
#define _Z2_CS Z2_CS_PIN,
#else
@ -449,7 +449,7 @@
#define _Z2_PINS
#endif
#if ENABLED(Z_TRIPLE_STEPPER_DRIVERS)
#if NUM_Z_STEPPER_DRIVERS >= 3
#if PIN_EXISTS(Z3_CS) && AXIS_HAS_SPI(Z3)
#define _Z3_CS Z3_CS_PIN,
#else
@ -475,6 +475,32 @@
#define _Z3_PINS
#endif
#if NUM_Z_STEPPER_DRIVERS >= 4
#if PIN_EXISTS(Z4_CS) && AXIS_HAS_SPI(Z4)
#define _Z4_CS Z4_CS_PIN,
#else
#define _Z4_CS
#endif
#if PIN_EXISTS(Z4_MS1)
#define _Z4_MS1 Z4_MS1_PIN,
#else
#define _Z4_MS1
#endif
#if PIN_EXISTS(Z4_MS2)
#define _Z4_MS2 Z4_MS2_PIN,
#else
#define _Z4_MS2
#endif
#if PIN_EXISTS(Z4_MS3)
#define _Z4_MS3 Z4_MS3_PIN,
#else
#define _Z4_MS3
#endif
#define _Z4_PINS Z4_STEP_PIN, Z4_DIR_PIN, Z4_ENABLE_PIN, _Z4_CS _Z4_MS1 _Z4_MS2 _Z4_MS3
#else
#define _Z4_PINS
#endif
//
// Generate the final Sensitive Pins array,
// keeping the array as small as possible.
@ -524,9 +550,9 @@
#endif
#define SENSITIVE_PINS { \
_X_PINS _Y_PINS _Z_PINS _X2_PINS _Y2_PINS _Z2_PINS _Z3_PINS _Z_PROBE \
_E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS _E5_PINS _BED_PINS \
_H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS _H5_PINS \
_X_PINS _Y_PINS _Z_PINS _X2_PINS _Y2_PINS _Z2_PINS _Z3_PINS _Z4_PINS \
_Z_PROBE _E0_PINS _E1_PINS _E2_PINS _E3_PINS _E4_PINS _E5_PINS \
_BED_PINS _H0_PINS _H1_PINS _H2_PINS _H3_PINS _H4_PINS _H5_PINS \
_PS_ON _HEATER_BED _FAN0 _FAN1 _FAN2 _FANC \
HAL_SENSITIVE_PINS \
}