diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-05-01 11:17:40 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-05-01 11:17:40 +0300 |
commit | 4751f5bf5ad49e969f2d6a0f092dc517de28dcfb (patch) | |
tree | dcd5aa7de840d524aa01975346decafd3ea3853e | |
parent | 3e66b9b56731f31e1fe55735a1b25551120f8ba3 (diff) |
Fixed bugs with fast-then-slow G30 probing3.3RC1
-rw-r--r-- | src/GCodes/GCodes4.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/GCodes/GCodes4.cpp b/src/GCodes/GCodes4.cpp index 965aa5b6..c3d2bbbb 100644 --- a/src/GCodes/GCodes4.cpp +++ b/src/GCodes/GCodes4.cpp @@ -1054,7 +1054,7 @@ void GCodes::RunStateMachine(GCodeBuffer& gb, const StringRef& reply) noexcept reprap.GetMove().GetCurrentMachinePosition(m, false); // get height without bed compensation const float g30zStoppedHeight = m[Z_AXIS] - g30HValue; // save for later zp->SetLastStoppedHeight(g30zStoppedHeight); - if (tapsDone > 0) + if (tapsDone > 0) // don't accumulate the result of we are doing fast-then-slow probing and this was the fast probe { g30zHeightError = g30zStoppedHeight - zp->GetActualTriggerHeight(); g30zHeightErrorSum += g30zHeightError; @@ -1073,7 +1073,7 @@ void GCodes::RunStateMachine(GCodeBuffer& gb, const StringRef& reply) noexcept break; } - if (tapsDone == 1 && !hadProbingError) + if (tapsDone <= 1 && !hadProbingError) { // Reset the Z axis origin according to the height error so that we can move back up to the dive height moveBuffer.coords[Z_AXIS] = zp->GetActualTriggerHeight(); @@ -1120,7 +1120,7 @@ void GCodes::RunStateMachine(GCodeBuffer& gb, const StringRef& reply) noexcept // See whether we need to do any more taps const auto zp = platform.GetZProbeOrDefault(currentZProbeNumber); bool acceptReading = false; - if (zp->GetMaxTaps() < 2) + if (zp->GetMaxTaps() < 2 && tapsDone == 1) { acceptReading = true; } |