diff --git a/planner.c b/planner.c index 8878390..7a5945f 100644 --- a/planner.c +++ b/planner.c @@ -18,6 +18,8 @@ along with Grbl. If not, see . */ +/* The ring buffer implementation gleaned from the wiring_serial library by David A. Mellis. */ + /* Reasoning behind the mathematics in this module (in the key of 'Mathematica'): diff --git a/stepper.c b/stepper.c index 131aa0a..92091a5 100644 --- a/stepper.c +++ b/stepper.c @@ -19,8 +19,7 @@ */ /* The timer calculations of this module informed by the 'RepRap cartesian firmware' by Zack Smith - and Philipp Tiefenbacher. The ring buffer implementation gleaned from the wiring_serial library - by David A. Mellis */ + and Philipp Tiefenbacher. */ #include "stepper.h" #include "config.h" @@ -108,6 +107,12 @@ inline void trapezoid_generator_tick() { trapezoid_adjusted_rate -= current_block->rate_delta; } set_step_events_per_minute(trapezoid_adjusted_rate); + } else { + // Make sure we cruise at exactly nominal rate + if (trapezoid_adjusted_rate != current_block->nominal_rate) { + trapezoid_adjusted_rate = current_block->nominal_rate; + set_step_events_per_minute(trapezoid_adjusted_rate); + } } } }