diff options
author | David Crocker <dcrocker@eschertech.com> | 2017-09-01 16:37:50 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2017-09-01 16:38:03 +0300 |
commit | cfd6cfa1a2bc814ad7f1c7512d5f75dbda537854 (patch) | |
tree | cd4019c42f5b9689b0cc5dc1731b260bb7eab910 /src/Movement | |
parent | bbee8ba5a9042ca7ed9fcb72e9a0cc7fbfbd13cb (diff) |
Verison 1.19.2
Better detection of whether a move was intended to be a printing move or
not, to handle slicers that generate moves with tiny amounts of
extrusion better
Diffstat (limited to 'src/Movement')
-rw-r--r-- | src/Movement/DDA.cpp | 23 | ||||
-rw-r--r-- | src/Movement/DDA.h | 2 |
2 files changed, 12 insertions, 13 deletions
diff --git a/src/Movement/DDA.cpp b/src/Movement/DDA.cpp index b43c87d4..a25b9e9d 100644 --- a/src/Movement/DDA.cpp +++ b/src/Movement/DDA.cpp @@ -239,6 +239,7 @@ bool DDA::Init(GCodes::RawMove &nextMove, bool doMotorMapping) isPrintingMove = false; xyMoving = false; + bool extruding = false; // we set this true if extrusion was commanded, even if it is too small to do bool realMove = false; float accelerations[DRIVES]; const float * const normalAccelerations = reprap.GetPlatform().Accelerations(); @@ -266,6 +267,10 @@ bool DDA::Init(GCodes::RawMove &nextMove, bool doMotorMapping) else { directionVector[drive] = (float)delta/reprap.GetPlatform().DriveStepsPerUnit(drive); + if (drive >= numAxes && nextMove.coords[drive] > 0.0) + { + extruding = true; + } } if (delta != 0) @@ -281,20 +286,13 @@ bool DDA::Init(GCodes::RawMove &nextMove, bool doMotorMapping) // It's an extruder movement nextMove.coords[drive] -= directionVector[drive]; // subtract the amount of extrusion we actually did to leave the residue outstanding - if (xyMoving) + if (xyMoving && nextMove.usePressureAdvance) { - if (delta > 0) - { - isPrintingMove = true; // we have both XY movement and forward extrusion - } - if (nextMove.usePressureAdvance) + const float compensationTime = reprap.GetPlatform().GetPressureAdvance(drive - numAxes); + if (compensationTime > 0.0) { - const float compensationTime = reprap.GetPlatform().GetPressureAdvance(drive - numAxes); - if (compensationTime > 0.0) - { - // Compensation causes instant velocity changes equal to acceleration * k, so we may need to limit the acceleration - accelerations[drive] = min<float>(accelerations[drive], reprap.GetPlatform().ConfiguredInstantDv(drive)/compensationTime); - } + // Compensation causes instant velocity changes equal to acceleration * k, so we may need to limit the acceleration + accelerations[drive] = min<float>(accelerations[drive], reprap.GetPlatform().ConfiguredInstantDv(drive)/compensationTime); } } } @@ -337,6 +335,7 @@ bool DDA::Init(GCodes::RawMove &nextMove, bool doMotorMapping) canPauseBefore = nextMove.canPauseBefore; canPauseAfter = nextMove.canPauseAfter; filePos = nextMove.filePos; + isPrintingMove = xyMoving && extruding; usePressureAdvance = nextMove.usePressureAdvance; virtualExtruderPosition = nextMove.virtualExtruderPosition; hadLookaheadUnderrun = false; diff --git a/src/Movement/DDA.h b/src/Movement/DDA.h index ebfd03b8..e96c0472 100644 --- a/src/Movement/DDA.h +++ b/src/Movement/DDA.h @@ -142,7 +142,7 @@ private: uint8_t isPrintingMove : 1; // True if this move includes XY movement and extrusion uint8_t usePressureAdvance : 1; // True if pressure advance should be applied to any forward extrusion uint8_t hadLookaheadUnderrun : 1; // True if the lookahead queue was not long enough to optimise this move - uint8_t xyMoving : 1; // True if we have movement along an X axis or the Y axis + uint8_t xyMoving : 1; // True if movement along an X axis or the Y axis was requested, even it if's too small to do uint8_t goingSlow : 1; // True if we have slowed the movement because the Z probe is approaching its threshold uint8_t isLeadscrewAdjustmentMove : 1; // True if this is a leadscrews adjustment move |