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
// 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
*

View File

@ -558,7 +558,12 @@
#undef DISABLE_E
#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
#define E_STEPPERS 3
#elif EXTRUDERS > 2
@ -569,17 +574,24 @@
#if DISABLED(SWITCHING_NOZZLE)
#define HOTENDS E_STEPPERS
#endif
#elif ENABLED(MIXING_EXTRUDER)
#elif ENABLED(MIXING_EXTRUDER) // Multiple feeds are mixed proportionally
#define E_STEPPERS MIXING_STEPPERS
#define E_MANUAL 1
#if MIXING_STEPPERS == 2
#define HAS_DUAL_MIXING 1
#endif
#elif ENABLED(SWITCHING_TOOLHEAD)
#elif ENABLED(SWITCHING_TOOLHEAD) // Toolchanger
#define E_STEPPERS EXTRUDERS
#define E_MANUAL EXTRUDERS
#elif HAS_PRUSA_MMU2
#elif HAS_PRUSA_MMU2 // Průša Multi-Material Unit v2
#define E_STEPPERS 1
#endif
// 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
/**
* 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
*/

View File

@ -645,6 +645,11 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
#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
#define E_STEP_WRITE(E,V) E0_STEP_WRITE(V)
#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)
/**
* 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 ENABLE_AXIS_E0() { RREPEAT(MIXING_STEPPERS, _CALL_ENA_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
#ifndef ENABLE_AXIS_E0

View File

@ -543,9 +543,17 @@
#define _EPIN(p,q) __EPIN(p,q)
#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
#define X2_E_INDEX E_STEPPERS
// The E0/E1 steppers are always used for Dual E
#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)
#ifndef X2_STEP_PIN
#define X2_STEP_PIN _EPIN(X2_E_INDEX, STEP)