diff --git a/src/logic/command_base.cpp b/src/logic/command_base.cpp index 6848bfa..aeebceb 100644 --- a/src/logic/command_base.cpp +++ b/src/logic/command_base.cpp @@ -99,7 +99,16 @@ bool CommandBase::WaitForOneModuleErrorRecovery(ErrorCode ec, modules::motion::M mui::Event ev = mui::userInput.ConsumeEvent(); if (ev == mui::Event::Middle) { recoveringMovableErrorAxisMask |= axisMask; - m.PlanHome(); // force initiate a new homing attempt + + // @@TODO this may be the best spot to initiate rehoming of BOTH movables - Idler AND Selector. + // It is merely a workaround to allow disabling power to both axes when one of the fails to home - to allow servicing. + + //m.PlanHome(); // force initiate a new homing attempt + mi::idler.InvalidateHoming(); + mi::idler.PlanHome(); + ms::selector.InvalidateHoming(); + ms::selector.PlanHome(); + state = ProgressCode::Homing; error = ErrorCode::RUNNING; } @@ -129,6 +138,7 @@ bool CommandBase::WaitForOneModuleErrorRecovery(ErrorCode ec, modules::motion::M } bool CommandBase::WaitForModulesErrorRecovery() { + // Beware, the order is important, Idler must come before Selector because of homing precedence. bool rv = WaitForOneModuleErrorRecovery(CheckMovable(mi::idler), mi::idler, 0x1); rv |= WaitForOneModuleErrorRecovery(CheckMovable(ms::selector), ms::selector, 0x2); rv |= WaitForOneModuleErrorRecovery(CheckMovable(mpu::pulley), mpu::pulley, 0x4); diff --git a/src/modules/movable_base.cpp b/src/modules/movable_base.cpp index 44f4798..49aa904 100644 --- a/src/modules/movable_base.cpp +++ b/src/modules/movable_base.cpp @@ -88,7 +88,13 @@ void MovableBase::HomeFailed() { // we ran out of planned moves but no StallGuard event has occurred // or the measured length of axis was not within the accepted tolerance homingValid = false; - mm::motion.Disable(axis); // disable power to the axis - allows the user to do something with the device manually + + // Explicitly cut the power to all the axes, the user will probably want to move one or the other. + // Rehoming of all the axes will happen after the error gets resolved. + mm::motion.Disable(mm::Idler); + mm::motion.Disable(mm::Selector); + mm::motion.Disable(mm::Pulley); + state = HomingFailed; }