Ignoring the diag pin (stallguard) completely in specified range
This seems to greatly improve overall homing reliability of Idler on MMUs which couldn't home with inserted filaments at all. The only downside is the fact, that we may actually "home" a blocked Idler correctly.pull/267/head
parent
95915cb080
commit
b97b7561c6
|
|
@ -74,6 +74,11 @@ void Idler::FinishMove() {
|
|||
}
|
||||
}
|
||||
|
||||
bool Idler::SGAllowed(bool forward) const {
|
||||
const uint8_t checkDistance = forward ? 220 : 200;
|
||||
return AxisDistance(mm::axisUnitToTruncatedUnit<config::U_deg>(mm::motion.CurPosition<mm::Idler>())) > checkDistance;
|
||||
}
|
||||
|
||||
void Idler::UpdateAdaptiveSGTHRS(bool forward) {
|
||||
// return;
|
||||
const uint8_t checkDistance = forward ? 220 : 200;
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ protected:
|
|||
virtual bool FinishHomingAndPlanMoveToParkPos() override;
|
||||
virtual void FinishMove() override;
|
||||
virtual void UpdateAdaptiveSGTHRS(bool forward) override;
|
||||
virtual bool SGAllowed(bool forward) const override;
|
||||
|
||||
private:
|
||||
enum class Operation : uint8_t {
|
||||
|
|
|
|||
|
|
@ -69,9 +69,11 @@ void MovableBase::PerformHomeForward() {
|
|||
if (mm::motion.StallGuard(axis)) {
|
||||
// we have reached the front end of the axis - first part homed probably ok
|
||||
mm::motion.StallGuardReset(axis);
|
||||
mm::motion.AbortPlannedMoves(axis, true);
|
||||
PlanHomingMoveBack();
|
||||
state = HomeBack;
|
||||
if (SGAllowed(true)) {
|
||||
mm::motion.AbortPlannedMoves(axis, true);
|
||||
PlanHomingMoveBack();
|
||||
state = HomeBack;
|
||||
}
|
||||
} else if (mm::motion.QueueEmpty(axis)) {
|
||||
HomeFailed();
|
||||
} else {
|
||||
|
|
@ -83,14 +85,16 @@ void MovableBase::PerformHomeBack() {
|
|||
if (mm::motion.StallGuard(axis)) {
|
||||
// we have reached the back end of the axis - second part homed probably ok
|
||||
mm::motion.StallGuardReset(axis);
|
||||
mm::motion.AbortPlannedMoves(axis, true);
|
||||
mm::motion.SetMode(axis, mg::globals.MotorsStealth() ? mm::Stealth : mm::Normal);
|
||||
if (!FinishHomingAndPlanMoveToParkPos()) {
|
||||
// the measured axis' length was incorrect, something is blocking it, report an error, homing procedure terminated
|
||||
HomeFailed();
|
||||
} else {
|
||||
homingValid = true;
|
||||
// state = Ready; // not yet - we have to move to our parking or target position after homing the axis
|
||||
if (SGAllowed(false)) {
|
||||
mm::motion.AbortPlannedMoves(axis, true);
|
||||
mm::motion.SetMode(axis, mg::globals.MotorsStealth() ? mm::Stealth : mm::Normal);
|
||||
if (!FinishHomingAndPlanMoveToParkPos()) {
|
||||
// the measured axis' length was incorrect, something is blocking it, report an error, homing procedure terminated
|
||||
HomeFailed();
|
||||
} else {
|
||||
homingValid = true;
|
||||
// state = Ready; // not yet - we have to move to our parking or target position after homing the axis
|
||||
}
|
||||
}
|
||||
} else if (mm::motion.QueueEmpty(axis)) {
|
||||
HomeFailed();
|
||||
|
|
|
|||
|
|
@ -112,6 +112,7 @@ protected:
|
|||
|
||||
/// default implementation is empty
|
||||
virtual void UpdateAdaptiveSGTHRS(bool /*forward*/) {}
|
||||
virtual bool SGAllowed(bool forward) const { return true; }
|
||||
|
||||
/// Initializes movement of a movable module.
|
||||
/// Beware: this operation reinitializes the axis/TMC driver as well (may introduce axis creep as we have seen on the Idler)
|
||||
|
|
|
|||
Loading…
Reference in New Issue