Added G61 exact path support.

- G61 exact path is the Grbl default path control mode, so it’s now
added as a supported g-code.
This commit is contained in:
Sonny Jeon
2015-05-29 21:32:45 -06:00
parent 2e8ed41b11
commit e14cff3ddc
5 changed files with 98 additions and 18 deletions

View File

@ -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)
*/

View File

@ -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}

View File

@ -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 <avr/io.h>