Fixed bug related to very very low feed rates.

- A very very low feed rate command like `G1 X100 F0.01`  would cause
some floating-point round-off error and freeze Grbl into an infinite
loop. To fix it, introduced a MINIMUM_FEED_RATE parameter in config.h
to ensure motions always complete.

- MINIMUM_FEED_RATE is set at 1.0 mm/min by default. It’s recommended
that no rates are below this value, but 0.1mm/min may be ok in some
situations.
This commit is contained in:
Sonny Jeon
2014-08-05 16:17:45 -06:00
parent 955a9f3cf8
commit 9b9abf1b2f
4 changed files with 9 additions and 29 deletions

View File

@ -309,6 +309,7 @@ uint8_t plan_check_full_buffer()
// TODO: Need to distinguish a rapids vs feed move for overrides. Some flag of some sort.
if (feed_rate < 0) { feed_rate = SOME_LARGE_VALUE; } // Scaled down to absolute max/rapids rate later
else if (invert_feed_rate) { feed_rate = block->millimeters/feed_rate; }
if (feed_rate < MINIMUM_FEED_RATE) { feed_rate = MINIMUM_FEED_RATE; } // Prevents step generation round-off condition.
// Calculate the unit vector of the line move and the block maximum feed rate and acceleration scaled
// down such that no individual axes maximum values are exceeded with respect to the line direction.