diff --git a/README.md b/README.md index 09504a1..1d0bc68 100644 --- a/README.md +++ b/README.md @@ -34,13 +34,13 @@ Grbl includes full acceleration management with look ahead. That means the contr ##Update Summary for v1.1 - **IMPORTANT:** Your EEPROM will be wiped and restored with new settings. This is due to the addition of two new spindle speed '$' settings. -- **Real-time Overrides** : Alters the machine running state immediately with feed, rapid, spindle speed, spindle stop, and coolant toggle controls. This huge contribution by the Grbl project is feature that is common only on industrial machines, often used to optimize cutting while the job is running. Most hobby CNC's try to mimic this with varying results. +- **Real-time Overrides** : Alters the machine running state immediately with feed, rapid, spindle speed, spindle stop, and coolant toggle controls. This awesome new feature is common only on industrial machines, often used to optimize speeds and feeds while a job is running. Most hobby CNC's try to mimic this behavior, but usually have large amounts of lag. Grbl executes overrides in realtime and within tens of milliseconds. -- **Jogging Mode** : New jogging commands seperate from the g-code parser, so that the parser state doesn't get altered and cause a potential crash if not restored properly. Documentation is included on how to use this with a joystick with a low-latency. +- **Jogging Mode** : The new jogging commands are independent of the g-code parser, so that the parser state doesn't get altered and cause a potential crash if not restored properly. Documentation is included on how this works and how it can be used to control your machine via a joystick or rotary dial with a low-latency, satisfying response. -- **Laser Mode** : Grbl now has a "laser" mode, where consecutive G1, G2, and G3 commands do not stop and continuously move through them with a spindle speed change. Spindle speed overrides also work with laser mode so you can tweak the laser power, if you need to during the job. Switch between "laser" mode and "normal" mode via a `$` setting. +- **Laser Mode** : The new "laser" mode will cause Grbl to move continuously through consecutive G1, G2, and G3 commands with spindle speed changes. When "laser" mode is disabled, Grbl will instead come to a stop to ensure a spindle comes up to speed properly. Spindle speed overrides also work with laser mode so you can tweak the laser power, if you need to during the job. Switch between "laser" mode and "normal" mode via a `$` setting. -- **Significant Interface Improvements**: Just this one time and done simultaneously with adding override controls, Grbl has tweaked the communication interface to make it easier for developers to write better GUIs. _NOTE: GUIs need to specifically update their code to be compatible with v1.1 and later._ +- **Significant Interface Improvements**: Just this one time and done simultaneously with adding override data and controls, Grbl has tweaked the communication interface to make it easier for developers to write and maintain their GUIs. _NOTE: GUIs need to specifically update their code to be compatible with v1.1 and later._ - **New Status Reports**: To account for the additional override data, status reports have been tweaked to cram more data into it, while still being smaller than before. Documentation is included, outlining how it has been changed. - **Improved Error/Alarm Feedback** : All Grbl error and alarm messages have been changed to providing a code. Each code is associated with a specific problem, so users will know exactly what is wrong without having to guess. Documentation and an easy to parse CSV is included in the repo. diff --git a/doc/log/commit_log_v1.1.txt b/doc/log/commit_log_v1.1.txt index 2b42f3c..da365fc 100644 --- a/doc/log/commit_log_v1.1.txt +++ b/doc/log/commit_log_v1.1.txt @@ -1,3 +1,9 @@ +---------------- +Date: 2016-09-27 +Author: Sonny Jeon +Subject: Update README and clarifications in jogging document. + + ---------------- Date: 2016-09-26 Author: Sonny Jeon diff --git a/grbl/gcode.c b/grbl/gcode.c index a230398..4969bc5 100644 --- a/grbl/gcode.c +++ b/grbl/gcode.c @@ -77,8 +77,6 @@ uint8_t gc_execute_line(char *line) uint8_t axis_command = AXIS_COMMAND_NONE; uint8_t axis_0, axis_1, axis_linear; uint8_t coord_select = 0; // Tracks G10 P coordinate selection for execution - float coordinate_data[N_AXIS]; // Multi-use variable to store coordinate data for execution - float parameter_data[N_AXIS]; // Multi-use variable to store parameter data for execution // Initialize bitflag tracking variables for axis indices compatible operations. uint8_t axis_words = 0; // XYZ tracking @@ -526,11 +524,12 @@ uint8_t gc_execute_line(char *line) // is active. The read pauses the processor temporarily and may cause a rare crash. For // future versions on processors with enough memory, all coordinate data should be stored // in memory and written to EEPROM only when there is not a cycle active. - memcpy(coordinate_data,gc_state.coord_system,sizeof(gc_state.coord_system)); + float block_coord_system[N_AXIS]; + memcpy(block_coord_system,gc_state.coord_system,sizeof(gc_state.coord_system)); if ( bit_istrue(command_words,bit(MODAL_GROUP_G12)) ) { // Check if called in block if (gc_block.modal.coord_select > N_COORDINATE_SYSTEM) { FAIL(STATUS_GCODE_UNSUPPORTED_COORD_SYS); } // [Greater than N sys] if (gc_state.modal.coord_select != gc_block.modal.coord_select) { - if (!(settings_read_coord_data(gc_block.modal.coord_select,coordinate_data))) { FAIL(STATUS_SETTING_READ_FAIL); } + if (!(settings_read_coord_data(gc_block.modal.coord_select,block_coord_system))) { FAIL(STATUS_SETTING_READ_FAIL); } } } @@ -562,21 +561,24 @@ uint8_t gc_execute_line(char *line) // Determine coordinate system to change and try to load from EEPROM. if (coord_select > 0) { coord_select--; } // Adjust P1-P6 index to EEPROM coordinate data indexing. else { coord_select = gc_block.modal.coord_select; } // Index P0 as the active coordinate system - if (!settings_read_coord_data(coord_select,parameter_data)) { FAIL(STATUS_SETTING_READ_FAIL); } // [EEPROM read fail] + + // NOTE: Store parameter data in IJK values. By rule, they are not in use with this command. + if (!settings_read_coord_data(coord_select,gc_block.values.ijk)) { FAIL(STATUS_SETTING_READ_FAIL); } // [EEPROM read fail] - // Pre-calculate the coordinate data changes. NOTE: Uses parameter_data since coordinate_data may be in use by G54-59. + // Pre-calculate the coordinate data changes. for (idx=0; idx WCS = MPos - G92 - TLO - WPos + gc_block.values.ijk[idx] = gc_state.position[idx]-gc_state.coord_offset[idx]-gc_block.values.xyz[idx]; + if (idx == TOOL_LENGTH_OFFSET_AXIS) { gc_block.values.ijk[idx] -= gc_state.tool_length_offset; } } else { // L2: Update coordinate system axis to programmed value. - parameter_data[idx] = gc_block.values.xyz[idx]; + gc_block.values.ijk[idx] = gc_block.values.xyz[idx]; } - } + } // Else, keep current stored value. } break; case NON_MODAL_SET_COORDINATE_OFFSET: @@ -587,7 +589,8 @@ uint8_t gc_execute_line(char *line) // active coordinate system is selected, but is still active unless G92.1 disables it. for (idx=0; idx G92 = MPos - WCS - TLO - WPos + gc_block.values.xyz[idx] = gc_state.position[idx]-block_coord_system[idx]-gc_block.values.xyz[idx]; if (idx == TOOL_LENGTH_OFFSET_AXIS) { gc_block.values.xyz[idx] -= gc_state.tool_length_offset; } } else { gc_block.values.xyz[idx] = gc_state.coord_offset[idx]; @@ -612,7 +615,7 @@ uint8_t gc_execute_line(char *line) if (gc_block.non_modal_command != NON_MODAL_ABSOLUTE_OVERRIDE) { // Apply coordinate offsets based on distance mode. if (gc_block.modal.distance == DISTANCE_MODE_ABSOLUTE) { - gc_block.values.xyz[idx] += coordinate_data[idx] + gc_state.coord_offset[idx]; + gc_block.values.xyz[idx] += block_coord_system[idx] + gc_state.coord_offset[idx]; if (idx == TOOL_LENGTH_OFFSET_AXIS) { gc_block.values.xyz[idx] += gc_state.tool_length_offset; } } else { // Incremental mode gc_block.values.xyz[idx] += gc_state.position[idx]; @@ -629,15 +632,16 @@ uint8_t gc_execute_line(char *line) case NON_MODAL_GO_HOME_1: // G30 // [G28/30 Errors]: Cutter compensation is enabled. // Retreive G28/30 go-home position data (in machine coordinates) from EEPROM + // NOTE: Store parameter data in IJK values. By rule, they are not in use with this command. if (gc_block.non_modal_command == NON_MODAL_GO_HOME_0) { - if (!settings_read_coord_data(SETTING_INDEX_G28,parameter_data)) { FAIL(STATUS_SETTING_READ_FAIL); } + if (!settings_read_coord_data(SETTING_INDEX_G28,gc_block.values.ijk)) { FAIL(STATUS_SETTING_READ_FAIL); } } else { // == NON_MODAL_GO_HOME_1 - if (!settings_read_coord_data(SETTING_INDEX_G30,parameter_data)) { FAIL(STATUS_SETTING_READ_FAIL); } + if (!settings_read_coord_data(SETTING_INDEX_G30,gc_block.values.ijk)) { FAIL(STATUS_SETTING_READ_FAIL); } } if (axis_words) { // Move only the axes specified in secondary move. for (idx=0; idxcondition |= PL_COND_FLAG_RAPID_MOTION; // Set rapid motion condition flag. if (axis_command) { mc_line(gc_block.values.xyz, pl_data); } - mc_line(parameter_data, pl_data); - memcpy(gc_state.position, parameter_data, sizeof(parameter_data)); + mc_line(gc_block.values.ijk, pl_data); + memcpy(gc_state.position, gc_block.values.ijk, N_AXIS*sizeof(float)); break; case NON_MODAL_SET_HOME_0: settings_write_coord_data(SETTING_INDEX_G28,gc_state.position); @@ -1085,8 +1089,7 @@ uint8_t gc_execute_line(char *line) // Execute coordinate change and spindle/coolant stop. if (sys.state != STATE_CHECK_MODE) { - if (!(settings_read_coord_data(gc_state.modal.coord_select,coordinate_data))) { FAIL(STATUS_SETTING_READ_FAIL); } - memcpy(gc_state.coord_system,coordinate_data,sizeof(coordinate_data)); + if (!(settings_read_coord_data(gc_state.modal.coord_select,gc_state.coord_system))) { FAIL(STATUS_SETTING_READ_FAIL); } system_flag_wco_change(); // Set to refresh immediately just in case something altered. spindle_stop(); coolant_set_state(COOLANT_DISABLE); diff --git a/grbl/grbl.h b/grbl/grbl.h index 7eb4d91..0e05310 100644 --- a/grbl/grbl.h +++ b/grbl/grbl.h @@ -23,7 +23,7 @@ // Grbl versioning system #define GRBL_VERSION "1.1b" -#define GRBL_VERSION_BUILD "20160926" +#define GRBL_VERSION_BUILD "20160927" // Define standard libraries used by Grbl. #include