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

@ -29,7 +29,7 @@
// Version of the EEPROM data. Will be used to migrate existing data from older versions of Grbl
// when firmware is upgraded. Always stored in byte 0 of eeprom
#define SETTINGS_VERSION 51
#define SETTINGS_VERSION 52
// Define bit flag masks for the boolean settings in settings.flag.
#define BITFLAG_REPORT_INCHES bit(0)
@ -62,7 +62,7 @@ typedef struct {
float default_feed_rate;
float default_seek_rate;
uint8_t invert_mask;
float mm_per_arc_segment;
float arc_tolerance;
float acceleration[N_AXIS];
float junction_deviation;
uint8_t flags; // Contains default boolean settings
@ -73,9 +73,8 @@ typedef struct {
float homing_pulloff;
uint8_t stepper_idle_lock_time; // If max value 255, steppers do not disable.
uint8_t decimal_places;
uint8_t n_arc_correction;
float max_velocity[N_AXIS];
// float mm_soft_limit[N_AXIS];
// float mm_soft_limit[N_AXIS];
// uint8_t status_report_mask; // Mask to indicate desired report data.
} settings_t;
extern settings_t settings;