pull/364/merge
P1R4M4X 2026-09-13 14:11:37 +00:00 committed by GitHub
commit 0a3cedefbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 34 additions and 10 deletions

View File

@ -104,7 +104,6 @@ static constexpr U_mm pulleyHelperMove = 10.0_mm; ///< Helper move for Load/Unlo
static constexpr U_mm cutLength = 8.0_mm;
static constexpr U_mm fsensorToNozzle = 30.0_mm; ///< ~20mm from MK4's filament sensor through extruder gears into nozzle
static constexpr U_mm fsensorToNozzleAvoidGrind = 5.0_mm;
static constexpr U_mm fsensorToNozzleAvoidGrindUnload = 20.0_mm;
/// Check the state of FSensor after this amount of filament got (hopefully) pulled out while unloading.
static constexpr U_mm fsensorUnloadCheckDistance = 40.0_mm;
@ -228,6 +227,16 @@ static constexpr U_deg idlerIntermediateSlotPositions[toolCount + 1] = {
IdlerOffsetFromHome ///18.0_deg Fully disengaged all slots
};
/// Intermediate positions for Idler's slots: Unloading version to fix the stuck filament
static constexpr U_deg idlerIntermediateUnloadSlotPositions[toolCount + 1] = {
IdlerOffsetFromHome + 4.25F * IdlerSlotDistance,
IdlerOffsetFromHome + 3.25F * IdlerSlotDistance,
IdlerOffsetFromHome + 2.25F * IdlerSlotDistance,
IdlerOffsetFromHome + 1.25F * IdlerSlotDistance,
IdlerOffsetFromHome + 0.25F * IdlerSlotDistance,
IdlerOffsetFromHome ///18.0_deg Fully disengaged all slots
};
static constexpr U_deg idlerParkPositionDelta = -IdlerSlotDistance + 5.0_deg / 2; // TODO verify
static constexpr U_deg_s idlerFeedrate = 300._deg_s;

View File

@ -20,7 +20,7 @@ void UnloadToFinda::Reset(uint8_t maxTries) {
} else {
// FINDA is sensing the filament, plan moves to unload it
state = EngagingIdler;
mi::idler.PartiallyDisengage(mg::globals.ActiveSlot()); // basically prepare before the active slot - saves ~1s
mi::idler.PartiallyEngage(mg::globals.ActiveSlot()); // basically prepare before the active slot - saves ~1s
started_ms = mt::timebase.Millis();
ml::leds.ActiveSlotProcessing();
}
@ -34,7 +34,7 @@ bool UnloadToFinda::Step() {
// It will not wait for the extruder to finish the relieve move.
// However, such an approach breaks running the MMU on a non-reworked MK4/C1, which hasn't been officially supported, but possible (with some level of uncertainity).
case EngagingIdler:
if (!mi::idler.PartiallyDisengaged()) { // just waiting for Idler to get into the target intermediate position
if (!mi::idler.PartiallyEngaged()) { // just waiting for Idler to get into the target intermediate position
return false;
}
if (mfs::fsensor.Pressed()) { // still pressed, printer didn't free the filament yet
@ -48,9 +48,6 @@ bool UnloadToFinda::Step() {
state = UnloadingToFinda;
mpu::pulley.InitAxis();
mi::idler.Engage(mg::globals.ActiveSlot());
// slow move for the first few millimeters - help the printer relieve the filament while engaging the Idler fully
mpu::pulley.PlanMove(-config::fsensorToNozzleAvoidGrindUnload, mg::globals.PulleySlowFeedrate_mm_s(), mg::globals.PulleySlowFeedrate_mm_s());
} else {
state = FailedFINDA;
}

View File

@ -13,9 +13,12 @@ namespace idler {
Idler idler;
void Idler::PrepareMoveToPlannedSlot() {
mm::motion.PlanMoveTo<mm::Idler>(
plannedMove == Operation::engage ? SlotPosition(plannedSlot) : IntermediateSlotPosition(plannedSlot),
mm::unitToAxisUnit<mm::I_speed_t>(mg::globals.IdlerFeedrate_deg_s()));
mm::motion.PlanMoveTo<mm::Idler>(plannedMove == Operation::engage
? SlotPosition(plannedSlot)
: plannedMove == Operation::intermediateUnload
? IntermediateUnloadSlotPosition(plannedSlot)
: IntermediateSlotPosition(plannedSlot),
mm::unitToAxisUnit<mm::I_speed_t>(mg::globals.IdlerFeedrate_deg_s()));
dbg_logic_fP(PSTR("Prepare Move Idler slot %d"), plannedSlot);
}
@ -80,6 +83,10 @@ Idler::OperationResult Idler::Engage(uint8_t slot) {
return PlanMoveInner(slot, Operation::engage);
}
Idler::OperationResult Idler::PartiallyEngage(uint8_t slot) {
return PlanMoveInner(slot, Operation::intermediateUnload);
}
Idler::OperationResult Idler::PlanMoveInner(uint8_t slot, Operation plannedOp) {
if (state == Moving || IsOnHold()) {
dbg_logic_P(PSTR("Moving --> Engage refused"));

View File

@ -25,6 +25,10 @@ public:
/// @note if(state==OnHold) all attempts to Engage are rejected with OperationResult::Rejected
OperationResult Engage(uint8_t slot);
/// Plan partial engaging of the idler
/// @returns #OperationResult
OperationResult PartiallyEngage(uint8_t slot);
/// Plan disengaging of the idler, i.e. parking the idler
/// @returns #OperationResult
/// @note if(state==OnHold) all attempts to Disengage are rejected with OperationResult::Rejected
@ -44,6 +48,7 @@ public:
inline bool Engaged() const { return currentlyEngaged == Operation::engage; }
inline bool Disengaged() const { return currentlyEngaged == Operation::disengage; }
inline bool PartiallyDisengaged() const { return currentlyEngaged == Operation::intermediate; }
inline bool PartiallyEngaged() const { return currentlyEngaged == Operation::intermediateUnload; }
/// @returns predefined positions of individual slots
static constexpr mm::I_pos_t SlotPosition(uint8_t slot) {
@ -55,6 +60,11 @@ public:
return mm::unitToAxisUnit<mm::I_pos_t>(config::idlerIntermediateSlotPositions[slot]);
}
/// @returns predefined intermediate positions between individual slots (Unload)
static constexpr mm::I_pos_t IntermediateUnloadSlotPosition(uint8_t slot) {
return mm::unitToAxisUnit<mm::I_pos_t>(config::idlerIntermediateUnloadSlotPositions[slot]);
}
/// @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; }
@ -76,7 +86,8 @@ private:
enum class Operation : uint8_t {
disengage = 0,
engage = 1,
intermediate = 2 ///< planned movement will be to an intermediate position between slots (different array of positions)
intermediate = 2, ///< planned movement will be to an intermediate position between slots (different array of positions)
intermediateUnload = 3 ///Reduced movement to prevent filament stuck
};
OperationResult PlanMoveInner(uint8_t slot, Operation plannedOp);