From 10395bde98e05075d116c1383e0e76a83b4d5e81 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Mon, 3 Mar 2025 00:27:43 -0500 Subject: [PATCH 01/14] Update Prusa MMU3 --- Marlin/src/feature/mmu3/mmu_hw/check-pce.sh | 2 +- Marlin/src/feature/mmu3/mmu_hw/errors_list.h | 20 +++++++++++++------- Marlin/src/lcd/language/language_en.h | 5 ++++- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Marlin/src/feature/mmu3/mmu_hw/check-pce.sh b/Marlin/src/feature/mmu3/mmu_hw/check-pce.sh index 197bc6dcc5..0fa6ef3fa5 100755 --- a/Marlin/src/feature/mmu3/mmu_hw/check-pce.sh +++ b/Marlin/src/feature/mmu3/mmu_hw/check-pce.sh @@ -2,7 +2,7 @@ # download Prusa Error Codes for MMU #wget https://raw.githubusercontent.com/3d-gussner/Prusa-Error-Codes/master/04_MMU/error-codes.yaml --output-document=error-codes.yaml -wget https://raw.githubusercontent.com/prusa3d/Prusa-Error-Codes/master/04_MMU/error-codes.yaml --output-document=error-codes.yaml +wget https://raw.githubusercontent.com/prusa3d/Prusa-Error-Codes/master/yaml/mmu-error-codes.yaml --output-document=error-codes.yaml oifs="$IFS" ## save original IFS IFS=$'\n' ## set IFS to break on newline diff --git a/Marlin/src/feature/mmu3/mmu_hw/errors_list.h b/Marlin/src/feature/mmu3/mmu_hw/errors_list.h index c4965791e6..c9e8282099 100644 --- a/Marlin/src/feature/mmu3/mmu_hw/errors_list.h +++ b/Marlin/src/feature/mmu3/mmu_hw/errors_list.h @@ -50,6 +50,7 @@ typedef enum : uint16_t { ERR_MECHANICAL = 100, ERR_MECHANICAL_FINDA_DIDNT_TRIGGER = 101, ERR_MECHANICAL_FINDA_FILAMENT_STUCK = 102, + ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER = 103, ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK = 104, @@ -57,8 +58,10 @@ typedef enum : uint16_t { ERR_MECHANICAL_FSENSOR_TOO_EARLY = 106, ERR_MECHANICAL_INSPECT_FINDA = 107, ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED = 108, + ERR_MECHANICAL_SELECTOR_CANNOT_HOME = 115, ERR_MECHANICAL_SELECTOR_CANNOT_MOVE = 116, + ERR_MECHANICAL_IDLER_CANNOT_HOME = 125, ERR_MECHANICAL_IDLER_CANNOT_MOVE = 126, @@ -71,7 +74,6 @@ typedef enum : uint16_t { ERR_TEMPERATURE_TMC_SELECTOR_OVERHEAT_ERROR = 212, ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR = 222, - ERR_ELECTRICAL = 300, ERR_ELECTRICAL_TMC_PULLEY_DRIVER_ERROR = 301, ERR_ELECTRICAL_TMC_SELECTOR_DRIVER_ERROR = 311, @@ -93,13 +95,13 @@ typedef enum : uint16_t { ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED = 315, ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED = 325, - ERR_ELECTRICAL_MMU_MCU_ERROR = 306, + ERR_ELECTRICAL_MMU_MCU_POWER_ERROR = 306, + ERR_ELECTRICAL_MMU_MCU_UNDERVOLTAGE_VCC = 307, ERR_CONNECT = 400, ERR_CONNECT_MMU_NOT_RESPONDING = 401, ERR_CONNECT_COMMUNICATION_ERROR = 402, - ERR_SYSTEM = 500, ERR_SYSTEM_FILAMENT_ALREADY_LOADED = 501, ERR_SYSTEM_INVALID_TOOL = 502, @@ -151,7 +153,8 @@ static const constexpr err_num_t errorCodes[] PROGMEM = { ERR_ELECTRICAL_MMU_PULLEY_SELFTEST_FAILED, ERR_ELECTRICAL_MMU_SELECTOR_SELFTEST_FAILED, ERR_ELECTRICAL_MMU_IDLER_SELFTEST_FAILED, - ERR_ELECTRICAL_MMU_MCU_ERROR, + ERR_ELECTRICAL_MMU_MCU_POWER_ERROR, + ERR_ELECTRICAL_MMU_MCU_UNDERVOLTAGE_VCC, ERR_CONNECT_MMU_NOT_RESPONDING, ERR_CONNECT_COMMUNICATION_ERROR, ERR_SYSTEM_FILAMENT_ALREADY_LOADED, @@ -199,7 +202,8 @@ FSTR_P const errorTitles[] PROGMEM = { GET_TEXT_F(MSG_TITLE_SELFTEST_FAILED), GET_TEXT_F(MSG_TITLE_SELFTEST_FAILED), GET_TEXT_F(MSG_TITLE_SELFTEST_FAILED), - GET_TEXT_F(MSG_TITLE_MMU_MCU_ERROR), + GET_TEXT_F(MSG_TITLE_MMU_MCU_POWER_ERROR), + GET_TEXT_F(MSG_TITLE_MMU_MCU_UNDERVOLTAGE_VCC), GET_TEXT_F(MSG_TITLE_MMU_NOT_RESPONDING), GET_TEXT_F(MSG_TITLE_COMMUNICATION_ERROR), GET_TEXT_F(MSG_TITLE_FILAMENT_ALREADY_LOADED), @@ -250,7 +254,8 @@ FSTR_P const errorDescs[] PROGMEM = { GET_TEXT_F(MSG_DESC_TMC), // MMU_PULLEY_SELFTEST_FAILED GET_TEXT_F(MSG_DESC_TMC), // MMU_SELECTOR_SELFTEST_FAILED GET_TEXT_F(MSG_DESC_TMC), // MMU_IDLER_SELFTEST_FAILED - GET_TEXT_F(MSG_DESC_TMC), // MSG_DESC_MMU_MCU_ERROR + GET_TEXT_F(MSG_DESC_MMU_MCU_POWER_ERROR), + GET_TEXT_F(MSG_DESC_MMU_MCU_UNDERVOLTAGE_VCC), GET_TEXT_F(MSG_DESC_MMU_NOT_RESPONDING), GET_TEXT_F(MSG_DESC_COMMUNICATION_ERROR), GET_TEXT_F(MSG_DESC_FILAMENT_ALREADY_LOADED), @@ -330,7 +335,8 @@ static const uint8_t errorButtons[] PROGMEM = { Btns(ButtonOperations::ResetMMU, ButtonOperations::NoOperation), // MMU_PULLEY_SELFTEST_FAILED Btns(ButtonOperations::ResetMMU, ButtonOperations::NoOperation), // MMU_SELECTOR_SELFTEST_FAILED Btns(ButtonOperations::ResetMMU, ButtonOperations::NoOperation), // MMU_IDLER_SELFTEST_FAILED - Btns(ButtonOperations::ResetMMU, ButtonOperations::NoOperation), // MMU_MCU_ERROR + Btns(ButtonOperations::ResetMMU, ButtonOperations::NoOperation), // MMU_MCU_POWER_ERROR + Btns(ButtonOperations::ResetMMU, ButtonOperations::NoOperation), // MMU_MCU_UNDERVOLTAGE_VCC Btns(ButtonOperations::ResetMMU, ButtonOperations::DisableMMU), // MMU_NOT_RESPONDING Btns(ButtonOperations::ResetMMU, ButtonOperations::DisableMMU), // COMMUNICATION_ERROR diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index a9067942de..c012d5e043 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -1040,7 +1040,8 @@ namespace LanguageNarrow_en { LSTR MSG_TITLE_TMC_UNDERVOLTAGE_ERROR = _UxGT("TMC UNDERVOLTAGE ERR"); LSTR MSG_TITLE_TMC_DRIVER_SHORTED = _UxGT("TMC DRIVER SHORTED"); LSTR MSG_TITLE_SELFTEST_FAILED = _UxGT("MMU SELFTEST FAILED"); - LSTR MSG_TITLE_MMU_MCU_ERROR = _UxGT("MMU MCU ERROR"); + LSTR MSG_TITLE_MMU_MCU_POWER_ERROR = _UxGT("MMU MCU ERROR"); + LSTR MSG_TITLE_MMU_MCU_UNDERVOLTAGE_VCC = _UxGT("MMU MCU UNDERPOWER"); LSTR MSG_TITLE_MMU_NOT_RESPONDING = _UxGT("MMU NOT RESPONDING"); LSTR MSG_TITLE_COMMUNICATION_ERROR = _UxGT("COMMUNICATION ERROR"); LSTR MSG_TITLE_FILAMENT_ALREADY_LOADED = _UxGT("FIL. ALREADY LOADED"); @@ -1065,6 +1066,8 @@ namespace LanguageNarrow_en { LSTR MSG_DESC_CANNOT_MOVE = _UxGT("Can't move Selector or Idler."); LSTR MSG_DESC_IDLER_CANNOT_HOME = _UxGT("The Idler cannot home properly. Check for anything blocking its movement."); LSTR MSG_DESC_TMC = _UxGT("More details online."); + LSTR MSG_DESC_MMU_MCU_POWER_ERROR = _UxGT("MMU detected a power-related issue. Check the wiring and connectors. If the issue persists, contact support."); + LSTR MSG_DESC_MMU_MCU_UNDERVOLTAGE_VCC = _UxGT("MMU MCU detected a 5V undervoltage. There might be an issue with the electronics. Check the wiring and connectors"); LSTR MSG_DESC_MMU_NOT_RESPONDING = _UxGT("MMU not responding. Check the wiring and connectors."); LSTR MSG_DESC_COMMUNICATION_ERROR = _UxGT("MMU not responding correctly. Check the wiring and connectors."); LSTR MSG_DESC_FILAMENT_ALREADY_LOADED = _UxGT("Cannot perform the action, filament is already loaded. Unload it first."); From 6729da615b2b3f4f407a30131fb60a9dc6591c23 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Mon, 3 Mar 2025 01:23:52 -0500 Subject: [PATCH 02/14] fix error, update additional code file --- Marlin/src/feature/mmu3/mmu3_error_converter.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Marlin/src/feature/mmu3/mmu3_error_converter.cpp b/Marlin/src/feature/mmu3/mmu3_error_converter.cpp index d7fc651fbd..4c571e8f57 100644 --- a/Marlin/src/feature/mmu3/mmu3_error_converter.cpp +++ b/Marlin/src/feature/mmu3/mmu3_error_converter.cpp @@ -125,8 +125,10 @@ namespace MMU3 { return FindErrorIndex(ERR_SYSTEM_FW_RUNTIME_ERROR); case ErrorCode::FINDA_VS_EEPROM_DISREPANCY: return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY); + case ErrorCode::MCU_POWER_ERROR: + return FindErrorIndex(ERR_ELECTRICAL_MMU_MCU_POWER_ERROR); case ErrorCode::MCU_UNDERVOLTAGE_VCC: - return FindErrorIndex(ERR_ELECTRICAL_MMU_MCU_ERROR); + return FindErrorIndex(ERR_ELECTRICAL_MMU_MCU_UNDERVOLTAGE_VCC); default: break; } @@ -314,7 +316,8 @@ namespace MMU3 { case ERR_SYSTEM_QUEUE_FULL: case ERR_SYSTEM_FW_RUNTIME_ERROR: - case ERR_ELECTRICAL_MMU_MCU_ERROR: + case ERR_ELECTRICAL_MMU_MCU_POWER_ERROR: + case ERR_ELECTRICAL_MMU_MCU_UNDERVOLTAGE_VCC: switch (buttonSelectedOperation) { case ButtonOperations::ResetMMU: // "Reset MMU" return Buttons::ResetMMU; From ae8744695438dfc6af0a63e29c1fc623d4c48db2 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Mon, 3 Mar 2025 03:24:00 -0500 Subject: [PATCH 03/14] fix to enum class ErrorCode --- Marlin/src/feature/mmu3/mmu_hw/error_codes.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Marlin/src/feature/mmu3/mmu_hw/error_codes.h b/Marlin/src/feature/mmu3/mmu_hw/error_codes.h index cc583efbe6..69f847293c 100644 --- a/Marlin/src/feature/mmu3/mmu_hw/error_codes.h +++ b/Marlin/src/feature/mmu3/mmu_hw/error_codes.h @@ -84,6 +84,7 @@ enum class ErrorCode : uint_fast16_t { FILAMENT_EJECTED = 0x800C, //!< Filament was ejected, waiting for user input - technically, this is not an error MCU_UNDERVOLTAGE_VCC = 0x800D, //!< MCU VCC rail undervoltage. + MCU_POWER_ERROR = MCU_UNDERVOLTAGE_VCC, //!< MCU power-related issue - the MCU is not powered properly. Check the wiring and connectors FILAMENT_CHANGE = 0x8029, //!< E32809 internal error of the printer - try-load-unload sequence detected missing filament -> failed load into the nozzle LOAD_TO_EXTRUDER_FAILED = 0x802A, //!< E32810 internal error of the printer - try-load-unload sequence detected missing filament -> failed load into the nozzle From df783c82505d6fc9f527303ad3aea5ef00331b19 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Mon, 3 Mar 2025 04:18:18 -0500 Subject: [PATCH 04/14] fix enum ErrorCode - arbitrary = to, spacing, typo --- Marlin/src/feature/mmu3/mmu_hw/buttons.h | 2 +- Marlin/src/feature/mmu3/mmu_hw/check-pce.sh | 24 ++++++++++---------- Marlin/src/feature/mmu3/mmu_hw/error_codes.h | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Marlin/src/feature/mmu3/mmu_hw/buttons.h b/Marlin/src/feature/mmu3/mmu_hw/buttons.h index 2b35d6339c..fb365c4bc5 100644 --- a/Marlin/src/feature/mmu3/mmu_hw/buttons.h +++ b/Marlin/src/feature/mmu3/mmu_hw/buttons.h @@ -46,7 +46,7 @@ enum class ButtonOperations : uint8_t { Tune = 7, StopPrint = 8, DisableMMU = 9, - MoreInfo = 10, + MoreInfo = 10 }; // Button codes + extended actions performed on the printer's side diff --git a/Marlin/src/feature/mmu3/mmu_hw/check-pce.sh b/Marlin/src/feature/mmu3/mmu_hw/check-pce.sh index 0fa6ef3fa5..06d5d4a383 100755 --- a/Marlin/src/feature/mmu3/mmu_hw/check-pce.sh +++ b/Marlin/src/feature/mmu3/mmu_hw/check-pce.sh @@ -6,11 +6,11 @@ wget https://raw.githubusercontent.com/prusa3d/Prusa-Error-Codes/master/yaml/mmu oifs="$IFS" ## save original IFS IFS=$'\n' ## set IFS to break on newline -codes=($(cat error-codes.yaml |grep "code:" |cut -d '"' -f2)) -titles=($(cat error-codes.yaml |grep 'title:' |cut -d '"' -f2)) -texts=($(cat error-codes.yaml |grep "text:" |cut -d '"' -f2)) -actions=($(cat error-codes.yaml |grep "action:" |cut -d ':' -f2)) -ids=($(cat error-codes.yaml |grep "id:" |cut -d '"' -f2)) +codes=($(cat error-codes.yaml | grep "code:" | cut -d '"' -f2)) +titles=($(cat error-codes.yaml | grep "title:" | cut -d '"' -f2)) +texts=($(cat error-codes.yaml | grep "text:" | cut -d '"' -f2)) +actions=($(cat error-codes.yaml | grep "action:" | cut -d ':' -f2)) +ids=($(cat error-codes.yaml | grep "id:" | cut -d '"' -f2)) IFS="$oifs" ## restore original IFS filename=errors_list.h @@ -18,13 +18,13 @@ filename=errors_list.h clear for ((i = 0; i < ${#codes[@]}; i++)) do code=${codes[i]} - id=$(cat $filename |grep "${code#04*}" | cut -d "=" -f1 | cut -d "_" -f3- |cut -d " " -f1) - title=$(cat $filename |grep "${id}" |grep --max-count=1 "MSG_TITLE" |cut -d '"' -f2) - text=$(cat $filename |grep "${id}" |grep --max-count=1 "MSG_DESC" |cut -d '"' -f2) - action1=$(cat $filename |grep "),//$id"| cut -d "," -f1) - action2=$(cat $filename |grep "),//$id"| cut -d "," -f2) - action1=$(echo $action1 | cut -d ":" -f2- |cut -d ":" -f2) - action2=$(echo $action2 | cut -d ":" -f2- |cut -d ":" -f2 |cut -d ")" -f1) + id=$(cat $filename | grep "${code#04*}" | cut -d "=" -f1 | cut -d "_" -f3- | cut -d " " -f1) + title=$(cat $filename | grep "${id}" | grep --max-count=1 "MSG_TITLE" | cut -d '"' -f2) + text=$(cat $filename | grep "${id}" | grep --max-count=1 "MSG_DESC" | cut -d '"' -f2) + action1=$(cat $filename | grep "),//$id"| cut -d "," -f1) + action2=$(cat $filename | grep "),//$id"| cut -d "," -f2) + action1=$(echo $action1 | cut -d ":" -f2- | cut -d ":" -f2) + action2=$(echo $action2 | cut -d ":" -f2- | cut -d ":" -f2 | cut -d ")" -f1) if [ "$action2" == "NoOperation" ]; then action=" [$action1]" else diff --git a/Marlin/src/feature/mmu3/mmu_hw/error_codes.h b/Marlin/src/feature/mmu3/mmu_hw/error_codes.h index 69f847293c..ae8902fea6 100644 --- a/Marlin/src/feature/mmu3/mmu_hw/error_codes.h +++ b/Marlin/src/feature/mmu3/mmu_hw/error_codes.h @@ -84,7 +84,7 @@ enum class ErrorCode : uint_fast16_t { FILAMENT_EJECTED = 0x800C, //!< Filament was ejected, waiting for user input - technically, this is not an error MCU_UNDERVOLTAGE_VCC = 0x800D, //!< MCU VCC rail undervoltage. - MCU_POWER_ERROR = MCU_UNDERVOLTAGE_VCC, //!< MCU power-related issue - the MCU is not powered properly. Check the wiring and connectors + MCU_POWER_ERROR = 0x800E, //!< MCU power-related issue - the MCU is not powered properly. Check the wiring and connectors FILAMENT_CHANGE = 0x8029, //!< E32809 internal error of the printer - try-load-unload sequence detected missing filament -> failed load into the nozzle LOAD_TO_EXTRUDER_FAILED = 0x802A, //!< E32810 internal error of the printer - try-load-unload sequence detected missing filament -> failed load into the nozzle From f255ef6f5005e1826bf1820c94f31bc6e60dea82 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Sat, 15 Mar 2025 04:37:13 -0400 Subject: [PATCH 05/14] Update MMU3 files --- Marlin/src/feature/mmu3/mmu3.cpp | 6 +- .../src/feature/mmu3/mmu3_error_converter.cpp | 18 +--- Marlin/src/feature/mmu3/mmu3_reporting.h | 16 ++-- Marlin/src/feature/mmu3/mmu_hw/buttons.h | 13 +-- Marlin/src/feature/mmu3/mmu_hw/error_codes.h | 2 - Marlin/src/feature/mmu3/mmu_hw/errors_list.h | 85 ++++++++++--------- .../src/feature/mmu3/mmu_hw/progress_codes.h | 62 +++++++------- Marlin/src/feature/mmu3/mmu_hw/registers.h | 68 +++++++-------- Marlin/src/lcd/language/language_en.h | 4 +- 9 files changed, 132 insertions(+), 142 deletions(-) diff --git a/Marlin/src/feature/mmu3/mmu3.cpp b/Marlin/src/feature/mmu3/mmu3.cpp index 27a1dc05c9..36e2296116 100644 --- a/Marlin/src/feature/mmu3/mmu3.cpp +++ b/Marlin/src/feature/mmu3/mmu3.cpp @@ -814,7 +814,7 @@ namespace MMU3 { default: break; } break; - case Buttons::TuneMMU: + case Buttons::TuneMMU: // TODO: May go unutilized, but it's here for now tune(); break; case Buttons::Load: @@ -1049,7 +1049,7 @@ namespace MMU3 { lastErrorSource = res; LogErrorEvent(PrusaErrorTitle(PrusaErrorCodeIndex(ec))); - if (ec != ErrorCode::OK && ec != ErrorCode::FILAMENT_EJECTED && ec != ErrorCode::FILAMENT_CHANGE) { + if (ec != ErrorCode::OK && ec != ErrorCode::FILAMENT_EJECTED) { IncrementMMUFails(); // Check if it is a "power" failure. TMC-related errors are considered power failures. @@ -1146,7 +1146,7 @@ namespace MMU3 { if (loadFilamentStarted) { switch (WhereIsFilament()) { case FilamentState::AT_FSENSOR: - // fsensor triggered, finish FeedingToExtruder state + // fsensor triggered, finish FeedingToBondtech state loadFilamentStarted = false; // Abort any excess E-move from the planner queue diff --git a/Marlin/src/feature/mmu3/mmu3_error_converter.cpp b/Marlin/src/feature/mmu3/mmu3_error_converter.cpp index 4c571e8f57..f55d305719 100644 --- a/Marlin/src/feature/mmu3/mmu3_error_converter.cpp +++ b/Marlin/src/feature/mmu3/mmu3_error_converter.cpp @@ -92,8 +92,6 @@ namespace MMU3 { return FindErrorIndex(ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED); case ErrorCode::FILAMENT_EJECTED: return FindErrorIndex(ERR_SYSTEM_FILAMENT_EJECTED); - case ErrorCode::FILAMENT_CHANGE: - return FindErrorIndex(ERR_SYSTEM_FILAMENT_CHANGE); case ErrorCode::STALLED_PULLEY: case ErrorCode::MOVE_PULLEY_FAILED: @@ -125,8 +123,6 @@ namespace MMU3 { return FindErrorIndex(ERR_SYSTEM_FW_RUNTIME_ERROR); case ErrorCode::FINDA_VS_EEPROM_DISREPANCY: return FindErrorIndex(ERR_SYSTEM_UNLOAD_MANUALLY); - case ErrorCode::MCU_POWER_ERROR: - return FindErrorIndex(ERR_ELECTRICAL_MMU_MCU_POWER_ERROR); case ErrorCode::MCU_UNDERVOLTAGE_VCC: return FindErrorIndex(ERR_ELECTRICAL_MMU_MCU_UNDERVOLTAGE_VCC); default: break; @@ -250,8 +246,8 @@ namespace MMU3 { case ERR_MECHANICAL_IDLER_CANNOT_HOME: switch (buttonSelectedOperation) { // may be allow move selector right and left in the future - case ButtonOperations::Tune: // Tune Stallguard threshold - return Buttons::TuneMMU; + //case ButtonOperations::Tune: // Tune Stallguard threshold + // return Buttons::TuneMMU; // Goes unused, possibility for future use case ButtonOperations::Retry: // "Repeat action" return Buttons::Middle; default: @@ -267,16 +263,6 @@ namespace MMU3 { break; } break; - case ERR_SYSTEM_FILAMENT_CHANGE: - switch (buttonSelectedOperation) { - case ButtonOperations::Load: - return Buttons::Load; - case ButtonOperations::Eject: - return Buttons::Eject; - default: - break; - } - break; case ERR_TEMPERATURE_WARNING_TMC_PULLEY_TOO_HOT: case ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT: case ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT: diff --git a/Marlin/src/feature/mmu3/mmu3_reporting.h b/Marlin/src/feature/mmu3/mmu3_reporting.h index d3e8db9c5e..4ce3129d44 100644 --- a/Marlin/src/feature/mmu3/mmu3_reporting.h +++ b/Marlin/src/feature/mmu3/mmu3_reporting.h @@ -34,14 +34,14 @@ namespace MMU3 { enum CommandInProgress : uint8_t { - NoCommand = 0, - CutFilament = 'K', - EjectFilament = 'E', - Homing = 'H', - LoadFilament = 'L', - Reset = 'X', - ToolChange = 'T', - UnloadFilament = 'U', + NoCommand = 0, + CutFilament = 'K', + EjectFilament = 'E', + Homing = 'H', + LoadFilament = 'L', + Reset = 'X', + ToolChange = 'T', + UnloadFilament = 'U' }; /** diff --git a/Marlin/src/feature/mmu3/mmu_hw/buttons.h b/Marlin/src/feature/mmu3/mmu_hw/buttons.h index fb365c4bc5..f00e00f353 100644 --- a/Marlin/src/feature/mmu3/mmu_hw/buttons.h +++ b/Marlin/src/feature/mmu3/mmu_hw/buttons.h @@ -41,12 +41,13 @@ enum class ButtonOperations : uint8_t { Continue = 2, ResetMMU = 3, Unload = 4, - Load = 5, - Eject = 6, - Tune = 7, - StopPrint = 8, - DisableMMU = 9, - MoreInfo = 10 + //Load = 5, + //Eject = 6, + //Tune = 7, + StopPrint = 5, + DisableMMU = 6, + Skip = 7 + //MoreInfo = 8 }; // Button codes + extended actions performed on the printer's side diff --git a/Marlin/src/feature/mmu3/mmu_hw/error_codes.h b/Marlin/src/feature/mmu3/mmu_hw/error_codes.h index ae8902fea6..715607b27b 100644 --- a/Marlin/src/feature/mmu3/mmu_hw/error_codes.h +++ b/Marlin/src/feature/mmu3/mmu_hw/error_codes.h @@ -84,9 +84,7 @@ enum class ErrorCode : uint_fast16_t { FILAMENT_EJECTED = 0x800C, //!< Filament was ejected, waiting for user input - technically, this is not an error MCU_UNDERVOLTAGE_VCC = 0x800D, //!< MCU VCC rail undervoltage. - MCU_POWER_ERROR = 0x800E, //!< MCU power-related issue - the MCU is not powered properly. Check the wiring and connectors - FILAMENT_CHANGE = 0x8029, //!< E32809 internal error of the printer - try-load-unload sequence detected missing filament -> failed load into the nozzle LOAD_TO_EXTRUDER_FAILED = 0x802A, //!< E32810 internal error of the printer - try-load-unload sequence detected missing filament -> failed load into the nozzle QUEUE_FULL = 0x802B, //!< E32811 internal logic error - attempt to move with a full queue VERSION_MISMATCH = 0x802C, //!< E32812 internal error of the printer - incompatible version of the MMU FW diff --git a/Marlin/src/feature/mmu3/mmu_hw/errors_list.h b/Marlin/src/feature/mmu3/mmu_hw/errors_list.h index c9e8282099..d333e21699 100644 --- a/Marlin/src/feature/mmu3/mmu_hw/errors_list.h +++ b/Marlin/src/feature/mmu3/mmu_hw/errors_list.h @@ -28,7 +28,7 @@ /** * Extracted from Prusa-Error-Codes repo * Subject to automation and optimization - * BEWARE - This file should only be included by mmu2_error_converter.cpp! + * BEWARE: This file should only be included by mmu3_error_converter.cpp! */ #include "inttypes.h" #include "../../../core/language.h" @@ -110,15 +110,16 @@ typedef enum : uint16_t { ERR_SYSTEM_FW_RUNTIME_ERROR = 505, ERR_SYSTEM_UNLOAD_MANUALLY = 506, ERR_SYSTEM_FILAMENT_EJECTED = 507, - ERR_SYSTEM_FILAMENT_CHANGE = 508, ERR_OTHER_UNKNOWN_ERROR = 900 } err_num_t; -// Avr gcc has serious trouble understanding static data structures in PROGMEM -// and inadvertedly falls back to copying the whole structure into RAM (which is obviously unwanted). -// But since this file ought to be generated in the future from yaml prescription, -// it really makes no difference if there are "nice" data structures or plain arrays. +/** + * Avr gcc has serious trouble understanding static data structures in PROGMEM + * and inadvertedly falls back to copying the whole structure into RAM (which is obviously unwanted). + * But since this file ought to be generated in the future from yaml prescription, + * it really makes no difference if there are "nice" data structures or plain arrays. + */ static const constexpr err_num_t errorCodes[] PROGMEM = { ERR_MECHANICAL_FINDA_DIDNT_TRIGGER, ERR_MECHANICAL_FINDA_FILAMENT_STUCK, @@ -164,7 +165,6 @@ static const constexpr err_num_t errorCodes[] PROGMEM = { ERR_SYSTEM_FW_RUNTIME_ERROR, ERR_SYSTEM_UNLOAD_MANUALLY, ERR_SYSTEM_FILAMENT_EJECTED, - ERR_SYSTEM_FILAMENT_CHANGE, ERR_OTHER_UNKNOWN_ERROR }; @@ -181,9 +181,9 @@ FSTR_P const errorTitles[] PROGMEM = { GET_TEXT_F(MSG_TITLE_SELECTOR_CANNOT_MOVE), GET_TEXT_F(MSG_TITLE_IDLER_CANNOT_HOME), GET_TEXT_F(MSG_TITLE_IDLER_CANNOT_MOVE), - GET_TEXT_F(MSG_TITLE_TMC_WARNING_TMC_TOO_HOT), - GET_TEXT_F(MSG_TITLE_TMC_WARNING_TMC_TOO_HOT), - GET_TEXT_F(MSG_TITLE_TMC_WARNING_TMC_TOO_HOT), + GET_TEXT_F(MSG_TITLE_WARNING_TMC_TOO_HOT), + GET_TEXT_F(MSG_TITLE_WARNING_TMC_TOO_HOT), + GET_TEXT_F(MSG_TITLE_WARNING_TMC_TOO_HOT), GET_TEXT_F(MSG_TITLE_TMC_OVERHEAT_ERROR), GET_TEXT_F(MSG_TITLE_TMC_OVERHEAT_ERROR), GET_TEXT_F(MSG_TITLE_TMC_OVERHEAT_ERROR), @@ -213,7 +213,6 @@ FSTR_P const errorTitles[] PROGMEM = { GET_TEXT_F(MSG_TITLE_FW_RUNTIME_ERROR), GET_TEXT_F(MSG_TITLE_UNLOAD_MANUALLY), GET_TEXT_F(MSG_TITLE_FILAMENT_EJECTED), - GET_TEXT_F(MSG_TITLE_FILAMENT_CHANGE), GET_TEXT_F(MSG_TITLE_UNKNOWN_ERROR) }; @@ -265,18 +264,19 @@ FSTR_P const errorDescs[] PROGMEM = { GET_TEXT_F(MSG_DESC_FW_RUNTIME_ERROR), GET_TEXT_F(MSG_DESC_UNLOAD_MANUALLY), GET_TEXT_F(MSG_DESC_FILAMENT_EJECTED), - GET_TEXT_F(MSG_DESC_FILAMENT_CHANGE), GET_TEXT_F(MSG_DESC_UNKNOWN_ERROR) }; -// We have max 3 buttons/operations to select from. -// One of them is "More" to show the explanation text normally hidden in the next screens. -// It is displayed with W (Double down arrow, special character from CGRAM) -// 01234567890123456789 -// >bttxt >bttxt >W -// Therefore at least some of the buttons, which can occur on the screen together, can only be 8-chars long max @@TODO. -// Beware - we only have space for 2 buttons on the LCD while the MMU has 3 buttons -// -> the left button on the MMU is not used/rendered on the LCD (it is also almost unused on the MMU side) +/** + * We have max 3 buttons/operations to select from. + * One of them is "More" to show the explanation text normally hidden in the next screens. + * It is displayed with W (Double down arrow, special character from CGRAM) + * 01234567890123456789 + * >bttxt >bttxt >W + * Therefore at least some of the buttons, which can occur on the screen together, can only be 8-chars long max @@TODO. + * BEWARE: We only have space for 2 buttons on the LCD while the MMU has 3 buttons + * -> the left button on the MMU is not used/rendered on the LCD (it is also almost unused on the MMU side) + */ // Used to parse the buttons from Btns(). FSTR_P const btnOperation[] PROGMEM = { @@ -284,34 +284,38 @@ FSTR_P const btnOperation[] PROGMEM = { GET_TEXT_F(MSG_DONE), GET_TEXT_F(MSG_BTN_RESET_MMU), GET_TEXT_F(MSG_BTN_UNLOAD), - GET_TEXT_F(MSG_BTN_LOAD), - GET_TEXT_F(MSG_BTN_EJECT), - GET_TEXT_F(MSG_TUNE), + //GET_TEXT_F(MSG_BTN_LOAD), + //GET_TEXT_F(MSG_BTN_EJECT), + //GET_TEXT_F(MSG_TUNE), GET_TEXT_F(MSG_BTN_STOP), - GET_TEXT_F(MSG_BTN_DISABLE_MMU) + GET_TEXT_F(MSG_BTN_DISABLE_MMU), + GET_TEXT_F(MSG_BUTTON_SKIP) + //GET_TEXT_F(MSG_BTN_MORE) }; -// We have 8 different operations/buttons at this time, so we need at least 4 bits to encode each. -// Since one of the buttons is always "More", we can skip that one. -// Therefore we need just 1 byte to describe the necessary buttons for each screen. +/** + * We have 8 different operations/buttons at this time, so we need at least 4 bits to encode each. + * Since one of the buttons is always "More", we can skip that one. + * Therefore we need just 1 byte to describe the necessary buttons for each screen. + */ uint8_t constexpr Btns(ButtonOperations bMiddle, ButtonOperations bRight) { return ((uint8_t)bRight) << 4 | ((uint8_t)bMiddle); } static const uint8_t errorButtons[] PROGMEM = { - Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // FINDA_DIDNT_TRIGGER - Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // FINDA_FILAMENT_STUCK - Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // FSENSOR_DIDNT_TRIGGER - Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // FSENSOR_FILAMENT_STUCK + Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // FINDA_DIDNT_TRIGGER + Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // FINDA_FILAMENT_STUCK + Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // FSENSOR_DIDNT_TRIGGER + Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // FSENSOR_FILAMENT_STUCK - Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // PULLEY_CANNOT_MOVE - Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // FSENSOR_TOO_EARLY - Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // INSPECT_FINDA + Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // PULLEY_CANNOT_MOVE + Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // FSENSOR_TOO_EARLY + Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // INSPECT_FINDA Btns(ButtonOperations::Continue, ButtonOperations::NoOperation), // LOAD_TO_EXTRUDER_FAILED - Btns(ButtonOperations::Retry, ButtonOperations::Tune), // SELECTOR_CANNOT_HOME - Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // SELECTOR_CANNOT_MOVE - Btns(ButtonOperations::Retry, ButtonOperations::Tune), // IDLER_CANNOT_HOME - Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // IDLER_CANNOT_MOVE + Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // SELECTOR_CANNOT_HOME + Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // SELECTOR_CANNOT_MOVE + Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // IDLER_CANNOT_HOME + Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // IDLER_CANNOT_MOVE Btns(ButtonOperations::Continue, ButtonOperations::ResetMMU), // WARNING_TMC_PULLEY_TOO_HOT Btns(ButtonOperations::Continue, ButtonOperations::ResetMMU), // WARNING_TMC_SELECTOR_TOO_HOT @@ -340,14 +344,13 @@ static const uint8_t errorButtons[] PROGMEM = { Btns(ButtonOperations::ResetMMU, ButtonOperations::DisableMMU), // MMU_NOT_RESPONDING Btns(ButtonOperations::ResetMMU, ButtonOperations::DisableMMU), // COMMUNICATION_ERROR - Btns(ButtonOperations::Unload, ButtonOperations::Continue), // FILAMENT_ALREADY_LOADED + Btns(ButtonOperations::Unload, ButtonOperations::Continue), // FILAMENT_ALREADY_LOADED Btns(ButtonOperations::StopPrint, ButtonOperations::ResetMMU), // INVALID_TOOL Btns(ButtonOperations::ResetMMU, ButtonOperations::NoOperation), // QUEUE_FULL Btns(ButtonOperations::ResetMMU, ButtonOperations::DisableMMU), // FW_UPDATE_NEEDED Btns(ButtonOperations::ResetMMU, ButtonOperations::NoOperation), // FW_RUNTIME_ERROR - Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // UNLOAD_MANUALLY + Btns(ButtonOperations::Retry, ButtonOperations::NoOperation), // UNLOAD_MANUALLY Btns(ButtonOperations::Continue, ButtonOperations::NoOperation), // FILAMENT_EJECTED - Btns(ButtonOperations::Eject, ButtonOperations::Load), // FILAMENT_CHANGE Btns(ButtonOperations::ResetMMU, ButtonOperations::NoOperation), // UNKOWN_ERROR }; diff --git a/Marlin/src/feature/mmu3/mmu_hw/progress_codes.h b/Marlin/src/feature/mmu3/mmu_hw/progress_codes.h index 16e63a8564..70ecde4d56 100644 --- a/Marlin/src/feature/mmu3/mmu_hw/progress_codes.h +++ b/Marlin/src/feature/mmu3/mmu_hw/progress_codes.h @@ -33,40 +33,44 @@ * codes are extracted to one place. */ enum class ProgressCode : uint_fast8_t { - OK = 0, //!< finished ok + OK = 0, //!< finished ok - EngagingIdler, // P1 - DisengagingIdler, // P2 - UnloadingToFinda, // P3 - UnloadingToPulley, // P4 - FeedingToFinda, // P5 - FeedingToExtruder, // P6 - FeedingToNozzle, // P7 - AvoidingGrind, // P8 - FinishingMoves, // P9 + EngagingIdler, // P1 + DisengagingIdler, // P2 + UnloadingToFinda, // P3 + UnloadingToPulley, // P4 + FeedingToFinda, // P5 + FeedingToBondtech, // P6 + FeedingToNozzle, // P7 + AvoidingGrind, // P8 + FinishingMoves, // P9 - ERRDisengagingIdler, // P10 - ERREngagingIdler, // P11 - ERRWaitingForUser, // P12 - ERRInternal, // P13 - ERRHelpingFilament, // P14 - ERRTMCFailed, // P15 + ERRDisengagingIdler, // P10 + ERREngagingIdler, // P11 - unused: intended for SlowLoad which is removed now + ERRWaitingForUser, // P12 + ERRInternal, // P13 + ERRHelpingFilament, // P14 - unused: intended for SlowLoad which is removed now + ERRTMCFailed, // P15 - UnloadingFilament, // P16 - LoadingFilament, // P17 + UnloadingFilament, // P16 + LoadingFilament, // P17 SelectingFilamentSlot, // P18 - PreparingBlade, // P19 - PushingFilament, // P20 - PerformingCut, // P21 - ReturningSelector, // P22 - ParkingSelector, // P23 - EjectingFilament, // P24 - RetractingFromFinda, // P25 + PreparingBlade, // P19 + PushingFilament, // P20 + PerformingCut, // P21 + ReturningSelector, // P22 + ParkingSelector, // P23 + EjectingFilament, // P24 + RetractingFromFinda, // P25 - Homing, // P26 - MovingSelector, // P27 + Homing, // P26 + MovingSelector, // P27 - FeedingToFSensor, // P28 + FeedingToFSensor, // P28 - Empty = 0xFF // dummy empty state + // Keep as the last item (except for Empty) + // Used for extending the progress codes on the printer side + _cnt, + + Empty = 0xFF // dummy empty state }; diff --git a/Marlin/src/feature/mmu3/mmu_hw/registers.h b/Marlin/src/feature/mmu3/mmu_hw/registers.h index 3e423c479d..ba984689b8 100644 --- a/Marlin/src/feature/mmu3/mmu_hw/registers.h +++ b/Marlin/src/feature/mmu3/mmu_hw/registers.h @@ -31,40 +31,40 @@ namespace MMU3 { // Register map for MMU enum class Register : uint8_t { - Project_Major = 0x00, - Project_Minor = 0x01, - Project_Revision = 0x02, - Project_Build_Number = 0x03, - MMU_Errors = 0x04, - Current_Progress_Code = 0x05, - Current_Error_Code = 0x06, - Filament_State = 0x07, - FINDA_State = 0x08, - FSensor_State = 0x09, - Motor_Mode = 0x0A, - Extra_Load_Distance = 0x0B, - FSensor_Unload_Check_Distance = 0xC, - Pulley_Unload_Feedrate = 0x0D, - Pulley_Acceleration = 0x0E, - Selector_Acceleration = 0x0F, - Idler_Acceleration = 0x10, - Pulley_Load_Feedrate = 0x11, - Selector_Nominal_Feedrate = 0x12, - Idler_Nominal_Feedrate = 0x13, - Pulley_Slow_Feedrate = 0x14, - Selector_Homing_Feedrate = 0x15, - Idler_Homing_Feedrate = 0x16, - Pulley_sg_thrs_R = 0x17, - Selector_sg_thrs_R = 0x18, - Idler_sg_thrs_R = 0x19, - Get_Pulley_Position = 0x1A, - Set_Get_Selector_Slot = 0x1B, - Set_Get_Idler_Slot = 0x1C, - Set_Get_Selector_Cut_iRun = 0x1D, - Set_Get_Pulley_iRun = 0x1E, - Set_Get_Selector_iRun = 0x1F, - Set_Get_Idler_iRun = 0x20, - Reserved = 0x21, + Project_Major = 0x00, + Project_Minor = 0x01, + Project_Revision = 0x02, + Project_Build_Number = 0x03, + MMU_Errors = 0x04, + Current_Progress_Code = 0x05, + Current_Error_Code = 0x06, + Filament_State = 0x07, + FINDA_State = 0x08, + FSensor_State = 0x09, + Motor_Mode = 0x0A, + Extra_Load_Distance = 0x0B, + FSensor_Unload_Check_Distance = 0x0C, + Pulley_Unload_Feedrate = 0x0D, + Pulley_Acceleration = 0x0E, + Selector_Acceleration = 0x0F, + Idler_Acceleration = 0x10, + Pulley_Load_Feedrate = 0x11, + Selector_Nominal_Feedrate = 0x12, + Idler_Nominal_Feedrate = 0x13, + Pulley_Slow_Feedrate = 0x14, + Selector_Homing_Feedrate = 0x15, + Idler_Homing_Feedrate = 0x16, + Pulley_sg_thrs_R = 0x17, + Selector_sg_thrs_R = 0x18, + Idler_sg_thrs_R = 0x19, + Get_Pulley_Position = 0x1A, + Set_Get_Selector_Slot = 0x1B, + Set_Get_Idler_Slot = 0x1C, + Set_Get_Selector_Cut_iRun = 0x1D, + Set_Get_Pulley_iRun = 0x1E, + Set_Get_Selector_iRun = 0x1F, + Set_Get_Idler_iRun = 0x20, + Reserved = 0x21 }; } // MMU3 diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index c012d5e043..e3dc8613b5 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -1033,7 +1033,7 @@ namespace LanguageNarrow_en { LSTR MSG_TITLE_SELECTOR_CANNOT_HOME = _UxGT("SELECTOR CANNOT HOME"); LSTR MSG_TITLE_IDLER_CANNOT_MOVE = _UxGT("IDLER CANNOT MOVE"); LSTR MSG_TITLE_IDLER_CANNOT_HOME = _UxGT("IDLER CANNOT HOME"); - LSTR MSG_TITLE_TMC_WARNING_TMC_TOO_HOT = _UxGT("WARNING TMC TOO HOT"); + LSTR MSG_TITLE_WARNING_TMC_TOO_HOT = _UxGT("WARNING TMC TOO HOT"); LSTR MSG_TITLE_TMC_OVERHEAT_ERROR = _UxGT("TMC OVERHEAT ERROR"); LSTR MSG_TITLE_TMC_DRIVER_ERROR = _UxGT("TMC DRIVER ERROR"); LSTR MSG_TITLE_TMC_DRIVER_RESET = _UxGT("TMC DRIVER RESET"); @@ -1051,7 +1051,6 @@ namespace LanguageNarrow_en { LSTR MSG_TITLE_FW_RUNTIME_ERROR = _UxGT("FW RUNTIME ERROR"); LSTR MSG_TITLE_UNLOAD_MANUALLY = _UxGT("UNLOAD MANUALLY"); LSTR MSG_TITLE_FILAMENT_EJECTED = _UxGT("FILAMENT EJECTED"); - LSTR MSG_TITLE_FILAMENT_CHANGE = _UxGT("FILAMENT CHANGE"); LSTR MSG_TITLE_UNKNOWN_ERROR = _UxGT("UNKNOWN ERROR"); LSTR MSG_DESC_FINDA_DIDNT_TRIGGER = _UxGT("FINDA didn't trigger while loading the filament. Ensure the filament can move and FINDA works."); @@ -1076,7 +1075,6 @@ namespace LanguageNarrow_en { LSTR MSG_DESC_FW_RUNTIME_ERROR = _UxGT("Internal runtime error. Try resetting the MMU or updating the firmware."); LSTR MSG_DESC_UNLOAD_MANUALLY = _UxGT("Filament detected unexpectedly. Ensure no filament is loaded. Check the sensors and wiring."); LSTR MSG_DESC_FILAMENT_EJECTED = _UxGT("Remove the ejected filament from the front of the MMU."); - LSTR MSG_DESC_FILAMENT_CHANGE = _UxGT("M600 Filament Change. Load a new filament or eject the old one."); LSTR MSG_DESC_UNKNOWN_ERROR = _UxGT("Unexpected error occurred."); LSTR MSG_DESC_FW_UPDATE_NEEDED = _UxGT("MMU FW version is not supported. Update to version " STRINGIFY(mmuVersionMajor) "." STRINGIFY(mmuVersionMinor) "." STRINGIFY(mmuVersionPatch) "."); From de146d1e77f54bbe5193996e196e1216ecde9272 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Sat, 15 Mar 2025 04:54:30 -0400 Subject: [PATCH 06/14] fix no MoreInfo --- Marlin/src/feature/mmu3/mmu_hw/buttons.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/feature/mmu3/mmu_hw/buttons.h b/Marlin/src/feature/mmu3/mmu_hw/buttons.h index f00e00f353..ad7a02b0ce 100644 --- a/Marlin/src/feature/mmu3/mmu_hw/buttons.h +++ b/Marlin/src/feature/mmu3/mmu_hw/buttons.h @@ -46,8 +46,8 @@ enum class ButtonOperations : uint8_t { //Tune = 7, StopPrint = 5, DisableMMU = 6, - Skip = 7 - //MoreInfo = 8 + Skip = 7, + MoreInfo = 8 // Not found in Prusa-Firmware-MMU }; // Button codes + extended actions performed on the printer's side From e69b793a512357ed97459aee6e48c89c3bf831d2 Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Sat, 15 Mar 2025 09:24:03 -0400 Subject: [PATCH 07/14] Draft TODO comments --- Marlin/src/feature/mmu3/mmu_hw/buttons.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/src/feature/mmu3/mmu_hw/buttons.h b/Marlin/src/feature/mmu3/mmu_hw/buttons.h index ad7a02b0ce..8a2d733812 100644 --- a/Marlin/src/feature/mmu3/mmu_hw/buttons.h +++ b/Marlin/src/feature/mmu3/mmu_hw/buttons.h @@ -41,13 +41,13 @@ enum class ButtonOperations : uint8_t { Continue = 2, ResetMMU = 3, Unload = 4, - //Load = 5, - //Eject = 6, - //Tune = 7, + //Load = 5, // + //Eject = 6, // TODO: Should these stay or go? + //Tune = 7, // StopPrint = 5, DisableMMU = 6, Skip = 7, - MoreInfo = 8 // Not found in Prusa-Firmware-MMU + MoreInfo = 8 // Not found in Prusa-Error-Codes }; // Button codes + extended actions performed on the printer's side From 69a4b909f00eb61e9b950f0ada0fd7baa3d2fccd Mon Sep 17 00:00:00 2001 From: classicrocker883 Date: Sat, 15 Mar 2025 09:54:22 -0400 Subject: [PATCH 08/14] Update SanityCheck --- Marlin/src/inc/SanityCheck.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/inc/SanityCheck.h b/Marlin/src/inc/SanityCheck.h index 1ff1e2b641..993dc10a0f 100644 --- a/Marlin/src/inc/SanityCheck.h +++ b/Marlin/src/inc/SanityCheck.h @@ -622,7 +622,7 @@ static_assert(COUNT(arm) == LOGICAL_AXES, "AXIS_RELATIVE_MODES must contain " _L #if HAS_PRUSA_MMU2 || HAS_PRUSA_MMU3 #if !HAS_EXTENDABLE_MMU && EXTRUDERS != 5 #undef SINGLENOZZLE - #error "PRUSA_MMU2(S) requires exactly 5 EXTRUDERS. Please update your Configuration." + #error "PRUSA_MMU2(S) and PRUSA_MMU3 require exactly 5 EXTRUDERS. Please update your Configuration." #elif HAS_EXTENDABLE_MMU && EXTRUDERS > 15 #error "EXTRUDERS is too large for MMU(S) emulation mode. The maximum value is 15." #elif DISABLED(NOZZLE_PARK_FEATURE) From 10356c55192b7a10b627a2e495d00391f654e487 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 20 Apr 2025 11:14:18 -0500 Subject: [PATCH 09/14] any dd extruder --- Marlin/src/feature/mmu3/mmu3.cpp | 2 +- Marlin/src/feature/mmu3/mmu_hw/progress_codes.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/feature/mmu3/mmu3.cpp b/Marlin/src/feature/mmu3/mmu3.cpp index 36e2296116..12e24355bf 100644 --- a/Marlin/src/feature/mmu3/mmu3.cpp +++ b/Marlin/src/feature/mmu3/mmu3.cpp @@ -1146,7 +1146,7 @@ namespace MMU3 { if (loadFilamentStarted) { switch (WhereIsFilament()) { case FilamentState::AT_FSENSOR: - // fsensor triggered, finish FeedingToBondtech state + // fsensor triggered, finish FeedingToExtruder state loadFilamentStarted = false; // Abort any excess E-move from the planner queue diff --git a/Marlin/src/feature/mmu3/mmu_hw/progress_codes.h b/Marlin/src/feature/mmu3/mmu_hw/progress_codes.h index 70ecde4d56..19134778f6 100644 --- a/Marlin/src/feature/mmu3/mmu_hw/progress_codes.h +++ b/Marlin/src/feature/mmu3/mmu_hw/progress_codes.h @@ -40,7 +40,7 @@ enum class ProgressCode : uint_fast8_t { UnloadingToFinda, // P3 UnloadingToPulley, // P4 FeedingToFinda, // P5 - FeedingToBondtech, // P6 + FeedingToExtruder, // P6 FeedingToNozzle, // P7 AvoidingGrind, // P8 FinishingMoves, // P9 From 5fda782edf29826b88dce9ead3adb58baefaa2d6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 20 Apr 2025 11:30:54 -0500 Subject: [PATCH 10/14] optimize? --- .../src/feature/mmu3/mmu3_error_converter.cpp | 56 +++++++++---------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/Marlin/src/feature/mmu3/mmu3_error_converter.cpp b/Marlin/src/feature/mmu3/mmu3_error_converter.cpp index f55d305719..99a4c0a903 100644 --- a/Marlin/src/feature/mmu3/mmu3_error_converter.cpp +++ b/Marlin/src/feature/mmu3/mmu3_error_converter.cpp @@ -37,7 +37,7 @@ namespace MMU3 { static ButtonOperations buttonSelectedOperation = ButtonOperations::NoOperation; - // we don't have a constexpr find_if in C++17/STL yet + // No constexpr find_if in C++17/STL so use our own template constexpr InputIt find_if_cx(InputIt first, InputIt last, UnaryPredicate p) { for (; first != last; ++first) { @@ -46,25 +46,21 @@ namespace MMU3 { return last; } - // Making a constexpr FindError should instruct the compiler to optimize the - // PrusaErrorCodeIndex in such a way that no searching will ever be done at - // runtime. A call to FindError then compiles to a single instruction even on - // the AVR. - // static constexpr uint8_t FindErrorIndex(uint16_t pec) { - static uint8_t FindErrorIndex(uint16_t pec) { - constexpr uint16_t errorCodesSize = sizeof(errorCodes) / sizeof(errorCodes[0]); + // Find the error index statically to save on runtime overhead + static constexpr uint8_t FindErrorIndex(const uint16_t pec) { + constexpr uint16_t errorCodesSize = COUNT(errorCodes); constexpr const auto *errorCodesEnd = errorCodes + errorCodesSize; - const auto *i = find_if_cx(errorCodes, errorCodesEnd, [pec](uint16_t ed) { + const auto *i = find_if_cx(errorCodes, errorCodesEnd, [pec](const uint16_t ed) { return ed == pec; }); return (i != errorCodesEnd) ? (i - errorCodes) : (errorCodesSize - 1); } - // check that the searching algoritm works - // static_assert( FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER) == 0); - // static_assert( FindErrorIndex(ERR_MECHANICAL_FINDA_FILAMENT_STUCK) == 1); - // static_assert( FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER) == 2); - // static_assert( FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK) == 3); + // Check that the search algorithm works + //static_assert( FindErrorIndex(ERR_MECHANICAL_FINDA_DIDNT_TRIGGER) == 0); + //static_assert( FindErrorIndex(ERR_MECHANICAL_FINDA_FILAMENT_STUCK) == 1); + //static_assert( FindErrorIndex(ERR_MECHANICAL_FSENSOR_DIDNT_TRIGGER) == 2); + //static_assert( FindErrorIndex(ERR_MECHANICAL_FSENSOR_FILAMENT_STUCK) == 3); constexpr ErrorCode operator&(ErrorCode a, ErrorCode b) { return (ErrorCode)((uint16_t)a & (uint16_t)b); @@ -190,7 +186,7 @@ namespace MMU3 { return FindErrorIndex(ERR_TEMPERATURE_TMC_IDLER_OVERHEAT_ERROR); } - // if nothing got caught, return a generic runtime error + // If nothing got caught, return a generic runtime error return FindErrorIndex(ERR_OTHER_UNKNOWN_ERROR); } @@ -235,7 +231,7 @@ namespace MMU3 { case ERR_MECHANICAL_PULLEY_CANNOT_MOVE: case ERR_SYSTEM_UNLOAD_MANUALLY: switch (buttonSelectedOperation) { - // may be allow move selector right and left in the future + // Maybe allow move selector right and left in the future case ButtonOperations::Retry: // "Repeat action" return Buttons::Middle; default: @@ -245,10 +241,10 @@ namespace MMU3 { case ERR_MECHANICAL_SELECTOR_CANNOT_HOME: case ERR_MECHANICAL_IDLER_CANNOT_HOME: switch (buttonSelectedOperation) { - // may be allow move selector right and left in the future - //case ButtonOperations::Tune: // Tune Stallguard threshold - // return Buttons::TuneMMU; // Goes unused, possibility for future use - case ButtonOperations::Retry: // "Repeat action" + // Maybe allow move selector right and left in the future + //case ButtonOperations::Tune: // Tune Stallguard threshold + // return Buttons::TuneMMU; // Goes unused, possibility for future use + case ButtonOperations::Retry: // "Repeat action" return Buttons::Middle; default: break; @@ -257,7 +253,7 @@ namespace MMU3 { case ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED: case ERR_SYSTEM_FILAMENT_EJECTED: switch (buttonSelectedOperation) { - case ButtonOperations::Continue: // User solved the serious mechanical problem by hand - there is no other way around + case ButtonOperations::Continue: // User solved the serious mechanical problem by hand - there is no other way around return Buttons::Middle; default: break; @@ -267,9 +263,9 @@ namespace MMU3 { case ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT: case ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT: switch (buttonSelectedOperation) { - case ButtonOperations::Continue: // "Continue" + case ButtonOperations::Continue: // "Continue" return Buttons::Left; - case ButtonOperations::ResetMMU: // "Reset MMU" + case ButtonOperations::ResetMMU: // "Reset MMU" return Buttons::ResetMMU; default: break; @@ -305,7 +301,7 @@ namespace MMU3 { case ERR_ELECTRICAL_MMU_MCU_POWER_ERROR: case ERR_ELECTRICAL_MMU_MCU_UNDERVOLTAGE_VCC: switch (buttonSelectedOperation) { - case ButtonOperations::ResetMMU: // "Reset MMU" + case ButtonOperations::ResetMMU: // "Reset MMU" return Buttons::ResetMMU; default: break; @@ -315,9 +311,9 @@ namespace MMU3 { case ERR_CONNECT_COMMUNICATION_ERROR: case ERR_SYSTEM_FW_UPDATE_NEEDED: switch (buttonSelectedOperation) { - case ButtonOperations::DisableMMU: // "Disable" + case ButtonOperations::DisableMMU: // "Disable" return Buttons::DisableMMU; - case ButtonOperations::ResetMMU: // "ResetMMU" + case ButtonOperations::ResetMMU: // "ResetMMU" return Buttons::ResetMMU; default: break; @@ -325,9 +321,9 @@ namespace MMU3 { break; case ERR_SYSTEM_FILAMENT_ALREADY_LOADED: switch (buttonSelectedOperation) { - case ButtonOperations::Unload: // "Unload" + case ButtonOperations::Unload: // "Unload" return Buttons::Left; - case ButtonOperations::Continue: // "Proceed/Continue" + case ButtonOperations::Continue: // "Proceed/Continue" return Buttons::Right; default: break; @@ -336,9 +332,9 @@ namespace MMU3 { case ERR_SYSTEM_INVALID_TOOL: switch (buttonSelectedOperation) { - case ButtonOperations::StopPrint: // "Stop print" + case ButtonOperations::StopPrint: // "Stop print" return Buttons::StopPrint; - case ButtonOperations::ResetMMU: // "Reset MMU" + case ButtonOperations::ResetMMU: // "Reset MMU" return Buttons::ResetMMU; default: break; From 96d19ceed76d45f54b8167aad9968c957b4bd319 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 20 Apr 2025 12:08:53 -0500 Subject: [PATCH 11/14] =?UTF-8?q?non-constexpr=20=E2=80=A6=20for=20now?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/feature/mmu3/mmu3_error_converter.cpp | 6 ++---- Marlin/src/feature/mmu3/mmu3_reporting.h | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Marlin/src/feature/mmu3/mmu3_error_converter.cpp b/Marlin/src/feature/mmu3/mmu3_error_converter.cpp index 99a4c0a903..4604e46c43 100644 --- a/Marlin/src/feature/mmu3/mmu3_error_converter.cpp +++ b/Marlin/src/feature/mmu3/mmu3_error_converter.cpp @@ -47,12 +47,10 @@ namespace MMU3 { } // Find the error index statically to save on runtime overhead - static constexpr uint8_t FindErrorIndex(const uint16_t pec) { + static uint8_t FindErrorIndex(const uint16_t pec) { constexpr uint16_t errorCodesSize = COUNT(errorCodes); constexpr const auto *errorCodesEnd = errorCodes + errorCodesSize; - const auto *i = find_if_cx(errorCodes, errorCodesEnd, [pec](const uint16_t ed) { - return ed == pec; - }); + const auto *i = find_if_cx(errorCodes, errorCodesEnd, [pec](const uint16_t ed) { return ed == pec; }); return (i != errorCodesEnd) ? (i - errorCodes) : (errorCodesSize - 1); } diff --git a/Marlin/src/feature/mmu3/mmu3_reporting.h b/Marlin/src/feature/mmu3/mmu3_reporting.h index 4ce3129d44..e931439cae 100644 --- a/Marlin/src/feature/mmu3/mmu3_reporting.h +++ b/Marlin/src/feature/mmu3/mmu3_reporting.h @@ -33,8 +33,8 @@ namespace MMU3 { - enum CommandInProgress : uint8_t { - NoCommand = 0, + enum CommandInProgress : unsigned char { + NoCommand = '\0', CutFilament = 'K', EjectFilament = 'E', Homing = 'H', From 6f98fd4157767151d908424956b7abdf1a182a30 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 23 Apr 2025 22:12:18 -0500 Subject: [PATCH 12/14] future expansion --- Marlin/src/feature/mmu3/mmu_hw/buttons.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Marlin/src/feature/mmu3/mmu_hw/buttons.h b/Marlin/src/feature/mmu3/mmu_hw/buttons.h index 8a2d733812..2e46ba9af3 100644 --- a/Marlin/src/feature/mmu3/mmu_hw/buttons.h +++ b/Marlin/src/feature/mmu3/mmu_hw/buttons.h @@ -41,13 +41,13 @@ enum class ButtonOperations : uint8_t { Continue = 2, ResetMMU = 3, Unload = 4, - //Load = 5, // - //Eject = 6, // TODO: Should these stay or go? - //Tune = 7, // + Load = 5, + Eject = 6, + Tune = 7, StopPrint = 5, DisableMMU = 6, Skip = 7, - MoreInfo = 8 // Not found in Prusa-Error-Codes + MoreInfo = 8 }; // Button codes + extended actions performed on the printer's side From 2d9cd9274e86f3bc9a9c3b3ea645edb5d1a31a5f Mon Sep 17 00:00:00 2001 From: Andrew <18502096+classicrocker883@users.noreply.github.com> Date: Thu, 24 Apr 2025 16:52:58 -0400 Subject: [PATCH 13/14] add period to language_en.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- Marlin/src/lcd/language/language_en.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index e3dc8613b5..74d628eb86 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -1066,7 +1066,7 @@ namespace LanguageNarrow_en { LSTR MSG_DESC_IDLER_CANNOT_HOME = _UxGT("The Idler cannot home properly. Check for anything blocking its movement."); LSTR MSG_DESC_TMC = _UxGT("More details online."); LSTR MSG_DESC_MMU_MCU_POWER_ERROR = _UxGT("MMU detected a power-related issue. Check the wiring and connectors. If the issue persists, contact support."); - LSTR MSG_DESC_MMU_MCU_UNDERVOLTAGE_VCC = _UxGT("MMU MCU detected a 5V undervoltage. There might be an issue with the electronics. Check the wiring and connectors"); + LSTR MSG_DESC_MMU_MCU_UNDERVOLTAGE_VCC = _UxGT("MMU MCU detected a 5V undervoltage. There might be an issue with the electronics. Check the wiring and connectors."); LSTR MSG_DESC_MMU_NOT_RESPONDING = _UxGT("MMU not responding. Check the wiring and connectors."); LSTR MSG_DESC_COMMUNICATION_ERROR = _UxGT("MMU not responding correctly. Check the wiring and connectors."); LSTR MSG_DESC_FILAMENT_ALREADY_LOADED = _UxGT("Cannot perform the action, filament is already loaded. Unload it first."); From dc3c8836062693fb0b807248f3d6248ae0ceec4b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 18 Jul 2025 22:57:30 -0500 Subject: [PATCH 14/14] less --- .../src/feature/mmu3/mmu3_error_converter.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Marlin/src/feature/mmu3/mmu3_error_converter.cpp b/Marlin/src/feature/mmu3/mmu3_error_converter.cpp index 4604e46c43..890456a82b 100644 --- a/Marlin/src/feature/mmu3/mmu3_error_converter.cpp +++ b/Marlin/src/feature/mmu3/mmu3_error_converter.cpp @@ -251,7 +251,7 @@ namespace MMU3 { case ERR_MECHANICAL_LOAD_TO_EXTRUDER_FAILED: case ERR_SYSTEM_FILAMENT_EJECTED: switch (buttonSelectedOperation) { - case ButtonOperations::Continue: // User solved the serious mechanical problem by hand - there is no other way around + case ButtonOperations::Continue: // User solved the serious mechanical problem by hand - there is no other way around return Buttons::Middle; default: break; @@ -261,9 +261,9 @@ namespace MMU3 { case ERR_TEMPERATURE_WARNING_TMC_SELECTOR_TOO_HOT: case ERR_TEMPERATURE_WARNING_TMC_IDLER_TOO_HOT: switch (buttonSelectedOperation) { - case ButtonOperations::Continue: // "Continue" + case ButtonOperations::Continue: // "Continue" return Buttons::Left; - case ButtonOperations::ResetMMU: // "Reset MMU" + case ButtonOperations::ResetMMU: // "Reset MMU" return Buttons::ResetMMU; default: break; @@ -299,7 +299,7 @@ namespace MMU3 { case ERR_ELECTRICAL_MMU_MCU_POWER_ERROR: case ERR_ELECTRICAL_MMU_MCU_UNDERVOLTAGE_VCC: switch (buttonSelectedOperation) { - case ButtonOperations::ResetMMU: // "Reset MMU" + case ButtonOperations::ResetMMU: // "Reset MMU" return Buttons::ResetMMU; default: break; @@ -309,9 +309,9 @@ namespace MMU3 { case ERR_CONNECT_COMMUNICATION_ERROR: case ERR_SYSTEM_FW_UPDATE_NEEDED: switch (buttonSelectedOperation) { - case ButtonOperations::DisableMMU: // "Disable" + case ButtonOperations::DisableMMU: // "Disable" return Buttons::DisableMMU; - case ButtonOperations::ResetMMU: // "ResetMMU" + case ButtonOperations::ResetMMU: // "ResetMMU" return Buttons::ResetMMU; default: break; @@ -319,9 +319,9 @@ namespace MMU3 { break; case ERR_SYSTEM_FILAMENT_ALREADY_LOADED: switch (buttonSelectedOperation) { - case ButtonOperations::Unload: // "Unload" + case ButtonOperations::Unload: // "Unload" return Buttons::Left; - case ButtonOperations::Continue: // "Proceed/Continue" + case ButtonOperations::Continue: // "Proceed/Continue" return Buttons::Right; default: break; @@ -330,9 +330,9 @@ namespace MMU3 { case ERR_SYSTEM_INVALID_TOOL: switch (buttonSelectedOperation) { - case ButtonOperations::StopPrint: // "Stop print" + case ButtonOperations::StopPrint: // "Stop print" return Buttons::StopPrint; - case ButtonOperations::ResetMMU: // "Reset MMU" + case ButtonOperations::ResetMMU: // "Reset MMU" return Buttons::ResetMMU; default: break;