Fix false FINDA_FLICKERS on Toolchange retry
Delay reporting the cut command finished until the selector has returned back to the cutting slot. This was done by adding ProgressCode::Homing to the Cut Filament state machine. ProgressCode::ReturningSelector is then used to wait for the selector to return back to the cut slot after homing becomes valid again. Only then is the cut operation reported finished and a new command can be processed e.g. Toolchange. Change in memory: Flash: +16 bytes SRAM: 0 bytespull/277/head
parent
6532a435d2
commit
2d3dcde23b
|
|
@ -117,7 +117,7 @@ bool CutFilament::StepInner() {
|
||||||
break;
|
break;
|
||||||
case ProgressCode::PerformingCut:
|
case ProgressCode::PerformingCut:
|
||||||
if (ms::selector.Slot() == cutSlot) { // this may not be necessary if we want the selector and pulley move at once
|
if (ms::selector.Slot() == cutSlot) { // this may not be necessary if we want the selector and pulley move at once
|
||||||
state = ProgressCode::ReturningSelector;
|
state = ProgressCode::Homing;
|
||||||
// revert current to Selector's normal value
|
// revert current to Selector's normal value
|
||||||
mm::motion.InitAxis(mm::Selector, mm::MotorCurrents(config::selector.iRun, config::selector.iHold));
|
mm::motion.InitAxis(mm::Selector, mm::MotorCurrents(config::selector.iRun, config::selector.iHold));
|
||||||
// revert move speed
|
// revert move speed
|
||||||
|
|
@ -126,8 +126,13 @@ bool CutFilament::StepInner() {
|
||||||
mpu::pulley.PlanMove(-config::cuttingEdgeRetract, config::pulleySlowFeedrate);
|
mpu::pulley.PlanMove(-config::cuttingEdgeRetract, config::pulleySlowFeedrate);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ProgressCode::Homing:
|
||||||
|
if (ms::selector.HomingValid()) {
|
||||||
|
state = ProgressCode::ReturningSelector;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case ProgressCode::ReturningSelector:
|
case ProgressCode::ReturningSelector:
|
||||||
if (ms::selector.HomingValid()) { // selector rehomed
|
if (ms::selector.State() == ms::selector.Ready) {
|
||||||
FinishedOK();
|
FinishedOK();
|
||||||
ml::leds.SetPairButOffOthers(mg::globals.ActiveSlot(), ml::on, ml::off);
|
ml::leds.SetPairButOffOthers(mg::globals.ActiveSlot(), ml::on, ml::off);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue