Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚧 Experimental: disengage to intermediate position #314

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/config/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ static constexpr U_deg idlerSlotPositions[toolCount + 1] = {

/// Intermediate positions for Idler's slots: 0-4 are the real ones, the 5th index is the idle position
static constexpr U_deg idlerIntermediateSlotPositions[toolCount + 1] = {
IdlerOffsetFromHome + 4.75F * IdlerSlotDistance,
IdlerOffsetFromHome + 3.75F * IdlerSlotDistance,
IdlerOffsetFromHome + 2.75F * IdlerSlotDistance,
IdlerOffsetFromHome + 1.75F * IdlerSlotDistance,
IdlerOffsetFromHome + 0.75F * IdlerSlotDistance,
IdlerOffsetFromHome + 4.55F * IdlerSlotDistance,
IdlerOffsetFromHome + 3.55F * IdlerSlotDistance,
IdlerOffsetFromHome + 2.55F * IdlerSlotDistance,
IdlerOffsetFromHome + 1.55F * IdlerSlotDistance,
IdlerOffsetFromHome + 0.55F * IdlerSlotDistance,
IdlerOffsetFromHome ///18.0_deg Fully disengaged all slots
};

Expand Down
19 changes: 10 additions & 9 deletions src/logic/feed_to_bondtech.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,19 @@ bool FeedToBondtech::Step() {
if (mi::idler.PartiallyDisengaged()) {
mm::motion.AbortPlannedMoves(mm::Pulley);
mpu::pulley.Disable();
mi::idler.Disengage(); // disengage fully while Pulley is already stopped
state = DisengagingIdler;
}
return false;
case DisengagingIdler:
if (mi::idler.Disengaged()) {
dbg_logic_P(PSTR("Feed to Bondtech --> Idler disengaged"));
dbg_logic_fP(PSTR("Pulley end steps %u"), mpu::pulley.CurrentPosition_mm());
state = OK;
//mi::idler.Disengage(); // disengage fully while Pulley is already stopped
ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::on);
state = OK;
}
return false;
// case DisengagingIdler:
// if (mi::idler.Disengaged()) {
// dbg_logic_P(PSTR("Feed to Bondtech --> Idler disengaged"));
// dbg_logic_fP(PSTR("Pulley end steps %u"), mpu::pulley.CurrentPosition_mm());
// state = OK;
// ml::leds.SetMode(mg::globals.ActiveSlot(), ml::green, ml::on);
// }
// return false;
case OK:
dbg_logic_P(PSTR("Feed to Bondtech OK"));
return true;
Expand Down
1 change: 1 addition & 0 deletions src/logic/tool_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ ProgressCode ToolChange::State() const {
return ProgressCode::FeedingToFSensor;
case FeedToBondtech::PushingFilamentIntoNozzle:
return ProgressCode::FeedingToNozzle;
case FeedToBondtech::PartiallyDisengagingIdler:
case FeedToBondtech::DisengagingIdler:
return ProgressCode::DisengagingIdler;
}
Expand Down
4 changes: 2 additions & 2 deletions src/logic/unload_filament.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ bool UnloadFilament::StepInner() {
GoToErrDisengagingIdler(ErrorCode::FINDA_DIDNT_SWITCH_OFF); // signal unloading error
} else {
state = ProgressCode::DisengagingIdler;
mi::idler.Disengage();
mi::idler.PartiallyDisengage(mg::globals.ActiveSlot());
}
}
return false;
case ProgressCode::DisengagingIdler:
if (mi::idler.Disengaged() && ms::selector.State() == ms::Selector::Ready) {
if (mi::idler.PartiallyDisengaged() && ms::selector.State() == ms::Selector::Ready) {
UnloadFinishedCorrectly();
}
return false;
Expand Down
Loading