From 79e0e45826641077fbd5771a139a3fafaf1927e5 Mon Sep 17 00:00:00 2001 From: Sonny Jeon Date: Sat, 31 May 2014 23:23:21 -0600 Subject: [PATCH] Arc error-checking update. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Updated offset-mode arc error-checking to EMC2’s version: The old NIST definition required the radii to the current location and target location to differ no more than 0.002mm. This proved to be problematic and probably why LinuxCNC(EMC2) updated it to be 0.005mm AND 0.1% radius OR 0.5mm. --- gcode.c | 8 ++++++-- settings.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gcode.c b/gcode.c index ab9ad1f..5214fc4 100644 --- a/gcode.c +++ b/gcode.c @@ -742,8 +742,12 @@ uint8_t gc_execute_line(char *line) y -= gc_block.values.ijk[axis_1]; // Delta y between circle center and target float target_r = hypot_f(x,y); gc_block.values.r = hypot_f(gc_block.values.ijk[axis_0], gc_block.values.ijk[axis_1]); // Compute arc radius for mc_arc - - if (fabs(target_r-gc_block.values.r) > 0.002) { FAIL(STATUS_GCODE_INVALID_TARGET); } // [Arc definition error] + + target_r = fabs(target_r-gc_block.values.r); + if (target_r > 0.005) { + if (target_r > 0.5) { FAIL(STATUS_GCODE_INVALID_TARGET); } // [Arc definition error] + if (target_r > 0.001*gc_block.values.r) { FAIL(STATUS_GCODE_INVALID_TARGET); } // [Arc definition error] + } } break; case MOTION_MODE_PROBE: diff --git a/settings.h b/settings.h index 0be1035..12bbba3 100644 --- a/settings.h +++ b/settings.h @@ -26,7 +26,7 @@ #define GRBL_VERSION "0.9e" -#define GRBL_VERSION_BUILD "20140529" +#define GRBL_VERSION_BUILD "20140531" // 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