Skip to content

Commit

Permalink
Generalize MMU (MarlinFirmware#21469)
Browse files Browse the repository at this point in the history
  • Loading branch information
GMagician authored Mar 30, 2021
1 parent c298095 commit 3f7cd45
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 23 deletions.
10 changes: 5 additions & 5 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@
* Multi-Material Unit
* Set to one of these predefined models:
*
* PRUSA_MMU1 : Průša MMU1 (The "multiplexer" version)
* PRUSA_MMU2 : Průša MMU2
* PRUSA_MMU2S : Průša MMU2S (Requires MK3S extruder with motion sensor, EXTRUDERS = 5)
* SMUFF_EMU_MMU2 : Technik Gegg SMuFF (Průša MMU2 emulation mode)
* SMUFF_EMU_MMU2S : Technik Gegg SMuFF (Průša MMU2S emulation mode)
* PRUSA_MMU1 : Průša MMU1 (The "multiplexer" version)
* PRUSA_MMU2 : Průša MMU2
* PRUSA_MMU2S : Průša MMU2S (Requires MK3S extruder with motion sensor, EXTRUDERS = 5)
* EXTENDABLE_EMU_MMU2 : MMU with configurable number of filaments (ERCF, SMuFF or similar with Průša MMU2 compatible firmware)
* EXTENDABLE_EMU_MMU2S : MMUS with configurable number of filaments (ERCF, SMuFF or similar with Průša MMU2 compatible firmware)
*
* Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails.
* See additional options in Configuration_adv.h.
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/control/T.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* F[units/min] Set the movement feedrate
* S1 Don't move the tool in XY after change
*
* For PRUSA_MMU2(S) and SMUFF_EMU_MMU2(S)
* For PRUSA_MMU2(S) and EXTENDABLE_EMU_MMU2(S)
* T[n] Gcode to extrude at least 38.10 mm at feedrate 19.02 mm/s must follow immediately to load to extruder wheels.
* T? Gcode to extrude shouldn't have to follow. Load to extruder wheels is done automatically.
* Tx Same as T?, but nozzle doesn't have to be preheated. Tc requires a preheated nozzle to finish filament load.
Expand Down
20 changes: 10 additions & 10 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,11 +501,11 @@
/**
* Multi-Material-Unit supported models
*/
#define PRUSA_MMU1 1
#define PRUSA_MMU2 2
#define PRUSA_MMU2S 3
#define SMUFF_EMU_MMU2 12
#define SMUFF_EMU_MMU2S 13
#define PRUSA_MMU1 1
#define PRUSA_MMU2 2
#define PRUSA_MMU2S 3
#define EXTENDABLE_EMU_MMU2 12
#define EXTENDABLE_EMU_MMU2S 13

#ifdef MMU_MODEL
#define HAS_MMU 1
Expand All @@ -517,16 +517,16 @@
#define HAS_PRUSA_MMU2 1
#define HAS_PRUSA_MMU2S 1
#endif
#if MMU_MODEL == SMUFF_EMU_MMU2 || MMU_MODEL == SMUFF_EMU_MMU2S
#define HAS_SMUFF 1
#if MMU_MODEL == EXTENDABLE_EMU_MMU2 || MMU_MODEL == EXTENDABLE_EMU_MMU2S
#define HAS_EXTENDABLE_MMU 1
#endif
#endif

#undef PRUSA_MMU1
#undef PRUSA_MMU2
#undef PRUSA_MMU2S
#undef SMUFF_EMU_MMU2
#undef SMUFF_EMU_MMU2S
#undef EXTENDABLE_EMU_MMU2
#undef EXTENDABLE_EMU_MMU2S

/**
* Extruders have some combination of stepper motors and hotends
Expand Down Expand Up @@ -579,7 +579,7 @@
#undef DISABLE_INACTIVE_EXTRUDER
#endif

// Průša MMU1, MMU 2.0, MMUS 2.0 and SMuFF force SINGLENOZZLE
// Průša MMU1, MMU(S) 2.0 and EXTENDABLE_EMU_MMU2(S) force SINGLENOZZLE
#if HAS_MMU
#define SINGLENOZZLE
#endif
Expand Down
14 changes: 9 additions & 5 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -920,10 +920,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "PRUSA_MMU2 is obsolete. Define MMU_MODEL as PRUSA_MMU2 instead."
#elif ENABLED(PRUSA_MMU2_S_MODE)
#error "PRUSA_MMU2_S_MODE is obsolete. Define MMU_MODEL as PRUSA_MMU2S instead."
#elif ENABLED(SMUFF_EMU_MMU2)
#error "SMUFF_EMU_MMU2 is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2 instead."
#elif ENABLED(SMUFF_EMU_MMU2S)
#error "SMUFF_EMU_MMU2S is obsolete. Define MMU_MODEL as EXTENDABLE_EMU_MMU2S instead."
#endif

/**
* Multi-Material-Unit 2 / SMuFF requirements
* Multi-Material-Unit 2 / EXTENDABLE_EMU_MMU2 requirements
*/
#if HAS_PRUSA_MMU2
#if EXTRUDERS != 5
Expand All @@ -938,11 +942,11 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#elif ENABLED(MMU_EXTRUDER_SENSOR) && !HAS_LCD_MENU
#error "MMU_EXTRUDER_SENSOR requires an LCD supporting MarlinUI to be enabled."
#elif DISABLED(ADVANCED_PAUSE_FEATURE)
static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2(S) / SMUFF_EMU_MMU2(S).");
static_assert(nullptr == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2(S) / HAS_EXTENDABLE_MMU(S).");
#endif
#endif
#if HAS_SMUFF && EXTRUDERS > 12
#error "Too many extruders for SMUFF_EMU_MMU2(S). (12 maximum)."
#if HAS_EXTENDABLE_MMU && EXTRUDERS > 15
#error "Too many extruders for MMU(S) emulation mode. (15 maximum)."
#endif

/**
Expand Down Expand Up @@ -980,7 +984,7 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "TOOLCHANGE_ZRAISE required for EXTRUDERS > 1."
#endif

#elif HAS_PRUSA_MMU1 || HAS_SMUFF
#elif HAS_PRUSA_MMU1 || HAS_EXTENDABLE_MMU

#error "Multi-Material-Unit requires 2 or more EXTRUDERS."

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/pins/pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
* These numbers are the same in any pin mapping.
*/

#if HAS_SMUFF
#define MAX_EXTRUDERS 12
#if HAS_EXTENDABLE_MMU
#define MAX_EXTRUDERS 15
#else
#define MAX_EXTRUDERS 8
#endif
Expand Down

0 comments on commit 3f7cd45

Please sign in to comment.