Actually fix retract filament from finda
parent
6071257973
commit
0a1290102c
|
|
@ -21,7 +21,7 @@ bool RetractFromFinda::Step() {
|
|||
if (mi::idler.Engaged()) {
|
||||
dbg_logic_sprintf_P(PSTR("Pulley start steps %u"), mm::motion.CurPosition(mm::Pulley));
|
||||
state = UnloadBackToPTFE;
|
||||
mm::motion.PlanMove<mm::Pulley>(-config::cuttingEdgeToFindaMidpoint, config::pulleyFeedrate);
|
||||
mm::motion.PlanMove<mm::Pulley>(-(config::cuttingEdgeToFindaMidpoint + config::cuttingEdgeRetract), config::pulleyFeedrate);
|
||||
}
|
||||
return false;
|
||||
case UnloadBackToPTFE:
|
||||
|
|
|
|||
|
|
@ -35,21 +35,23 @@ bool UnloadFilament::StepInner() {
|
|||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::red, ml::blink0);
|
||||
mi::idler.Disengage();
|
||||
} else {
|
||||
state = ProgressCode::UnloadingToPulley;
|
||||
mm::motion.PlanMove<mm::Pulley>(-config::cuttingEdgeToFindaMidpoint, config::pulleyFeedrate);
|
||||
state = ProgressCode::RetractingFromFinda;
|
||||
retract.Reset();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case ProgressCode::UnloadingToPulley:
|
||||
if (mm::motion.QueueEmpty()) {
|
||||
state = ProgressCode::DisengagingIdler;
|
||||
case ProgressCode::RetractingFromFinda:
|
||||
if (retract.Step()) {
|
||||
if (retract.State() == RetractFromFinda::Failed) {
|
||||
state = ProgressCode::ERRDisengagingIdler;
|
||||
error = ErrorCode::FINDA_DIDNT_SWITCH_OFF;
|
||||
mi::idler.Disengage();
|
||||
}
|
||||
return false;
|
||||
case ProgressCode::DisengagingIdler:
|
||||
if (mm::motion.QueueEmpty()) {
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::off);
|
||||
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::red, ml::blink0); // signal loading error
|
||||
} else {
|
||||
state = ProgressCode::FinishingMoves;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case ProgressCode::FinishingMoves:
|
||||
if (mm::motion.QueueEmpty()) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#include <stdint.h>
|
||||
#include "command_base.h"
|
||||
#include "unload_to_finda.h"
|
||||
#include "retract_from_finda.h"
|
||||
|
||||
namespace logic {
|
||||
|
||||
|
|
@ -21,6 +22,7 @@ public:
|
|||
private:
|
||||
constexpr static const uint8_t maxRetries = 3;
|
||||
UnloadToFinda unl;
|
||||
RetractFromFinda retract;
|
||||
};
|
||||
|
||||
/// The one and only instance of UnloadFilament state machine in the FW
|
||||
|
|
|
|||
Loading…
Reference in New Issue