makes sure steppers cruise at exactly nominal rate to eliminate rounding errors. Possibly fixes the problem where some moves have a long tail of slow steps. (Untested)
This commit is contained in:
parent
d96e48cecf
commit
ef61efbf70
@ -18,6 +18,8 @@
|
||||
along with Grbl. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* 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'):
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user