Rehome all movables if any of them fails to home
parent
9fce324bff
commit
fbfbfbe809
|
|
@ -99,7 +99,16 @@ bool CommandBase::WaitForOneModuleErrorRecovery(ErrorCode ec, modules::motion::M
|
||||||
mui::Event ev = mui::userInput.ConsumeEvent();
|
mui::Event ev = mui::userInput.ConsumeEvent();
|
||||||
if (ev == mui::Event::Middle) {
|
if (ev == mui::Event::Middle) {
|
||||||
recoveringMovableErrorAxisMask |= axisMask;
|
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;
|
state = ProgressCode::Homing;
|
||||||
error = ErrorCode::RUNNING;
|
error = ErrorCode::RUNNING;
|
||||||
}
|
}
|
||||||
|
|
@ -129,6 +138,7 @@ bool CommandBase::WaitForOneModuleErrorRecovery(ErrorCode ec, modules::motion::M
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CommandBase::WaitForModulesErrorRecovery() {
|
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);
|
bool rv = WaitForOneModuleErrorRecovery(CheckMovable(mi::idler), mi::idler, 0x1);
|
||||||
rv |= WaitForOneModuleErrorRecovery(CheckMovable(ms::selector), ms::selector, 0x2);
|
rv |= WaitForOneModuleErrorRecovery(CheckMovable(ms::selector), ms::selector, 0x2);
|
||||||
rv |= WaitForOneModuleErrorRecovery(CheckMovable(mpu::pulley), mpu::pulley, 0x4);
|
rv |= WaitForOneModuleErrorRecovery(CheckMovable(mpu::pulley), mpu::pulley, 0x4);
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,13 @@ void MovableBase::HomeFailed() {
|
||||||
// we ran out of planned moves but no StallGuard event has occurred
|
// we ran out of planned moves but no StallGuard event has occurred
|
||||||
// or the measured length of axis was not within the accepted tolerance
|
// or the measured length of axis was not within the accepted tolerance
|
||||||
homingValid = false;
|
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;
|
state = HomingFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue