diff --git a/src/logic/feed_to_finda.cpp b/src/logic/feed_to_finda.cpp index e4b03e8..762aefb 100644 --- a/src/logic/feed_to_finda.cpp +++ b/src/logic/feed_to_finda.cpp @@ -20,7 +20,7 @@ void FeedToFinda::Reset(bool feedPhaseLimited, bool haltAtEnd) { ml::leds.SetPairButOffOthers(mg::globals.ActiveSlot(), ml::blink0, ml::off); mi::idler.Engage(mg::globals.ActiveSlot()); // We can't get any FINDA readings if the selector is at the wrong spot - move it accordingly if necessary - ms::selector.MoveToSlot(mg::globals.ActiveSlot()); + ms::selector.MoveToSlot(mg::globals.ActiveSlot()); // @@TODO move to slot can return "refused", what shall we do in such a state? Report an error? } bool FeedToFinda::Step() { diff --git a/src/modules/selector.cpp b/src/modules/selector.cpp index 0b7fbdc..7f59ee1 100644 --- a/src/modules/selector.cpp +++ b/src/modules/selector.cpp @@ -67,8 +67,13 @@ Selector::OperationResult Selector::MoveToSlot(uint8_t slot) { return OperationResult::Accepted; } - if (mf::finda.Pressed()) { - // @@TODO not sure why (if) this happens, but anyway - we must not move the selector if FINDA is pressed + // This seems to cause all kinds of strange issues like errorneously ejected filaments from the wrong slot (because selector refused to move). + // Moreover, FINDA looks very unreliable over time and occasionally causes spurious triggers. + // But relying on a higher-level status (filament load state) could solve the issue, + // because it is only updated at specific spots sometimes also according to FINDA status. + //if (mf::finda.Pressed()) { + if( mg::globals.FilamentLoaded() > mg::FilamentLoadState::AtPulley ){ + // @@TODO not sure why (if) this happens, but anyway - we must not move the selector if we think that we have filament in the selector. // That includes the CutFilament operation as well return OperationResult::Refused; }