Skip to content

Commit

Permalink
Experimental: disengage to intermediate
Browse files Browse the repository at this point in the history
  • Loading branch information
D.R.racer committed Jan 19, 2024
1 parent d510e1e commit 2c0c63d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
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

0 comments on commit 2c0c63d

Please sign in to comment.