diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-08-02 21:47:41 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-08-02 21:47:41 +0300 |
commit | 27d86b761983a35c23faa45a5f8d0648c01fa08b (patch) | |
tree | f66eb8176e574deed256f890974bfe9193e5e79a /src/Movement | |
parent | 47ab99cfbc5d4b586b4f2f41e1510b744c1b279f (diff) |
Another bug fix to pressure advance
Diffstat (limited to 'src/Movement')
-rw-r--r-- | src/Movement/DriveMovement.cpp | 2 | ||||
-rw-r--r-- | src/Movement/MoveSegment.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/Movement/DriveMovement.cpp b/src/Movement/DriveMovement.cpp index f0dfef69..9a95862a 100644 --- a/src/Movement/DriveMovement.cpp +++ b/src/Movement/DriveMovement.cpp @@ -412,7 +412,7 @@ bool DriveMovement::PrepareExtruder(const DDA& dda, const PrepParams& params) no if (timeToReverse < params.unshaped.decelClocks) { // There is a reversal, although it could be tiny - const float distanceToReverse = fsquare(initialDecelSpeed) * decelSeg->GetC() * 0.25; // because (v^2-u^2) = 2as, so if v=0 then s=-u^2/2a = u^2/2d = 0.25*u^2*c + const float distanceToReverse = fsquare(initialDecelSpeed) * decelSeg->GetC() * (-0.25); // because (v^2-u^2) = 2as, so if v=0 then s=-u^2/2a = u^2/2d = -0.25*u^2*c forwardDistance += params.unshaped.decelStartDistance + distanceToReverse; reverseDistance = 0.5 * params.unshaped.deceleration * fsquare(params.unshaped.decelClocks - timeToReverse); // because s = 0.5*a*t^2 } diff --git a/src/Movement/MoveSegment.cpp b/src/Movement/MoveSegment.cpp index f2f8c244..666af6b8 100644 --- a/src/Movement/MoveSegment.cpp +++ b/src/Movement/MoveSegment.cpp @@ -50,14 +50,14 @@ void MoveSegment::AddToTail(MoveSegment *tail) noexcept void MoveSegment::DebugPrint(char ch) const noexcept { - debugPrintf("%c d=%.3e t=%" PRIu32 " ", ch, (double)segmentLength, (uint32_t)segTime); + debugPrintf("%c d=%.4e t=%.1f ", ch, (double)segmentLength, (double)segTime); if (IsLinear()) { - debugPrintf("c=%.3e\n", (double)c); + debugPrintf("c=%.4e\n", (double)c); } else { - debugPrintf("b=%.3e c=%.3e\n", (double)b, (double)c); + debugPrintf("b=%.4e c=%.4e\n", (double)b, (double)c); } } |