SMUFF (MMU2 clone) support (#19912)

This commit is contained in:
Giuliano Zaro 2020-11-18 08:27:21 +01:00 committed by GitHub
parent 11b811820f
commit 41529b6598
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 622 additions and 616 deletions

View file

@ -158,33 +158,19 @@
#endif #endif
/** /**
* Průša MK2 Single Nozzle Multi-Material Multiplexer, and variants. * Multi-Material Unit
* Set to one of these predefined models:
* *
* This device allows one stepper driver on a control board to drive * PRUSA_MMU1 : Průša MMU1 (The "multiplexer" version)
* two to eight stepper motors, one at a time, in a manner suitable * PRUSA_MMU2 : Průša MMU2
* for extruders. * PRUSA_MMU2S : Průša MMU2S (Requires MK3S extruder with motion sensor, EXTRUDERS = 5)
* * SMUFF_EMU_MMU2 : Technik Gegg SMUFF (Průša MMU2 emulation mode)
* This option only allows the multiplexer to switch on tool-change. * SMUFF_EMU_MMU2S : Technik Gegg SMUFF (Průša MMU2S emulation mode)
* Additional options to configure custom E moves are pending.
*/
//#define MK2_MULTIPLEXER
#if ENABLED(MK2_MULTIPLEXER)
// Override the default DIO selector pins here, if needed.
// Some pins files may provide defaults for these pins.
//#define E_MUX0_PIN 40 // Always Required
//#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs
//#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs
#endif
/**
* Průša Multi-Material Unit v2
* *
* Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails.
* Requires EXTRUDERS = 5 * See additional options in Configuration_adv.h.
*
* For additional configuration see Configuration_adv.h
*/ */
//#define PRUSA_MMU2 //#define MMU_MODEL PRUSA_MMU2
// A dual extruder that uses a single stepper motor // A dual extruder that uses a single stepper motor
//#define SWITCHING_EXTRUDER //#define SWITCHING_EXTRUDER

View file

@ -3532,11 +3532,24 @@
#endif #endif
/** /**
* Průša Multi-Material Unit v2 * Průša Multi-Material Unit (MMU)
* Enable in Configuration.h * Enable in Configuration.h
*
* These devices allow a single stepper driver on the board to drive
* multi-material feeders with any number of stepper motors.
*/ */
#if ENABLED(PRUSA_MMU2) #if HAS_PRUSA_MMU1
/**
* This option only allows the multiplexer to switch on tool-change.
* Additional options to configure custom E moves are pending.
*
* Override the default DIO selector pins here, if needed.
* Some pins files may provide defaults for these pins.
*/
//#define E_MUX0_PIN 40 // Always Required
//#define E_MUX1_PIN 42 // Needed for 3 to 8 inputs
//#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs
#elif HAS_PRUSA_MMU2
// Serial port used for communication with MMU2. // Serial port used for communication with MMU2.
// For AVR enable the UART port used for the MMU. (e.g., mmuSerial) // For AVR enable the UART port used for the MMU. (e.g., mmuSerial)
// For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2)
@ -3554,7 +3567,7 @@
// Add an LCD menu for MMU2 // Add an LCD menu for MMU2
//#define MMU2_MENUS //#define MMU2_MENUS
#if ENABLED(MMU2_MENUS) #if EITHER(MMU2_MENUS, HAS_PRUSA_MMU2S)
// Settings for filament load / unload from the LCD menu. // Settings for filament load / unload from the LCD menu.
// This is for Průša MK3-style extruders. Customize for your hardware. // This is for Průša MK3-style extruders. Customize for your hardware.
#define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0
@ -3579,29 +3592,12 @@
{ -50.0, 2000 } { -50.0, 2000 }
#endif #endif
/**
* MMU Extruder Sensor
*
* Support for a Průša (or other) IR Sensor to detect filament near the extruder
* and make loading more reliable. Suitable for an extruder equipped with a filament
* sensor less than 38mm from the gears.
*
* During loading the extruder will stop when the sensor is triggered, then do a last
* move up to the gears. If no filament is detected, the MMU2 can make some more attempts.
* If all attempts fail, a filament runout will be triggered.
*/
//#define MMU_EXTRUDER_SENSOR
#if ENABLED(MMU_EXTRUDER_SENSOR)
#define MMU_LOADING_ATTEMPTS_NR 5 // max. number of attempts to load filament if first load fail
#endif
/** /**
* Using a sensor like the MMU2S * Using a sensor like the MMU2S
* This mode requires a MK3S extruder with a sensor at the extruder idler, like the MMU2S. * This mode requires a MK3S extruder with a sensor at the extruder idler, like the MMU2S.
* See https://help.prusa3d.com/en/guide/3b-mk3s-mk2-5s-extruder-upgrade_41560, step 11 * See https://help.prusa3d.com/en/guide/3b-mk3s-mk2-5s-extruder-upgrade_41560, step 11
*/ */
//#define PRUSA_MMU2_S_MODE #if HAS_PRUSA_MMU2S
#if ENABLED(PRUSA_MMU2_S_MODE)
#define MMU2_C0_RETRY 5 // Number of retries (total time = timeout*retries) #define MMU2_C0_RETRY 5 // Number of retries (total time = timeout*retries)
#define MMU2_CAN_LOAD_FEEDRATE 800 // (mm/min) #define MMU2_CAN_LOAD_FEEDRATE 800 // (mm/min)
@ -3617,11 +3613,29 @@
#define MMU2_CAN_LOAD_INCREMENT_SEQUENCE \ #define MMU2_CAN_LOAD_INCREMENT_SEQUENCE \
{ -MMU2_CAN_LOAD_INCREMENT, MMU2_CAN_LOAD_FEEDRATE } { -MMU2_CAN_LOAD_INCREMENT, MMU2_CAN_LOAD_FEEDRATE }
#else
/**
* MMU1 Extruder Sensor
*
* Support for a Průša (or other) IR Sensor to detect filament near the extruder
* and make loading more reliable. Suitable for an extruder equipped with a filament
* sensor less than 38mm from the gears.
*
* During loading the extruder will stop when the sensor is triggered, then do a last
* move up to the gears. If no filament is detected, the MMU2 can make some more attempts.
* If all attempts fail, a filament runout will be triggered.
*/
//#define MMU_EXTRUDER_SENSOR
#if ENABLED(MMU_EXTRUDER_SENSOR)
#define MMU_LOADING_ATTEMPTS_NR 5 // max. number of attempts to load filament if first load fail
#endif
#endif #endif
//#define MMU2_DEBUG // Write debug info to serial output //#define MMU2_DEBUG // Write debug info to serial output
#endif // PRUSA_MMU2 #endif // HAS_PRUSA_MMU2
/** /**
* Advanced Print Counter settings * Advanced Print Counter settings

View file

@ -97,8 +97,8 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o
#define IS_RX0(P) (P == P0_03) #define IS_RX0(P) (P == P0_03)
#if IS_TX0(TMC_SW_MISO) || IS_RX0(TMC_SW_MOSI) #if IS_TX0(TMC_SW_MISO) || IS_RX0(TMC_SW_MOSI)
#error "Serial port pins (0) conflict with Trinamic SPI pins!" #error "Serial port pins (0) conflict with Trinamic SPI pins!"
#elif ENABLED(MK2_MULTIPLEXER) && (IS_TX0(E_MUX1_PIN) || IS_RX0(E_MUX0_PIN)) #elif HAS_PRUSA_MMU1 && (IS_TX0(E_MUX1_PIN) || IS_RX0(E_MUX0_PIN))
#error "Serial port pins (0) conflict with MK2 multiplexer pins!" #error "Serial port pins (0) conflict with Multi-Material-Unit multiplexer pins!"
#elif (AXIS_HAS_SPI(X) && IS_TX0(X_CS_PIN)) || (AXIS_HAS_SPI(Y) && IS_RX0(Y_CS_PIN)) #elif (AXIS_HAS_SPI(X) && IS_TX0(X_CS_PIN)) || (AXIS_HAS_SPI(Y) && IS_RX0(Y_CS_PIN))
#error "Serial port pins (0) conflict with X/Y axis SPI pins!" #error "Serial port pins (0) conflict with X/Y axis SPI pins!"
#endif #endif

View file

@ -213,8 +213,8 @@
#include "feature/controllerfan.h" #include "feature/controllerfan.h"
#endif #endif
#if ENABLED(PRUSA_MMU2) #if HAS_PRUSA_MMU2
#include "feature/mmu2/mmu2.h" #include "feature/mmu/mmu2.h"
#endif #endif
#if HAS_L64XX #if HAS_L64XX
@ -713,9 +713,7 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
TERN_(HAS_FILAMENT_SENSOR, runout.run()); TERN_(HAS_FILAMENT_SENSOR, runout.run());
// Run HAL idle tasks // Run HAL idle tasks
#ifdef HAL_IDLETASK TERN_(HAL_IDLETASK, HAL_idletask());
HAL_idletask();
#endif
// Check network connection // Check network connection
TERN_(HAS_ETHERNET, ethernet.check()); TERN_(HAS_ETHERNET, ethernet.check());
@ -772,7 +770,7 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
#endif #endif
// Update the Průša MMU2 // Update the Průša MMU2
TERN_(PRUSA_MMU2, mmu2.mmu_loop()); TERN_(HAS_PRUSA_MMU2, mmu2.mmu_loop());
// Handle Joystick jogging // Handle Joystick jogging
TERN_(POLL_JOG, joystick.inject_jog_moves()); TERN_(POLL_JOG, joystick.inject_jog_moves());
@ -780,9 +778,8 @@ void idle(TERN_(ADVANCED_PAUSE_FEATURE, bool no_stepper_sleep/*=false*/)) {
// Direct Stepping // Direct Stepping
TERN_(DIRECT_STEPPING, page_manager.write_responses()); TERN_(DIRECT_STEPPING, page_manager.write_responses());
#if HAS_TFT_LVGL_UI // Update the LVGL interface
LV_TASK_HANDLER(); TERN_(HAS_TFT_LVGL_UI, LV_TASK_HANDLER());
#endif
} }
/** /**
@ -1187,8 +1184,8 @@ void setup() {
SETUP_RUN(caselight.update_brightness()); SETUP_RUN(caselight.update_brightness());
#endif #endif
#if ENABLED(MK2_MULTIPLEXER) #if HAS_PRUSA_MMU1
SETUP_LOG("MK2_MULTIPLEXER"); SETUP_LOG("Prusa MMU1");
SET_OUTPUT(E_MUX0_PIN); SET_OUTPUT(E_MUX0_PIN);
SET_OUTPUT(E_MUX1_PIN); SET_OUTPUT(E_MUX1_PIN);
SET_OUTPUT(E_MUX2_PIN); SET_OUTPUT(E_MUX2_PIN);
@ -1268,7 +1265,7 @@ void setup() {
SETUP_RUN(test_tmc_connection(true, true, true, true)); SETUP_RUN(test_tmc_connection(true, true, true, true));
#endif #endif
#if ENABLED(PRUSA_MMU2) #if HAS_PRUSA_MMU2
SETUP_RUN(mmu2.init()); SETUP_RUN(mmu2.init());
#endif #endif

View file

@ -22,7 +22,7 @@
#include "../inc/MarlinConfig.h" #include "../inc/MarlinConfig.h"
#if ENABLED(MK2_MULTIPLEXER) #if HAS_PRUSA_MMU1
#include "../module/stepper.h" #include "../module/stepper.h"
@ -35,4 +35,4 @@ void select_multiplexed_stepper(const uint8_t e) {
safe_delay(100); safe_delay(100);
} }
#endif // MK2_MULTIPLEXER #endif // HAS_PRUSA_MMU1

View file

@ -22,7 +22,7 @@
#include "../../inc/MarlinConfig.h" #include "../../inc/MarlinConfig.h"
#if ENABLED(PRUSA_MMU2) #if HAS_PRUSA_MMU2
#include "mmu2.h" #include "mmu2.h"
#include "../../lcd/menu/menu_mmu2.h" #include "../../lcd/menu/menu_mmu2.h"
@ -94,7 +94,7 @@ MMU2 mmu2;
#define mmuSerial MMU2_SERIAL #define mmuSerial MMU2_SERIAL
bool MMU2::enabled, MMU2::ready, MMU2::mmu_print_saved; bool MMU2::enabled, MMU2::ready, MMU2::mmu_print_saved;
#if ENABLED(PRUSA_MMU2_S_MODE) #if HAS_PRUSA_MMU2S
bool MMU2::mmu2s_triggered; bool MMU2::mmu2s_triggered;
#endif #endif
uint8_t MMU2::cmd, MMU2::cmd_arg, MMU2::last_cmd, MMU2::extruder; uint8_t MMU2::cmd, MMU2::cmd_arg, MMU2::last_cmd, MMU2::extruder;
@ -105,23 +105,19 @@ int16_t MMU2::version = -1, MMU2::buildnr = -1;
millis_t MMU2::prev_request, MMU2::prev_P0_request; millis_t MMU2::prev_request, MMU2::prev_P0_request;
char MMU2::rx_buffer[MMU_RX_SIZE], MMU2::tx_buffer[MMU_TX_SIZE]; char MMU2::rx_buffer[MMU_RX_SIZE], MMU2::tx_buffer[MMU_TX_SIZE];
#if BOTH(HAS_LCD_MENU, MMU2_MENUS) struct E_Step {
struct E_Step {
float extrude; //!< extrude distance in mm float extrude; //!< extrude distance in mm
feedRate_t feedRate; //!< feed rate in mm/s feedRate_t feedRate; //!< feed rate in mm/s
}; };
static constexpr E_Step static constexpr E_Step
ramming_sequence[] PROGMEM = { MMU2_RAMMING_SEQUENCE } ramming_sequence[] PROGMEM = { MMU2_RAMMING_SEQUENCE }
, load_to_nozzle_sequence[] PROGMEM = { MMU2_LOAD_TO_NOZZLE_SEQUENCE } , load_to_nozzle_sequence[] PROGMEM = { MMU2_LOAD_TO_NOZZLE_SEQUENCE }
#if ENABLED(PRUSA_MMU2_S_MODE) #if HAS_PRUSA_MMU2S
, can_load_sequence[] PROGMEM = { MMU2_CAN_LOAD_SEQUENCE } , can_load_sequence[] PROGMEM = { MMU2_CAN_LOAD_SEQUENCE }
, can_load_increment_sequence[] PROGMEM = { MMU2_CAN_LOAD_INCREMENT_SEQUENCE } , can_load_increment_sequence[] PROGMEM = { MMU2_CAN_LOAD_INCREMENT_SEQUENCE }
#endif #endif
; ;
#endif // MMU2_MENUS
MMU2::MMU2() { MMU2::MMU2() {
rx_buffer[0] = '\0'; rx_buffer[0] = '\0';
@ -162,7 +158,7 @@ uint8_t MMU2::get_current_tool() {
return extruder == MMU2_NO_TOOL ? -1 : extruder; return extruder == MMU2_NO_TOOL ? -1 : extruder;
} }
#if EITHER(PRUSA_MMU2_S_MODE, MMU_EXTRUDER_SENSOR) #if EITHER(HAS_PRUSA_MMU2S, MMU_EXTRUDER_SENSOR)
#define FILAMENT_PRESENT() (READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE) #define FILAMENT_PRESENT() (READ(FIL_RUNOUT1_PIN) != FIL_RUNOUT1_STATE)
#endif #endif
@ -188,7 +184,7 @@ void MMU2::mmu_loop() {
case -2: case -2:
if (rx_ok()) { if (rx_ok()) {
sscanf(rx_buffer, "%uok\n", &version); sscanf(rx_buffer, "%huok\n", &version);
DEBUG_ECHOLNPAIR("MMU => ", version, "\nMMU <= 'S2'"); DEBUG_ECHOLNPAIR("MMU => ", version, "\nMMU <= 'S2'");
@ -199,7 +195,7 @@ void MMU2::mmu_loop() {
case -3: case -3:
if (rx_ok()) { if (rx_ok()) {
sscanf(rx_buffer, "%uok\n", &buildnr); sscanf(rx_buffer, "%huok\n", &buildnr);
DEBUG_ECHOLNPAIR("MMU => ", buildnr); DEBUG_ECHOLNPAIR("MMU => ", buildnr);
@ -242,7 +238,7 @@ void MMU2::mmu_loop() {
enabled = true; enabled = true;
state = 1; state = 1;
TERN_(PRUSA_MMU2_S_MODE, mmu2s_triggered = false); TERN_(HAS_PRUSA_MMU2S, mmu2s_triggered = false);
} }
break; break;
@ -307,7 +303,7 @@ void MMU2::mmu_loop() {
state = 2; // wait for response state = 2; // wait for response
} }
TERN_(PRUSA_MMU2_S_MODE, check_filament()); TERN_(HAS_PRUSA_MMU2S, check_filament());
break; break;
case 2: // response to command P0 case 2: // response to command P0
@ -324,7 +320,7 @@ void MMU2::mmu_loop() {
else if (ELAPSED(millis(), prev_request + MMU_P0_TIMEOUT)) // Resend request after timeout (3s) else if (ELAPSED(millis(), prev_request + MMU_P0_TIMEOUT)) // Resend request after timeout (3s)
state = 1; state = 1;
TERN_(PRUSA_MMU2_S_MODE, check_filament()); TERN_(HAS_PRUSA_MMU2S, check_filament());
break; break;
case 3: // response to mmu commands case 3: // response to mmu commands
@ -340,9 +336,9 @@ void MMU2::mmu_loop() {
#endif #endif
if (rx_ok()) { if (rx_ok()) {
// Response to C0 mmu command in PRUSA_MMU2_S_MODE // Response to C0 mmu command in MMU2S model
bool can_reset = true; bool can_reset = true;
#if ENABLED(PRUSA_MMU2_S_MODE) #if HAS_PRUSA_MMU2S
if (!mmu2s_triggered && last_cmd == MMU_CMD_C0) { if (!mmu2s_triggered && last_cmd == MMU_CMD_C0) {
can_reset = false; can_reset = false;
// MMU ok received but filament sensor not triggered, retrying... // MMU ok received but filament sensor not triggered, retrying...
@ -367,7 +363,7 @@ void MMU2::mmu_loop() {
} }
state = 1; state = 1;
} }
TERN_(PRUSA_MMU2_S_MODE, check_filament()); TERN_(HAS_PRUSA_MMU2S, check_filament());
break; break;
} }
} }
@ -487,7 +483,7 @@ static void mmu2_not_responding() {
BUZZ(100, 659); BUZZ(100, 659);
} }
#if ENABLED(PRUSA_MMU2_S_MODE) #if HAS_PRUSA_MMU2S
bool MMU2::load_to_gears() { bool MMU2::load_to_gears() {
command(MMU_CMD_C0); command(MMU_CMD_C0);
@ -541,23 +537,25 @@ static void mmu2_not_responding() {
* Tc Load to nozzle after filament was prepared by Tx and extruder nozzle is already heated. * Tc Load to nozzle after filament was prepared by Tx and extruder nozzle is already heated.
*/ */
void MMU2::tool_change(const char* special) { void MMU2::tool_change(const char* special) {
if (!enabled) return; if (!enabled) return;
#if ENABLED(MMU2_MENUS)
set_runout_valid(false); set_runout_valid(false);
switch (*special) { switch (*special) {
case '?': { case '?': {
uint8_t index = mmu2_choose_filament(); #if ENABLED(MMU2_MENUS)
const uint8_t index = mmu2_choose_filament();
while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100);
load_filament_to_nozzle(index); load_filament_to_nozzle(index);
#else
BUZZ(400, 40);
#endif
} break; } break;
case 'x': { case 'x': {
#if ENABLED(MMU2_MENUS)
planner.synchronize(); planner.synchronize();
uint8_t index = mmu2_choose_filament(); const uint8_t index = mmu2_choose_filament();
DISABLE_AXIS_E0(); DISABLE_AXIS_E0();
command(MMU_CMD_T0 + index); command(MMU_CMD_T0 + index);
manage_response(true, true); manage_response(true, true);
@ -568,6 +566,9 @@ static void mmu2_not_responding() {
extruder = index; extruder = index;
active_extruder = 0; active_extruder = 0;
} }
#else
BUZZ(400, 40);
#endif
} break; } break;
case 'c': { case 'c': {
@ -577,8 +578,6 @@ static void mmu2_not_responding() {
} }
set_runout_valid(true); set_runout_valid(true);
#endif // MMU2_MENUS
} }
#elif ENABLED(MMU_EXTRUDER_SENSOR) #elif ENABLED(MMU_EXTRUDER_SENSOR)
@ -628,20 +627,23 @@ static void mmu2_not_responding() {
void MMU2::tool_change(const char* special) { void MMU2::tool_change(const char* special) {
if (!enabled) return; if (!enabled) return;
#if ENABLED(MMU2_MENUS)
set_runout_valid(false); set_runout_valid(false);
switch (*special) { switch (*special) {
case '?': { case '?': {
DEBUG_ECHOLNPGM("case ?\n"); DEBUG_ECHOLNPGM("case ?\n");
#if ENABLED(MMU2_MENUS)
uint8_t index = mmu2_choose_filament(); uint8_t index = mmu2_choose_filament();
while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100);
load_filament_to_nozzle(index); load_filament_to_nozzle(index);
#else
BUZZ(400, 40);
#endif
} break; } break;
case 'x': { case 'x': {
DEBUG_ECHOLNPGM("case x\n"); DEBUG_ECHOLNPGM("case x\n");
#if ENABLED(MMU2_MENUS)
planner.synchronize(); planner.synchronize();
uint8_t index = mmu2_choose_filament(); uint8_t index = mmu2_choose_filament();
DISABLE_AXIS_E0(); DISABLE_AXIS_E0();
@ -654,6 +656,9 @@ static void mmu2_not_responding() {
ENABLE_AXIS_E0(); ENABLE_AXIS_E0();
extruder = index; extruder = index;
active_extruder = 0; active_extruder = 0;
#else
BUZZ(400, 40);
#endif
} break; } break;
case 'c': { case 'c': {
@ -664,8 +669,6 @@ static void mmu2_not_responding() {
} }
set_runout_valid(true); set_runout_valid(true);
#endif // MMU2_MENUS
} }
void MMU2::mmu_continue_loading() { void MMU2::mmu_continue_loading() {
@ -682,12 +685,12 @@ static void mmu2_not_responding() {
mmu_idl_sens = 0; mmu_idl_sens = 0;
} }
#elif DISABLED(MMU_EXTRUDER_SENSOR) && DISABLED(PRUSA_MMU2_S_MODE) #else // !HAS_PRUSA_MMU2S && !MMU_EXTRUDER_SENSOR
/** /**
* Handle tool change * Handle tool change
*/ */
void MMU2::tool_change(const uint8_t index) { void MMU2::tool_change(const uint8_t index) {
if (!enabled) return; if (!enabled) return;
set_runout_valid(false); set_runout_valid(false);
@ -707,32 +710,35 @@ void MMU2::tool_change(const uint8_t index) {
} }
set_runout_valid(true); set_runout_valid(true);
} }
/** /**
* Handle special T?/Tx/Tc commands * Handle special T?/Tx/Tc commands
* *
* T? Gcode to extrude shouldn't have to follow, load to extruder wheels is done automatically * T? Gcode to extrude shouldn't have to follow, load to extruder wheels is done automatically
* Tx Same as T?, except nozzle doesn't have to be preheated. Tc must be placed after extruder nozzle is preheated to finish filament load. * Tx Same as T?, except nozzle doesn't have to be preheated. Tc must be placed after extruder nozzle is preheated to finish filament load.
* Tc Load to nozzle after filament was prepared by Tx and extruder nozzle is already heated. * Tc Load to nozzle after filament was prepared by Tx and extruder nozzle is already heated.
*/ */
void MMU2::tool_change(const char* special) { void MMU2::tool_change(const char* special) {
if (!enabled) return; if (!enabled) return;
#if ENABLED(MMU2_MENUS)
set_runout_valid(false); set_runout_valid(false);
switch (*special) { switch (*special) {
case '?': { case '?': {
DEBUG_ECHOLNPGM("case ?\n"); DEBUG_ECHOLNPGM("case ?\n");
#if ENABLED(MMU2_MENUS)
uint8_t index = mmu2_choose_filament(); uint8_t index = mmu2_choose_filament();
while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100);
load_filament_to_nozzle(index); load_filament_to_nozzle(index);
#else
BUZZ(400, 40);
#endif
} break; } break;
case 'x': { case 'x': {
DEBUG_ECHOLNPGM("case x\n"); DEBUG_ECHOLNPGM("case x\n");
#if ENABLED(MMU2_MENUS)
planner.synchronize(); planner.synchronize();
uint8_t index = mmu2_choose_filament(); uint8_t index = mmu2_choose_filament();
DISABLE_AXIS_E0(); DISABLE_AXIS_E0();
@ -744,6 +750,9 @@ void MMU2::tool_change(const char* special) {
ENABLE_AXIS_E0(); ENABLE_AXIS_E0();
extruder = index; extruder = index;
active_extruder = 0; active_extruder = 0;
#else
BUZZ(400, 40);
#endif
} break; } break;
case 'c': { case 'c': {
@ -754,11 +763,9 @@ void MMU2::tool_change(const char* special) {
} }
set_runout_valid(true); set_runout_valid(true);
#endif
} }
#endif // MMU_EXTRUDER_SENSOR #endif // HAS_PRUSA_MMU2S
/** /**
* Set next command * Set next command
@ -866,7 +873,7 @@ void MMU2::filament_runout() {
planner.synchronize(); planner.synchronize();
} }
#if ENABLED(PRUSA_MMU2_S_MODE) #if HAS_PRUSA_MMU2S
void MMU2::check_filament() { void MMU2::check_filament() {
const bool present = FILAMENT_PRESENT(); const bool present = FILAMENT_PRESENT();
@ -907,22 +914,21 @@ void MMU2::filament_runout() {
DEBUG_ECHOLNPGM(" succeeded."); DEBUG_ECHOLNPGM(" succeeded.");
return true; return true;
} }
#endif #endif
#if BOTH(HAS_LCD_MENU, MMU2_MENUS) // Load filament into MMU2
void MMU2::load_filament(const uint8_t index) {
// Load filament into MMU2
void MMU2::load_filament(const uint8_t index) {
if (!enabled) return; if (!enabled) return;
command(MMU_CMD_L0 + index); command(MMU_CMD_L0 + index);
manage_response(false, false); manage_response(false, false);
BUZZ(200, 404); BUZZ(200, 404);
} }
/** /**
* Switch material and load to nozzle * Switch material and load to nozzle
*/ */
bool MMU2::load_filament_to_nozzle(const uint8_t index) { bool MMU2::load_filament_to_nozzle(const uint8_t index) {
if (!enabled) return false; if (!enabled) return false;
@ -944,21 +950,21 @@ void MMU2::filament_runout() {
BUZZ(200, 404); BUZZ(200, 404);
} }
return success; return success;
} }
/** /**
* Load filament to nozzle of multimaterial printer * Load filament to nozzle of multimaterial printer
* *
* This function is used only only after T? (user select filament) and M600 (change filament). * This function is used only only after T? (user select filament) and M600 (change filament).
* It is not used after T0 .. T4 command (select filament), in such case, gcode is responsible for loading * It is not used after T0 .. T4 command (select filament), in such case, gcode is responsible for loading
* filament to nozzle. * filament to nozzle.
*/ */
void MMU2::load_to_nozzle() { void MMU2::load_to_nozzle() {
if (!enabled) return; if (!enabled) return;
execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, COUNT(load_to_nozzle_sequence)); execute_extruder_sequence((const E_Step *)load_to_nozzle_sequence, COUNT(load_to_nozzle_sequence));
} }
bool MMU2::eject_filament(const uint8_t index, const bool recover) { bool MMU2::eject_filament(const uint8_t index, const bool recover) {
if (!enabled) return false; if (!enabled) return false;
@ -972,7 +978,7 @@ void MMU2::filament_runout() {
ENABLE_AXIS_E0(); ENABLE_AXIS_E0();
current_position.e -= MMU2_FILAMENTCHANGE_EJECT_FEED; current_position.e -= MMU2_FILAMENTCHANGE_EJECT_FEED;
line_to_current_position(2500 / 60); line_to_current_position(MMM_TO_MMS(2500));
planner.synchronize(); planner.synchronize();
command(MMU_CMD_E0 + index); command(MMU_CMD_E0 + index);
manage_response(false, false); manage_response(false, false);
@ -1002,12 +1008,12 @@ void MMU2::filament_runout() {
DISABLE_AXIS_E0(); DISABLE_AXIS_E0();
return true; return true;
} }
/** /**
* Unload from hotend and retract to MMU * Unload from hotend and retract to MMU
*/ */
bool MMU2::unload() { bool MMU2::unload() {
if (!enabled) return false; if (!enabled) return false;
@ -1030,16 +1036,16 @@ void MMU2::filament_runout() {
set_runout_valid(false); set_runout_valid(false);
return true; return true;
} }
/** /**
* Unload sequence to optimize shape of the tip of the unloaded filament * Unload sequence to optimize shape of the tip of the unloaded filament
*/ */
void MMU2::filament_ramming() { void MMU2::filament_ramming() {
execute_extruder_sequence((const E_Step *)ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); execute_extruder_sequence((const E_Step *)ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step));
} }
void MMU2::execute_extruder_sequence(const E_Step * sequence, int steps) { void MMU2::execute_extruder_sequence(const E_Step * sequence, int steps) {
planner.synchronize(); planner.synchronize();
ENABLE_AXIS_E0(); ENABLE_AXIS_E0();
@ -1061,8 +1067,6 @@ void MMU2::filament_runout() {
} }
DISABLE_AXIS_E0(); DISABLE_AXIS_E0();
} }
#endif // HAS_LCD_MENU && MMU2_MENUS #endif // HAS_PRUSA_MMU2
#endif // PRUSA_MMU2

View file

@ -49,13 +49,11 @@ public:
static uint8_t get_current_tool(); static uint8_t get_current_tool();
static void set_filament_type(const uint8_t index, const uint8_t type); static void set_filament_type(const uint8_t index, const uint8_t type);
#if BOTH(HAS_LCD_MENU, MMU2_MENUS)
static bool unload(); static bool unload();
static void load_filament(uint8_t); static void load_filament(uint8_t);
static void load_all(); static void load_all();
static bool load_filament_to_nozzle(const uint8_t index); static bool load_filament_to_nozzle(const uint8_t index);
static bool eject_filament(const uint8_t index, const bool recover); static bool eject_filament(const uint8_t index, const bool recover);
#endif
private: private:
static bool rx_str_P(const char* str); static bool rx_str_P(const char* str);
@ -72,15 +70,13 @@ private:
static bool get_response(); static bool get_response();
static void manage_response(const bool move_axes, const bool turn_off_nozzle); static void manage_response(const bool move_axes, const bool turn_off_nozzle);
#if BOTH(HAS_LCD_MENU, MMU2_MENUS)
static void load_to_nozzle(); static void load_to_nozzle();
static void filament_ramming(); static void filament_ramming();
static void execute_extruder_sequence(const E_Step * sequence, int steps); static void execute_extruder_sequence(const E_Step * sequence, int steps);
#endif
static void filament_runout(); static void filament_runout();
#if ENABLED(PRUSA_MMU2_S_MODE) #if HAS_PRUSA_MMU2S
static bool mmu2s_triggered; static bool mmu2s_triggered;
static void check_filament(); static void check_filament();
static bool can_load(); static bool can_load();

View file

@ -31,13 +31,13 @@
* *
* Report the current speed percentage factor if no parameter is specified * Report the current speed percentage factor if no parameter is specified
* *
* With PRUSA_MMU2... * For MMU2 and MMU2S devices...
* B : Flag to back up the current factor * B : Flag to back up the current factor
* R : Flag to restore the last-saved factor * R : Flag to restore the last-saved factor
*/ */
void GcodeSuite::M220() { void GcodeSuite::M220() {
#if ENABLED(PRUSA_MMU2) #if HAS_PRUSA_MMU2
static int16_t backup_feedrate_percentage = 100; static int16_t backup_feedrate_percentage = 100;
if (parser.seen('B')) backup_feedrate_percentage = feedrate_percentage; if (parser.seen('B')) backup_feedrate_percentage = feedrate_percentage;
if (parser.seen('R')) feedrate_percentage = backup_feedrate_percentage; if (parser.seen('R')) feedrate_percentage = backup_feedrate_percentage;

View file

@ -27,8 +27,8 @@
#include "../../module/motion.h" #include "../../module/motion.h"
#endif #endif
#if ENABLED(PRUSA_MMU2) #if HAS_PRUSA_MMU2
#include "../../feature/mmu2/mmu2.h" #include "../../feature/mmu/mmu2.h"
#endif #endif
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE) #define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
@ -40,7 +40,7 @@
* F[units/min] Set the movement feedrate * F[units/min] Set the movement feedrate
* S1 Don't move the tool in XY after change * S1 Don't move the tool in XY after change
* *
* For PRUSA_MMU2: * For PRUSA_MMU2(S) and SMUFF_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[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. * 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. * Tx Same as T?, but nozzle doesn't have to be preheated. Tc requires a preheated nozzle to finish filament load.
@ -54,7 +54,7 @@ void GcodeSuite::T(const int8_t tool_index) {
// Count this command as movement / activity // Count this command as movement / activity
reset_stepper_timeout(); reset_stepper_timeout();
#if ENABLED(PRUSA_MMU2) #if HAS_PRUSA_MMU2
if (parser.string_arg) { if (parser.string_arg) {
mmu2.tool_change(parser.string_arg); // Special commands T?/Tx/Tc mmu2.tool_change(parser.string_arg); // Special commands T?/Tx/Tc
return; return;

View file

@ -38,8 +38,8 @@
#include "../../../lcd/marlinui.h" #include "../../../lcd/marlinui.h"
#endif #endif
#if ENABLED(PRUSA_MMU2) #if HAS_PRUSA_MMU2
#include "../../../feature/mmu2/mmu2.h" #include "../../../feature/mmu/mmu2.h"
#endif #endif
#if ENABLED(MIXING_EXTRUDER) #if ENABLED(MIXING_EXTRUDER)
@ -86,7 +86,7 @@ void GcodeSuite::M701() {
// Show initial "wait for load" message // Show initial "wait for load" message
TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_LOAD, PAUSE_MODE_LOAD_FILAMENT, target_extruder)); TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_LOAD, PAUSE_MODE_LOAD_FILAMENT, target_extruder));
#if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2) #if HAS_MULTI_EXTRUDER && (HAS_PRUSA_MMU1 || !HAS_MMU)
// Change toolhead if specified // Change toolhead if specified
uint8_t active_extruder_before_filament_change = active_extruder; uint8_t active_extruder_before_filament_change = active_extruder;
if (active_extruder != target_extruder) if (active_extruder != target_extruder)
@ -98,7 +98,7 @@ void GcodeSuite::M701() {
do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
// Load filament // Load filament
#if ENABLED(PRUSA_MMU2) #if HAS_PRUSA_MMU2
mmu2.load_filament_to_nozzle(target_extruder); mmu2.load_filament_to_nozzle(target_extruder);
#else #else
constexpr float purge_length = ADVANCED_PAUSE_PURGE_LENGTH, constexpr float purge_length = ADVANCED_PAUSE_PURGE_LENGTH,
@ -121,7 +121,7 @@ void GcodeSuite::M701() {
if (park_point.z > 0) if (park_point.z > 0)
do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
#if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2) #if HAS_MULTI_EXTRUDER && (HAS_PRUSA_MMU1 || !HAS_MMU)
// Restore toolhead if it was changed // Restore toolhead if it was changed
if (active_extruder_before_filament_change != active_extruder) if (active_extruder_before_filament_change != active_extruder)
tool_change(active_extruder_before_filament_change, false); tool_change(active_extruder_before_filament_change, false);
@ -186,7 +186,7 @@ void GcodeSuite::M702() {
// Show initial "wait for unload" message // Show initial "wait for unload" message
TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_UNLOAD, PAUSE_MODE_UNLOAD_FILAMENT, target_extruder)); TERN_(HAS_LCD_MENU, lcd_pause_show_message(PAUSE_MESSAGE_UNLOAD, PAUSE_MODE_UNLOAD_FILAMENT, target_extruder));
#if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2) #if HAS_MULTI_EXTRUDER && (HAS_PRUSA_MMU1 || !HAS_MMU)
// Change toolhead if specified // Change toolhead if specified
uint8_t active_extruder_before_filament_change = active_extruder; uint8_t active_extruder_before_filament_change = active_extruder;
if (active_extruder != target_extruder) if (active_extruder != target_extruder)
@ -198,7 +198,7 @@ void GcodeSuite::M702() {
do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); do_blocking_move_to_z(_MIN(current_position.z + park_point.z, Z_MAX_POS), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
// Unload filament // Unload filament
#if ENABLED(PRUSA_MMU2) #if HAS_PRUSA_MMU2
mmu2.unload(); mmu2.unload();
#else #else
#if BOTH(HAS_MULTI_EXTRUDER, FILAMENT_UNLOAD_ALL_EXTRUDERS) #if BOTH(HAS_MULTI_EXTRUDER, FILAMENT_UNLOAD_ALL_EXTRUDERS)
@ -227,7 +227,7 @@ void GcodeSuite::M702() {
if (park_point.z > 0) if (park_point.z > 0)
do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE)); do_blocking_move_to_z(_MAX(current_position.z - park_point.z, 0), feedRate_t(NOZZLE_PARK_Z_FEEDRATE));
#if HAS_MULTI_EXTRUDER && DISABLED(PRUSA_MMU2) #if HAS_MULTI_EXTRUDER && (HAS_PRUSA_MMU1 || !HAS_MMU)
// Restore toolhead if it was changed // Restore toolhead if it was changed
if (active_extruder_before_filament_change != active_extruder) if (active_extruder_before_filament_change != active_extruder)
tool_change(active_extruder_before_filament_change, false); tool_change(active_extruder_before_filament_change, false);

View file

@ -22,10 +22,10 @@
#include "../../../inc/MarlinConfigPre.h" #include "../../../inc/MarlinConfigPre.h"
#if ENABLED(PRUSA_MMU2) #if HAS_PRUSA_MMU2
#include "../../gcode.h" #include "../../gcode.h"
#include "../../../feature/mmu2/mmu2.h" #include "../../../feature/mmu/mmu2.h"
/** /**
* M403: Set filament type for MMU2 * M403: Set filament type for MMU2
@ -46,4 +46,4 @@ void GcodeSuite::M403() {
SERIAL_ECHO_MSG("M403 - bad arguments."); SERIAL_ECHO_MSG("M403 - bad arguments.");
} }
#endif // PRUSA_MMU2 #endif // HAS_PRUSA_MMU2

View file

@ -702,7 +702,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 402: M402(); break; // M402: Stow probe case 402: M402(); break; // M402: Stow probe
#endif #endif
#if ENABLED(PRUSA_MMU2) #if HAS_PRUSA_MMU2
case 403: M403(); break; case 403: M403(); break;
#endif #endif

View file

@ -181,7 +181,7 @@
* M217 - Set filament swap parameters: "M217 S<length> P<feedrate> R<feedrate>". (Requires SINGLENOZZLE) * M217 - Set filament swap parameters: "M217 S<length> P<feedrate> R<feedrate>". (Requires SINGLENOZZLE)
* M218 - Set/get a tool offset: "M218 T<index> X<offset> Y<offset>". (Requires 2 or more extruders) * M218 - Set/get a tool offset: "M218 T<index> X<offset> Y<offset>". (Requires 2 or more extruders)
* M220 - Set Feedrate Percentage: "M220 S<percent>" (i.e., "FR" on the LCD) * M220 - Set Feedrate Percentage: "M220 S<percent>" (i.e., "FR" on the LCD)
* Use "M220 B" to back up the Feedrate Percentage and "M220 R" to restore it. (Requires PRUSA_MMU2) * Use "M220 B" to back up the Feedrate Percentage and "M220 R" to restore it. (Requires an MMU_MODEL version 2 or 2S)
* M221 - Set Flow Percentage: "M221 S<percent>" * M221 - Set Flow Percentage: "M221 S<percent>"
* M226 - Wait until a pin is in a given state: "M226 P<pin> S<state>" (Requires DIRECT_PIN_CONTROL) * M226 - Wait until a pin is in a given state: "M226 P<pin> S<state>" (Requires DIRECT_PIN_CONTROL)
* M240 - Trigger a camera to take a photograph. (Requires PHOTO_GCODE) * M240 - Trigger a camera to take a photograph. (Requires PHOTO_GCODE)
@ -735,7 +735,7 @@ private:
static void M402(); static void M402();
#endif #endif
TERN_(PRUSA_MMU2, static void M403()); TERN_(HAS_PRUSA_MMU2, static void M403());
#if ENABLED(FILAMENT_WIDTH_SENSOR) #if ENABLED(FILAMENT_WIDTH_SENSOR)
static void M404(); static void M404();

View file

@ -155,7 +155,7 @@ void GCodeParser::parse(char *p) {
// Skip spaces to get the numeric part // Skip spaces to get the numeric part
while (*p == ' ') p++; while (*p == ' ') p++;
#if ENABLED(PRUSA_MMU2) #if HAS_PRUSA_MMU2
if (letter == 'T') { if (letter == 'T') {
// check for special MMU2 T?/Tx/Tc commands // check for special MMU2 T?/Tx/Tc commands
if (*p == '?' || *p == 'x' || *p == 'c') { if (*p == '?' || *p == 'x' || *p == 'c') {

View file

@ -495,6 +495,36 @@
#endif #endif
#endif #endif
/**
* 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
#ifdef MMU_MODEL
#define HAS_MMU 1
#if MMU_MODEL == PRUSA_MMU1
#define HAS_PRUSA_MMU1 1
#elif MMU_MODEL % 10 == PRUSA_MMU2
#define HAS_PRUSA_MMU2 1
#elif MMU_MODEL % 10 == PRUSA_MMU2S
#define HAS_PRUSA_MMU2 1
#define HAS_PRUSA_MMU2S 1
#endif
#if MMU_MODEL >= SMUFF_EMU_MMU2
#define HAS_SMUFF 1
#endif
#endif
#undef PRUSA_MMU1
#undef PRUSA_MMU2
#undef PRUSA_MMU2S
#undef SMUFF_EMU_MMU2
#undef SMUFF_EMU_MMU2S
/** /**
* Extruders have some combination of stepper motors and hotends * Extruders have some combination of stepper motors and hotends
* so we separate these concepts into the defines: * so we separate these concepts into the defines:
@ -512,8 +542,6 @@
#undef SWITCHING_EXTRUDER #undef SWITCHING_EXTRUDER
#undef SWITCHING_NOZZLE #undef SWITCHING_NOZZLE
#undef MIXING_EXTRUDER #undef MIXING_EXTRUDER
#undef MK2_MULTIPLEXER
#undef PRUSA_MMU2
#undef HOTEND_IDLE_TIMEOUT #undef HOTEND_IDLE_TIMEOUT
#elif EXTRUDERS > 1 #elif EXTRUDERS > 1
#define HAS_MULTI_EXTRUDER 1 #define HAS_MULTI_EXTRUDER 1
@ -539,17 +567,17 @@
#elif ENABLED(SWITCHING_TOOLHEAD) #elif ENABLED(SWITCHING_TOOLHEAD)
#define E_STEPPERS EXTRUDERS #define E_STEPPERS EXTRUDERS
#define E_MANUAL EXTRUDERS #define E_MANUAL EXTRUDERS
#elif ENABLED(PRUSA_MMU2) #elif HAS_PRUSA_MMU2
#define E_STEPPERS 1 #define E_STEPPERS 1
#endif #endif
// No inactive extruders with MK2_MULTIPLEXER or SWITCHING_NOZZLE // No inactive extruders with SWITCHING_NOZZLE or Průša MMU1
#if EITHER(MK2_MULTIPLEXER, SWITCHING_NOZZLE) #if ENABLED(SWITCHING_NOZZLE) || HAS_PRUSA_MMU1
#undef DISABLE_INACTIVE_EXTRUDER #undef DISABLE_INACTIVE_EXTRUDER
#endif #endif
// Průša MK2 Multiplexer and MMU 2.0 force SINGLENOZZLE // Průša MMU1, MMU 2.0, MMUS 2.0 and SMUFF force SINGLENOZZLE
#if EITHER(MK2_MULTIPLEXER, PRUSA_MMU2) #if HAS_MMU
#define SINGLENOZZLE #define SINGLENOZZLE
#endif #endif

View file

@ -804,7 +804,11 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#if !PIN_EXISTS(FIL_RUNOUT) #if !PIN_EXISTS(FIL_RUNOUT)
#error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN." #error "FILAMENT_RUNOUT_SENSOR requires FIL_RUNOUT_PIN."
#elif NUM_RUNOUT_SENSORS > E_STEPPERS #elif NUM_RUNOUT_SENSORS > E_STEPPERS
#if HAS_PRUSA_MMU2
#error "NUM_RUNOUT_SENSORS must be 1 with MMU2 / MMU2S."
#else
#error "NUM_RUNOUT_SENSORS cannot exceed the number of E steppers." #error "NUM_RUNOUT_SENSORS cannot exceed the number of E steppers."
#endif
#elif NUM_RUNOUT_SENSORS >= 2 && !PIN_EXISTS(FIL_RUNOUT2) #elif NUM_RUNOUT_SENSORS >= 2 && !PIN_EXISTS(FIL_RUNOUT2)
#error "FIL_RUNOUT2_PIN is required with NUM_RUNOUT_SENSORS >= 2." #error "FIL_RUNOUT2_PIN is required with NUM_RUNOUT_SENSORS >= 2."
#elif NUM_RUNOUT_SENSORS >= 3 && !PIN_EXISTS(FIL_RUNOUT3) #elif NUM_RUNOUT_SENSORS >= 3 && !PIN_EXISTS(FIL_RUNOUT3)
@ -867,6 +871,42 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics." #error "INDIVIDUAL_AXIS_HOMING_MENU is incompatible with DELTA kinematics."
#endif #endif
/**
* Sanity checking for all Průša MMU
*/
#ifdef SNMM
#error "SNMM is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
#elif ENABLED(MK2_MULTIPLEXER)
#error "MK2_MULTIPLEXER is obsolete. Define MMU_MODEL as PRUSA_MMU1 instead."
#elif ENABLED(PRUSA_MMU2)
#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."
#endif
/**
* Multi-Material-Unit 2 / SMUFF requirements
*/
#if HAS_PRUSA_MMU2
#if EXTRUDERS != 5
#undef SINGLENOZZLE
#error "PRUSA_MMU2(S) requires exactly 5 EXTRUDERS. Please update your Configuration."
#elif DISABLED(NOZZLE_PARK_FEATURE)
#error "PRUSA_MMU2(S) requires NOZZLE_PARK_FEATURE. Enable it to continue."
#elif HAS_PRUSA_MMU2S && DISABLED(FILAMENT_RUNOUT_SENSOR)
#error "PRUSA_MMU2S requires FILAMENT_RUNOUT_SENSOR. Enable it to continue."
#elif ENABLED(MMU_EXTRUDER_SENSOR) && DISABLED(FILAMENT_RUNOUT_SENSOR)
#error "MMU_EXTRUDER_SENSOR requires FILAMENT_RUNOUT_SENSOR. Enable it to continue."
#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).");
#endif
#endif
#if HAS_SMUFF && EXTRUDERS > 12
#error "Too many extruders for SMUFF_EMU_MMU2(S). (12 maximum)."
#endif
/** /**
* Options only for EXTRUDERS > 1 * Options only for EXTRUDERS > 1
*/ */
@ -902,17 +942,14 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
#error "TOOLCHANGE_ZRAISE required for EXTRUDERS > 1." #error "TOOLCHANGE_ZRAISE required for EXTRUDERS > 1."
#endif #endif
#elif ENABLED(MK2_MULTIPLEXER) #elif HAS_PRUSA_MMU1 || HAS_SMUFF
#error "MK2_MULTIPLEXER requires 2 or more EXTRUDERS."
#elif ENABLED(SINGLENOZZLE) #error "Multi-Material-Unit requires 2 or more EXTRUDERS."
#error "SINGLENOZZLE requires 2 or more EXTRUDERS."
#endif #elif ENABLED(SINGLENOZZLE)
#error "SINGLENOZZLE requires 2 or more EXTRUDERS."
/**
* Sanity checking for the Průša MK2 Multiplexer
*/
#ifdef SNMM
#error "SNMM is now MK2_MULTIPLEXER."
#endif #endif
/** /**
@ -1870,8 +1907,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
/** /**
* Test Extruder Stepper Pins * Test Extruder Stepper Pins
*/ */
#if DISABLED(MK2_MULTIPLEXER) // MK2_MULTIPLEXER uses E0 stepper only #if E_STEPPERS
#if E_STEPPERS
#if !(PINS_EXIST(E0_STEP, E0_DIR) && HAS_E0_ENABLE) #if !(PINS_EXIST(E0_STEP, E0_DIR) && HAS_E0_ENABLE)
#error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board." #error "E0_STEP_PIN, E0_DIR_PIN, or E0_ENABLE_PIN not defined for this board."
#endif #endif
@ -1910,8 +1946,7 @@ static_assert(hbm[Z_AXIS] >= 0, "HOMING_BUMP_MM.Z must be greater than or equal
#endif // E_STEPPERS > 3 #endif // E_STEPPERS > 3
#endif // E_STEPPERS > 2 #endif // E_STEPPERS > 2
#endif // E_STEPPERS > 1 #endif // E_STEPPERS > 1
#endif // E_STEPPERS #endif // E_STEPPERS
#endif
/** /**
* Endstop Tests * Endstop Tests
@ -2977,23 +3012,6 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
#endif #endif
#endif #endif
/**
* Průša MMU2 requirements
*/
#if ENABLED(PRUSA_MMU2)
#if EXTRUDERS != 5
#error "PRUSA_MMU2 requires EXTRUDERS = 5."
#elif DISABLED(NOZZLE_PARK_FEATURE)
#error "PRUSA_MMU2 requires NOZZLE_PARK_FEATURE. Enable it to continue."
#elif EITHER(PRUSA_MMU2_S_MODE, MMU_EXTRUDER_SENSOR) && DISABLED(FILAMENT_RUNOUT_SENSOR)
#error "PRUSA_MMU2_S_MODE or MMU_EXTRUDER_SENSOR requires FILAMENT_RUNOUT_SENSOR. Enable it to continue."
#elif BOTH(PRUSA_MMU2_S_MODE, MMU_EXTRUDER_SENSOR)
#error "Enable only one of PRUSA_MMU2_S_MODE or MMU_EXTRUDER_SENSOR."
#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.");
#endif
#endif
/** /**
* Advanced PRINTCOUNTER settings * Advanced PRINTCOUNTER settings
*/ */

View file

@ -46,7 +46,7 @@
#define MACHINE_CAN_PAUSE 1 #define MACHINE_CAN_PAUSE 1
#endif #endif
#if ENABLED(PRUSA_MMU2) #if ENABLED(MMU2_MENUS)
#include "../../lcd/menu/menu_mmu2.h" #include "../../lcd/menu/menu_mmu2.h"
#endif #endif

View file

@ -24,13 +24,10 @@
#if BOTH(HAS_LCD_MENU, MMU2_MENUS) #if BOTH(HAS_LCD_MENU, MMU2_MENUS)
#include "../../feature/mmu2/mmu2.h" #include "../../feature/mmu/mmu2.h"
#include "menu_mmu2.h" #include "menu_mmu2.h"
#include "menu_item.h" #include "menu_item.h"
uint8_t currentTool;
bool mmuMenuWait;
// //
// Load Filament // Load Filament
// //
@ -123,9 +120,12 @@ void menu_mmu2() {
// T* Choose Filament // T* Choose Filament
// //
inline void action_mmu2_choose(const uint8_t tool) { uint8_t feeder_index;
currentTool = tool; bool wait_for_mmu_menu;
mmuMenuWait = false;
inline void action_mmu2_chosen(const uint8_t index) {
feeder_index = index;
wait_for_mmu_menu = false;
} }
void menu_mmu2_choose_filament() { void menu_mmu2_choose_filament() {
@ -133,7 +133,7 @@ void menu_mmu2_choose_filament() {
#if LCD_HEIGHT > 2 #if LCD_HEIGHT > 2
STATIC_ITEM(MSG_MMU2_CHOOSE_FILAMENT_HEADER, SS_DEFAULT|SS_INVERT); STATIC_ITEM(MSG_MMU2_CHOOSE_FILAMENT_HEADER, SS_DEFAULT|SS_INVERT);
#endif #endif
LOOP_L_N(i, 5) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ action_mmu2_choose(MenuItemBase::itemIndex); }); LOOP_L_N(i, 5) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ action_mmu2_chosen(MenuItemBase::itemIndex); });
END_MENU(); END_MENU();
} }
@ -142,32 +142,32 @@ void menu_mmu2_choose_filament() {
// //
void menu_mmu2_pause() { void menu_mmu2_pause() {
currentTool = mmu2.get_current_tool(); feeder_index = mmu2.get_current_tool();
START_MENU(); START_MENU();
#if LCD_HEIGHT > 2 #if LCD_HEIGHT > 2
STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, SS_DEFAULT|SS_INVERT); STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, SS_DEFAULT|SS_INVERT);
#endif #endif
ACTION_ITEM(MSG_MMU2_RESUME, []{ mmuMenuWait = false; }); ACTION_ITEM(MSG_MMU2_RESUME, []{ wait_for_mmu_menu = false; });
ACTION_ITEM(MSG_MMU2_UNLOAD_FILAMENT, []{ mmu2.unload(); }); ACTION_ITEM(MSG_MMU2_UNLOAD_FILAMENT, []{ mmu2.unload(); });
ACTION_ITEM(MSG_MMU2_LOAD_FILAMENT, []{ mmu2.load_filament(currentTool); }); ACTION_ITEM(MSG_MMU2_LOAD_FILAMENT, []{ mmu2.load_filament(feeder_index); });
ACTION_ITEM(MSG_MMU2_LOAD_TO_NOZZLE, []{ mmu2.load_filament_to_nozzle(currentTool); }); ACTION_ITEM(MSG_MMU2_LOAD_TO_NOZZLE, []{ mmu2.load_filament_to_nozzle(feeder_index); });
END_MENU(); END_MENU();
} }
void mmu2_M600() { void mmu2_M600() {
ui.defer_status_screen(); ui.defer_status_screen();
ui.goto_screen(menu_mmu2_pause); ui.goto_screen(menu_mmu2_pause);
mmuMenuWait = true; wait_for_mmu_menu = true;
while (mmuMenuWait) idle(); while (wait_for_mmu_menu) idle();
} }
uint8_t mmu2_choose_filament() { uint8_t mmu2_choose_filament() {
ui.defer_status_screen(); ui.defer_status_screen();
ui.goto_screen(menu_mmu2_choose_filament); ui.goto_screen(menu_mmu2_choose_filament);
mmuMenuWait = true; wait_for_mmu_menu = true;
while (mmuMenuWait) idle(); while (wait_for_mmu_menu) idle();
ui.return_to_status(); ui.return_to_status();
return currentTool; return feeder_index;
} }
#endif // HAS_LCD_MENU && MMU2_MENUS #endif // HAS_LCD_MENU && MMU2_MENUS

View file

@ -1068,46 +1068,30 @@ void MarlinSettings::postprocess() {
#if AXIS_IS_TMC(Z4) #if AXIS_IS_TMC(Z4)
tmc_stepper_current.Z4 = stepperZ4.getMilliamps(); tmc_stepper_current.Z4 = stepperZ4.getMilliamps();
#endif #endif
#if MAX_EXTRUDERS
#if AXIS_IS_TMC(E0) #if AXIS_IS_TMC(E0)
tmc_stepper_current.E0 = stepperE0.getMilliamps(); tmc_stepper_current.E0 = stepperE0.getMilliamps();
#endif #endif
#if MAX_EXTRUDERS > 1
#if AXIS_IS_TMC(E1) #if AXIS_IS_TMC(E1)
tmc_stepper_current.E1 = stepperE1.getMilliamps(); tmc_stepper_current.E1 = stepperE1.getMilliamps();
#endif #endif
#if MAX_EXTRUDERS > 2
#if AXIS_IS_TMC(E2) #if AXIS_IS_TMC(E2)
tmc_stepper_current.E2 = stepperE2.getMilliamps(); tmc_stepper_current.E2 = stepperE2.getMilliamps();
#endif #endif
#if MAX_EXTRUDERS > 3
#if AXIS_IS_TMC(E3) #if AXIS_IS_TMC(E3)
tmc_stepper_current.E3 = stepperE3.getMilliamps(); tmc_stepper_current.E3 = stepperE3.getMilliamps();
#endif #endif
#if MAX_EXTRUDERS > 4
#if AXIS_IS_TMC(E4) #if AXIS_IS_TMC(E4)
tmc_stepper_current.E4 = stepperE4.getMilliamps(); tmc_stepper_current.E4 = stepperE4.getMilliamps();
#endif #endif
#if MAX_EXTRUDERS > 5
#if AXIS_IS_TMC(E5) #if AXIS_IS_TMC(E5)
tmc_stepper_current.E5 = stepperE5.getMilliamps(); tmc_stepper_current.E5 = stepperE5.getMilliamps();
#endif #endif
#if MAX_EXTRUDERS > 6
#if AXIS_IS_TMC(E6) #if AXIS_IS_TMC(E6)
tmc_stepper_current.E6 = stepperE6.getMilliamps(); tmc_stepper_current.E6 = stepperE6.getMilliamps();
#endif #endif
#if MAX_EXTRUDERS > 7
#if AXIS_IS_TMC(E7) #if AXIS_IS_TMC(E7)
tmc_stepper_current.E7 = stepperE7.getMilliamps(); tmc_stepper_current.E7 = stepperE7.getMilliamps();
#endif #endif
#endif // MAX_EXTRUDERS > 7
#endif // MAX_EXTRUDERS > 6
#endif // MAX_EXTRUDERS > 5
#endif // MAX_EXTRUDERS > 4
#endif // MAX_EXTRUDERS > 3
#endif // MAX_EXTRUDERS > 2
#endif // MAX_EXTRUDERS > 1
#endif // MAX_EXTRUDERS
#endif #endif
EEPROM_WRITE(tmc_stepper_current); EEPROM_WRITE(tmc_stepper_current);
} }
@ -1144,46 +1128,30 @@ void MarlinSettings::postprocess() {
#if AXIS_HAS_STEALTHCHOP(Z4) #if AXIS_HAS_STEALTHCHOP(Z4)
tmc_hybrid_threshold.Z4 = stepperZ4.get_pwm_thrs(); tmc_hybrid_threshold.Z4 = stepperZ4.get_pwm_thrs();
#endif #endif
#if MAX_EXTRUDERS
#if AXIS_HAS_STEALTHCHOP(E0) #if AXIS_HAS_STEALTHCHOP(E0)
tmc_hybrid_threshold.E0 = stepperE0.get_pwm_thrs(); tmc_hybrid_threshold.E0 = stepperE0.get_pwm_thrs();
#endif #endif
#if MAX_EXTRUDERS > 1
#if AXIS_HAS_STEALTHCHOP(E1) #if AXIS_HAS_STEALTHCHOP(E1)
tmc_hybrid_threshold.E1 = stepperE1.get_pwm_thrs(); tmc_hybrid_threshold.E1 = stepperE1.get_pwm_thrs();
#endif #endif
#if MAX_EXTRUDERS > 2
#if AXIS_HAS_STEALTHCHOP(E2) #if AXIS_HAS_STEALTHCHOP(E2)
tmc_hybrid_threshold.E2 = stepperE2.get_pwm_thrs(); tmc_hybrid_threshold.E2 = stepperE2.get_pwm_thrs();
#endif #endif
#if MAX_EXTRUDERS > 3
#if AXIS_HAS_STEALTHCHOP(E3) #if AXIS_HAS_STEALTHCHOP(E3)
tmc_hybrid_threshold.E3 = stepperE3.get_pwm_thrs(); tmc_hybrid_threshold.E3 = stepperE3.get_pwm_thrs();
#endif #endif
#if MAX_EXTRUDERS > 4
#if AXIS_HAS_STEALTHCHOP(E4) #if AXIS_HAS_STEALTHCHOP(E4)
tmc_hybrid_threshold.E4 = stepperE4.get_pwm_thrs(); tmc_hybrid_threshold.E4 = stepperE4.get_pwm_thrs();
#endif #endif
#if MAX_EXTRUDERS > 5
#if AXIS_HAS_STEALTHCHOP(E5) #if AXIS_HAS_STEALTHCHOP(E5)
tmc_hybrid_threshold.E5 = stepperE5.get_pwm_thrs(); tmc_hybrid_threshold.E5 = stepperE5.get_pwm_thrs();
#endif #endif
#if MAX_EXTRUDERS > 6
#if AXIS_HAS_STEALTHCHOP(E6) #if AXIS_HAS_STEALTHCHOP(E6)
tmc_hybrid_threshold.E6 = stepperE6.get_pwm_thrs(); tmc_hybrid_threshold.E6 = stepperE6.get_pwm_thrs();
#endif #endif
#if MAX_EXTRUDERS > 7
#if AXIS_HAS_STEALTHCHOP(E7) #if AXIS_HAS_STEALTHCHOP(E7)
tmc_hybrid_threshold.E7 = stepperE7.get_pwm_thrs(); tmc_hybrid_threshold.E7 = stepperE7.get_pwm_thrs();
#endif #endif
#endif // MAX_EXTRUDERS > 7
#endif // MAX_EXTRUDERS > 6
#endif // MAX_EXTRUDERS > 5
#endif // MAX_EXTRUDERS > 4
#endif // MAX_EXTRUDERS > 3
#endif // MAX_EXTRUDERS > 2
#endif // MAX_EXTRUDERS > 1
#endif // MAX_EXTRUDERS
#else #else
const tmc_hybrid_threshold_t tmc_hybrid_threshold = { const tmc_hybrid_threshold_t tmc_hybrid_threshold = {
.X = 100, .Y = 100, .Z = 3, .X = 100, .Y = 100, .Z = 3,
@ -1219,9 +1187,7 @@ void MarlinSettings::postprocess() {
{ {
_FIELD_TEST(tmc_stealth_enabled); _FIELD_TEST(tmc_stealth_enabled);
tmc_stealth_enabled_t tmc_stealth_enabled = { false, false, false, false, false, false, false, false, false, false, false, false, false }; tmc_stealth_enabled_t tmc_stealth_enabled = { false };
#if HAS_STEALTHCHOP
#if AXIS_HAS_STEALTHCHOP(X) #if AXIS_HAS_STEALTHCHOP(X)
tmc_stealth_enabled.X = stepperX.get_stored_stealthChop(); tmc_stealth_enabled.X = stepperX.get_stored_stealthChop();
#endif #endif
@ -1246,47 +1212,30 @@ void MarlinSettings::postprocess() {
#if AXIS_HAS_STEALTHCHOP(Z4) #if AXIS_HAS_STEALTHCHOP(Z4)
tmc_stealth_enabled.Z4 = stepperZ4.get_stored_stealthChop(); tmc_stealth_enabled.Z4 = stepperZ4.get_stored_stealthChop();
#endif #endif
#if MAX_EXTRUDERS
#if AXIS_HAS_STEALTHCHOP(E0) #if AXIS_HAS_STEALTHCHOP(E0)
tmc_stealth_enabled.E0 = stepperE0.get_stored_stealthChop(); tmc_stealth_enabled.E0 = stepperE0.get_stored_stealthChop();
#endif #endif
#if MAX_EXTRUDERS > 1
#if AXIS_HAS_STEALTHCHOP(E1) #if AXIS_HAS_STEALTHCHOP(E1)
tmc_stealth_enabled.E1 = stepperE1.get_stored_stealthChop(); tmc_stealth_enabled.E1 = stepperE1.get_stored_stealthChop();
#endif #endif
#if MAX_EXTRUDERS > 2
#if AXIS_HAS_STEALTHCHOP(E2) #if AXIS_HAS_STEALTHCHOP(E2)
tmc_stealth_enabled.E2 = stepperE2.get_stored_stealthChop(); tmc_stealth_enabled.E2 = stepperE2.get_stored_stealthChop();
#endif #endif
#if MAX_EXTRUDERS > 3
#if AXIS_HAS_STEALTHCHOP(E3) #if AXIS_HAS_STEALTHCHOP(E3)
tmc_stealth_enabled.E3 = stepperE3.get_stored_stealthChop(); tmc_stealth_enabled.E3 = stepperE3.get_stored_stealthChop();
#endif #endif
#if MAX_EXTRUDERS > 4
#if AXIS_HAS_STEALTHCHOP(E4) #if AXIS_HAS_STEALTHCHOP(E4)
tmc_stealth_enabled.E4 = stepperE4.get_stored_stealthChop(); tmc_stealth_enabled.E4 = stepperE4.get_stored_stealthChop();
#endif #endif
#if MAX_EXTRUDERS > 5
#if AXIS_HAS_STEALTHCHOP(E5) #if AXIS_HAS_STEALTHCHOP(E5)
tmc_stealth_enabled.E5 = stepperE5.get_stored_stealthChop(); tmc_stealth_enabled.E5 = stepperE5.get_stored_stealthChop();
#endif #endif
#if MAX_EXTRUDERS > 6
#if AXIS_HAS_STEALTHCHOP(E6) #if AXIS_HAS_STEALTHCHOP(E6)
tmc_stealth_enabled.E6 = stepperE6.get_stored_stealthChop(); tmc_stealth_enabled.E6 = stepperE6.get_stored_stealthChop();
#endif #endif
#if MAX_EXTRUDERS > 7
#if AXIS_HAS_STEALTHCHOP(E7) #if AXIS_HAS_STEALTHCHOP(E7)
tmc_stealth_enabled.E7 = stepperE7.get_stored_stealthChop(); tmc_stealth_enabled.E7 = stepperE7.get_stored_stealthChop();
#endif #endif
#endif // MAX_EXTRUDERS > 7
#endif // MAX_EXTRUDERS > 6
#endif // MAX_EXTRUDERS > 5
#endif // MAX_EXTRUDERS > 4
#endif // MAX_EXTRUDERS > 3
#endif // MAX_EXTRUDERS > 2
#endif // MAX_EXTRUDERS > 1
#endif // MAX_EXTRUDERS
#endif
EEPROM_WRITE(tmc_stealth_enabled); EEPROM_WRITE(tmc_stealth_enabled);
} }

View file

@ -417,12 +417,15 @@ void reset_stepper_drivers(); // Called by settings.load / settings.reset
#define NORM_E_DIR(E) do{ E0_DIR_WRITE(E ? INVERT_E0_DIR : !INVERT_E0_DIR); }while(0) #define NORM_E_DIR(E) do{ E0_DIR_WRITE(E ? INVERT_E0_DIR : !INVERT_E0_DIR); }while(0)
#define REV_E_DIR(E) do{ E0_DIR_WRITE(E ? !INVERT_E0_DIR : INVERT_E0_DIR); }while(0) #define REV_E_DIR(E) do{ E0_DIR_WRITE(E ? !INVERT_E0_DIR : INVERT_E0_DIR); }while(0)
#endif #endif
#elif ENABLED(PRUSA_MMU2)
#elif HAS_PRUSA_MMU2
#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)
#define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR) #define REV_E_DIR(E) E0_DIR_WRITE( INVERT_E0_DIR)
#elif ENABLED(MK2_MULTIPLEXER) // One multiplexed stepper driver, reversed on odd index #elif HAS_PRUSA_MMU1 // One multiplexed stepper driver, reversed on odd index
#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) do{ E0_DIR_WRITE(TEST(E, 0) ? !INVERT_E0_DIR: INVERT_E0_DIR); }while(0) #define NORM_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? !INVERT_E0_DIR: INVERT_E0_DIR); }while(0)
#define REV_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? INVERT_E0_DIR: !INVERT_E0_DIR); }while(0) #define REV_E_DIR(E) do{ E0_DIR_WRITE(TEST(E, 0) ? INVERT_E0_DIR: !INVERT_E0_DIR); }while(0)

View file

@ -73,10 +73,6 @@
#include "../feature/solenoid.h" #include "../feature/solenoid.h"
#endif #endif
#if ENABLED(MK2_MULTIPLEXER)
#include "../feature/snmm.h"
#endif
#if ENABLED(MIXING_EXTRUDER) #if ENABLED(MIXING_EXTRUDER)
#include "../feature/mixing.h" #include "../feature/mixing.h"
#endif #endif
@ -89,8 +85,10 @@
#include "../feature/fanmux.h" #include "../feature/fanmux.h"
#endif #endif
#if ENABLED(PRUSA_MMU2) #if HAS_PRUSA_MMU1
#include "../feature/mmu2/mmu2.h" #include "../feature/mmu/mmu.h"
#elif HAS_PRUSA_MMU2
#include "../feature/mmu/mmu2.h"
#endif #endif
#if HAS_LCD_MENU #if HAS_LCD_MENU
@ -863,7 +861,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
mixer.T(new_tool); mixer.T(new_tool);
#endif #endif
#elif ENABLED(PRUSA_MMU2) #elif HAS_PRUSA_MMU2
UNUSED(no_move); UNUSED(no_move);
@ -1171,8 +1169,6 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
do_blocking_move_to_z(destination.z, planner.settings.max_feedrate_mm_s[Z_AXIS]); do_blocking_move_to_z(destination.z, planner.settings.max_feedrate_mm_s[Z_AXIS]);
#endif #endif
TERN_(PRUSA_MMU2, mmu2.tool_change(new_tool));
TERN_(SWITCHING_NOZZLE_TWO_SERVOS, lower_nozzle(new_tool)); TERN_(SWITCHING_NOZZLE_TWO_SERVOS, lower_nozzle(new_tool));
} // (new_tool != old_tool) } // (new_tool != old_tool)
@ -1184,7 +1180,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
enable_solenoid_on_active_extruder(); enable_solenoid_on_active_extruder();
#endif #endif
#if ENABLED(MK2_MULTIPLEXER) #if HAS_PRUSA_MMU1
if (new_tool >= E_STEPPERS) return invalid_extruder_error(new_tool); if (new_tool >= E_STEPPERS) return invalid_extruder_error(new_tool);
select_multiplexed_stepper(new_tool); select_multiplexed_stepper(new_tool);
#endif #endif

View file

@ -131,9 +131,9 @@
#define PIN_P2_11 P2_11 // Interrupt Capable #define PIN_P2_11 P2_11 // Interrupt Capable
// //
// Průša i3 MK2 Multi Material Multiplexer Support // Průša i3 MMU1 (Multi Material Multiplexer) Support
// //
#if ENABLED(MK2_MULTIPLEXER) #if HAS_PRUSA_MMU1
#define E_MUX0_PIN P1_23 // J8-3 #define E_MUX0_PIN P1_23 // J8-3
#define E_MUX1_PIN P2_12 // J8-4 #define E_MUX1_PIN P2_12 // J8-4
#define E_MUX2_PIN P2_11 // J8-5 #define E_MUX2_PIN P2_11 // J8-5

View file

@ -35,7 +35,12 @@
* These numbers are the same in any pin mapping. * These numbers are the same in any pin mapping.
*/ */
#define MAX_EXTRUDERS 8 #if HAS_SMUFF
#define MAX_EXTRUDERS 12
#else
#define MAX_EXTRUDERS 8
#endif
#define MAX_E_STEPPERS 8
#if MB(RAMPS_13_EFB, RAMPS_14_EFB, RAMPS_PLUS_EFB, RAMPS_14_RE_ARM_EFB, RAMPS_SMART_EFB, RAMPS_DUO_EFB, RAMPS4DUE_EFB) #if MB(RAMPS_13_EFB, RAMPS_14_EFB, RAMPS_PLUS_EFB, RAMPS_14_RE_ARM_EFB, RAMPS_SMART_EFB, RAMPS_DUO_EFB, RAMPS4DUE_EFB)
#define IS_RAMPS_EFB #define IS_RAMPS_EFB

View file

@ -521,7 +521,7 @@
#define X2_STEP_PIN _EPIN(X2_E_INDEX, STEP) #define X2_STEP_PIN _EPIN(X2_E_INDEX, STEP)
#define X2_DIR_PIN _EPIN(X2_E_INDEX, DIR) #define X2_DIR_PIN _EPIN(X2_E_INDEX, DIR)
#define X2_ENABLE_PIN _EPIN(X2_E_INDEX, ENABLE) #define X2_ENABLE_PIN _EPIN(X2_E_INDEX, ENABLE)
#if X2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(X2_STEP) #if X2_E_INDEX >= MAX_E_STEPPERS || !PIN_EXISTS(X2_STEP)
#error "No E stepper plug left for X2!" #error "No E stepper plug left for X2!"
#endif #endif
#endif #endif
@ -594,7 +594,7 @@
#define Y2_STEP_PIN _EPIN(Y2_E_INDEX, STEP) #define Y2_STEP_PIN _EPIN(Y2_E_INDEX, STEP)
#define Y2_DIR_PIN _EPIN(Y2_E_INDEX, DIR) #define Y2_DIR_PIN _EPIN(Y2_E_INDEX, DIR)
#define Y2_ENABLE_PIN _EPIN(Y2_E_INDEX, ENABLE) #define Y2_ENABLE_PIN _EPIN(Y2_E_INDEX, ENABLE)
#if Y2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Y2_STEP) #if Y2_E_INDEX >= MAX_E_STEPPERS || !PIN_EXISTS(Y2_STEP)
#error "No E stepper plug left for Y2!" #error "No E stepper plug left for Y2!"
#endif #endif
#endif #endif
@ -662,7 +662,7 @@
#define Z2_STEP_PIN _EPIN(Z2_E_INDEX, STEP) #define Z2_STEP_PIN _EPIN(Z2_E_INDEX, STEP)
#define Z2_DIR_PIN _EPIN(Z2_E_INDEX, DIR) #define Z2_DIR_PIN _EPIN(Z2_E_INDEX, DIR)
#define Z2_ENABLE_PIN _EPIN(Z2_E_INDEX, ENABLE) #define Z2_ENABLE_PIN _EPIN(Z2_E_INDEX, ENABLE)
#if Z2_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z2_STEP) #if Z2_E_INDEX >= MAX_E_STEPPERS || !PIN_EXISTS(Z2_STEP)
#error "No E stepper plug left for Z2!" #error "No E stepper plug left for Z2!"
#endif #endif
#endif #endif
@ -729,7 +729,7 @@
#define Z3_STEP_PIN _EPIN(Z3_E_INDEX, STEP) #define Z3_STEP_PIN _EPIN(Z3_E_INDEX, STEP)
#define Z3_DIR_PIN _EPIN(Z3_E_INDEX, DIR) #define Z3_DIR_PIN _EPIN(Z3_E_INDEX, DIR)
#define Z3_ENABLE_PIN _EPIN(Z3_E_INDEX, ENABLE) #define Z3_ENABLE_PIN _EPIN(Z3_E_INDEX, ENABLE)
#if Z3_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z3_STEP) #if Z3_E_INDEX >= MAX_E_STEPPERS || !PIN_EXISTS(Z3_STEP)
#error "No E stepper plug left for Z3!" #error "No E stepper plug left for Z3!"
#endif #endif
#endif #endif
@ -796,7 +796,7 @@
#define Z4_STEP_PIN _EPIN(Z4_E_INDEX, STEP) #define Z4_STEP_PIN _EPIN(Z4_E_INDEX, STEP)
#define Z4_DIR_PIN _EPIN(Z4_E_INDEX, DIR) #define Z4_DIR_PIN _EPIN(Z4_E_INDEX, DIR)
#define Z4_ENABLE_PIN _EPIN(Z4_E_INDEX, ENABLE) #define Z4_ENABLE_PIN _EPIN(Z4_E_INDEX, ENABLE)
#if Z4_E_INDEX >= MAX_EXTRUDERS || !PIN_EXISTS(Z4_STEP) #if Z4_E_INDEX >= MAX_E_STEPPERS || !PIN_EXISTS(Z4_STEP)
#error "No E stepper plug left for Z4!" #error "No E stepper plug left for Z4!"
#endif #endif
#endif #endif

View file

@ -25,8 +25,8 @@
#error "Oops! Select an STM32F4 board in 'Tools > Board.'" #error "Oops! Select an STM32F4 board in 'Tools > Board.'"
#elif HOTENDS > 8 || E_STEPPERS > 8 #elif HOTENDS > 8 || E_STEPPERS > 8
#error "BIGTREE GTR V1.0 supports up to 8 hotends / E-steppers." #error "BIGTREE GTR V1.0 supports up to 8 hotends / E-steppers."
#elif HOTENDS > MAX_EXTRUDERS || E_STEPPERS > MAX_EXTRUDERS #elif HOTENDS > MAX_E_STEPPERS || E_STEPPERS > MAX_E_STEPPERS
#error "Marlin extruder/hotends limit! Increase MAX_EXTRUDERS to continue." #error "Marlin extruder/hotends limit! Increase MAX_E_STEPPERS to continue."
#endif #endif
#define BOARD_INFO_NAME "BTT GTR V1.0" #define BOARD_INFO_NAME "BTT GTR V1.0"

View file

@ -66,28 +66,38 @@ exec_test $1 $2 "Azteeg X3 Pro | EXTRUDERS 5 | RRDFGSC | UBL | LIN_ADVANCE | Sle
# #
restore_configs restore_configs
opt_set LCD_LANGUAGE zh_CN opt_set LCD_LANGUAGE zh_CN
opt_set MMU_MODEL PRUSA_MMU2S
opt_set EXTRUDERS 5 opt_set EXTRUDERS 5
opt_set NUM_SERVOS 1 opt_set NUM_SERVOS 1
opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE BOOT_MARLIN_LOGO_ANIMATED \ opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE BOOT_MARLIN_LOGO_ANIMATED \
AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL \ AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL \
NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \ NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \
PRUSA_MMU2 MMU2_MENUS PRUSA_MMU2_S_MODE DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \ MMU2_MENUS DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \
FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING
exec_test $1 $2 "RAMPS | ZONESTAR + Chinese | MMU2 | Servo | 3-Point + Debug | G38 ..." "$3" exec_test $1 $2 "RAMPS | ZONESTAR + Chinese | MMU2S | Servo | 3-Point + Debug | G38 ..." "$3"
# #
# 5 runout sensors with distinct states # 5 runout sensors with distinct states
# #
restore_configs restore_configs
opt_set MOTHERBOARD BOARD_AZTEEG_X3_PRO
opt_set EXTRUDERS 5 opt_set EXTRUDERS 5
opt_set NUM_SERVOS 1 opt_set NUM_SERVOS 1
opt_set TEMP_SENSOR_1 1
opt_set TEMP_SENSOR_2 1
opt_set TEMP_SENSOR_3 1
opt_set TEMP_SENSOR_4 1
opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE BOOT_MARLIN_LOGO_ANIMATED \ opt_enable ZONESTAR_LCD Z_PROBE_SERVO_NR Z_SERVO_ANGLES DEACTIVATE_SERVOS_AFTER_MOVE BOOT_MARLIN_LOGO_ANIMATED \
AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL \ AUTO_BED_LEVELING_3POINT DEBUG_LEVELING_FEATURE EEPROM_SETTINGS EEPROM_CHITCHAT M114_DETAIL \
NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \ NO_VOLUMETRICS EXTENDED_CAPABILITIES_REPORT AUTO_REPORT_TEMPERATURES AUTOTEMP G38_PROBE_TARGET JOYSTICK \
PRUSA_MMU2 MMU2_MENUS PRUSA_MMU2_S_MODE DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \ DIRECT_STEPPING DETECT_BROKEN_ENDSTOP \
FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING FIL_RUNOUT3_PULL FILAMENT_RUNOUT_SENSOR NOZZLE_PARK_FEATURE ADVANCED_PAUSE_FEATURE Z_SAFE_HOMING FIL_RUNOUT3_PULL
opt_set MIXING_STEPPERS 5 opt_set NUM_RUNOUT_SENSORS 5
opt_set FIL_RUNOUT2_PIN 44
opt_set FIL_RUNOUT3_PIN 45
opt_set FIL_RUNOUT3_STATE HIGH opt_set FIL_RUNOUT3_STATE HIGH
opt_set FIL_RUNOUT4_PIN 46
opt_set FIL_RUNOUT5_PIN 47
exec_test $1 $2 "Multiple runout sensors (x5) | Distinct runout states" exec_test $1 $2 "Multiple runout sensors (x5) | Distinct runout states"
# #

View file

@ -93,7 +93,8 @@ default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
-<src/feature/leds/tempstat.cpp> -<src/feature/leds/tempstat.cpp>
-<src/feature/max7219.cpp> -<src/feature/max7219.cpp>
-<src/feature/mixing.cpp> -<src/feature/mixing.cpp>
-<src/feature/mmu2> -<src/gcode/feature/prusa_MMU2> -<src/feature/mmu/mmu.cpp>
-<src/feature/mmu/mmu2.cpp> -<src/gcode/feature/prusa_MMU2>
-<src/feature/password> -<src/gcode/feature/password> -<src/feature/password> -<src/gcode/feature/password>
-<src/feature/pause.cpp> -<src/feature/pause.cpp>
-<src/feature/power.cpp> -<src/feature/power.cpp>
@ -101,7 +102,6 @@ default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
-<src/feature/powerloss.cpp> -<src/gcode/feature/powerloss> -<src/feature/powerloss.cpp> -<src/gcode/feature/powerloss>
-<src/feature/probe_temp_comp.cpp> -<src/feature/probe_temp_comp.cpp>
-<src/feature/runout.cpp> -<src/gcode/feature/runout> -<src/feature/runout.cpp> -<src/gcode/feature/runout>
-<src/feature/snmm.cpp>
-<src/feature/solenoid.cpp> -<src/gcode/control/M380_M381.cpp> -<src/feature/solenoid.cpp> -<src/gcode/control/M380_M381.cpp>
-<src/feature/spindle_laser.cpp> -<src/gcode/control/M3-M5.cpp> -<src/feature/spindle_laser.cpp> -<src/gcode/control/M3-M5.cpp>
-<src/feature/tmc_util.cpp> -<src/module/stepper/trinamic.cpp> -<src/feature/tmc_util.cpp> -<src/module/stepper/trinamic.cpp>
@ -304,7 +304,8 @@ PRINTER_EVENT_LEDS = src_filter=+<src/feature/leds/printer_event_leds.cpp>
TEMP_STAT_LEDS = src_filter=+<src/feature/leds/tempstat.cpp> TEMP_STAT_LEDS = src_filter=+<src/feature/leds/tempstat.cpp>
MAX7219_DEBUG = src_filter=+<src/feature/max7219.cpp> +<src/gcode/feature/leds/M7219.cpp> MAX7219_DEBUG = src_filter=+<src/feature/max7219.cpp> +<src/gcode/feature/leds/M7219.cpp>
MIXING_EXTRUDER = src_filter=+<src/feature/mixing.cpp> +<src/gcode/feature/mixing/M163-M165.cpp> MIXING_EXTRUDER = src_filter=+<src/feature/mixing.cpp> +<src/gcode/feature/mixing/M163-M165.cpp>
PRUSA_MMU2 = src_filter=+<src/feature/mmu2> +<src/gcode/feature/prusa_MMU2> HAS_PRUSA_MMU1 = src_filter=+<src/feature/mmu/mmu.cpp>
HAS_PRUSA_MMU2 = src_filter=+<src/feature/mmu/mmu2.cpp> +<src/gcode/feature/prusa_MMU2>
PASSWORD_FEATURE = src_filter=+<src/feature/password> +<src/gcode/feature/password> PASSWORD_FEATURE = src_filter=+<src/feature/password> +<src/gcode/feature/password>
ADVANCED_PAUSE_FEATURE = src_filter=+<src/feature/pause.cpp> +<src/gcode/feature/pause/M600.cpp> +<src/gcode/feature/pause/M603.cpp> ADVANCED_PAUSE_FEATURE = src_filter=+<src/feature/pause.cpp> +<src/gcode/feature/pause/M600.cpp> +<src/gcode/feature/pause/M603.cpp>
AUTO_POWER_CONTROL = src_filter=+<src/feature/power.cpp> AUTO_POWER_CONTROL = src_filter=+<src/feature/power.cpp>
@ -312,8 +313,7 @@ HAS_POWER_MONITOR = src_filter=+<src/feature/power_monitor.cpp> +<src/gcod
POWER_LOSS_RECOVERY = src_filter=+<src/feature/powerloss.cpp> +<src/gcode/feature/powerloss> POWER_LOSS_RECOVERY = src_filter=+<src/feature/powerloss.cpp> +<src/gcode/feature/powerloss>
PROBE_TEMP_COMPENSATION = src_filter=+<src/feature/probe_temp_comp.cpp> +<src/gcode/calibrate/G76_M192_M871.cpp> PROBE_TEMP_COMPENSATION = src_filter=+<src/feature/probe_temp_comp.cpp> +<src/gcode/calibrate/G76_M192_M871.cpp>
HAS_FILAMENT_SENSOR = src_filter=+<src/feature/runout.cpp> +<src/gcode/feature/runout> HAS_FILAMENT_SENSOR = src_filter=+<src/feature/runout.cpp> +<src/gcode/feature/runout>
MK2_MULTIPLEXER = src_filter=+<src/feature/snmm.cpp> (EXT|MANUAL)_SOLENOID.* = src_filter=+<src/feature/solenoid.cpp> +<src/gcode/control/M380_M381.cpp>
EXT_SOLENOID|MANUAL_SOLENOID_CONTROL = src_filter=+<src/feature/solenoid.cpp> +<src/gcode/control/M380_M381.cpp>
HAS_CUTTER = src_filter=+<src/feature/spindle_laser.cpp> +<src/gcode/control/M3-M5.cpp> HAS_CUTTER = src_filter=+<src/feature/spindle_laser.cpp> +<src/gcode/control/M3-M5.cpp>
EXPERIMENTAL_I2CBUS = src_filter=+<src/feature/twibus.cpp> +<src/gcode/feature/i2c> EXPERIMENTAL_I2CBUS = src_filter=+<src/feature/twibus.cpp> +<src/gcode/feature/i2c>
MECHANICAL_GANTRY_CAL.+ = src_filter=+<src/gcode/calibrate/G34.cpp> MECHANICAL_GANTRY_CAL.+ = src_filter=+<src/gcode/calibrate/G34.cpp>