From c02a6e23664511b01f0d7859c4432c79a3050feb Mon Sep 17 00:00:00 2001 From: Simen Svale Skogsrud Date: Wed, 16 Feb 2011 21:11:27 +0100 Subject: [PATCH] possible improvement on the long, slow tail problem --- planner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/planner.c b/planner.c index 90b93f2..d3de443 100644 --- a/planner.c +++ b/planner.c @@ -128,7 +128,7 @@ void calculate_trapezoid_for_block(block_t *block, double entry_factor, double e int32_t accelerate_steps = ceil(estimate_acceleration_distance(block->initial_rate, block->nominal_rate, acceleration_per_minute)); int32_t decelerate_steps = - ceil(estimate_acceleration_distance(block->nominal_rate, final_rate, -acceleration_per_minute)); + floor(estimate_acceleration_distance(block->nominal_rate, final_rate, -acceleration_per_minute)); // Calculate the size of Plateau of Nominal Rate. int32_t plateau_steps = block->step_event_count-accelerate_steps-decelerate_steps;