Merge pull request #4111 from gudnimg/E-cool-gudni
Fix clicking noise during Toolchange when E-cool mode is enabled
This commit is contained in:
commit
3b049a1b91
|
|
@ -922,10 +922,12 @@ void MMU2::ReportError(ErrorCode ec, ErrorSource res) {
|
||||||
switch (logic.Progress()) {
|
switch (logic.Progress()) {
|
||||||
case ProgressCode::UnloadingToFinda:
|
case ProgressCode::UnloadingToFinda:
|
||||||
unloadFilamentStarted = false;
|
unloadFilamentStarted = false;
|
||||||
|
planner_abort_queued_moves(); // Abort excess E-moves to be safe
|
||||||
break;
|
break;
|
||||||
case ProgressCode::FeedingToFSensor:
|
case ProgressCode::FeedingToFSensor:
|
||||||
// FSENSOR error during load. Make sure E-motor stops moving.
|
// FSENSOR error during load. Make sure E-motor stops moving.
|
||||||
loadFilamentStarted = false;
|
loadFilamentStarted = false;
|
||||||
|
planner_abort_queued_moves(); // Abort excess E-moves to be safe
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
@ -1040,6 +1042,10 @@ void MMU2::OnMMUProgressMsgSame(ProgressCode pc) {
|
||||||
case FilamentState::AT_FSENSOR:
|
case FilamentState::AT_FSENSOR:
|
||||||
// fsensor triggered, finish FeedingToExtruder state
|
// fsensor triggered, finish FeedingToExtruder state
|
||||||
loadFilamentStarted = false;
|
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:
|
// After the MMU knows the FSENSOR is triggered it will:
|
||||||
// 1. Push the filament by additional 30mm (see fsensorToNozzle)
|
// 1. Push the filament by additional 30mm (see fsensorToNozzle)
|
||||||
// 2. Disengage the idler and push another 2mm.
|
// 2. Disengage the idler and push another 2mm.
|
||||||
|
|
@ -1048,7 +1054,12 @@ void MMU2::OnMMUProgressMsgSame(ProgressCode pc) {
|
||||||
case FilamentState::NOT_PRESENT:
|
case FilamentState::NOT_PRESENT:
|
||||||
// fsensor not triggered, continue moving extruder
|
// fsensor not triggered, continue moving extruder
|
||||||
if (!planner_any_moves()) { // Only plan a move if there is no move ongoing
|
if (!planner_any_moves()) { // Only plan a move if there is no move ongoing
|
||||||
MoveE(2.0f, MMU2_LOAD_TO_NOZZLE_FEED_RATE);
|
// Plan a very long move, where 'very long' is hundreds
|
||||||
|
// of millimeters. Keep in mind though the move can't be much longer
|
||||||
|
// than 450mm because the firmware will ignore too long extrusions
|
||||||
|
// for safety reasons. See PREVENT_LENGTHY_EXTRUDE.
|
||||||
|
// Use 350mm to be safely away from the prevention threshold
|
||||||
|
MoveE(350.0f, MMU2_LOAD_TO_NOZZLE_FEED_RATE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ void MoveE(float delta, float feedRate);
|
||||||
|
|
||||||
float MoveRaiseZ(float delta);
|
float MoveRaiseZ(float delta);
|
||||||
|
|
||||||
|
void planner_abort_queued_moves();
|
||||||
void planner_synchronize();
|
void planner_synchronize();
|
||||||
bool planner_any_moves();
|
bool planner_any_moves();
|
||||||
float planner_get_machine_position_E_mm();
|
float planner_get_machine_position_E_mm();
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,17 @@ float MoveRaiseZ(float delta) {
|
||||||
return raise_z(delta);
|
return raise_z(delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void planner_abort_queued_moves() {
|
||||||
|
planner_abort_hard();
|
||||||
|
|
||||||
|
// Unblock the planner. This should be safe in the
|
||||||
|
// toolchange context. Currently we are mainly aborting
|
||||||
|
// excess E-moves after detecting filament during toolchange.
|
||||||
|
// If a MMU error is reported, the planner must be unblocked
|
||||||
|
// as well so the extruder can be parked safely.
|
||||||
|
planner_aborted = false;
|
||||||
|
}
|
||||||
|
|
||||||
void planner_synchronize() {
|
void planner_synchronize() {
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue