summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidopple <mdoppler@gmx.at>2012-04-02 10:21:54 +0200
committermidopple <mdoppler@gmx.at>2012-04-02 10:21:54 +0200
commit31ccfda44b9c1675d4a0b7b3f0788d7c8c29f218 (patch)
tree7184a0f092886366a35b2bdd0319ee510d1d06e6
parent4eeeaed9fc5c97f7b17cd3acfbf5c55e8f246762 (diff)
Fixed small bug in arcs when segemnts are zero
Thanks to hurzl
-rw-r--r--Sprinter/arc_func.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Sprinter/arc_func.cpp b/Sprinter/arc_func.cpp
index 255129f..1446e30 100644
--- a/Sprinter/arc_func.cpp
+++ b/Sprinter/arc_func.cpp
@@ -50,6 +50,8 @@ void mc_arc(float *position, float *target, float *offset, uint8_t axis_0, uint8
float millimeters_of_travel = hypot(angular_travel*radius, fabs(linear_travel));
if (millimeters_of_travel < 0.001) { return; }
uint16_t segments = floor(millimeters_of_travel/MM_PER_ARC_SEGMENT);
+ if(segments == 0) segments = 1;
+
/*
// Multiply inverse feed_rate to compensate for the fact that this movement is approximated
// by a number of discrete segments. The inverse feed_rate should be correct for the sum of