From b1b5b9db846f1f6055b4eb4596e0def559ac103f Mon Sep 17 00:00:00 2001 From: "D.R.racer" Date: Tue, 7 Sep 2021 14:43:27 +0200 Subject: [PATCH] Set better planned moves for homing + abort moves at StallGuard --- src/modules/idler.cpp | 2 +- src/modules/movable_base.cpp | 1 + src/modules/selector.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/idler.cpp b/src/modules/idler.cpp index 95c3734..6691aa2 100644 --- a/src/modules/idler.cpp +++ b/src/modules/idler.cpp @@ -14,7 +14,7 @@ void Idler::PrepareMoveToPlannedSlot() { } void Idler::PlanHomingMove() { - mm::motion.PlanMove(mm::unitToAxisUnit(-360.0_deg), mm::unitToAxisUnit(config::idlerFeedrate)); + mm::motion.PlanMove(mm::unitToAxisUnit(-config::idlerLimits.lenght * 2), mm::unitToAxisUnit(config::idlerFeedrate)); } Idler::OperationResult Idler::Disengage() { diff --git a/src/modules/movable_base.cpp b/src/modules/movable_base.cpp index 91fab93..142fe55 100644 --- a/src/modules/movable_base.cpp +++ b/src/modules/movable_base.cpp @@ -41,6 +41,7 @@ void MovableBase::PerformMove(config::Axis axis) { void MovableBase::PerformHome(config::Axis axis) { if (mm::motion.StallGuard(axis)) { // we have reached the end of the axis - homed ok + mm::motion.AbortPlannedMoves(true); mm::motion.SetMode(axis, mg::globals.MotorsStealth() ? mm::Stealth : mm::Normal); state = Ready; } else if (mm::motion.QueueEmpty(axis)) { diff --git a/src/modules/selector.cpp b/src/modules/selector.cpp index d4bbb3e..794739a 100644 --- a/src/modules/selector.cpp +++ b/src/modules/selector.cpp @@ -14,7 +14,7 @@ void Selector::PrepareMoveToPlannedSlot() { } void Selector::PlanHomingMove() { - mm::motion.PlanMove(mm::unitToAxisUnit(-100.0_mm), mm::unitToAxisUnit(config::selectorFeedrate)); + mm::motion.PlanMove(mm::unitToAxisUnit(config::selectorLimits.lenght * 2), mm::unitToAxisUnit(config::selectorFeedrate)); } Selector::OperationResult Selector::MoveToSlot(uint8_t slot) {