Extruder with Dual Stepper Drivers (#21403)

This commit is contained in:
Bo Herrmannsen 2021-06-14 11:28:13 +02:00 committed by Scott Lahteine
parent 31fd3be6eb
commit dba877311e
7 changed files with 60 additions and 10 deletions

View File

@ -677,6 +677,12 @@
#endif #endif
#endif #endif
// Drive the E axis with two synchronized steppers
//#define E_DUAL_STEPPER_DRIVERS
#if ENABLED(E_DUAL_STEPPER_DRIVERS)
//#define INVERT_E1_VS_E0_DIR // Enable if the E motors need opposite DIR states
#endif
/** /**
* Dual X Carriage * Dual X Carriage
* *

View File

@ -558,7 +558,12 @@
#undef DISABLE_E #undef DISABLE_E
#endif #endif
#if ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS #if ENABLED(E_DUAL_STEPPER_DRIVERS) // E0/E1 steppers act in tandem as E0
#define E_STEPPERS 2
#elif ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS
#if EXTRUDERS > 4 #if EXTRUDERS > 4
#define E_STEPPERS 3 #define E_STEPPERS 3
#elif EXTRUDERS > 2 #elif EXTRUDERS > 2
@ -569,17 +574,24 @@
#if DISABLED(SWITCHING_NOZZLE) #if DISABLED(SWITCHING_NOZZLE)
#define HOTENDS E_STEPPERS #define HOTENDS E_STEPPERS
#endif #endif
#elif ENABLED(MIXING_EXTRUDER)
#elif ENABLED(MIXING_EXTRUDER) // Multiple feeds are mixed proportionally
#define E_STEPPERS MIXING_STEPPERS #define E_STEPPERS MIXING_STEPPERS
#define E_MANUAL 1 #define E_MANUAL 1
#if MIXING_STEPPERS == 2 #if MIXING_STEPPERS == 2
#define HAS_DUAL_MIXING 1 #define HAS_DUAL_MIXING 1
#endif #endif
#elif ENABLED(SWITCHING_TOOLHEAD)
#elif ENABLED(SWITCHING_TOOLHEAD) // Toolchanger
#define E_STEPPERS EXTRUDERS #define E_STEPPERS EXTRUDERS
#define E_MANUAL EXTRUDERS #define E_MANUAL EXTRUDERS
#elif HAS_PRUSA_MMU2
#elif HAS_PRUSA_MMU2 // Průša Multi-Material Unit v2
#define E_STEPPERS 1 #define E_STEPPERS 1
#endif #endif
// No inactive extruders with SWITCHING_NOZZLE or Průša MMU1 // No inactive extruders with SWITCHING_NOZZLE or Průša MMU1

View File

@ -1161,6 +1161,19 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#endif #endif
#endif #endif
/**
* Dual E Steppers requirements
*/
#if ENABLED(E_DUAL_STEPPER_DRIVERS)
#if EXTRUDERS > 1
#error "E_DUAL_STEPPER_DRIVERS can only be used with EXTRUDERS set to 1."
#elif ENABLED(MIXING_EXTRUDER)
#error "E_DUAL_STEPPER_DRIVERS is incompatible with MIXING_EXTRUDER."
#elif ENABLED(SWITCHING_EXTRUDER)
#error "E_DUAL_STEPPER_DRIVERS is incompatible with SWITCHING_EXTRUDER."
#endif
#endif
/** /**
* Linear Advance 1.5 - Check K value range * Linear Advance 1.5 - Check K value range
*/ */

View File

@ -645,6 +645,11 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
#endif #endif
#elif ENABLED(E_DUAL_STEPPER_DRIVERS)
#define E_STEP_WRITE(E,V) do{ E0_STEP_WRITE(V); E1_STEP_WRITE(V); }while(0)
#define NORM_E_DIR(E) do{ E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E0_DIR ^ ENABLED(INVERT_E1_VS_E0_DIR)); }while(0)
#define REV_E_DIR(E) do{ E0_DIR_WRITE( INVERT_E0_DIR); E1_DIR_WRITE( INVERT_E0_DIR ^ ENABLED(INVERT_E1_VS_E0_DIR)); }while(0)
#elif E_STEPPERS #elif E_STEPPERS
#define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V)
#define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR) #define NORM_E_DIR(E) E0_DIR_WRITE(!INVERT_E0_DIR)
@ -1013,6 +1018,7 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
// //
#if ENABLED(MIXING_EXTRUDER) #if ENABLED(MIXING_EXTRUDER)
/** /**
* Mixing steppers keep all their enable (and direction) states synchronized * Mixing steppers keep all their enable (and direction) states synchronized
*/ */
@ -1020,6 +1026,12 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
#define _CALL_DIS_E(N) DISABLE_STEPPER_E##N () ; #define _CALL_DIS_E(N) DISABLE_STEPPER_E##N () ;
#define ENABLE_AXIS_E0() { RREPEAT(MIXING_STEPPERS, _CALL_ENA_E) } #define ENABLE_AXIS_E0() { RREPEAT(MIXING_STEPPERS, _CALL_ENA_E) }
#define DISABLE_AXIS_E0() { RREPEAT(MIXING_STEPPERS, _CALL_DIS_E) } #define DISABLE_AXIS_E0() { RREPEAT(MIXING_STEPPERS, _CALL_DIS_E) }
#elif ENABLED(E_DUAL_STEPPER_DRIVERS)
#define ENABLE_AXIS_E0() do{ ENABLE_STEPPER_E0(); ENABLE_STEPPER_E1(); }while(0)
#define DISABLE_AXIS_E0() do{ DISABLE_STEPPER_E0(); DISABLE_STEPPER_E1(); }while(0)
#endif #endif
#ifndef ENABLE_AXIS_E0 #ifndef ENABLE_AXIS_E0

View File

@ -543,9 +543,17 @@
#define _EPIN(p,q) __EPIN(p,q) #define _EPIN(p,q) __EPIN(p,q)
#define DIAG_REMAPPED(p,q) (PIN_EXISTS(q) && _EPIN(p##_E_INDEX, DIAG) == q##_PIN) #define DIAG_REMAPPED(p,q) (PIN_EXISTS(q) && _EPIN(p##_E_INDEX, DIAG) == q##_PIN)
// The X2 axis, if any, should be the next open extruder port // The E0/E1 steppers are always used for Dual E
#define X2_E_INDEX E_STEPPERS #if ENABLED(E_DUAL_STEPPER_DRIVERS)
#ifndef E1_STEP_PIN
#error "No E1 stepper available for E_DUAL_STEPPER_DRIVERS!"
#endif
#define X2_E_INDEX INCREMENT(E_STEPPERS)
#else
#define X2_E_INDEX E_STEPPERS
#endif
// The X2 axis, if any, should be the next open extruder port
#if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS) #if EITHER(DUAL_X_CARRIAGE, X_DUAL_STEPPER_DRIVERS)
#ifndef X2_STEP_PIN #ifndef X2_STEP_PIN
#define X2_STEP_PIN _EPIN(X2_E_INDEX, STEP) #define X2_STEP_PIN _EPIN(X2_E_INDEX, STEP)

View File

@ -24,7 +24,7 @@ opt_enable S_CURVE_ACCELERATION EEPROM_SETTINGS GCODE_MACROS \
SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE CALIBRATION_GCODE \ SKEW_CORRECTION SKEW_CORRECTION_FOR_Z SKEW_CORRECTION_GCODE CALIBRATION_GCODE \
BACKLASH_COMPENSATION BACKLASH_GCODE BAUD_RATE_GCODE BEZIER_CURVE_SUPPORT \ BACKLASH_COMPENSATION BACKLASH_GCODE BAUD_RATE_GCODE BEZIER_CURVE_SUPPORT \
FWRETRACT ARC_SUPPORT ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \ FWRETRACT ARC_SUPPORT ARC_P_CIRCLES CNC_WORKSPACE_PLANES CNC_COORDINATE_SYSTEMS \
PSU_CONTROL AUTO_POWER_CONTROL \ PSU_CONTROL AUTO_POWER_CONTROL E_DUAL_STEPPER_DRIVERS \
PIDTEMPBED SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER \ PIDTEMPBED SLOW_PWM_HEATERS THERMAL_PROTECTION_CHAMBER \
PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL \ PINS_DEBUGGING MAX7219_DEBUG M114_DETAIL \
EXTENSIBLE_UI EXTENSIBLE_UI
@ -38,10 +38,9 @@ restore_configs
opt_set MOTHERBOARD BOARD_RADDS NUM_Z_STEPPER_DRIVERS 3 opt_set MOTHERBOARD BOARD_RADDS NUM_Z_STEPPER_DRIVERS 3
opt_enable USE_XMAX_PLUG USE_YMAX_PLUG ENDSTOPPULLUPS BLTOUCH AUTO_BED_LEVELING_BILINEAR \ opt_enable USE_XMAX_PLUG USE_YMAX_PLUG ENDSTOPPULLUPS BLTOUCH AUTO_BED_LEVELING_BILINEAR \
Z_STEPPER_AUTO_ALIGN Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS Z_SAFE_HOMING Z_STEPPER_AUTO_ALIGN Z_STEPPER_ALIGN_KNOWN_STEPPER_POSITIONS Z_SAFE_HOMING
#TOUCH_UI_FTDI_EVE LCD_ALEPHOBJECTS_CLCD_UI OTHER_PIN_LAYOUT
pins_set ramps/RAMPS X_MAX_PIN -1 pins_set ramps/RAMPS X_MAX_PIN -1
pins_set ramps/RAMPS Y_MAX_PIN -1 pins_set ramps/RAMPS Y_MAX_PIN -1
exec_test $1 $2 "RADDS with ABL (Bilinear), Triple Z Axis, Z_STEPPER_AUTO_ALIGN" "$3" exec_test $1 $2 "RADDS with ABL (Bilinear), Triple Z Axis, Z_STEPPER_AUTO_ALIGN, E_DUAL_STEPPER_DRIVERS" "$3"
# #
# Test SWITCHING_EXTRUDER # Test SWITCHING_EXTRUDER

View File

@ -16,7 +16,7 @@ set -e
restore_configs restore_configs
opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB SERIAL_PORT_3 3 \ opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB SERIAL_PORT_3 3 \
NEOPIXEL_TYPE NEO_GRB RGB_LED_R_PIN P2_12 RGB_LED_G_PIN P1_23 RGB_LED_B_PIN P1_22 RGB_LED_W_PIN P1_24 NEOPIXEL_TYPE NEO_GRB RGB_LED_R_PIN P2_12 RGB_LED_G_PIN P1_23 RGB_LED_B_PIN P1_22 RGB_LED_W_PIN P1_24
opt_enable FYSETC_MINI_12864_2_1 SDSUPPORT SDCARD_READONLY SERIAL_PORT_2 RGBW_LED \ opt_enable FYSETC_MINI_12864_2_1 SDSUPPORT SDCARD_READONLY SERIAL_PORT_2 RGBW_LED E_DUAL_STEPPER_DRIVERS \
NEOPIXEL_LED NEOPIXEL_IS_SEQUENTIAL NEOPIXEL_STARTUP_TEST NEOPIXEL_BKGD_INDEX_FIRST NEOPIXEL_BKGD_INDEX_LAST NEOPIXEL_BKGD_COLOR NEOPIXEL_BKGD_ALWAYS_ON NEOPIXEL_LED NEOPIXEL_IS_SEQUENTIAL NEOPIXEL_STARTUP_TEST NEOPIXEL_BKGD_INDEX_FIRST NEOPIXEL_BKGD_INDEX_LAST NEOPIXEL_BKGD_COLOR NEOPIXEL_BKGD_ALWAYS_ON
exec_test $1 $2 "ReARM EFB VIKI2, SDSUPPORT, 2 Serial ports (USB CDC + UART0), NeoPixel" "$3" exec_test $1 $2 "ReARM EFB VIKI2, SDSUPPORT, 2 Serial ports (USB CDC + UART0), NeoPixel" "$3"