Make SG work on Selector
surprisingly - it needed somewhat lower sensitivity, because the selector was triggering stall guard signal even when decelerating (which is subject to separate investigation)pull/172/head
parent
d4c9fa77f9
commit
a9200f73f5
|
|
@ -131,7 +131,7 @@ static constexpr AxisConfig selector = {
|
|||
.iHold = 5, /// 99mA
|
||||
.stealth = false,
|
||||
.stepsPerUnit = (200 * 8 / 8.),
|
||||
.sg_thrs = 3,
|
||||
.sg_thrs = 5, // 6 looks like too much on my MMU
|
||||
};
|
||||
|
||||
/// Selector motion limits
|
||||
|
|
|
|||
|
|
@ -85,12 +85,14 @@ bool CommandBase::WaitForOneModuleErrorRecovery(ErrorCode ec, modules::motion::M
|
|||
stateBeforeModuleFailed = state;
|
||||
errorBeforeModuleFailed = error;
|
||||
error = ec;
|
||||
// mui::userInput.Clear(); // @@TODO
|
||||
state = ProgressCode::ERRWaitingForUser; // such a situation always requires user's attention -> let the printer display an error screen
|
||||
}
|
||||
|
||||
// are we already recovering an error - that would mean we got another one
|
||||
if (recoveringMovableErrorAxisMask) {
|
||||
error = ec;
|
||||
// mui::userInput.Clear(); // @@TODO
|
||||
state = ProgressCode::ERRWaitingForUser; // such a situation always requires user's attention -> let the printer display an error screen
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#include "movable_base.h"
|
||||
#include "globals.h"
|
||||
#include "motion.h"
|
||||
#include "leds.h"
|
||||
|
||||
namespace modules {
|
||||
namespace motion {
|
||||
|
|
@ -37,18 +38,23 @@ void MovableBase::PerformMove() {
|
|||
// TMC2130 entered some error state, the planned move couldn't have been finished - result of operation is Failed
|
||||
tmcErrorFlags = mm::motion.DriverForAxis(axis).GetErrorFlags(); // save the failed state
|
||||
state = TMCFailed;
|
||||
} else if (mm::motion.QueueEmpty(axis)) {
|
||||
// move finished
|
||||
// ml::leds.SetMode(4, ml::red, ml::off); // @@TODO - temporary signal of the finished move
|
||||
currentSlot = plannedSlot;
|
||||
FinishMove();
|
||||
state = Ready;
|
||||
} else if (SupportsHoming() && (!mg::globals.MotorsStealth()) && mm::motion.StallGuard(axis)) {
|
||||
// Beware - the ordering of these if statements is important.
|
||||
// We shall only check stallguard when motion queue is not empty for this axis - i.e. ! mm::motion.QueueEmpty(axis)
|
||||
// Such a check has already been done in the previous else-if branch.
|
||||
// ml::leds.SetMode(4, ml::red, ml::on); // @@TODO - temporary signal of the stall guard
|
||||
// Axis stalled while moving - dangerous especially with the Selector
|
||||
// Checked only for axes which support homing (because we plan a homing move after the error is resolved to regain precise position)
|
||||
mm::motion.StallGuardReset(axis);
|
||||
mm::motion.AbortPlannedMoves(axis, true);
|
||||
// @@TODO move a bit back from where it came from to enable easier removal of whatever is blocking the axis
|
||||
state = MoveFailed;
|
||||
} else if (mm::motion.QueueEmpty(axis)) {
|
||||
// move finished
|
||||
currentSlot = plannedSlot;
|
||||
FinishMove();
|
||||
state = Ready;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue