Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crocker <dcrocker@eschertech.com>2021-05-01 11:17:40 +0300
committerDavid Crocker <dcrocker@eschertech.com>2021-05-01 11:17:40 +0300
commit4751f5bf5ad49e969f2d6a0f092dc517de28dcfb (patch)
treedcd5aa7de840d524aa01975346decafd3ea3853e
parent3e66b9b56731f31e1fe55735a1b25551120f8ba3 (diff)
Fixed bugs with fast-then-slow G30 probing3.3RC1
-rw-r--r--src/GCodes/GCodes4.cpp6
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;
}