PFW-1334 Move E-motor on FSENSOR error retry
This commit is contained in:
parent
b8432e6bf2
commit
59d19a8330
|
|
@ -93,6 +93,7 @@ MMU2::MMU2()
|
||||||
, state(xState::Stopped)
|
, state(xState::Stopped)
|
||||||
, mmu_print_saved(SavedState::None)
|
, mmu_print_saved(SavedState::None)
|
||||||
, loadFilamentStarted(false)
|
, loadFilamentStarted(false)
|
||||||
|
, unloadFilamentStarted(false)
|
||||||
, loadingToNozzle(false)
|
, loadingToNozzle(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -737,6 +738,8 @@ void MMU2::ReportError(ErrorCode ec, uint8_t res) {
|
||||||
// Depending on the Progress code, we may want to do some action when an error occurs
|
// Depending on the Progress code, we may want to do some action when an error occurs
|
||||||
switch (logic.Progress())
|
switch (logic.Progress())
|
||||||
{
|
{
|
||||||
|
case ProgressCode::UnloadingToFinda:
|
||||||
|
unloadFilamentStarted = false;
|
||||||
case ProgressCode::FeedingToBondtech:
|
case ProgressCode::FeedingToBondtech:
|
||||||
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.
|
||||||
|
|
@ -778,6 +781,19 @@ void MMU2::OnMMUProgressMsg(ProgressCode pc){
|
||||||
|
|
||||||
// Act accordingly - one-time handling
|
// Act accordingly - one-time handling
|
||||||
switch (pc) {
|
switch (pc) {
|
||||||
|
case ProgressCode::UnloadingToFinda:
|
||||||
|
// This is intended to handle Retry option on MMU error screen
|
||||||
|
// MMU sends P3 progress code during Query, and if filament is stuck
|
||||||
|
// in the gears, the MK3S needs to move e-axis as well.
|
||||||
|
st_synchronize();
|
||||||
|
unloadFilamentStarted = true;
|
||||||
|
// Unload slowly while MMU is initalising its axis
|
||||||
|
current_position[E_AXIS] -= 10.0f;
|
||||||
|
plan_buffer_line_curposXYZE(10.0f);
|
||||||
|
st_synchronize();
|
||||||
|
// Now do a fast unload in sync with the MMU
|
||||||
|
current_position[E_AXIS] -= 427.0f - 42.85f - 20.0f; // Roughly same distance as MMU plans
|
||||||
|
plan_buffer_line_curposXYZE(120.0f);
|
||||||
case ProgressCode::FeedingToBondtech:
|
case ProgressCode::FeedingToBondtech:
|
||||||
// prepare for the movement of the E-motor
|
// prepare for the movement of the E-motor
|
||||||
st_synchronize();
|
st_synchronize();
|
||||||
|
|
@ -790,6 +806,19 @@ void MMU2::OnMMUProgressMsg(ProgressCode pc){
|
||||||
} else {
|
} else {
|
||||||
// Act accordingly - every status change (even the same state)
|
// Act accordingly - every status change (even the same state)
|
||||||
switch (pc) {
|
switch (pc) {
|
||||||
|
case ProgressCode::UnloadingToFinda:
|
||||||
|
if (unloadFilamentStarted && !blocks_queued()) { // Only plan a move if there is no move ongoing
|
||||||
|
|
||||||
|
if (mmu2.FindaDetectsFilament() == 1)
|
||||||
|
{ // Keep moving the E-motor until and error happens or FINDA untriggers
|
||||||
|
current_position[E_AXIS] -= 6.0f;
|
||||||
|
plan_buffer_line_curposXYZE(60.0f);
|
||||||
|
} else {
|
||||||
|
// Only stop moving the motor if FINDA is still triggered.
|
||||||
|
// Even if the FSENSOR is 0, the filament may get stuck in the bondtech gears
|
||||||
|
unloadFilamentStarted = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
case ProgressCode::FeedingToBondtech:
|
case ProgressCode::FeedingToBondtech:
|
||||||
case ProgressCode::FeedingToFSensor:
|
case ProgressCode::FeedingToFSensor:
|
||||||
if (loadFilamentStarted) {
|
if (loadFilamentStarted) {
|
||||||
|
|
|
||||||
|
|
@ -247,6 +247,7 @@ private:
|
||||||
|
|
||||||
uint8_t mmu_print_saved;
|
uint8_t mmu_print_saved;
|
||||||
bool loadFilamentStarted;
|
bool loadFilamentStarted;
|
||||||
|
bool unloadFilamentStarted;
|
||||||
|
|
||||||
friend struct LoadingToNozzleRAII;
|
friend struct LoadingToNozzleRAII;
|
||||||
/// true in case we are doing the LoadToNozzle operation - that means the filament shall be loaded all the way down to the nozzle
|
/// true in case we are doing the LoadToNozzle operation - that means the filament shall be loaded all the way down to the nozzle
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue