diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-12-05 19:23:07 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-12-05 19:23:07 +0300 |
commit | 459f188ea6dd37e6c3a974f70e5abf6e285e970f (patch) | |
tree | 9f0200ce0577b2c0b7bccdfd4415ca3e17dd959c | |
parent | a2be2d386d01b7851c5808fea177c2c484dad4a8 (diff) |
Correction to polar kinematics
-rw-r--r-- | src/Movement/Kinematics/PolarKinematics.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Movement/Kinematics/PolarKinematics.cpp b/src/Movement/Kinematics/PolarKinematics.cpp index 565214bb..25a26735 100644 --- a/src/Movement/Kinematics/PolarKinematics.cpp +++ b/src/Movement/Kinematics/PolarKinematics.cpp @@ -296,7 +296,7 @@ void PolarKinematics::OnHomingSwitchTriggered(size_t axis, bool highEnd, const f // The speeds in Cartesian space have already been limited. void PolarKinematics::LimitSpeedAndAcceleration(DDA& dda, const float *normalisedDirectionVector, size_t numVisibleAxes, bool continuousRotationShortcut) const noexcept { - int32_t turntableMovement = labs(dda.DriveCoordinates()[1] - dda.GetPrevious()->DriveCoordinates()[1]); + int32_t turntableMovement = dda.DriveCoordinates()[1] - dda.GetPrevious()->DriveCoordinates()[1]; if (turntableMovement != 0) { const float stepsPerDegree = reprap.GetPlatform().DriveStepsPerUnit(1); @@ -314,7 +314,7 @@ void PolarKinematics::LimitSpeedAndAcceleration(DDA& dda, const float *normalise } if (turntableMovement != 0) { - const float stepRatio = dda.GetTotalDistance() * stepsPerDegree/abs(turntableMovement); + const float stepRatio = dda.GetTotalDistance() * stepsPerDegree/labs(turntableMovement); dda.LimitSpeedAndAcceleration(stepRatio * maxTurntableSpeed, stepRatio * maxTurntableAcceleration); } } |