From 9379430f8cb12338d375bbf38a63ca0509157a04 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Fri, 2 Feb 2018 20:45:45 +0100 Subject: [PATCH] A bit of documentation. --- Firmware/planner.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Firmware/planner.cpp b/Firmware/planner.cpp index d7f30d23..880ab650 100644 --- a/Firmware/planner.cpp +++ b/Firmware/planner.cpp @@ -186,12 +186,16 @@ FORCE_INLINE float intersection_distance(float initial_rate, float final_rate, f } } +// Minimum stepper rate 120Hz. #define MINIMAL_STEP_RATE 120 // Calculates trapezoid parameters so that the entry- and exit-speed is compensated by the provided factors. void calculate_trapezoid_for_block(block_t *block, float entry_speed, float exit_speed) { // These two lines are the only floating point calculations performed in this routine. + // initial_rate, final_rate in Hz. + // Minimum stepper rate 120Hz, maximum 40kHz. If the stepper rate goes above 10kHz, + // the stepper interrupt routine groups the pulses by 2 or 4 pulses per interrupt tick. uint32_t initial_rate = ceil(entry_speed * block->speed_factor); // (step/min) uint32_t final_rate = ceil(exit_speed * block->speed_factor); // (step/min)