Arc mm_per_segment removed, now in terms of tolerance. Stepper ramp counter variable type corrected.

- Arc mm_per_segment parameter was removed and replaced with an
arc_tolerance parameter, which scales all arc segments automatically to
radius, such that the line segment error doesn't exceed the tolerance.
Significantly improves arc performance through larger radius arc,
because the segments are much longer and the planner buffer has more to
work with.

- Moved n_arc correction from the settings to config.h. Mathematically
this doesn't need to be a setting anymore, as the default config value
will work for all known CNC applications. The error does not accumulate
as much anymore, since the small angle approximation used by the arc
generation has been updated to a third-order approximation and how the
line segment length scale with radius and tolerance now. Left in
config.h for extraneous circumstances.

- Corrected the st.ramp_count variable (acceleration tick counter) to a
8-bit vs. 32-bit variable. Should make the stepper algorithm just a
touch faster overall.
This commit is contained in:
Sonny Jeon
2012-12-19 17:30:09 -07:00
parent a1397f61c4
commit 3dfffa622d
8 changed files with 208 additions and 128 deletions

View File

@ -30,7 +30,6 @@
// Some useful constants
#define TICKS_PER_MICROSECOND (F_CPU/1000000)
#define INTERRUPTS_PER_ACCELERATION_TICK (ISR_TICKS_PER_SECOND/ACCELERATION_TICKS_PER_SECOND)
#define CRUISE_RAMP 0
#define ACCEL_RAMP 1
#define DECEL_RAMP 2
@ -47,7 +46,7 @@ typedef struct {
// Used by Pramod Ranade inverse time algorithm
int32_t delta_d; // Ranade distance traveled per interrupt tick
int32_t d_counter; // Ranade distance traveled since last step event
uint32_t ramp_count; // Acceleration interrupt tick counter.
uint8_t ramp_count; // Acceleration interrupt tick counter.
uint8_t ramp_type; // Ramp type variable.
uint8_t execute_step; // Flags step execution for each interrupt.