diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-10-22 15:30:53 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-10-22 15:30:53 +0300 |
commit | ce8b859b0190f5d1a77037803647db376e53a638 (patch) | |
tree | 061099cf3695fa5457f6ffb87a7bbe315b807e53 /src/Movement | |
parent | bfdd16fc98afee821ec3db216d630b9a76a38e37 (diff) |
Fix for G1 H2 moves on rotational axes not always working
Diffstat (limited to 'src/Movement')
-rw-r--r-- | src/Movement/DDA.cpp | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/src/Movement/DDA.cpp b/src/Movement/DDA.cpp index 1244698b..1efc9b90 100644 --- a/src/Movement/DDA.cpp +++ b/src/Movement/DDA.cpp @@ -330,31 +330,31 @@ bool DDA::InitStandardMove(DDARing& ring, const RawMove &nextMove, bool doMotorM for (size_t drive = 0; drive < MaxAxesPlusExtruders; drive++) { accelerations[drive] = normalAccelerations[drive]; - endCoordinates[drive] = nextMove.coords[drive]; if (drive < numVisibleAxes) { - const float positionDelta = endCoordinates[drive] - prev->GetEndCoordinate(drive, false); - if (positionDelta != 0.0) - { - if (reprap.GetPlatform().IsAxisRotational(drive)) - { - rotationalAxesMoving = true; - } - else - { - linearAxesMoving = true; - } - } int32_t delta; if (doMotorMapping) { + endCoordinates[drive] = nextMove.coords[drive]; delta = endPoint[drive] - positionNow[drive]; + const float positionDelta = endCoordinates[drive] - prev->GetEndCoordinate(drive, false); directionVector[drive] = positionDelta; - if (positionDelta != 0.0 && (Tool::GetXAxes(nextMove.tool).IsBitSet(drive) || Tool::GetYAxes(nextMove.tool).IsBitSet(drive))) + if (positionDelta != 0.0) { - flags.xyMoving = true; // this move has XY movement in user space, before axis were mapped + if (reprap.GetPlatform().IsAxisRotational(drive)) + { + rotationalAxesMoving = true; + } + else + { + linearAxesMoving = true; + } + if (Tool::GetXAxes(nextMove.tool).IsBitSet(drive) || Tool::GetYAxes(nextMove.tool).IsBitSet(drive)) + { + flags.xyMoving = true; // this move has XY movement in user space, before axis were mapped + } } } else @@ -363,6 +363,17 @@ bool DDA::InitStandardMove(DDARing& ring, const RawMove &nextMove, bool doMotorM endPoint[drive] = Move::MotorMovementToSteps(drive, nextMove.coords[drive]); delta = endPoint[drive] - positionNow[drive]; directionVector[drive] = (float)delta/reprap.GetPlatform().DriveStepsPerUnit(drive); + if (delta != 0) + { + if (reprap.GetPlatform().IsAxisRotational(drive)) + { + rotationalAxesMoving = true; + } + else + { + linearAxesMoving = true; + } + } } #if 0 // debug only @@ -511,7 +522,7 @@ bool DDA::InitStandardMove(DDARing& ring, const RawMove &nextMove, bool doMotorM maxDistance = normalisedDirectionVector[axis]; } } - if (maxDistance != 0.0) // should always be true + if (maxDistance != 0.0) // should be true if we are homing a delta { reqSpeed /= maxDistance; // because normalisedDirectionVector is unit-normalised } |