From e14cff3ddcf04bfd0502b47fd7b521991deca0b5 Mon Sep 17 00:00:00 2001 From: Sonny Jeon Date: Fri, 29 May 2015 21:32:45 -0600 Subject: [PATCH] Added G61 exact path support. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - G61 exact path is the Grbl default path control mode, so it’s now added as a supported g-code. --- README.md | 7 ++-- doc/log/commit_log_v0.9i.txt | 68 ++++++++++++++++++++++++++++++++++++ grbl/gcode.c | 14 +++++--- grbl/gcode.h | 25 +++++++------ grbl/grbl.h | 2 +- 5 files changed, 98 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 053c0dd..3984d9c 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,8 @@ Grbl includes full acceleration management with look ahead. That means the contr *** _**Master Branch:**_ -* [Grbl v0.9i Atmega328p 16mhz 115200baud with generic defaults](http://bit.ly/1EiviDk) _(2015-05-23)_ -* [Grbl v0.9i Atmega328p 16mhz 115200baud with ShapeOko2 defaults](http://bit.ly/1NYIfKl) _(2015-05-23)_ +* [Grbl v0.9i Atmega328p 16mhz 115200baud with generic defaults](http://bit.ly/1EiviDk) _(2015-05-29)_ +* [Grbl v0.9i Atmega328p 16mhz 115200baud with ShapeOko2 defaults](http://bit.ly/1NYIfKl) _(2015-05-29)_ - **IMPORTANT INFO WHEN UPGRADING TO GRBL v0.9i:** - Baudrate is now **115200** (Up from 9600). - Homing cycle updated. Located based on switch trigger, rather than release point. @@ -52,7 +52,7 @@ _**Archives:**_ - **Z-limit(D12) and spindle enable(D11) pins have switched to support variable spindle!** - **Homing cycle updated. Locates based on trigger point, rather than release point.** - **System tweaks: $14 cycle auto-start has been removed. No more QUEUE state.** - - **New G-Codes:** Additional probing cycle commands G38.3, G38.4, G38.5 now supported. G40 cutter radius compensation cancel. G91.1 arc IJK distance mode incremental. + - **New G-Codes:** Additional probing cycle commands G38.3, G38.4, G38.5 now supported. G40 cutter radius compensation cancel. G91.1 arc IJK distance mode incremental. G61 exact path mode. - **CoreXY Support:** Grbl now supports CoreXY kinematics on an introductory-level. Most functions have been verified to work, but there may be bugs here or there. Please report any problems you find! - **Safety Door Support:** Safety door switches are now supported. Grbl will force a feed hold, shutdown the spindle and coolant, and wait until the door switch has closed and the user has issued a resume. Upon resuming, the spindle and coolant will re-energize after a configurable delay and continue. Useful for OEMs that require this feature. - **Full Limit and Control Pin Configurability:** Limits and control pins operation can now be interpreted by Grbl however you'd like, with the internal pull-up resistors enabled or disabled, or reading a high or low as a trigger. This should cover all wiring and NO or NC switch scenarios. @@ -91,6 +91,7 @@ List of Supported G-Codes in Grbl v0.9i Master: - Tool Length Offset Modes: G43.1, G49 - Cutter Compensation Modes: G40 - Coordinate System Modes: G54, G55, G56, G57, G58, G59 + - Control Modes: G61 - Program Flow: M0, M1, M2, M30* - Coolant Control: M7*, M8, M9 - Spindle Control: M3, M4, M5 diff --git a/doc/log/commit_log_v0.9i.txt b/doc/log/commit_log_v0.9i.txt index 4cd5b97..98655e1 100644 --- a/doc/log/commit_log_v0.9i.txt +++ b/doc/log/commit_log_v0.9i.txt @@ -1,3 +1,71 @@ +---------------- +Date: 2015-05-27 +Author: Sonny Jeon +Subject: Another git case-sensitive folder fix. + +- I’m now officially annoyed. + + +---------------- +Date: 2015-05-27 +Author: Sonny Jeon +Subject: Added X-Carve defaults. + +- Added X-Carve 500mm and 1000mm default files. + +- Tweaked all default files. Removed obsolete AUTO_START and updated +some JUNCTION_DEVIATION defaults after testing showed these needed to +be reduced slightly. + + +---------------- +Date: 2015-05-27 +Author: Sonny Jeon +Subject: Merge pull request #710 from buserror/fix-directory-case-sensitivity + +Rename Grbl to grbl + +---------------- +Date: 2015-05-27 +Author: Michel Pollet +Subject: Rename Grbl to grbl + +Otherwise compilation fails on linux, or other case sensitive systems + +Signed-off-by: Michel Pollet + + +---------------- +Date: 2015-05-26 +Author: Sonny Jeon +Subject: Updated README + + +---------------- +Date: 2015-05-26 +Author: Sonny Jeon +Subject: Merge pull request #706 from grbl/edge + +Merge edge branch. + +---------------- +Date: 2015-05-23 +Author: Sonny Jeon +Subject: CoreXY planner bug fix. + +- CoreXY motions were moving to the negative value of the intended +target. Now fixed. + + +---------------- +Date: 2015-05-23 +Author: Sonny Jeon +Subject: Moved cpu_map. + +- Moved cpu_map files to a cpu_map directory, like the defaults file +organization. + + ---------------- Date: 2015-05-23 Author: Sonny Jeon diff --git a/grbl/gcode.c b/grbl/gcode.c index b3093a8..c47808e 100644 --- a/grbl/gcode.c +++ b/grbl/gcode.c @@ -259,6 +259,11 @@ uint8_t gc_execute_line(char *line) word_bit = MODAL_GROUP_G12; gc_block.modal.coord_select = int_value-54; // Shift to array indexing. break; + case 61: + word_bit = MODAL_GROUP_G13; + if (mantissa != 0) { FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND); } // [G61.1 not supported] + // gc_block.modal.control = CONTROL_MODE_EXACT_PATH; // G61 + break; default: FAIL(STATUS_GCODE_UNSUPPORTED_COMMAND); // [Unsupported G command] } if (mantissa > 0) { FAIL(STATUS_GCODE_COMMAND_VALUE_NOT_INTEGER); } // [Unsupported or invalid Gxx.x command] @@ -519,8 +524,8 @@ uint8_t gc_execute_line(char *line) } } - // [16. Set path control mode ]: NOT SUPPORTED. - // [17. Set distance mode ]: N/A. G90.1 and G91.1 NOT SUPPORTED. + // [16. Set path control mode ]: N/A. Only G61. G61.1 and G64 NOT SUPPORTED. + // [17. Set distance mode ]: N/A. Only G91.1. G90.1 NOT SUPPORTED. // [18. Set retract mode ]: NOT SUPPORTED. // [19. Remaining non-modal actions ]: Check go to predefined position, set G10, or set axis offsets. @@ -900,7 +905,8 @@ uint8_t gc_execute_line(char *line) memcpy(gc_state.coord_system,coordinate_data,sizeof(coordinate_data)); } - // [16. Set path control mode ]: NOT SUPPORTED + // [16. Set path control mode ]: G61.1/G64 NOT SUPPORTED + // gc_state.modal.control = gc_block.modal.control; // NOTE: Always default. // [17. Set distance mode ]: gc_state.modal.distance = gc_block.modal.distance; @@ -1089,5 +1095,5 @@ uint8_t gc_execute_line(char *line) group 8 = {*M7} enable mist coolant (* Compile-option) group 9 = {M48, M49} enable/disable feed and speed override switches group 10 = {G98, G99} return mode canned cycles - group 13 = {G61, G61.1, G64} path control mode + group 13 = {G61.1, G64} path control mode (G61 is supported) */ diff --git a/grbl/gcode.h b/grbl/gcode.h index 10d4792..9a289af 100644 --- a/grbl/gcode.h +++ b/grbl/gcode.h @@ -39,14 +39,15 @@ #define MODAL_GROUP_G7 7 // [G40] Cutter radius compensation mode. G41/42 NOT SUPPORTED. #define MODAL_GROUP_G8 8 // [G43.1,G49] Tool length offset #define MODAL_GROUP_G12 9 // [G54,G55,G56,G57,G58,G59] Coordinate system selection +#define MODAL_GROUP_G13 10 // [G61] Control mode -#define MODAL_GROUP_M4 10 // [M0,M1,M2,M30] Stopping -#define MODAL_GROUP_M7 11 // [M3,M4,M5] Spindle turning -#define MODAL_GROUP_M8 12 // [M7,M8,M9] Coolant control +#define MODAL_GROUP_M4 11 // [M0,M1,M2,M30] Stopping +#define MODAL_GROUP_M7 12 // [M3,M4,M5] Spindle turning +#define MODAL_GROUP_M8 13 // [M7,M8,M9] Coolant control -#define OTHER_INPUT_F 12 -#define OTHER_INPUT_S 13 -#define OTHER_INPUT_T 14 +// #define OTHER_INPUT_F 14 +// #define OTHER_INPUT_S 15 +// #define OTHER_INPUT_T 16 // Define command actions for within execution-type modal groups (motion, stopping, non-modal). Used // internally by the parser to know which command to execute. @@ -102,6 +103,9 @@ // Modal Group G7: Cutter radius compensation mode #define CUTTER_COMP_DISABLE 0 // G40 (Default: Must be zero) +// Modal Group G13: Control mode +#define CONTROL_MODE_EXACT_PATH 0 // G61 (Default: Must be zero) + // Modal Group M7: Spindle control #define SPINDLE_DISABLE 0 // M5 (Default: Must be zero) #define SPINDLE_ENABLE_CW 1 // M3 @@ -119,6 +123,8 @@ // Modal Group G12: Active work coordinate system // N/A: Stores coordinate system value (54-59) to change to. + +// Define parameter word mapping. #define WORD_F 0 #define WORD_I 1 #define WORD_J 2 @@ -134,19 +140,18 @@ #define WORD_Z 12 - - // NOTE: When this struct is zeroed, the above defines set the defaults for the system. typedef struct { uint8_t motion; // {G0,G1,G2,G3,G38.2,G80} uint8_t feed_rate; // {G93,G94} uint8_t units; // {G20,G21} uint8_t distance; // {G90,G91} - // uint8_t distance_arc; // {G91.1} NOTE: Don't track. Only one supported. + // uint8_t distance_arc; // {G91.1} NOTE: Don't track. Only default supported. uint8_t plane_select; // {G17,G18,G19} - // uint8_t cutter_comp; // {G40} NOTE: Don't track. Only one supported. + // uint8_t cutter_comp; // {G40} NOTE: Don't track. Only default supported. uint8_t tool_length; // {G43.1,G49} uint8_t coord_select; // {G54,G55,G56,G57,G58,G59} + // uint8_t control; // {G61} NOTE: Don't track. Only default supported. uint8_t program_flow; // {M0,M1,M2,M30} uint8_t coolant; // {M7,M8,M9} uint8_t spindle; // {M3,M4,M5} diff --git a/grbl/grbl.h b/grbl/grbl.h index 00c3ba4..e8c2789 100644 --- a/grbl/grbl.h +++ b/grbl/grbl.h @@ -23,7 +23,7 @@ // Grbl versioning system #define GRBL_VERSION "0.9i" -#define GRBL_VERSION_BUILD "20150523" +#define GRBL_VERSION_BUILD "20150529" // Define standard libraries used by Grbl. #include