diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index d5214d8821..bc3a5339cc 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 0f7c81c8cf..0c808ee5a3 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -1463,7 +1463,7 @@ * Define you own with * { , , hysteresis_start[1..8] } */ - #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + #define CHOPPER_TIMING { 4, -2, 1 } /** * Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions, @@ -2104,6 +2104,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp b/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp index 36134f7b89..65aec60de7 100644 --- a/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp +++ b/Marlin/src/HAL/HAL_AVR/MarlinSerial.cpp @@ -739,6 +739,24 @@ #endif // !USBCON && (UBRRH || UBRR0H || UBRR1H || UBRR2H || UBRR3H) + +#if defined(INTERNAL_SERIAL_PORT) + + ISR(SERIAL_REGNAME(USART,INTERNAL_SERIAL_PORT,_RX_vect)) { + MarlinSerial>::store_rxd_char(); + } + + ISR(SERIAL_REGNAME(USART,INTERNAL_SERIAL_PORT,_UDRE_vect)) { + MarlinSerial>::_tx_udr_empty_irq(); + } + + // Preinstantiate + template class MarlinSerial>; + + // Instantiate + MarlinSerial> internalSerial; + +#endif // For AT90USB targets use the UART for BT interfacing #if defined(USBCON) && ENABLED(BLUETOOTH) HardwareSerial bluetoothSerial; diff --git a/Marlin/src/HAL/HAL_AVR/MarlinSerial.h b/Marlin/src/HAL/HAL_AVR/MarlinSerial.h index 132097eb49..b0376b745d 100644 --- a/Marlin/src/HAL/HAL_AVR/MarlinSerial.h +++ b/Marlin/src/HAL/HAL_AVR/MarlinSerial.h @@ -275,6 +275,24 @@ #endif // !USBCON + +#if defined(INTERNAL_SERIAL_PORT) + template + struct MarlinInternalSerialCfg { + static constexpr int PORT = serial; + static constexpr unsigned int RX_SIZE = 32; + static constexpr unsigned int TX_SIZE = 32; + static constexpr bool XONOFF = false; + static constexpr bool EMERGENCYPARSER = false; + static constexpr bool DROPPED_RX = false; + static constexpr bool RX_OVERRUNS = false; + static constexpr bool RX_FRAMING_ERRORS = false; + static constexpr bool MAX_RX_QUEUED = false; + }; + + extern MarlinSerial> internalSerial; +#endif + // Use the UART for Bluetooth in AT90USB configurations #if defined(USBCON) && ENABLED(BLUETOOTH) extern HardwareSerial bluetoothSerial; diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index b72c0b037c..4180787d09 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -156,6 +156,10 @@ #include "feature/controllerfan.h" #endif +#if ENABLED(PRUSA_MMU2) + #include "feature/prusa_MMU2/mmu2.h" +#endif + #if ENABLED(EXTENSIBLE_UI) #include "lcd/extensible_ui/ui_api.h" #endif @@ -632,6 +636,10 @@ void idle( #if ENABLED(USB_FLASH_DRIVE_SUPPORT) Sd2Card::idle(); #endif + + #if ENABLED(PRUSA_MMU2) + mmu2.mmuLoop(); + #endif } /** @@ -984,6 +992,10 @@ void setup() { #if HAS_TRINAMIC && DISABLED(PS_DEFAULT_OFF) test_tmc_connection(true, true, true, true); #endif + + #if ENABLED(PRUSA_MMU2) + mmu2.init(); + #endif } /** diff --git a/Marlin/src/config/default/Configuration.h b/Marlin/src/config/default/Configuration.h index d5214d8821..bc3a5339cc 100644 --- a/Marlin/src/config/default/Configuration.h +++ b/Marlin/src/config/default/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/default/Configuration_adv.h b/Marlin/src/config/default/Configuration_adv.h old mode 100755 new mode 100644 index 0f7c81c8cf..0c808ee5a3 --- a/Marlin/src/config/default/Configuration_adv.h +++ b/Marlin/src/config/default/Configuration_adv.h @@ -1463,7 +1463,7 @@ * Define you own with * { , , hysteresis_start[1..8] } */ - #define CHOPPER_TIMING CHOPPER_DEFAULT_12V + #define CHOPPER_TIMING { 4, -2, 1 } /** * Monitor Trinamic TMC2130 and TMC2208 drivers for error conditions, @@ -2104,6 +2104,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/3DFabXYZ/Migbot/Configuration.h b/Marlin/src/config/examples/3DFabXYZ/Migbot/Configuration.h index c769489445..be651c5580 100644 --- a/Marlin/src/config/examples/3DFabXYZ/Migbot/Configuration.h +++ b/Marlin/src/config/examples/3DFabXYZ/Migbot/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/3DFabXYZ/Migbot/Configuration_adv.h b/Marlin/src/config/examples/3DFabXYZ/Migbot/Configuration_adv.h index d7a17176a2..6fd4a9c4cd 100644 --- a/Marlin/src/config/examples/3DFabXYZ/Migbot/Configuration_adv.h +++ b/Marlin/src/config/examples/3DFabXYZ/Migbot/Configuration_adv.h @@ -2106,6 +2106,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h index 456ab7b132..d4d682f03d 100644 --- a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h +++ b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h index bd1758a015..da102cba41 100644 --- a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h +++ b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h b/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h index b83387e958..6c38c7c2e4 100644 --- a/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h +++ b/Marlin/src/config/examples/AliExpress/CL-260/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Anet/A2/Configuration.h b/Marlin/src/config/examples/Anet/A2/Configuration.h index e322eded32..ba3258d546 100644 --- a/Marlin/src/config/examples/Anet/A2/Configuration.h +++ b/Marlin/src/config/examples/Anet/A2/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Anet/A2/Configuration_adv.h b/Marlin/src/config/examples/Anet/A2/Configuration_adv.h index 0b3b44fd4c..3911fc2f27 100644 --- a/Marlin/src/config/examples/Anet/A2/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A2/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Anet/A2plus/Configuration.h b/Marlin/src/config/examples/Anet/A2plus/Configuration.h index ef978e1f43..e2330ebe17 100644 --- a/Marlin/src/config/examples/Anet/A2plus/Configuration.h +++ b/Marlin/src/config/examples/Anet/A2plus/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h b/Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h index 0b3b44fd4c..3911fc2f27 100644 --- a/Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A2plus/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Anet/A6/Configuration.h b/Marlin/src/config/examples/Anet/A6/Configuration.h index 4016ee14b0..f4b59bfc02 100644 --- a/Marlin/src/config/examples/Anet/A6/Configuration.h +++ b/Marlin/src/config/examples/Anet/A6/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h index 8034595f45..7b6ee82ff5 100644 --- a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h @@ -2102,6 +2102,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Anet/A8/Configuration.h b/Marlin/src/config/examples/Anet/A8/Configuration.h index 0076f99050..8820526c19 100644 --- a/Marlin/src/config/examples/Anet/A8/Configuration.h +++ b/Marlin/src/config/examples/Anet/A8/Configuration.h @@ -175,6 +175,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h index dd50b96afc..a71802f94d 100644 --- a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/AnyCubic/i3/Configuration.h b/Marlin/src/config/examples/AnyCubic/i3/Configuration.h index 1ddbc45841..15a82f9ef4 100644 --- a/Marlin/src/config/examples/AnyCubic/i3/Configuration.h +++ b/Marlin/src/config/examples/AnyCubic/i3/Configuration.h @@ -175,6 +175,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) @@ -403,7 +413,7 @@ // ANYCUBIC I3 240C and 8 cycles #define DEFAULT_Kp 17.80 #define DEFAULT_Ki 0.84 - #define DEFAULT_Kd 64.84 + #define DEFAULT_Kd 64.84 // Ultimaker //#define DEFAULT_Kp 22.2 diff --git a/Marlin/src/config/examples/AnyCubic/i3/Configuration_adv.h b/Marlin/src/config/examples/AnyCubic/i3/Configuration_adv.h index 4e29a36151..b98646f241 100644 --- a/Marlin/src/config/examples/AnyCubic/i3/Configuration_adv.h +++ b/Marlin/src/config/examples/AnyCubic/i3/Configuration_adv.h @@ -2104,6 +2104,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/ArmEd/Configuration.h b/Marlin/src/config/examples/ArmEd/Configuration.h index cf7c6eb3a7..cb4a4a43d2 100644 --- a/Marlin/src/config/examples/ArmEd/Configuration.h +++ b/Marlin/src/config/examples/ArmEd/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/ArmEd/Configuration_adv.h b/Marlin/src/config/examples/ArmEd/Configuration_adv.h index 53fd134495..c18f9a78a5 100644 --- a/Marlin/src/config/examples/ArmEd/Configuration_adv.h +++ b/Marlin/src/config/examples/ArmEd/Configuration_adv.h @@ -2108,6 +2108,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Azteeg/X5GT/Configuration.h b/Marlin/src/config/examples/Azteeg/X5GT/Configuration.h index 4f049c548b..577a0c1a53 100644 --- a/Marlin/src/config/examples/Azteeg/X5GT/Configuration.h +++ b/Marlin/src/config/examples/Azteeg/X5GT/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h b/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h index aac07912e8..a84d8021b3 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h +++ b/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h b/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h index b9497dbd78..9fdf29bc1e 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h +++ b/Marlin/src/config/examples/BIBO/TouchX/cyclops/Configuration_adv.h @@ -2102,6 +2102,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h b/Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h index 5719760889..ba79e6b500 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h +++ b/Marlin/src/config/examples/BIBO/TouchX/default/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h b/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h index a295ce5518..02de3817c3 100644 --- a/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h +++ b/Marlin/src/config/examples/BIBO/TouchX/default/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/BQ/Hephestos/Configuration.h b/Marlin/src/config/examples/BQ/Hephestos/Configuration.h index 3229f2785b..86033ae808 100644 --- a/Marlin/src/config/examples/BQ/Hephestos/Configuration.h +++ b/Marlin/src/config/examples/BQ/Hephestos/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h index 4514709d9a..421d76492e 100644 --- a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h index 8c9544307a..5b65b0cdc3 100644 --- a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h +++ b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration.h @@ -182,6 +182,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h index 322f425012..1b134db71f 100644 --- a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h @@ -2111,6 +2111,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/BQ/WITBOX/Configuration.h b/Marlin/src/config/examples/BQ/WITBOX/Configuration.h index ddad01acfd..33f3878d1a 100644 --- a/Marlin/src/config/examples/BQ/WITBOX/Configuration.h +++ b/Marlin/src/config/examples/BQ/WITBOX/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h index 4514709d9a..421d76492e 100644 --- a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Cartesio/Configuration.h b/Marlin/src/config/examples/Cartesio/Configuration.h index 1db76dee47..ceaa26cde6 100644 --- a/Marlin/src/config/examples/Cartesio/Configuration.h +++ b/Marlin/src/config/examples/Cartesio/Configuration.h @@ -175,6 +175,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Cartesio/Configuration_adv.h b/Marlin/src/config/examples/Cartesio/Configuration_adv.h index 09cbc4fc1f..83f3bb38a0 100644 --- a/Marlin/src/config/examples/Cartesio/Configuration_adv.h +++ b/Marlin/src/config/examples/Cartesio/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Creality/CR-10/Configuration.h b/Marlin/src/config/examples/Creality/CR-10/Configuration.h index e9b49d96de..16e9cd2a5e 100755 --- a/Marlin/src/config/examples/Creality/CR-10/Configuration.h +++ b/Marlin/src/config/examples/Creality/CR-10/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h old mode 100755 new mode 100644 index 589ce48dde..3a7442e7f6 --- a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h @@ -2106,6 +2106,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Creality/CR-10S/Configuration.h b/Marlin/src/config/examples/Creality/CR-10S/Configuration.h index bd865cdfa5..8c504ae8c2 100644 --- a/Marlin/src/config/examples/Creality/CR-10S/Configuration.h +++ b/Marlin/src/config/examples/Creality/CR-10S/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h index 8ada67836b..6eacb822b5 100644 --- a/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10S/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Creality/CR-10mini/Configuration.h b/Marlin/src/config/examples/Creality/CR-10mini/Configuration.h index 6dc12d2a19..35efae8a6e 100644 --- a/Marlin/src/config/examples/Creality/CR-10mini/Configuration.h +++ b/Marlin/src/config/examples/Creality/CR-10mini/Configuration.h @@ -183,6 +183,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h index b54a680a1d..5b2f629fa6 100644 --- a/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10mini/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Creality/CR-8/Configuration.h b/Marlin/src/config/examples/Creality/CR-8/Configuration.h index 3285f922d3..c8ea20c595 100644 --- a/Marlin/src/config/examples/Creality/CR-8/Configuration.h +++ b/Marlin/src/config/examples/Creality/CR-8/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h index 2c7db0cf20..7cce6b6ff7 100644 --- a/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-8/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Creality/Ender-2/Configuration.h b/Marlin/src/config/examples/Creality/Ender-2/Configuration.h index c50ee9b16c..05bd3bf042 100644 --- a/Marlin/src/config/examples/Creality/Ender-2/Configuration.h +++ b/Marlin/src/config/examples/Creality/Ender-2/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h b/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h index 984758a39a..e04e9b4555 100644 --- a/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/Ender-2/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Creality/Ender-3/Configuration.h b/Marlin/src/config/examples/Creality/Ender-3/Configuration.h index 0bb132fcb4..b2e0c39e03 100644 --- a/Marlin/src/config/examples/Creality/Ender-3/Configuration.h +++ b/Marlin/src/config/examples/Creality/Ender-3/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h b/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h index 1f6e2fe60c..c32886f0b5 100644 --- a/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/Ender-3/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Creality/Ender-4/Configuration.h b/Marlin/src/config/examples/Creality/Ender-4/Configuration.h index 466cc0d6dc..6abe5c9f48 100644 --- a/Marlin/src/config/examples/Creality/Ender-4/Configuration.h +++ b/Marlin/src/config/examples/Creality/Ender-4/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h b/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h index 66663c1ffc..0ec1f9df8e 100644 --- a/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/Ender-4/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Einstart-S/Configuration.h b/Marlin/src/config/examples/Einstart-S/Configuration.h index 09a8629505..cf3eb13a39 100644 --- a/Marlin/src/config/examples/Einstart-S/Configuration.h +++ b/Marlin/src/config/examples/Einstart-S/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Einstart-S/Configuration_adv.h b/Marlin/src/config/examples/Einstart-S/Configuration_adv.h index 7973184f54..aa1b5f65bb 100644 --- a/Marlin/src/config/examples/Einstart-S/Configuration_adv.h +++ b/Marlin/src/config/examples/Einstart-S/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Felix/Configuration.h b/Marlin/src/config/examples/Felix/Configuration.h index a8402b3ae8..0f22541949 100644 --- a/Marlin/src/config/examples/Felix/Configuration.h +++ b/Marlin/src/config/examples/Felix/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Felix/Configuration_adv.h b/Marlin/src/config/examples/Felix/Configuration_adv.h index 30ee49cdf9..0c6999a75f 100644 --- a/Marlin/src/config/examples/Felix/Configuration_adv.h +++ b/Marlin/src/config/examples/Felix/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Felix/DUAL/Configuration.h b/Marlin/src/config/examples/Felix/DUAL/Configuration.h index 531cd8c0da..41626b3499 100644 --- a/Marlin/src/config/examples/Felix/DUAL/Configuration.h +++ b/Marlin/src/config/examples/Felix/DUAL/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/FlashForge/CreatorPro/Configuration.h b/Marlin/src/config/examples/FlashForge/CreatorPro/Configuration.h index 0b7bf17fb6..6f7c9bd284 100644 --- a/Marlin/src/config/examples/FlashForge/CreatorPro/Configuration.h +++ b/Marlin/src/config/examples/FlashForge/CreatorPro/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/FlashForge/CreatorPro/Configuration_adv.h b/Marlin/src/config/examples/FlashForge/CreatorPro/Configuration_adv.h index 8adc87d96e..105e702dda 100644 --- a/Marlin/src/config/examples/FlashForge/CreatorPro/Configuration_adv.h +++ b/Marlin/src/config/examples/FlashForge/CreatorPro/Configuration_adv.h @@ -2102,6 +2102,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h index 4d63e41c54..91bbb8426d 100644 --- a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h +++ b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h index 655aef60b7..17b1744377 100644 --- a/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h +++ b/Marlin/src/config/examples/FolgerTech/i3-2020/Configuration_adv.h @@ -2111,12 +2111,65 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins */ -#define PINS_DEBUGGING +//#define PINS_DEBUGGING // Enable Marlin dev mode which adds some special commands //#define MARLIN_DEV_MODE diff --git a/Marlin/src/config/examples/Formbot/Raptor/Configuration.h b/Marlin/src/config/examples/Formbot/Raptor/Configuration.h index 59f4586bbe..c4ec8c8ab8 100644 --- a/Marlin/src/config/examples/Formbot/Raptor/Configuration.h +++ b/Marlin/src/config/examples/Formbot/Raptor/Configuration.h @@ -215,6 +215,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h b/Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h index f37920c4e6..672935d2b1 100644 --- a/Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h +++ b/Marlin/src/config/examples/Formbot/Raptor/Configuration_adv.h @@ -2107,12 +2107,65 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** * M43 - display pin status, watch pins for changes, watch endstops & toggle LED, Z servo probe test, toggle pins */ -#define PINS_DEBUGGING +//#define PINS_DEBUGGING // Enable Marlin dev mode which adds some special commands //#define MARLIN_DEV_MODE diff --git a/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration.h b/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration.h index a24ebf4617..16137278e6 100644 --- a/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration.h +++ b/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration.h @@ -177,6 +177,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration_adv.h b/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration_adv.h index 91e59ccf00..d507fcc870 100644 --- a/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration_adv.h +++ b/Marlin/src/config/examples/Formbot/T_Rex_2+/Configuration_adv.h @@ -2118,6 +2118,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration.h b/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration.h index 0d852d9918..f1bd52f3b8 100644 --- a/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration.h +++ b/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration.h @@ -178,6 +178,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration_adv.h b/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration_adv.h index ad83f0b8e2..2c4dd39e35 100644 --- a/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration_adv.h +++ b/Marlin/src/config/examples/Formbot/T_Rex_3/Configuration_adv.h @@ -2113,6 +2113,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h b/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h index c945d9069e..4011ba8a32 100644 --- a/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/GT2560/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h b/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h index 9565d9a5ce..e8e780b10e 100644 --- a/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/I3_Pro_X-GT2560/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration.h b/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration.h index 8225db8822..a5868b7b1c 100644 --- a/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h b/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h index 7ee52a5bfd..b120b237dc 100644 --- a/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h +++ b/Marlin/src/config/examples/Geeetech/MeCreator2/Configuration_adv.h @@ -2089,6 +2089,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h index 0712e4f8e3..f5d8c40e8e 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h index 33dd05a3e7..7d32a3b0a1 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h index 7353b4260e..f556cae521 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h index a7618f1b28..057dce74b1 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro C/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h index 4eef948958..ec783066a4 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h index a7618f1b28..057dce74b1 100644 --- a/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h +++ b/Marlin/src/config/examples/Geeetech/Prusa i3 Pro W/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h b/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h index cc10774cf1..990b558905 100644 --- a/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h +++ b/Marlin/src/config/examples/Infitary/i3-M508/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h index 26f7957b88..334592a712 100644 --- a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/JGAurora/A5/Configuration.h b/Marlin/src/config/examples/JGAurora/A5/Configuration.h index b629becf5b..73b190f190 100644 --- a/Marlin/src/config/examples/JGAurora/A5/Configuration.h +++ b/Marlin/src/config/examples/JGAurora/A5/Configuration.h @@ -179,6 +179,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h b/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h index c75d6083db..0634a33509 100644 --- a/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h +++ b/Marlin/src/config/examples/JGAurora/A5/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/MakerParts/Configuration.h b/Marlin/src/config/examples/MakerParts/Configuration.h index b60dd74d7a..76210aa850 100644 --- a/Marlin/src/config/examples/MakerParts/Configuration.h +++ b/Marlin/src/config/examples/MakerParts/Configuration.h @@ -194,6 +194,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/MakerParts/Configuration_adv.h b/Marlin/src/config/examples/MakerParts/Configuration_adv.h index 4853ed8bbd..5a7c50c291 100644 --- a/Marlin/src/config/examples/MakerParts/Configuration_adv.h +++ b/Marlin/src/config/examples/MakerParts/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Malyan/M150/Configuration.h b/Marlin/src/config/examples/Malyan/M150/Configuration.h index 1025ccb60e..ba349afa0b 100644 --- a/Marlin/src/config/examples/Malyan/M150/Configuration.h +++ b/Marlin/src/config/examples/Malyan/M150/Configuration.h @@ -179,6 +179,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h index ca9f37f5c3..36f6e6524b 100644 --- a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h +++ b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Malyan/M200/Configuration.h b/Marlin/src/config/examples/Malyan/M200/Configuration.h index 01af8f3c26..06df322ad7 100644 --- a/Marlin/src/config/examples/Malyan/M200/Configuration.h +++ b/Marlin/src/config/examples/Malyan/M200/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h b/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h index 9e369cb955..79a8c1a948 100644 --- a/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h +++ b/Marlin/src/config/examples/Malyan/M200/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h b/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h index 4a32847818..c8f3affbd2 100644 --- a/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h +++ b/Marlin/src/config/examples/Micromake/C1/basic/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h index 54d186fc3c..68b1084433 100644 --- a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h +++ b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h index 9f89a66073..d78bdeaebb 100644 --- a/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h +++ b/Marlin/src/config/examples/Micromake/C1/enhanced/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Mks/Robin/Configuration.h b/Marlin/src/config/examples/Mks/Robin/Configuration.h index 6b0c3f3504..985d660bce 100644 --- a/Marlin/src/config/examples/Mks/Robin/Configuration.h +++ b/Marlin/src/config/examples/Mks/Robin/Configuration.h @@ -175,6 +175,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Mks/Robin/Configuration_adv.h b/Marlin/src/config/examples/Mks/Robin/Configuration_adv.h index 337bbc4d5b..92918c4824 100644 --- a/Marlin/src/config/examples/Mks/Robin/Configuration_adv.h +++ b/Marlin/src/config/examples/Mks/Robin/Configuration_adv.h @@ -2104,6 +2104,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Mks/Sbase/Configuration.h b/Marlin/src/config/examples/Mks/Sbase/Configuration.h index fc4c536c42..03a1ac723f 100644 --- a/Marlin/src/config/examples/Mks/Sbase/Configuration.h +++ b/Marlin/src/config/examples/Mks/Sbase/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h b/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h index 2ced8dcc2b..b47569977b 100644 --- a/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h +++ b/Marlin/src/config/examples/Mks/Sbase/Configuration_adv.h @@ -2111,6 +2111,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/RapideLite/RL200/Configuration.h b/Marlin/src/config/examples/RapideLite/RL200/Configuration.h index 1cde9106e8..171636448d 100644 --- a/Marlin/src/config/examples/RapideLite/RL200/Configuration.h +++ b/Marlin/src/config/examples/RapideLite/RL200/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/RapideLite/RL200/Configuration_adv.h b/Marlin/src/config/examples/RapideLite/RL200/Configuration_adv.h index 5d0dd35533..bfc1c4700c 100644 --- a/Marlin/src/config/examples/RapideLite/RL200/Configuration_adv.h +++ b/Marlin/src/config/examples/RapideLite/RL200/Configuration_adv.h @@ -2104,6 +2104,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h b/Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h index 24d5e5ffe3..87b5a789e5 100644 --- a/Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h +++ b/Marlin/src/config/examples/RepRapPro/Huxley/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h b/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h index e30f4c78c5..85d02059d1 100644 --- a/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/src/config/examples/RepRapWorld/Megatronics/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/RigidBot/Configuration.h b/Marlin/src/config/examples/RigidBot/Configuration.h index 6a7cdcf09e..5fd67dd653 100644 --- a/Marlin/src/config/examples/RigidBot/Configuration.h +++ b/Marlin/src/config/examples/RigidBot/Configuration.h @@ -177,6 +177,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/RigidBot/Configuration_adv.h b/Marlin/src/config/examples/RigidBot/Configuration_adv.h index d8bf246c59..1553f9ad96 100644 --- a/Marlin/src/config/examples/RigidBot/Configuration_adv.h +++ b/Marlin/src/config/examples/RigidBot/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/SCARA/Configuration.h b/Marlin/src/config/examples/SCARA/Configuration.h index e569f6c658..6e25f50f2c 100644 --- a/Marlin/src/config/examples/SCARA/Configuration.h +++ b/Marlin/src/config/examples/SCARA/Configuration.h @@ -205,6 +205,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/SCARA/Configuration_adv.h b/Marlin/src/config/examples/SCARA/Configuration_adv.h index 6f559a85d0..68d189f2b7 100644 --- a/Marlin/src/config/examples/SCARA/Configuration_adv.h +++ b/Marlin/src/config/examples/SCARA/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/STM32F10/Configuration.h b/Marlin/src/config/examples/STM32F10/Configuration.h index 507b62cbd8..5a118d2e25 100644 --- a/Marlin/src/config/examples/STM32F10/Configuration.h +++ b/Marlin/src/config/examples/STM32F10/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/STM32F4/Configuration.h b/Marlin/src/config/examples/STM32F4/Configuration.h index 634a08846d..e1a1596a3e 100644 --- a/Marlin/src/config/examples/STM32F4/Configuration.h +++ b/Marlin/src/config/examples/STM32F4/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Sanguinololu/Configuration.h b/Marlin/src/config/examples/Sanguinololu/Configuration.h index 5311f5ce39..a42d6d94ad 100644 --- a/Marlin/src/config/examples/Sanguinololu/Configuration.h +++ b/Marlin/src/config/examples/Sanguinololu/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h index e801512cc0..610e33dc8e 100644 --- a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h +++ b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/TheBorg/Configuration.h b/Marlin/src/config/examples/TheBorg/Configuration.h index 8bcae8a3b9..b759f204e1 100644 --- a/Marlin/src/config/examples/TheBorg/Configuration.h +++ b/Marlin/src/config/examples/TheBorg/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/TheBorg/Configuration_adv.h b/Marlin/src/config/examples/TheBorg/Configuration_adv.h index 4df21eab0d..1f2df5ae1b 100644 --- a/Marlin/src/config/examples/TheBorg/Configuration_adv.h +++ b/Marlin/src/config/examples/TheBorg/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/TinyBoy2/Configuration.h b/Marlin/src/config/examples/TinyBoy2/Configuration.h index 44af23c1fb..459c5e0366 100644 --- a/Marlin/src/config/examples/TinyBoy2/Configuration.h +++ b/Marlin/src/config/examples/TinyBoy2/Configuration.h @@ -196,6 +196,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h index 700fa444ce..fb6b9dc57c 100644 --- a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h +++ b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Tronxy/X1/Configuration.h b/Marlin/src/config/examples/Tronxy/X1/Configuration.h index f3f61803c7..4572c1b53a 100644 --- a/Marlin/src/config/examples/Tronxy/X1/Configuration.h +++ b/Marlin/src/config/examples/Tronxy/X1/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Tronxy/X3A/Configuration.h b/Marlin/src/config/examples/Tronxy/X3A/Configuration.h index 572be073d9..e6f579bcdc 100644 --- a/Marlin/src/config/examples/Tronxy/X3A/Configuration.h +++ b/Marlin/src/config/examples/Tronxy/X3A/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h b/Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h index fc9c6fb7ac..42bd31a25d 100644 --- a/Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h +++ b/Marlin/src/config/examples/Tronxy/X3A/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Tronxy/X5S/Configuration.h b/Marlin/src/config/examples/Tronxy/X5S/Configuration.h index e7e2b6cb5d..b114998ed0 100644 --- a/Marlin/src/config/examples/Tronxy/X5S/Configuration.h +++ b/Marlin/src/config/examples/Tronxy/X5S/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Tronxy/XY100/Configuration.h b/Marlin/src/config/examples/Tronxy/XY100/Configuration.h index bdb220145d..352163ceac 100644 --- a/Marlin/src/config/examples/Tronxy/XY100/Configuration.h +++ b/Marlin/src/config/examples/Tronxy/XY100/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/UltiMachine/Archim1/Configuration.h b/Marlin/src/config/examples/UltiMachine/Archim1/Configuration.h index dae63e13ce..4d03d0af56 100644 --- a/Marlin/src/config/examples/UltiMachine/Archim1/Configuration.h +++ b/Marlin/src/config/examples/UltiMachine/Archim1/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/UltiMachine/Archim1/Configuration_adv.h b/Marlin/src/config/examples/UltiMachine/Archim1/Configuration_adv.h index d038a97bf5..160a402e5b 100644 --- a/Marlin/src/config/examples/UltiMachine/Archim1/Configuration_adv.h +++ b/Marlin/src/config/examples/UltiMachine/Archim1/Configuration_adv.h @@ -2104,6 +2104,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h index 97e977850b..3aeed2f0e4 100644 --- a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h +++ b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h index 0b68a63cda..d8246026ac 100644 --- a/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h +++ b/Marlin/src/config/examples/UltiMachine/Archim2/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/VORONDesign/Configuration.h b/Marlin/src/config/examples/VORONDesign/Configuration.h index 52f7d12ee2..88fcbcd37d 100644 --- a/Marlin/src/config/examples/VORONDesign/Configuration.h +++ b/Marlin/src/config/examples/VORONDesign/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/VORONDesign/Configuration_adv.h b/Marlin/src/config/examples/VORONDesign/Configuration_adv.h index ae36ddacdc..d04d49b6d8 100644 --- a/Marlin/src/config/examples/VORONDesign/Configuration_adv.h +++ b/Marlin/src/config/examples/VORONDesign/Configuration_adv.h @@ -2104,6 +2104,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Velleman/K8200/Configuration.h b/Marlin/src/config/examples/Velleman/K8200/Configuration.h index fc2eaa519a..20ba9f376e 100644 --- a/Marlin/src/config/examples/Velleman/K8200/Configuration.h +++ b/Marlin/src/config/examples/Velleman/K8200/Configuration.h @@ -194,6 +194,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h index 68e8617923..6ab9963598 100644 --- a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h @@ -2116,6 +2116,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Velleman/K8400/Configuration.h b/Marlin/src/config/examples/Velleman/K8400/Configuration.h index a6b03b4e95..bd3a4a38e1 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Configuration.h +++ b/Marlin/src/config/examples/Velleman/K8400/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h index a97aeed5df..5aad34fab9 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h b/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h index 9137b51037..26a826b7a8 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h +++ b/Marlin/src/config/examples/Velleman/K8400/Dual-head/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/WASP/PowerWASP/Configuration.h b/Marlin/src/config/examples/WASP/PowerWASP/Configuration.h index 3a0d982966..09f29b55af 100644 --- a/Marlin/src/config/examples/WASP/PowerWASP/Configuration.h +++ b/Marlin/src/config/examples/WASP/PowerWASP/Configuration.h @@ -193,6 +193,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/WASP/PowerWASP/Configuration_adv.h b/Marlin/src/config/examples/WASP/PowerWASP/Configuration_adv.h index ab2e598d49..526cf1b375 100644 --- a/Marlin/src/config/examples/WASP/PowerWASP/Configuration_adv.h +++ b/Marlin/src/config/examples/WASP/PowerWASP/Configuration_adv.h @@ -2104,6 +2104,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h index 5bbbe60eac..b9322fb283 100644 --- a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h +++ b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h index 6f8e20996c..1a45aac015 100644 --- a/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h +++ b/Marlin/src/config/examples/Wanhao/Duplicator 6/Configuration_adv.h @@ -2105,6 +2105,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/adafruit/ST7565/Configuration.h b/Marlin/src/config/examples/adafruit/ST7565/Configuration.h index 4186ddbd3b..cb6e932afb 100644 --- a/Marlin/src/config/examples/adafruit/ST7565/Configuration.h +++ b/Marlin/src/config/examples/adafruit/ST7565/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration.h b/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration.h index ed2f558037..9c395097d8 100644 --- a/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration.h +++ b/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration.h @@ -189,6 +189,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h b/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h index b800689a91..fc3d6ce121 100644 --- a/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/Anycubic/Kossel/Configuration_adv.h @@ -2105,6 +2105,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h index 412e69397c..541ae8dd8f 100644 --- a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h +++ b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h index 4d904ef9cc..2eb31d35a7 100644 --- a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -2105,6 +2105,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h index b478f2ef75..3217764ec5 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h index 4d904ef9cc..2eb31d35a7 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel/Configuration_adv.h @@ -2105,6 +2105,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h index 135a67fa15..6ea32388f8 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h index c4bcb8c2fa..d48b97b9eb 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -2105,6 +2105,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration.h b/Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration.h index c77f889575..b609e4d348 100644 --- a/Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration.h +++ b/Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h b/Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h index ab6438094b..770a3a70ef 100644 --- a/Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/Geeetech/Rostock 301/Configuration_adv.h @@ -2106,6 +2106,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h b/Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h index c3abc8a697..7a313044dc 100644 --- a/Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h +++ b/Marlin/src/config/examples/delta/Hatchbox_Alpha/Configuration.h @@ -179,6 +179,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/delta/MKS/SBASE/Configuration.h b/Marlin/src/config/examples/delta/MKS/SBASE/Configuration.h index bb98e4119c..c12d42d8bb 100644 --- a/Marlin/src/config/examples/delta/MKS/SBASE/Configuration.h +++ b/Marlin/src/config/examples/delta/MKS/SBASE/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/delta/MKS/SBASE/Configuration_adv.h b/Marlin/src/config/examples/delta/MKS/SBASE/Configuration_adv.h index ba7633b7c5..d2e3a6ebc5 100644 --- a/Marlin/src/config/examples/delta/MKS/SBASE/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/MKS/SBASE/Configuration_adv.h @@ -2105,6 +2105,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/delta/Tevo Little Monster/Configuration.h b/Marlin/src/config/examples/delta/Tevo Little Monster/Configuration.h index ef95c68272..98d2a46dba 100644 --- a/Marlin/src/config/examples/delta/Tevo Little Monster/Configuration.h +++ b/Marlin/src/config/examples/delta/Tevo Little Monster/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/delta/Tevo Little Monster/Configuration_adv.h b/Marlin/src/config/examples/delta/Tevo Little Monster/Configuration_adv.h index 806de63f39..319a141302 100644 --- a/Marlin/src/config/examples/delta/Tevo Little Monster/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/Tevo Little Monster/Configuration_adv.h @@ -2093,6 +2093,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/delta/generic/Configuration.h b/Marlin/src/config/examples/delta/generic/Configuration.h index 0aba3b1b6a..f9e317cc25 100644 --- a/Marlin/src/config/examples/delta/generic/Configuration.h +++ b/Marlin/src/config/examples/delta/generic/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/delta/generic/Configuration_adv.h b/Marlin/src/config/examples/delta/generic/Configuration_adv.h index c4bcb8c2fa..d48b97b9eb 100644 --- a/Marlin/src/config/examples/delta/generic/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/generic/Configuration_adv.h @@ -2105,6 +2105,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/delta/kossel_mini/Configuration.h b/Marlin/src/config/examples/delta/kossel_mini/Configuration.h index d955ddbc66..c296cde278 100644 --- a/Marlin/src/config/examples/delta/kossel_mini/Configuration.h +++ b/Marlin/src/config/examples/delta/kossel_mini/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h index c4bcb8c2fa..d48b97b9eb 100644 --- a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h @@ -2105,6 +2105,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/delta/kossel_pro/Configuration.h b/Marlin/src/config/examples/delta/kossel_pro/Configuration.h index c1ea1a5f18..50c8ab8740 100644 --- a/Marlin/src/config/examples/delta/kossel_pro/Configuration.h +++ b/Marlin/src/config/examples/delta/kossel_pro/Configuration.h @@ -178,6 +178,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/delta/kossel_xl/Configuration.h b/Marlin/src/config/examples/delta/kossel_xl/Configuration.h index 9b163d3b47..b6e0632435 100644 --- a/Marlin/src/config/examples/delta/kossel_xl/Configuration.h +++ b/Marlin/src/config/examples/delta/kossel_xl/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h index db534447ad..1bc3c2698e 100644 --- a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h @@ -2105,6 +2105,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h index 0e0364ad02..24f5427c03 100644 --- a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h +++ b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration.h @@ -179,6 +179,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h index 747d39c1c8..75f595f4db 100644 --- a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/makibox/Configuration.h b/Marlin/src/config/examples/makibox/Configuration.h index 9ccd93de9c..0447133c96 100644 --- a/Marlin/src/config/examples/makibox/Configuration.h +++ b/Marlin/src/config/examples/makibox/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/makibox/Configuration_adv.h b/Marlin/src/config/examples/makibox/Configuration_adv.h index 4835f0d2b8..15b33f39bb 100644 --- a/Marlin/src/config/examples/makibox/Configuration_adv.h +++ b/Marlin/src/config/examples/makibox/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/stm32f103ret6/Configuration.h b/Marlin/src/config/examples/stm32f103ret6/Configuration.h index 12e9400dfc..574088179f 100644 --- a/Marlin/src/config/examples/stm32f103ret6/Configuration.h +++ b/Marlin/src/config/examples/stm32f103ret6/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/tvrrug/Round2/Configuration.h b/Marlin/src/config/examples/tvrrug/Round2/Configuration.h index 65dcf19b8e..07d129c0a5 100644 --- a/Marlin/src/config/examples/tvrrug/Round2/Configuration.h +++ b/Marlin/src/config/examples/tvrrug/Round2/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h index a4a303c8f0..15f842fa39 100644 --- a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h @@ -2103,6 +2103,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/config/examples/wt150/Configuration.h b/Marlin/src/config/examples/wt150/Configuration.h index c49914aea3..15f2ca433f 100644 --- a/Marlin/src/config/examples/wt150/Configuration.h +++ b/Marlin/src/config/examples/wt150/Configuration.h @@ -174,6 +174,16 @@ //#define E_MUX2_PIN 44 // Needed for 5 to 8 inputs #endif +/** + * Prusa Multi-Material Unit v2 + * + * Requires NOZZLE_PARK_FEATURE to park print head in case MMU unit fails. + * Requires EXTRUDERS = 5 + * + * For additional configuration see Configuration_adv.h + */ +//#define PRUSA_MMU2 + // A dual extruder that uses a single stepper motor //#define SWITCHING_EXTRUDER #if ENABLED(SWITCHING_EXTRUDER) diff --git a/Marlin/src/config/examples/wt150/Configuration_adv.h b/Marlin/src/config/examples/wt150/Configuration_adv.h index ff38ed2afa..0d92cb7b42 100644 --- a/Marlin/src/config/examples/wt150/Configuration_adv.h +++ b/Marlin/src/config/examples/wt150/Configuration_adv.h @@ -2104,6 +2104,59 @@ #define WIFI_PWD "Wifi Password" #endif +/** + * Prusa Multi-Material Unit v2 + * Enable in Configuration.h + */ +#if ENABLED(PRUSA_MMU2) + + // Serial port used for communication with MMU2. + // For AVR enable the UART port used for the MMU. (e.g., internalSerial) + // For 32-bit boards check your HAL for available serial ports. (e.g., Serial2) + #define INTERNAL_SERIAL_PORT 2 + #define MMU2_SERIAL internalSerial + + // Use hardware reset for MMU if a pin is defined for it + //#define MMU2_RST_PIN 23 + + // Enable if the MMU2 has 12V stepper motors (MMU2 Firmware 1.0.2 and up) + //#define MMU2_MODE_12V + + // G-code to execute when MMU2 F.I.N.D.A. probe detects filament runout + #define MMU2_FILAMENT_RUNOUT_SCRIPT "M600" + + // Add an LCD menu for MMU2 + //#define MMU2_MENUS + #if ENABLED(MMU2_MENUS) + // Settings for filament load / unload from the LCD menu. + // This is for Prusa MK3-style extruders. Customize for your hardware. + #define MMU2_FILAMENTCHANGE_EJECT_FEED 80.0 + #define MMU2_LOAD_TO_NOZZLE_SEQUENCE \ + { 7.2, 562 }, \ + { 14.4, 871 }, \ + { 36.0, 1393 }, \ + { 14.4, 871 }, \ + { 50.0, 198 } + + #define MMU2_RAMMING_SEQUENCE \ + { 1.0, 1000 }, \ + { 1.0, 1500 }, \ + { 2.0, 2000 }, \ + { 1.5, 3000 }, \ + { 2.5, 4000 }, \ + { -15.0, 5000 }, \ + { -14.0, 1200 }, \ + { -6.0, 600 }, \ + { 10.0, 700 }, \ + { -10.0, 400 }, \ + { -50.0, 2000 } + + #endif + + //#define MMU2_DEBUG // Write debug info to serial output + +#endif // PRUSA_MMU2 + // @section develop /** diff --git a/Marlin/src/feature/prusa_MMU2/mmu2.cpp b/Marlin/src/feature/prusa_MMU2/mmu2.cpp new file mode 100644 index 0000000000..f0e27b6515 --- /dev/null +++ b/Marlin/src/feature/prusa_MMU2/mmu2.cpp @@ -0,0 +1,898 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../inc/MarlinConfig.h" + +#if ENABLED(PRUSA_MMU2) + +#include "mmu2.h" +#include "mmu2_menu.h" + +MMU2 mmu2; + +#include "../../gcode/gcode.h" +#include "../../lcd/ultralcd.h" +#include "../../libs/buzzer.h" +#include "../../libs/nozzle.h" +#include "../../module/temperature.h" +#include "../../module/planner.h" +#include "../../module/stepper_indirection.h" +#include "../../Marlin.h" + +#if ENABLED(FILAMENT_RUNOUT_SENSOR) + #include "../runout.h" +#endif + +#define MMU_TODELAY 100 +#define MMU_TIMEOUT 10 +#define MMU_CMD_TIMEOUT 60000ul //5min timeout for mmu commands (except P0) +#define MMU_P0_TIMEOUT 3000ul //timeout for P0 command: 3seconds + +#define MMU_CMD_NONE 0 +#define MMU_CMD_T0 0x10 +#define MMU_CMD_T1 0x11 +#define MMU_CMD_T2 0x12 +#define MMU_CMD_T3 0x13 +#define MMU_CMD_T4 0x14 +#define MMU_CMD_L0 0x20 +#define MMU_CMD_L1 0x21 +#define MMU_CMD_L2 0x22 +#define MMU_CMD_L3 0x23 +#define MMU_CMD_L4 0x24 +#define MMU_CMD_C0 0x30 +#define MMU_CMD_U0 0x40 +#define MMU_CMD_E0 0x50 +#define MMU_CMD_E1 0x51 +#define MMU_CMD_E2 0x52 +#define MMU_CMD_E3 0x53 +#define MMU_CMD_E4 0x54 +#define MMU_CMD_R0 0x60 +#define MMU_CMD_F0 0x70 +#define MMU_CMD_F1 0x71 +#define MMU_CMD_F2 0x72 +#define MMU_CMD_F3 0x73 +#define MMU_CMD_F4 0x74 + +#if ENABLED(MMU2_MODE_12V) + #define MMU_REQUIRED_FW_BUILDNR 132 +#else + #define MMU_REQUIRED_FW_BUILDNR 126 +#endif + +#define MMU2_NO_TOOL 99 +#define MMU_BAUD 115200 + +#define mmuSerial MMU2_SERIAL + +bool MMU2::enabled, MMU2::ready, MMU2::mmu_print_saved; +uint8_t MMU2::cmd, MMU2::cmd_arg, MMU2::last_cmd, MMU2::extruder; +int8_t MMU2::state = 0; +volatile int8_t MMU2::finda = 1; +volatile bool MMU2::findaRunoutValid; +int16_t MMU2::version = -1, MMU2::buildnr = -1; +millis_t MMU2::next_request, MMU2::next_response; +char MMU2::rx_buffer[16], MMU2::tx_buffer[16]; + +#if HAS_LCD_MENU && ENABLED(MMU2_MENUS) + + struct E_Step { + float extrude; //!< extrude distance in mm + float feedRate; //!< feed rate in mm/s + }; + + static constexpr E_Step ramming_sequence[] PROGMEM = { MMU2_RAMMING_SEQUENCE }; + static constexpr E_Step loadToNozzle_sequence[] PROGMEM = { MMU2_LOAD_TO_NOZZLE_SEQUENCE }; + +#endif // MMU2_MENUS + +MMU2::MMU2() { + rx_buffer[0] = '\0'; +} + +void MMU2::init() { + findaRunoutValid = false; + + #if PIN_EXISTS(MMU2_RST) + // TODO use macros for this + WRITE(MMU2_RST_PIN, HIGH); + SET_OUTPUT(MMU2_RST_PIN); + #endif + + mmuSerial.begin(MMU_BAUD); + extruder = MMU2_NO_TOOL; + + safe_delay(10); + reset(); + rx_buffer[0] = '\0'; + state = -1; +} + +void MMU2::reset() { + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHOLNPGM("MMU <= reset"); + #endif + + #if PIN_EXISTS(MMU2_RST) + WRITE(MMU2_RST_PIN, LOW); + safe_delay(20); + WRITE(MMU2_RST_PIN, HIGH); + #else + tx_str_P(PSTR("X0\n")); // Send soft reset + #endif +} + +uint8_t MMU2::getCurrentTool() { + return extruder == MMU2_NO_TOOL ? -1 : extruder; +} + +void MMU2::mmuLoop() { + + switch (state) { + + case 0: break; + + case -1: + if (rx_start()) { + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHOLNPGM("MMU => 'start'"); + SERIAL_ECHOLNPGM("MMU <= 'S1'"); + #endif + + // send "read version" request + tx_str_P(PSTR("S1\n")); + + state = -2; + } + else if (millis() > 3000000) { + SERIAL_ECHOLNPGM("MMU not responding - DISABLED"); + state = 0; + } + break; + + case -2: + if (rx_ok()) { + sscanf(rx_buffer, "%uok\n", &version); + + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHOLNPAIR("MMU => ", version); + SERIAL_ECHOLNPGM("MMU <= 'S2'"); + #endif + + tx_str_P(PSTR("S2\n")); // read build number + state = -3; + } + break; + + case -3: + if (rx_ok()) { + sscanf(rx_buffer, "%uok\n", &buildnr); + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHOLNPAIR("MMU => ", buildnr); + #endif + + checkVersion(); + + #if ENABLED(MMU2_MODE_12V) + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHOLNPGM("MMU <= 'M1'"); + #endif + + tx_str_P(PSTR("M1\n")); // switch to stealth mode + state = -5; + + #else + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHOLNPGM("MMU <= 'P0'"); + #endif + + tx_str_P(PSTR("P0\n")); // read finda + state = -4; + #endif + } + break; + + case -5: + // response to M1 + if (rx_ok()) { + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHOLNPGM("MMU => ok"); + #endif + + checkVersion(); + + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHOLNPGM("MMU <= 'P0'"); + #endif + + tx_str_P(PSTR("P0\n")); // read finda + state = -4; + } + break; + + case -4: + if (rx_ok()) { + sscanf(rx_buffer, "%hhuok\n", &finda); + + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHOLNPAIR("MMU => ", finda); + SERIAL_ECHOLNPGM("MMU - ENABLED"); + #endif + + enabled = true; + state = 1; + } + break; + + case 1: + if (cmd) { + if (WITHIN(cmd, MMU_CMD_T0, MMU_CMD_T4)) { + // tool change + int filament = cmd - MMU_CMD_T0; + + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHOLNPAIR("MMU <= T", filament); + #endif + + tx_printf_P(PSTR("T%d\n"), filament); + state = 3; // wait for response + } + else if (WITHIN(cmd, MMU_CMD_L0, MMU_CMD_L4)) { + // load + int filament = cmd - MMU_CMD_L0; + + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHOLNPAIR("MMU <= L", filament); + #endif + + tx_printf_P(PSTR("L%d\n"), filament); + state = 3; // wait for response + } + else if (cmd == MMU_CMD_C0) { + // continue loading + + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHOLNPGM("MMU <= 'C0'"); + #endif + + tx_str_P(PSTR("C0\n")); + state = 3; // wait for response + } + else if (cmd == MMU_CMD_U0) { + // unload current + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHOLNPGM("MMU <= 'U0'"); + #endif + + tx_str_P(PSTR("U0\n")); + state = 3; // wait for response + } + else if (WITHIN(cmd, MMU_CMD_E0, MMU_CMD_E4)) { + // eject filament + int filament = cmd - MMU_CMD_E0; + + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHOLNPAIR("MMU <= E", filament); + #endif + tx_printf_P(PSTR("E%d\n"), filament); + state = 3; // wait for response + } + else if (cmd == MMU_CMD_R0) { + // recover after eject + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHOLNPGM("MMU <= 'R0'"); + #endif + + tx_str_P(PSTR("R0\n")); + state = 3; // wait for response + } + else if (WITHIN(cmd, MMU_CMD_F0, MMU_CMD_F4)) { + // filament type + int filament = cmd - MMU_CMD_F0; + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHOPAIR("MMU <= F", filament); + SERIAL_ECHOPGM(" "); + SERIAL_ECHO_F(cmd_arg, DEC); + SERIAL_ECHOPGM("\n"); + #endif + + tx_printf_P(PSTR("F%d %d\n"), filament, cmd_arg); + state = 3; // wait for response + } + + last_cmd = cmd; + cmd = MMU_CMD_NONE; + } + else if (ELAPSED(millis(), next_response)) { + // read FINDA + tx_str_P(PSTR("P0\n")); + state = 2; // wait for response + } + break; + + case 2: // response to command P0 + if (rx_ok()) { + sscanf(rx_buffer, "%hhuok\n", &finda); + + #if ENABLED(MMU2_DEBUG) + // This is super annoying. Only activate if necessary + /* + if (findaRunoutValid) { + SERIAL_ECHOLNPGM("MMU <= 'P0'"); + SERIAL_ECHOPGM("MMU => "); + SERIAL_ECHO_F(finda, DEC); + SERIAL_ECHOPGM("\n"); + } + */ + #endif + + state = 1; + + if (cmd == 0) ready = true; + + if (!finda && findaRunoutValid) filamentRunout(); + } + else if (ELAPSED(millis(), next_request)) // Resend request after timeout (30s) + state = 1; + + break; + + case 3: // response to mmu commands + if (rx_ok()) { + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHOLNPGM("MMU => 'ok'"); + #endif + + ready = true; + state = 1; + last_cmd = MMU_CMD_NONE; + } + else if (ELAPSED(millis(), next_request)) { + // resend request after timeout + if (last_cmd) { + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHOLNPGM("MMU retry"); + #endif + + cmd = last_cmd; + last_cmd = MMU_CMD_NONE; + } + state = 1; + } + break; + } +} + + +/** + * Check if MMU was started + */ +bool MMU2::rx_start() { + // check for start message + if (rx_str_P(PSTR("start\n"))) { + next_response = millis() + 300; + return true; + } + return false; +} + + +/** + * Check if the data received ends with the given string. + */ +bool MMU2::rx_str_P(const char* str) { + uint8_t i = strlen(rx_buffer); + + while (mmuSerial.available()) { + rx_buffer[i++] = mmuSerial.read(); + rx_buffer[i] = '\0'; + + if (i == sizeof(rx_buffer) - 1) { + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHOLNPGM("rx buffer overrun"); + #endif + + break; + } + } + + uint8_t len = strlen_P(str); + + if (i < len) return false; + + str += len; + + while (len--) { + char c0 = pgm_read_byte(str--), c1 = rx_buffer[i--]; + if (c0 == c1) continue; + if (c0 == '\r' && c1 == '\n') continue; // match cr as lf + if (c0 == '\n' && c1 == '\r') continue; // match lf as cr + return false; + } + return true; +} + + +/** + * Transfer data to MMU, no argument + */ +void MMU2::tx_str_P(const char* str) { + clear_rx_buffer(); + uint8_t len = strlen_P(str); + for (uint8_t i = 0; i < len; i++) mmuSerial.write(pgm_read_byte(str++)); + rx_buffer[0] = '\0'; + next_request = millis() + MMU_P0_TIMEOUT; +} + + +/** + * Transfer data to MMU, single argument + */ +void MMU2::tx_printf_P(const char* format, int argument = -1) { + clear_rx_buffer(); + uint8_t len = sprintf_P(tx_buffer, format, argument); + for (uint8_t i = 0; i < len; i++) mmuSerial.write(tx_buffer[i]); + rx_buffer[0] = '\0'; + next_request = millis() + MMU_P0_TIMEOUT; +} + + +/** + * Transfer data to MMU, two arguments + */ +void MMU2::tx_printf_P(const char* format, int argument1, int argument2) { + clear_rx_buffer(); + uint8_t len = sprintf_P(tx_buffer, format, argument1, argument2); + for (uint8_t i = 0; i < len; i++) mmuSerial.write(tx_buffer[i]); + rx_buffer[0] = '\0'; + next_request = millis() + MMU_P0_TIMEOUT; +} + + +/** + * Empty the rx buffer + */ +void MMU2::clear_rx_buffer() { + while (mmuSerial.available()) mmuSerial.read(); + rx_buffer[0] = '\0'; +} + + +/** + * Check if we received 'ok' from MMU + */ +bool MMU2::rx_ok() { + if (rx_str_P(PSTR("ok\n"))) { + next_response = millis() + 300; + return true; + } + return false; +} + + +/** + * Check if MMU has compatible firmware + */ +void MMU2::checkVersion() { + if (buildnr < MMU_REQUIRED_FW_BUILDNR) { + SERIAL_ERROR_START(); + SERIAL_ECHOPGM("MMU2 firmware version invalid. Required version >= "); + SERIAL_ECHOLN(MMU_REQUIRED_FW_BUILDNR); + kill(MSG_MMU2_WRONG_FIRMWARE); + } +} + + +/** + * Handle tool change + */ +void MMU2::toolChange(uint8_t index) { + + if (!enabled) return; + + findaRunoutValid = false; + + if (index != extruder) { + + KEEPALIVE_STATE(IN_HANDLER); + disable_E0(); + ui.status_printf_P(0, PSTR(MSG_MMU2_LOADING_FILAMENT), int(index + 1)); + + command(MMU_CMD_T0 + index); + + manageResponse(true, true); + KEEPALIVE_STATE(IN_HANDLER); + + command(MMU_CMD_C0); + extruder = index; //filament change is finished + active_extruder = 0; + + enable_E0(); + + SERIAL_ECHO_START(); + SERIAL_ECHOLNPAIR(MSG_ACTIVE_EXTRUDER, int(extruder)); + + ui.reset_status(); + KEEPALIVE_STATE(NOT_BUSY); + } + + findaRunoutValid = true; +} + + +/** + * + * Handle special T?/Tx/Tc commands + * + * 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. + * Tc Load to nozzle after filament was prepared by Tx and extruder nozzle is already heated. + * + */ +void MMU2::toolChange(const char* special) { + + if (!enabled) return; + + #if ENABLED(MMU2_MENUS) + + findaRunoutValid = false; + KEEPALIVE_STATE(IN_HANDLER); + + switch(*special) { + case '?': { + uint8_t index = mmu2_chooseFilament(); + while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); + loadFilamentToNozzle(index); + } break; + + case 'x': { + planner.synchronize(); + uint8_t index = mmu2_chooseFilament(); + disable_E0(); + command(MMU_CMD_T0 + index); + manageResponse(true, true); + command(MMU_CMD_C0); + mmuLoop(); + + enable_E0(); + extruder = index; + active_extruder = 0; + } break; + + case 'c': { + while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(100); + executeExtruderSequence((const E_Step *)loadToNozzle_sequence, COUNT(loadToNozzle_sequence)); + } break; + } + + KEEPALIVE_STATE(NOT_BUSY); + + findaRunoutValid = true; + + #endif +} + + +/** + * Set next command + */ +void MMU2::command(const uint8_t mmu_cmd) { + if (!enabled) return; + cmd = mmu_cmd; + ready = false; +} + + +/** + * Wait for response from MMU + */ +bool MMU2::getResponse(void) { + while (cmd != MMU_CMD_NONE) idle(); + + while (!ready) { + idle(); + if (state != 3) break; + } + + const bool ret = ready; + ready = false; + + return ret; +} + + +/** + * Wait for response and deal with timeout if nexcessary + */ +void MMU2::manageResponse(bool move_axes, bool turn_off_nozzle) { + + bool response = false; + mmu_print_saved = false; + point_t park_point = NOZZLE_PARK_POINT; + float resume_position[XYZE]; + int16_t resume_hotend_temp; + + while (!response) { + + response = getResponse(); //wait for "ok" from mmu + + if (!response) { //no "ok" was received in reserved time frame, user will fix the issue on mmu unit + if (!mmu_print_saved) { //first occurence, we are saving current position, park print head in certain position and disable nozzle heater + + planner.synchronize(); + + mmu_print_saved = true; + + SERIAL_ECHOLNPGM("MMU not responding"); + + resume_hotend_temp = thermalManager.degTargetHotend(active_extruder); + COPY(resume_position, current_position); + + if (move_axes && all_axes_homed()) + Nozzle::park(2, park_point /*= NOZZLE_PARK_POINT*/); + + if (turn_off_nozzle) thermalManager.setTargetHotend(0, active_extruder); + + LCD_MESSAGEPGM(MSG_MMU2_NOT_RESPONDING); + BUZZ(100, 659); + BUZZ(200, 698); + BUZZ(100, 659); + BUZZ(300, 440); + BUZZ(100, 659); + + KEEPALIVE_STATE(PAUSED_FOR_USER); + } + } + else if (mmu_print_saved) { + SERIAL_ECHOLNPGM("MMU starts responding\n"); + KEEPALIVE_STATE(IN_HANDLER); + + if (turn_off_nozzle && resume_hotend_temp) { + thermalManager.setTargetHotend(resume_hotend_temp, active_extruder); + LCD_MESSAGEPGM(MSG_HEATING); + BUZZ(200, 40); + + while (!thermalManager.wait_for_hotend(active_extruder, false)) safe_delay(1000); + } + + if (move_axes && all_axes_homed()) { + LCD_MESSAGEPGM(MSG_MMU2_RESUMING); + BUZZ(200, 404); + BUZZ(200, 404); + + // Move XY to starting position, then Z + do_blocking_move_to_xy(resume_position[X_AXIS], resume_position[Y_AXIS], NOZZLE_PARK_XY_FEEDRATE); + + // Move Z_AXIS to saved position + do_blocking_move_to_z(resume_position[Z_AXIS], NOZZLE_PARK_Z_FEEDRATE); + } + else { + BUZZ(200, 404); + BUZZ(200, 404); + LCD_MESSAGEPGM(MSG_MMU2_RESUMING); + } + } + } +} + +void MMU2::setFilamentType(uint8_t index, uint8_t filamentType) { + if (!enabled) return; + + KEEPALIVE_STATE(IN_HANDLER); + + cmd_arg = filamentType; + command(MMU_CMD_F0 + index); + + manageResponse(true, true); + + KEEPALIVE_STATE(NOT_BUSY); +} + +void MMU2::filamentRunout() { + enqueue_and_echo_commands_P(PSTR(MMU2_FILAMENT_RUNOUT_SCRIPT)); + planner.synchronize(); +} + +#if HAS_LCD_MENU && ENABLED(MMU2_MENUS) + + // Load filament into MMU2 + void MMU2::loadFilament(uint8_t index) { + if (!enabled) return; + command(MMU_CMD_L0 + index); + manageResponse(false, false); + BUZZ(200, 404); + } + + /** + * + * Switch material and load to nozzle + * + */ + bool MMU2::loadFilamentToNozzle(uint8_t index) { + + if (!enabled) return false; + + if (thermalManager.tooColdToExtrude(active_extruder)) { + BUZZ(200, 404); + LCD_ALERTMESSAGEPGM(MSG_HOTEND_TOO_COLD); + return false; + } + else { + KEEPALIVE_STATE(IN_HANDLER); + + command(MMU_CMD_T0 + index); + manageResponse(true, true); + command(MMU_CMD_C0); + mmuLoop(); + + extruder = index; + active_extruder = 0; + + loadToNozzle(); + + BUZZ(200, 404); + + KEEPALIVE_STATE(NOT_BUSY); + return true; + } + } + + /** + * + * Load filament to nozzle of multimaterial printer + * + * 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 + * filament to nozzle. + */ + void MMU2::loadToNozzle() { + if (!enabled) return; + executeExtruderSequence((const E_Step *)loadToNozzle_sequence, COUNT(loadToNozzle_sequence)); + } + + bool MMU2::ejectFilament(uint8_t index, bool recover) { + + if (!enabled) return false; + + if (thermalManager.tooColdToExtrude(active_extruder)) { + BUZZ(200, 404); + LCD_ALERTMESSAGEPGM(MSG_HOTEND_TOO_COLD); + return false; + } + + KEEPALIVE_STATE(IN_HANDLER); + LCD_MESSAGEPGM(MSG_MMU2_EJECTING_FILAMENT); + const bool saved_e_relative_mode = gcode.axis_relative_modes[E_AXIS]; + gcode.axis_relative_modes[E_AXIS] = true; + + enable_E0(); + current_position[E_AXIS] -= MMU2_FILAMENTCHANGE_EJECT_FEED; + planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 2500 / 60, active_extruder); + planner.synchronize(); + command(MMU_CMD_E0 + index); + manageResponse(false, false); + + if (recover) { + LCD_MESSAGEPGM(MSG_MMU2_EJECT_RECOVER); + BUZZ(200, 404); + wait_for_user = true; + while (wait_for_user) idle(); + BUZZ(200, 404); + BUZZ(200, 404); + + command(MMU_CMD_R0); + manageResponse(false, false); + } + + ui.reset_status(); + + // no active tool + extruder = MMU2_NO_TOOL; + findaRunoutValid = false; + + BUZZ(200, 404); + + KEEPALIVE_STATE(NOT_BUSY); + + gcode.axis_relative_modes[E_AXIS] = saved_e_relative_mode; + + disable_E0(); + + return true; + } + + /** + * + * unload from hotend and retract to MMU + * + */ + bool MMU2::unload() { + + if (!enabled) return false; + + if (thermalManager.tooColdToExtrude(active_extruder)) { + BUZZ(200, 404); + LCD_ALERTMESSAGEPGM(MSG_HOTEND_TOO_COLD); + return false; + } + + KEEPALIVE_STATE(IN_HANDLER); + + filamentRamming(); + + command(MMU_CMD_U0); + manageResponse(false, true); + + BUZZ(200, 404); + + // no active tool + extruder = MMU2_NO_TOOL; + findaRunoutValid = false; + + KEEPALIVE_STATE(NOT_BUSY); + + return true; + } + + /** + * Unload sequence to optimize shape of the tip of the unloaded filament + */ + void MMU2::filamentRamming() { + executeExtruderSequence((const E_Step *)ramming_sequence, sizeof(ramming_sequence) / sizeof(E_Step)); + } + + void MMU2::executeExtruderSequence(const E_Step * sequence, int steps) { + + planner.synchronize(); + enable_E0(); + + const bool saved_e_relative_mode = gcode.axis_relative_modes[E_AXIS]; + gcode.axis_relative_modes[E_AXIS] = true; + + const E_Step* step = sequence; + + for (uint8_t i = 0; i < steps; i++) { + const float es = pgm_read_float(&(step->extrude)), + fr = pgm_read_float(&(step->feedRate)); + + #if ENABLED(MMU2_DEBUG) + SERIAL_ECHO_START(); + SERIAL_ECHOPAIR("E step ", es); + SERIAL_CHAR('/'); + SERIAL_ECHOLN(fr); + #endif + + current_position[E_AXIS] += es; + planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], + current_position[E_AXIS], MMM_TO_MMS(fr), active_extruder); + planner.synchronize(); + + step++; + } + + gcode.axis_relative_modes[E_AXIS] = saved_e_relative_mode; + + disable_E0(); + } + +#endif // HAS_LCD_MENU && MMU2_MENUS + +#endif // PRUSA_MMU2 diff --git a/Marlin/src/feature/prusa_MMU2/mmu2.h b/Marlin/src/feature/prusa_MMU2/mmu2.h new file mode 100644 index 0000000000..7d7a4facf4 --- /dev/null +++ b/Marlin/src/feature/prusa_MMU2/mmu2.h @@ -0,0 +1,82 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +#include "../../inc/MarlinConfig.h" + +struct E_Step; + +class MMU2 { +public: + MMU2(); + + static void init(); + static void reset(); + static void mmuLoop(); + static void toolChange(uint8_t index); + static void toolChange(const char* special); + static uint8_t getCurrentTool(); + static void setFilamentType(uint8_t index, uint8_t type); + + #if HAS_LCD_MENU && ENABLED(MMU2_MENUS) + static bool unload(); + static void loadFilament(uint8_t); + static void loadAll(); + static bool loadFilamentToNozzle(uint8_t index); + static bool ejectFilament(uint8_t index, bool recover); + #endif + +private: + static bool rx_str_P(const char* str); + static void tx_str_P(const char* str); + static void tx_printf_P(const char* format, int argument); + static void tx_printf_P(const char* format, int argument1, int argument2); + static void clear_rx_buffer(); + + static bool rx_ok(); + static bool rx_start(); + static void checkVersion(); + + static void command(const uint8_t cmd); + static bool getResponse(void); + static void manageResponse(bool move_axes, bool turn_off_nozzle); + + #if HAS_LCD_MENU && ENABLED(MMU2_MENUS) + static void loadToNozzle(); + static void filamentRamming(); + static void executeExtruderSequence(const E_Step * sequence, int steps); + #endif + + static void filamentRunout(); + + static bool enabled, ready, mmu_print_saved; + static uint8_t cmd, cmd_arg, last_cmd, extruder; + static int8_t state; + static volatile int8_t finda; + static volatile bool findaRunoutValid; + static int16_t version, buildnr; + static millis_t next_request, next_response; + static char rx_buffer[16], tx_buffer[16]; +}; + +extern MMU2 mmu2; diff --git a/Marlin/src/feature/prusa_MMU2/mmu2_menu.cpp b/Marlin/src/feature/prusa_MMU2/mmu2_menu.cpp new file mode 100644 index 0000000000..6f2e186c01 --- /dev/null +++ b/Marlin/src/feature/prusa_MMU2/mmu2_menu.cpp @@ -0,0 +1,215 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../inc/MarlinConfig.h" + +#if HAS_LCD_MENU && ENABLED(MMU2_MENUS) + +#include "mmu2.h" +#include "mmu2_menu.h" +#include "../../lcd/menu/menu.h" + +uint8_t currentTool; +bool mmuMenuWait; + +// +// Load Filament +// + +void _mmu2_loadFilamentToNozzle(uint8_t index) { + ui.reset_status(); + ui.return_to_status(); + ui.status_printf_P(0, PSTR(MSG_MMU2_LOADING_FILAMENT), int(index + 1)); + if (mmu2.loadFilamentToNozzle(index)) ui.reset_status(); +} + +inline void action_mmu2_loadFilamentToNozzle(const uint8_t tool) { + _mmu2_loadFilamentToNozzle(tool); + ui.return_to_status(); +} +inline void action_mmu2_loadFilamentToNozzle0() { action_mmu2_loadFilamentToNozzle(0); } +inline void action_mmu2_loadFilamentToNozzle1() { action_mmu2_loadFilamentToNozzle(1); } +inline void action_mmu2_loadFilamentToNozzle2() { action_mmu2_loadFilamentToNozzle(2); } +inline void action_mmu2_loadFilamentToNozzle3() { action_mmu2_loadFilamentToNozzle(3); } +inline void action_mmu2_loadFilamentToNozzle4() { action_mmu2_loadFilamentToNozzle(4); } + +void _mmu2_loadFilament(uint8_t index) { + ui.return_to_status(); + ui.status_printf_P(0, PSTR(MSG_MMU2_LOADING_FILAMENT), int(index + 1)); + mmu2.loadFilament(index); + ui.reset_status(); +} +void action_mmu2_loadAll() { + for (uint8_t i = 0; i < EXTRUDERS; i++) + _mmu2_loadFilament(i); + ui.return_to_status(); +} +inline void action_mmu2_loadFilament0() { _mmu2_loadFilament(0); } +inline void action_mmu2_loadFilament1() { _mmu2_loadFilament(1); } +inline void action_mmu2_loadFilament2() { _mmu2_loadFilament(2); } +inline void action_mmu2_loadFilament3() { _mmu2_loadFilament(3); } +inline void action_mmu2_loadFilament4() { _mmu2_loadFilament(4); } + +void menu_mmu2_loadFilament() { + START_MENU(); + MENU_BACK(MSG_MMU2_MENU); + MENU_ITEM(function, MSG_MMU2_ALL, action_mmu2_loadAll); + MENU_ITEM(function, MSG_MMU2_FILAMENT0, action_mmu2_loadFilament0); + MENU_ITEM(function, MSG_MMU2_FILAMENT1, action_mmu2_loadFilament1); + MENU_ITEM(function, MSG_MMU2_FILAMENT2, action_mmu2_loadFilament2); + MENU_ITEM(function, MSG_MMU2_FILAMENT3, action_mmu2_loadFilament3); + MENU_ITEM(function, MSG_MMU2_FILAMENT4, action_mmu2_loadFilament4); + END_MENU(); +} + +void menu_mmu2_loadToNozzle() { + START_MENU(); + MENU_BACK(MSG_MMU2_MENU); + MENU_ITEM(function, MSG_MMU2_FILAMENT0, action_mmu2_loadFilamentToNozzle0); + MENU_ITEM(function, MSG_MMU2_FILAMENT1, action_mmu2_loadFilamentToNozzle1); + MENU_ITEM(function, MSG_MMU2_FILAMENT2, action_mmu2_loadFilamentToNozzle2); + MENU_ITEM(function, MSG_MMU2_FILAMENT3, action_mmu2_loadFilamentToNozzle3); + MENU_ITEM(function, MSG_MMU2_FILAMENT4, action_mmu2_loadFilamentToNozzle4); + END_MENU(); +} + +// +// Eject Filament +// + +void _mmu2_ejectFilament(uint8_t index) { + ui.reset_status(); + ui.return_to_status(); + ui.status_printf_P(0, PSTR(MSG_MMU2_EJECTING_FILAMENT), int(index + 1)); + if (mmu2.ejectFilament(index, true)) ui.reset_status(); +} +inline void action_mmu2_ejectFilament0() { _mmu2_ejectFilament(0); } +inline void action_mmu2_ejectFilament1() { _mmu2_ejectFilament(1); } +inline void action_mmu2_ejectFilament2() { _mmu2_ejectFilament(2); } +inline void action_mmu2_ejectFilament3() { _mmu2_ejectFilament(3); } +inline void action_mmu2_ejectFilament4() { _mmu2_ejectFilament(4); } + +void action_mmu2_unloadFilament() { + ui.reset_status(); + ui.return_to_status(); + LCD_MESSAGEPGM(MSG_MMU2_UNLOADING_FILAMENT); + idle(); + if (mmu2.unload()) ui.reset_status(); +} + +void menu_mmu2_ejectFilament() { + START_MENU(); + MENU_BACK(MSG_MMU2_MENU); + MENU_ITEM(function, MSG_MMU2_FILAMENT0, action_mmu2_ejectFilament0); + MENU_ITEM(function, MSG_MMU2_FILAMENT1, action_mmu2_ejectFilament1); + MENU_ITEM(function, MSG_MMU2_FILAMENT2, action_mmu2_ejectFilament2); + MENU_ITEM(function, MSG_MMU2_FILAMENT3, action_mmu2_ejectFilament3); + MENU_ITEM(function, MSG_MMU2_FILAMENT4, action_mmu2_ejectFilament4); + END_MENU(); +} + +// +// MMU2 Menu +// + +void action_mmu2_reset() { + mmu2.init(); + ui.reset_status(); +} + +void menu_mmu2() { + START_MENU(); + MENU_BACK(MSG_MAIN); + MENU_ITEM(submenu, MSG_MMU2_LOAD_FILAMENT, menu_mmu2_loadFilament); + MENU_ITEM(submenu, MSG_MMU2_LOAD_TO_NOZZLE, menu_mmu2_loadToNozzle); + MENU_ITEM(submenu, MSG_MMU2_EJECT_FILAMENT, menu_mmu2_ejectFilament); + MENU_ITEM(function, MSG_MMU2_UNLOAD_FILAMENT, action_mmu2_unloadFilament); + MENU_ITEM(function, MSG_MMU2_RESET, action_mmu2_reset); + END_MENU(); +} + +// +// T* Choose Filament +// + +inline void action_mmu2_choose(const uint8_t tool) { + currentTool = tool; + mmuMenuWait = false; +} +inline void action_mmu2_choose0() { action_mmu2_choose(0); } +inline void action_mmu2_choose1() { action_mmu2_choose(1); } +inline void action_mmu2_choose2() { action_mmu2_choose(2); } +inline void action_mmu2_choose3() { action_mmu2_choose(3); } +inline void action_mmu2_choose4() { action_mmu2_choose(4); } + +void menu_mmu2_chooseFilament() { + START_MENU(); + #if LCD_HEIGHT > 2 + STATIC_ITEM(MSG_MMU2_CHOOSE_FILAMENT_HEADER, true, true); + #endif + MENU_ITEM(function, MSG_MMU2_FILAMENT0, action_mmu2_choose0); + MENU_ITEM(function, MSG_MMU2_FILAMENT1, action_mmu2_choose1); + MENU_ITEM(function, MSG_MMU2_FILAMENT2, action_mmu2_choose2); + MENU_ITEM(function, MSG_MMU2_FILAMENT3, action_mmu2_choose3); + MENU_ITEM(function, MSG_MMU2_FILAMENT4, action_mmu2_choose4); + END_MENU(); +} + +// +// MMU2 Filament Runout +// + +inline void action_mmu2_M600_loadCurrentFilament() { mmu2.loadFilament(currentTool); } +inline void action_mmu2_M600_loadCurrentFilamentToNozzle() { mmu2.loadFilamentToNozzle(currentTool); } +inline void action_mmu2_M600_unloadFilament() { mmu2.unload(); } +inline void action_mmu2_M600_resume() { mmuMenuWait = false; } + +void menu_mmu2_advanced_pause() { + currentTool = mmu2.getCurrentTool(); + START_MENU(); + #if LCD_HEIGHT > 2 + STATIC_ITEM(MSG_MMU2_FILAMENT_CHANGE_HEADER, true, true); + #endif + MENU_ITEM(function, MSG_MMU2_RESUME, action_mmu2_M600_resume); + MENU_ITEM(function, MSG_MMU2_UNLOAD_FILAMENT, action_mmu2_M600_unloadFilament); + MENU_ITEM(function, MSG_MMU2_LOAD_FILAMENT, action_mmu2_M600_loadCurrentFilament); + MENU_ITEM(function, MSG_MMU2_LOAD_TO_NOZZLE, action_mmu2_M600_loadCurrentFilamentToNozzle); + END_MENU(); +} + +void mmu2_M600() { + ui.defer_status_screen(true); + ui.goto_screen(menu_mmu2_advanced_pause); + mmuMenuWait = true; + while (mmuMenuWait) idle(); +} + +uint8_t mmu2_chooseFilament() { + ui.defer_status_screen(true); + ui.goto_screen(menu_mmu2_chooseFilament); + mmuMenuWait = true; + while (mmuMenuWait) idle(); + ui.return_to_status(); + return currentTool; +} + +#endif // HAS_LCD_MENU && ENABLED(PRUSA_MMU2_MENUS) diff --git a/Marlin/src/feature/prusa_MMU2/mmu2_menu.h b/Marlin/src/feature/prusa_MMU2/mmu2_menu.h new file mode 100644 index 0000000000..52b1cbb6a2 --- /dev/null +++ b/Marlin/src/feature/prusa_MMU2/mmu2_menu.h @@ -0,0 +1,31 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +#include "../../inc/MarlinConfig.h" + +#if HAS_LCD_MENU && ENABLED(MMU2_MENUS) + extern void menu_mmu2(); + extern void mmu2_M600(); + extern uint8_t mmu2_chooseFilament(); +#endif diff --git a/Marlin/src/feature/prusa_MMU2/serial-protocol.md b/Marlin/src/feature/prusa_MMU2/serial-protocol.md new file mode 100644 index 0000000000..936830e1dc --- /dev/null +++ b/Marlin/src/feature/prusa_MMU2/serial-protocol.md @@ -0,0 +1,94 @@ +Startup sequence +================ + +When initialized, MMU sends + +- MMU => 'start\n' + +We follow with + +- MMU <= 'S1\n' +- MMU => 'ok*Firmware version*\n' +- MMU <= 'S2\n' +- MMU => 'ok*Build number*\n' + +#if (12V_mode) + +- MMU <= 'M1\n' +- MMU => 'ok\n' + +#endif + +- MMU <= 'P0\n' +- MMU => '*FINDA status*\n' + +Now we are sure MMU is available and ready. If there was a timeout or other communication problem somewhere, printer will be killed. + +- *Firmware version* is an integer value, but we don't care about it +- *Build number* is an integer value and has to be >=126, or =>132 if 12V mode is enabled +- *FINDA status* is 1 if the is filament loaded to the extruder, 0 otherwise + + +*Build number* is checked against the required value, if it does not match, printer is halted. + + + +Toolchange +========== + +- MMU <= 'T*Filament index*\n' + +MMU sends + +- MMU => 'ok\n' + +as soon as the filament is fed down to the extruder. We follow with + +- MMU <= 'C0\n' + +MMU will feed a few more millimeters of filament for the extruder gears to grab. +When done, the MMU sends + +- MMU => 'ok\n' + +We don't wait for a response here but immediately continue with the next gcode which should +be one or more extruder moves to feed the filament into the hotend. + + +FINDA status +============ + +- MMU <= 'P0\n' +- MMU => '*FINDA status*\n' + +*FINDA status* is 1 if the is filament loaded to the extruder, 0 otherwise. This could be used as filament runout sensor if probed regularly. + + + +Load filament +============= + +- MMU <= 'L*Filament index*\n' + +MMU will feed filament down to the extruder, when done + +- MMU => 'ok\n' + + +Unload filament +============= + +- MMU <= 'U0\n' + +MMU will retract current filament from the extruder, when done + +- MMU => 'ok\n' + + + +Eject filament +============== + +- MMU <= 'E*Filament index*\n' +- MMU => 'ok\n' + diff --git a/Marlin/src/gcode/control/T.cpp b/Marlin/src/gcode/control/T.cpp index ba6db22440..7867c380ca 100644 --- a/Marlin/src/gcode/control/T.cpp +++ b/Marlin/src/gcode/control/T.cpp @@ -27,11 +27,21 @@ #include "../../module/motion.h" #endif +#if ENABLED(PRUSA_MMU2) + #include "../../feature/prusa_MMU2/mmu2.h" +#endif + /** - * T0-T3: Switch tool, usually switching extruders + * T0-T: Switch tool, usually switching extruders * * F[units/min] Set the movement feedrate * S1 Don't move the tool in XY after change + * + * For PRUSA_MMU2: + * 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. + * Tc Load to nozzle after filament was prepared by Tc and nozzle is already heated. */ void GcodeSuite::T(const uint8_t tool_index) { @@ -44,6 +54,13 @@ void GcodeSuite::T(const uint8_t tool_index) { } #endif + #if ENABLED(PRUSA_MMU2) + if (parser.string_arg) { + mmu2.toolChange(parser.string_arg); // Special commands T?/Tx/Tc + return; + } + #endif + #if EXTRUDERS < 2 tool_change(tool_index); diff --git a/Marlin/src/gcode/feature/pause/M600.cpp b/Marlin/src/gcode/feature/pause/M600.cpp index d7e57845e4..72cc96f2d0 100644 --- a/Marlin/src/gcode/feature/pause/M600.cpp +++ b/Marlin/src/gcode/feature/pause/M600.cpp @@ -37,6 +37,10 @@ #include "../../../lcd/ultralcd.h" #endif +#if ENABLED(PRUSA_MMU2) + #include "../../../feature/prusa_MMU2/mmu2_menu.h" +#endif + /** * M600: Pause for filament change * @@ -71,7 +75,7 @@ void GcodeSuite::M600() { #endif // Show initial "wait for start" message - #if HAS_LCD_MENU + #if HAS_LCD_MENU && DISABLED(PRUSA_MMU2) lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_INIT, ADVANCED_PAUSE_MODE_PAUSE_PRINT, target_extruder); #endif @@ -110,16 +114,23 @@ void GcodeSuite::M600() { park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0); #endif - // Unload filament - const float unload_length = -ABS(parser.seen('U') ? parser.value_axis_units(E_AXIS) - : fc_settings[active_extruder].unload_length); + #if ENABLED(PRUSA_MMU2) + // For MMU2 reset retract and load/unload values so they don't mess with MMU filament handling + constexpr float unload_length = 0.5f, + slow_load_length = 0.0f, + fast_load_length = 0.0f; + #else + // Unload filament + const float unload_length = -ABS(parser.seen('U') ? parser.value_axis_units(E_AXIS) + : fc_settings[active_extruder].unload_length); - // Slow load filament - constexpr float slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH; + // Slow load filament + constexpr float slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH; - // Fast load filament - const float fast_load_length = ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) - : fc_settings[active_extruder].load_length); + // Fast load filament + const float fast_load_length = ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) + : fc_settings[active_extruder].load_length); + #endif const int beep_count = parser.intval('B', #ifdef FILAMENT_CHANGE_ALERT_BEEPS @@ -130,8 +141,13 @@ void GcodeSuite::M600() { ); if (pause_print(retract, park_point, unload_length, true DXC_PASS)) { - wait_for_confirmation(true, beep_count DXC_PASS); - resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, beep_count DXC_PASS); + #if ENABLED(PRUSA_MMU2) + mmu2_M600(); + resume_print(slow_load_length, fast_load_length, 0, beep_count DXC_PASS); + #else + wait_for_confirmation(true, beep_count DXC_PASS); + resume_print(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, beep_count DXC_PASS); + #endif } #if EXTRUDERS > 1 diff --git a/Marlin/src/gcode/feature/pause/M701_M702.cpp b/Marlin/src/gcode/feature/pause/M701_M702.cpp index 95d7ea0160..467c79e125 100644 --- a/Marlin/src/gcode/feature/pause/M701_M702.cpp +++ b/Marlin/src/gcode/feature/pause/M701_M702.cpp @@ -38,6 +38,10 @@ #include "../../../lcd/ultralcd.h" #endif +#if ENABLED(PRUSA_MMU2) + #include "../../../feature/prusa_MMU2/mmu2.h" +#endif + /** * M701: Load filament * @@ -67,7 +71,7 @@ void GcodeSuite::M701() { lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, ADVANCED_PAUSE_MODE_LOAD_FILAMENT, target_extruder); #endif - #if EXTRUDERS > 1 + #if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2) // Change toolhead if specified uint8_t active_extruder_before_filament_change = active_extruder; if (active_extruder != target_extruder) @@ -79,21 +83,25 @@ void GcodeSuite::M701() { do_blocking_move_to_z(MIN(current_position[Z_AXIS] + park_point.z, Z_MAX_POS), NOZZLE_PARK_Z_FEEDRATE); // Load filament - constexpr float slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH; - const float fast_load_length = ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) - : fc_settings[active_extruder].load_length); - load_filament(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, FILAMENT_CHANGE_ALERT_BEEPS, - true, thermalManager.still_heating(target_extruder), ADVANCED_PAUSE_MODE_LOAD_FILAMENT - #if ENABLED(DUAL_X_CARRIAGE) - , target_extruder - #endif - ); + #if ENABLED(PRUSA_MMU2) + mmu2.loadFilamentToNozzle(target_extruder); + #else + constexpr float slow_load_length = FILAMENT_CHANGE_SLOW_LOAD_LENGTH; + const float fast_load_length = ABS(parser.seen('L') ? parser.value_axis_units(E_AXIS) + : fc_settings[active_extruder].load_length); + load_filament(slow_load_length, fast_load_length, ADVANCED_PAUSE_PURGE_LENGTH, FILAMENT_CHANGE_ALERT_BEEPS, + true, thermalManager.still_heating(target_extruder), ADVANCED_PAUSE_MODE_LOAD_FILAMENT + #if ENABLED(DUAL_X_CARRIAGE) + , target_extruder + #endif + ); + #endif // Restore Z axis if (park_point.z > 0) do_blocking_move_to_z(MAX(current_position[Z_AXIS] - park_point.z, 0), NOZZLE_PARK_Z_FEEDRATE); - #if EXTRUDERS > 1 + #if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2) // Restore toolhead if it was changed if (active_extruder_before_filament_change != active_extruder) tool_change(active_extruder_before_filament_change, 0, false); @@ -134,7 +142,7 @@ void GcodeSuite::M702() { lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_UNLOAD, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT, target_extruder); #endif - #if EXTRUDERS > 1 + #if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2) // Change toolhead if specified uint8_t active_extruder_before_filament_change = active_extruder; if (active_extruder != target_extruder) @@ -146,28 +154,32 @@ void GcodeSuite::M702() { do_blocking_move_to_z(MIN(current_position[Z_AXIS] + park_point.z, Z_MAX_POS), NOZZLE_PARK_Z_FEEDRATE); // Unload filament - #if EXTRUDERS > 1 && ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) - if (!parser.seenval('T')) { - HOTEND_LOOP() { - if (e != active_extruder) tool_change(e, 0, false); - unload_filament(-fc_settings[e].unload_length, true, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT); + #if ENABLED(PRUSA_MMU2) + mmu2.unload(); + #else + #if EXTRUDERS > 1 && ENABLED(FILAMENT_UNLOAD_ALL_EXTRUDERS) + if (!parser.seenval('T')) { + HOTEND_LOOP() { + if (e != active_extruder) tool_change(e, 0, false); + unload_filament(-fc_settings[e].unload_length, true, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT); + } } - } - else - #endif - { - // Unload length - const float unload_length = -ABS(parser.seen('U') ? parser.value_axis_units(E_AXIS) - : fc_settings[target_extruder].unload_length); + else + #endif + { + // Unload length + const float unload_length = -ABS(parser.seen('U') ? parser.value_axis_units(E_AXIS) + : fc_settings[target_extruder].unload_length); - unload_filament(unload_length, true, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT); - } + unload_filament(unload_length, true, ADVANCED_PAUSE_MODE_UNLOAD_FILAMENT); + } + #endif // Restore Z axis if (park_point.z > 0) do_blocking_move_to_z(MAX(current_position[Z_AXIS] - park_point.z, 0), NOZZLE_PARK_Z_FEEDRATE); - #if EXTRUDERS > 1 + #if EXTRUDERS > 1 && DISABLED(PRUSA_MMU2) // Restore toolhead if it was changed if (active_extruder_before_filament_change != active_extruder) tool_change(active_extruder_before_filament_change, 0, false); diff --git a/Marlin/src/gcode/feature/prusa_MMU2/M403.cpp b/Marlin/src/gcode/feature/prusa_MMU2/M403.cpp new file mode 100644 index 0000000000..d3b010a51a --- /dev/null +++ b/Marlin/src/gcode/feature/prusa_MMU2/M403.cpp @@ -0,0 +1,49 @@ +/** + * Marlin 3D Printer Firmware + * Copyright (C) 2016 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] + * + * Based on Sprinter and grbl. + * Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + +#include "../../../inc/MarlinConfigPre.h" + +#if ENABLED(PRUSA_MMU2) + +#include "../../gcode.h" +#include "../../../feature/prusa_MMU2/mmu2.h" + +/** + * M403: Set filament type for MMU2 + * + * Valid filament type values: + * + * 0 Default + * 1 Flexible + * 2 PVA + */ +void GcodeSuite::M403() { + int8_t index = parser.intval('E', -1), + type = parser.intval('F', -1); + + if (WITHIN(index, 0, 4) && WITHIN(type, 0, 2)) + mmu2.setFilamentType(index, type); + else + SERIAL_ECHO_MSG("M403 - bad arguments."); +} + +#endif // PRUSA_MMU2 diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 7e43693491..34d35c4c75 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -557,6 +557,10 @@ void GcodeSuite::process_parsed_command( case 402: M402(); break; // M402: Stow probe #endif + #if ENABLED(PRUSA_MMU2) + case 403: M403(); break; + #endif + #if ENABLED(FILAMENT_WIDTH_SENSOR) case 404: M404(); break; // M404: Enter the nominal filament width (3mm, 1.75mm ) N<3.0> or display nominal filament width case 405: M405(); break; // M405: Turn on filament sensor for control diff --git a/Marlin/src/gcode/gcode.h b/Marlin/src/gcode/gcode.h index 34b4c80357..05a222095d 100644 --- a/Marlin/src/gcode/gcode.h +++ b/Marlin/src/gcode/gcode.h @@ -191,6 +191,7 @@ * M400 - Finish all moves. * M401 - Deploy and activate Z probe. (Requires a probe) * M402 - Deactivate and stow Z probe. (Requires a probe) + * M403 - Set filament type for PRUSA MMU2 * M404 - Display or set the Nominal Filament Width: "W". (Requires FILAMENT_WIDTH_SENSOR) * M405 - Enable Filament Sensor flow control. "M405 D". (Requires FILAMENT_WIDTH_SENSOR) * M406 - Disable Filament Sensor flow control. (Requires FILAMENT_WIDTH_SENSOR) @@ -699,6 +700,10 @@ private: static void M402(); #endif + #if ENABLED(PRUSA_MMU2) + static void M403(); + #endif + #if ENABLED(FILAMENT_WIDTH_SENSOR) static void M404(); static void M405(); diff --git a/Marlin/src/gcode/parser.cpp b/Marlin/src/gcode/parser.cpp index 2b678d7e20..8eee57306f 100644 --- a/Marlin/src/gcode/parser.cpp +++ b/Marlin/src/gcode/parser.cpp @@ -143,12 +143,27 @@ void GCodeParser::parse(char *p) { while (*p == ' ') p++; // Bail if there's no command code number - if (!NUMERIC(*p)) return; + // Prusa MMU2 has T?/Tx/Tc commands + #if DISABLED(PRUSA_MMU2) + if (!NUMERIC(*p)) return; + #endif // Save the command letter at this point // A '?' signifies an unknown command command_letter = letter; + + #if ENABLED(PRUSA_MMU2) + if (letter == 'T') { + // check for special MMU2 T?/Tx/Tc commands + if (*p == '?' || *p == 'x' || *p == 'c') { + string_arg = p; + return; + } + } + #endif + + // Get the code number - integer digits only codenum = 0; do { codenum *= 10, codenum += *p++ - '0'; } while (NUMERIC(*p)); diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index dd71d98d78..654db63f05 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -368,7 +368,8 @@ * E_MANUAL - Number of E steppers for LCD move options * */ -#if ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS + +#if ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS #if EXTRUDERS > 4 #define E_STEPPERS 3 #elif EXTRUDERS > 2 @@ -385,6 +386,11 @@ #elif ENABLED(SWITCHING_TOOLHEAD) #define E_STEPPERS EXTRUDERS #define E_MANUAL EXTRUDERS +#elif ENABLED(PRUSA_MMU2) + #define E_STEPPERS 1 + #ifndef TOOLCHANGE_ZRAISE + #define TOOLCHANGE_ZRAISE 0 + #endif #endif // No inactive extruders with MK2_MULTIPLEXER or SWITCHING_NOZZLE @@ -392,8 +398,8 @@ #undef DISABLE_INACTIVE_EXTRUDER #endif -// MK2 Multiplexer forces SINGLENOZZLE -#if ENABLED(MK2_MULTIPLEXER) +// Prusa MK2 Multiplexer and MMU 2.0 force SINGLENOZZLE +#if ENABLED(MK2_MULTIPLEXER) || ENABLED(PRUSA_MMU2) #define SINGLENOZZLE #endif diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index c9726e01ca..c547a1672b 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -2009,3 +2009,16 @@ static_assert(sanity_arr_3[0] > 0 && sanity_arr_3[1] > 0 && sanity_arr_3[2] > 0 #if ENABLED(BACKLASH_COMPENSATION) && IS_CORE #error "BACKLASH_COMPENSATION is incompatible with CORE kinematics." #endif + +/** + * Prusa MMU2 requirements + */ +#if ENABLED(PRUSA_MMU2) + #if DISABLED(NOZZLE_PARK_FEATURE) + #error "PRUSA_MMU2 requires NOZZLE_PARK_FEATURE." + #elif EXTRUDERS != 5 + #error "PRUSA_MMU2 requires EXTRUDERS = 5." + #elif DISABLED(ADVANCED_PAUSE_FEATURE) + static_assert(NULL == strstr(MMU2_FILAMENT_RUNOUT_SCRIPT, "M600"), "ADVANCED_PAUSE_FEATURE is required to use M600 with PRUSA_MMU2."); + #endif +#endif diff --git a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp index af7cc433e1..6375d5cb74 100644 --- a/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp +++ b/Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp @@ -402,7 +402,7 @@ void ST7920_Lite_Status_Screen::draw_degree_symbol(uint8_t x, uint8_t y, const b const bool oddChar = x & 1; const uint8_t x_word = x >> 1, y_top = degree_symbol_y_top, - y_bot = y_top + sizeof(degree_symbol)/sizeof(degree_symbol[0]); + y_bot = y_top + COUNT(degree_symbol); for (uint8_t i = y_top; i < y_bot; i++) { uint8_t byte = pgm_read_byte(p_bytes++); set_gdram_address(x_word, i + y * 16); diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index 7b903a8b5c..b8040b3312 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -1117,6 +1117,94 @@ #define MSG_M600_TOO_COLD _UxGT("M600: Too cold") #endif +#ifndef MSG_MMU2_FILAMENT_CHANGE_HEADER + #define MSG_MMU2_FILAMENT_CHANGE_HEADER _UxGT("FILAMENT CHANGE") +#endif +#ifndef MSG_MMU2_CHOOSE_FILAMENT_HEADER + #define MSG_MMU2_CHOOSE_FILAMENT_HEADER _UxGT("CHOOSE FILAMENT") +#endif +#ifndef MSG_MMU2_MENU + #define MSG_MMU2_MENU _UxGT("MMU") +#endif +#ifndef MSG_MMU2_WRONG_FIRMWARE + #define MSG_MMU2_WRONG_FIRMWARE _UxGT("Update MMU firmware!") +#endif +#ifndef MSG_MMU2_NOT_RESPONDING + #define MSG_MMU2_NOT_RESPONDING _UxGT("MMU needs attention.") +#endif +#ifndef MSG_MMU2_RESUME + #define MSG_MMU2_RESUME _UxGT("Resume print") +#endif +#ifndef MSG_MMU2_RESUMING + #define MSG_MMU2_RESUMING _UxGT("Resuming...") +#endif +#ifndef MSG_MMU2_LOAD_FILAMENT + #define MSG_MMU2_LOAD_FILAMENT _UxGT("Load filament") +#endif +#ifndef MSG_MMU2_LOAD_ALL + #define MSG_MMU2_LOAD_ALL _UxGT("Load all") +#endif +#ifndef MSG_MMU2_LOAD_TO_NOZZLE + #define MSG_MMU2_LOAD_TO_NOZZLE _UxGT("Load to nozzle") +#endif +#ifndef MSG_MMU2_EJECT_FILAMENT + #define MSG_MMU2_EJECT_FILAMENT _UxGT("Eject filament") +#endif +#ifndef MSG_MMU2_EJECT_FILAMENT0 + #define MSG_MMU2_EJECT_FILAMENT0 _UxGT("Eject filament 1") +#endif +#ifndef MSG_MMU2_EJECT_FILAMENT1 + #define MSG_MMU2_EJECT_FILAMENT1 _UxGT("Eject filament 2") +#endif +#ifndef MSG_MMU2_EJECT_FILAMENT2 + #define MSG_MMU2_EJECT_FILAMENT2 _UxGT("Eject filament 3") +#endif +#ifndef MSG_MMU2_EJECT_FILAMENT3 + #define MSG_MMU2_EJECT_FILAMENT3 _UxGT("Eject filament 4") +#endif +#ifndef MSG_MMU2_EJECT_FILAMENT4 + #define MSG_MMU2_EJECT_FILAMENT4 _UxGT("Eject filament 5") +#endif +#ifndef MSG_MMU2_UNLOAD_FILAMENT + #define MSG_MMU2_UNLOAD_FILAMENT _UxGT("Unload filament") +#endif +#ifndef MSG_MMU2_LOADING_FILAMENT + #define MSG_MMU2_LOADING_FILAMENT _UxGT("Loading fil. %i...") +#endif +#ifndef MSG_MMU2_EJECTING_FILAMENT + #define MSG_MMU2_EJECTING_FILAMENT _UxGT("Ejecting fil. ...") +#endif +#ifndef MSG_MMU2_UNLOADING_FILAMENT + #define MSG_MMU2_UNLOADING_FILAMENT _UxGT("Unloading fil....") +#endif +#ifndef MSG_MMU2_ALL + #define MSG_MMU2_ALL _UxGT("All") +#endif +#ifndef MSG_MMU2_FILAMENT0 + #define MSG_MMU2_FILAMENT0 _UxGT("Filament 1") +#endif +#ifndef MSG_MMU2_FILAMENT1 + #define MSG_MMU2_FILAMENT1 _UxGT("Filament 2") +#endif +#ifndef MSG_MMU2_FILAMENT2 + #define MSG_MMU2_FILAMENT2 _UxGT("Filament 3") +#endif +#ifndef MSG_MMU2_FILAMENT3 + #define MSG_MMU2_FILAMENT3 _UxGT("Filament 4") +#endif +#ifndef MSG_MMU2_FILAMENT4 + #define MSG_MMU2_FILAMENT4 _UxGT("Filament 5") +#endif +#ifndef MSG_MMU2_RESET + #define MSG_MMU2_RESET _UxGT("Reset MMU") +#endif +#ifndef MSG_MMU2_RESETTING + #define MSG_MMU2_RESETTING _UxGT("Resetting MMU...") +#endif +#ifndef MSG_MMU2_EJECT_RECOVER + #define MSG_MMU2_EJECT_RECOVER _UxGT("Remove, click") +#endif + // // Filament Change screens show up to 3 lines on a 4-line display // ...or up to 2 lines on a 3-line display diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index 8838ddfde4..a2b0477481 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -86,6 +86,10 @@ void menu_abort_confirm() { END_MENU(); } +#if ENABLED(PRUSA_MMU2) + #include "../../feature/prusa_MMU2/mmu2_menu.h" +#endif + void menu_tune(); void menu_motion(); void menu_temperature(); @@ -138,6 +142,10 @@ void menu_main() { MENU_ITEM(submenu, MSG_MOTION, menu_motion); MENU_ITEM(submenu, MSG_TEMPERATURE, menu_temperature); + + #if ENABLED(MMU2_MENUS) + MENU_ITEM(submenu, MSG_MMU2_MENU, menu_mmu2); + #endif } MENU_ITEM(submenu, MSG_CONFIGURATION, menu_configuration); diff --git a/Marlin/src/module/stepper_indirection.h b/Marlin/src/module/stepper_indirection.h index 4279dee918..12bf87c7fa 100644 --- a/Marlin/src/module/stepper_indirection.h +++ b/Marlin/src/module/stepper_indirection.h @@ -584,6 +584,11 @@ 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 REV_E_DIR(E) do{ E0_DIR_WRITE(E ? !INVERT_E0_DIR : INVERT_E0_DIR); }while(0) #endif +#elif ENABLED(PRUSA_MMU2) + #define E_STEP_WRITE(E,V) E0_STEP_WRITE(V) + #define NORM_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 #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) diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 0d79f7c9e4..159adc5fb3 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -70,6 +70,10 @@ #include "../feature/fanmux.h" #endif +#if ENABLED(PRUSA_MMU2) + #include "../feature/prusa_MMU2/mmu2.h" +#endif + #if HAS_LCD_MENU #include "../lcd/ultralcd.h" #endif @@ -508,6 +512,13 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n mixer.T(uint_fast8_t(tmp_extruder)); #endif + #elif ENABLED(PRUSA_MMU2) + + UNUSED(fr_mm_s); UNUSED(no_move); + + mmu2.toolChange(tmp_extruder); + + #elif EXTRUDERS < 2 UNUSED(fr_mm_s); UNUSED(no_move); @@ -714,6 +725,11 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n do_blocking_move_to_z(destination[Z_AXIS], planner.settings.max_feedrate_mm_s[Z_AXIS]); } #endif + + #if ENABLED(PRUSA_MMU2) + mmu2.toolChange(tmp_extruder); + #endif + } // (tmp_extruder != active_extruder) planner.synchronize();