From b8eee5ac9a403b84de4ddc86b824606e06390d8f Mon Sep 17 00:00:00 2001 From: Simen Svale Skogsrud Date: Thu, 17 Feb 2011 21:41:41 +0100 Subject: [PATCH] clamped safe speed to 100% of nominal speed. Fixes a problem that might have spelled trouble at very low feed rates --- planner.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/planner.c b/planner.c index 7684632..6e9721d 100644 --- a/planner.c +++ b/planner.c @@ -168,7 +168,11 @@ inline double junction_jerk(block_t *before, block_t *after) { // Calculate a braking factor to reach baseline speed which is max_jerk/2, e.g. the // speed under which you cannot exceed max_jerk no matter what you do. double factor_for_safe_speed(block_t *block) { - return(settings.max_jerk/block->nominal_speed); + if(settings.max_jerk < block->nominal_speed) { + return(settings.max_jerk/block->nominal_speed); + } else { + return(1.0); + } } // The kernel called by planner_recalculate() when scanning the plan from last to first entry.