diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-03-12 14:18:22 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-03-12 14:18:22 +0300 |
commit | 461028abf44a1c435839f2d8936c5ba6b1e2001f (patch) | |
tree | 50839728de0cb0391eed2a3ec3e28575bd49a5ce | |
parent | b93a6e663e9b67b0f575e6fd76c3767baca81ff6 (diff) |
Minor fixes
-rw-r--r-- | src/GCodes/GCodes.cpp | 4 | ||||
-rw-r--r-- | src/GCodes/GCodes2.cpp | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/GCodes/GCodes.cpp b/src/GCodes/GCodes.cpp index 9e9cf15c..be78a126 100644 --- a/src/GCodes/GCodes.cpp +++ b/src/GCodes/GCodes.cpp @@ -3143,11 +3143,11 @@ const char* GCodes::DoArcMove(GCodeBuffer& gb, bool clockwise) } // Compute how many segments to use - // For the arc to deviate up to MaxArcDeviation from the ideal, the segment length should be sqrt(8 * arcRadius * MaxArcDeviation + fsquare(MaxArcDeviation)) + // For the arc to deviate up to MaxArcDeviation from the ideal, the segment length should be sqrtf(8 * arcRadius * MaxArcDeviation + fsquare(MaxArcDeviation)) // We leave out the square term because it is very small // In CNC applications even very small deviations can be visible, so we use a smaller segment length at low speeds const float arcSegmentLength = constrain<float> - ( min<float>(sqrt(8 * arcRadius * MaxArcDeviation), moveBuffer.feedRate * (1.0/MinArcSegmentsPerSec)), + ( min<float>(sqrtf(8 * arcRadius * MaxArcDeviation), moveBuffer.feedRate * (1.0/MinArcSegmentsPerSec)), MinArcSegmentLength, MaxArcSegmentLength ); diff --git a/src/GCodes/GCodes2.cpp b/src/GCodes/GCodes2.cpp index 38409d55..b5e763ff 100644 --- a/src/GCodes/GCodes2.cpp +++ b/src/GCodes/GCodes2.cpp @@ -432,6 +432,10 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, const StringRef& reply) #if SUPPORT_LASER case MachineType::laser: + if (segmentsLeft != 0) + { + return false; // don't modify moves that haven't gone yet + } moveBuffer.laserPwmOrIoBits.laserPwm = ConvertLaserPwm(gb.GetFValue()); break; #endif @@ -506,6 +510,10 @@ bool GCodes::HandleMcode(GCodeBuffer& gb, const StringRef& reply) #if SUPPORT_LASER case MachineType::laser: + if (segmentsLeft != 0) + { + return false; // don't modify moves that haven't gone yet + } moveBuffer.laserPwmOrIoBits.Clear(); break; #endif |