diff --git a/Firmware/mmu2.cpp b/Firmware/mmu2.cpp index 62b46375e..8c07a3f6a 100644 --- a/Firmware/mmu2.cpp +++ b/Firmware/mmu2.cpp @@ -922,10 +922,12 @@ void MMU2::ReportError(ErrorCode ec, ErrorSource res) { switch (logic.Progress()) { case ProgressCode::UnloadingToFinda: unloadFilamentStarted = false; + planner_abort_queued_moves(); // Abort excess E-moves to be safe break; case ProgressCode::FeedingToFSensor: // FSENSOR error during load. Make sure E-motor stops moving. loadFilamentStarted = false; + planner_abort_queued_moves(); // Abort excess E-moves to be safe break; default: break; @@ -1040,6 +1042,10 @@ void MMU2::OnMMUProgressMsgSame(ProgressCode pc) { case FilamentState::AT_FSENSOR: // fsensor triggered, finish FeedingToExtruder state loadFilamentStarted = false; + + // Abort any excess E-move from the planner queue + planner_abort_queued_moves(); + // After the MMU knows the FSENSOR is triggered it will: // 1. Push the filament by additional 30mm (see fsensorToNozzle) // 2. Disengage the idler and push another 2mm. @@ -1048,7 +1054,7 @@ void MMU2::OnMMUProgressMsgSame(ProgressCode pc) { case FilamentState::NOT_PRESENT: // fsensor not triggered, continue moving extruder if (!planner_any_moves()) { // Only plan a move if there is no move ongoing - MoveE(2.0f, MMU2_LOAD_TO_NOZZLE_FEED_RATE); + MoveE(350.0f, MMU2_LOAD_TO_NOZZLE_FEED_RATE); } break; default: diff --git a/Firmware/mmu2_marlin.h b/Firmware/mmu2_marlin.h index 199de649e..0877a60f8 100644 --- a/Firmware/mmu2_marlin.h +++ b/Firmware/mmu2_marlin.h @@ -26,6 +26,7 @@ void MoveE(float delta, float feedRate); float MoveRaiseZ(float delta); +void planner_abort_queued_moves(); void planner_synchronize(); bool planner_any_moves(); float planner_get_machine_position_E_mm(); diff --git a/Firmware/mmu2_marlin1.cpp b/Firmware/mmu2_marlin1.cpp index 07f3c01b5..c197d2b01 100644 --- a/Firmware/mmu2_marlin1.cpp +++ b/Firmware/mmu2_marlin1.cpp @@ -18,6 +18,11 @@ float MoveRaiseZ(float delta) { return raise_z(delta); } +void planner_abort_queued_moves() { + planner_abort_hard(); + planner_aborted = false; +} + void planner_synchronize() { st_synchronize(); }