Avoid homing the idler at start when printing
parent
6973dbff13
commit
9bf2b401e4
|
|
@ -113,8 +113,8 @@ void setup() {
|
|||
}
|
||||
ml::leds.Step();
|
||||
|
||||
// Idler will home on its own by default
|
||||
// Selector decides whether homing is possible
|
||||
// Idler and Selector decide whether homing is possible/safe
|
||||
mi::idler.Init();
|
||||
ms::selector.Init();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/// @file idler.cpp
|
||||
#include "idler.h"
|
||||
#include "buttons.h"
|
||||
#include "globals.h"
|
||||
#include "leds.h"
|
||||
#include "motion.h"
|
||||
#include "permanent_storage.h"
|
||||
|
|
@ -76,7 +77,10 @@ Idler::OperationResult Idler::Engage(uint8_t slot) {
|
|||
}
|
||||
|
||||
// coordinates invalid, first home, then engage
|
||||
if (!homingValid) {
|
||||
// avoid homing if filament in fsensor or in nozzle
|
||||
// - the printer may be printing right now and holding the filament
|
||||
// against the pulley even for a short period of time may not be healthy
|
||||
if (!homingValid && mg::globals.FilamentLoaded() < mg::InFSensor) {
|
||||
PlanHome(mm::Idler);
|
||||
return OperationResult::Accepted;
|
||||
}
|
||||
|
|
@ -102,7 +106,7 @@ bool Idler::Step() {
|
|||
PerformHome(mm::Idler);
|
||||
return false;
|
||||
case Ready:
|
||||
if (!homingValid) {
|
||||
if (!homingValid && mg::globals.FilamentLoaded() < mg::InFSensor) {
|
||||
PlanHome(mm::Idler);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -114,5 +118,16 @@ bool Idler::Step() {
|
|||
}
|
||||
}
|
||||
|
||||
void Idler::Init() {
|
||||
if (mg::globals.FilamentLoaded() < mg::InFSensor) {
|
||||
// home the Idler only in case we don't have filament loaded in the printer (or at least we think we don't)
|
||||
PlanHome(mm::Idler);
|
||||
} else {
|
||||
// otherwise set selector's position according to know slot positions (and pretend it is correct)
|
||||
mm::motion.SetPosition(mm::Idler, SlotPosition(mg::globals.ActiveSlot()).v);
|
||||
InvalidateHoming(); // and plan homing sequence ASAP
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace idler
|
||||
} // namespace modules
|
||||
|
|
|
|||
|
|
@ -45,6 +45,12 @@ public:
|
|||
/// @returns the index of idle position of the idler, usually 5 in case of 0-4 valid indices of filament slots
|
||||
inline static constexpr uint8_t IdleSlotIndex() { return config::toolCount; }
|
||||
|
||||
/// Initializes the idler after restart/cold boot
|
||||
/// Reads the active slot from the EEPROM and decides if the idler is safe to move (not hold the filament while printing)
|
||||
/// - free -> home the idler
|
||||
/// - blocked -> set idler's position according to the active filament slot
|
||||
void Init();
|
||||
|
||||
protected:
|
||||
virtual void PrepareMoveToPlannedSlot() override;
|
||||
virtual void PlanHomingMove() override;
|
||||
|
|
|
|||
Loading…
Reference in New Issue