Pulled in Grbl-328p changes.

- [fix] Spindle enable pin behavior corrected to be independent of the
PWM output. There was some crossover behavior.

- [fix] Tool numbers are now tracking and reporting correctly.

- [fix] G-code parser error when G0 is commanded without a feed rate
word while in inverse time mode.

- [fix] Config file was missing an option for probing behavior.

- [doc] Updated documentation.
This commit is contained in:
Sonny Jeon
2017-01-14 14:35:49 -07:00
parent c912b82710
commit 795d2f657a
8 changed files with 69 additions and 46 deletions
+36 -35
View File
@@ -1,35 +1,36 @@
"Error Code in v1.1+ ","Error Message in v1.0-"," Error Description"
"1","Expected command letter","G-code words consist of a letter and a value. Letter was not found."
"2","Bad number format","Missing the expected G-code word value or numeric value format is not valid."
"3","Invalid statement","Grbl '$' system command was not recognized or supported."
"4","Value < 0","Negative value received for an expected positive value."
"5","Setting disabled","Homing cycle failure. Homing is not enabled via settings."
"6","Value < 3 usec","Minimum step pulse time must be greater than 3usec."
"7","EEPROM read fail. Using defaults","An EEPROM read failed. Auto-restoring affected EEPROM to default values."
"8","Not idle","Grbl '$' command cannot be used unless Grbl is IDLE. Ensures smooth operation during a job."
"9","G-code lock","G-code commands are locked out during alarm or jog state."
"10","Homing not enabled","Soft limits cannot be enabled without homing also enabled."
"11","Line overflow","Max characters per line exceeded. Received command line was not executed."
"12","Step rate > 30kHz","Grbl '$' setting value cause the step rate to exceed the maximum supported."
"13","Check Door","Safety door detected as opened and door state initiated."
"14","Line length exceeded","Build info or startup line exceeded EEPROM line length limit. Line not stored."
"15","Travel exceeded","Jog target exceeds machine travel. Jog command has been ignored."
"16","Invalid jog command","Jog command has no '=' or contains prohibited g-code."
"20","Unsupported command","Unsupported or invalid g-code command found in block."
"21","Modal group violation","More than one g-code command from same modal group found in block."
"22","Undefined feed rate","Feed rate has not yet been set or is undefined."
"23","Invalid gcode ID:23","G-code command in block requires an integer value."
"24","Invalid gcode ID:24","More than one g-code command that requires axis words found in block."
"25","Invalid gcode ID:25","Repeated g-code word found in block."
"26","Invalid gcode ID:26","No axis words found in block for g-code command or current modal state which requires them."
"27","Invalid gcode ID:27","Line number value is invalid."
"28","Invalid gcode ID:28","G-code command is missing a required value word."
"29","Invalid gcode ID:29","G59.x work coordinate systems are not supported."
"30","Invalid gcode ID:30","G53 only allowed with G0 and G1 motion modes."
"31","Invalid gcode ID:31","Axis words found in block when no command or current modal state uses them."
"32","Invalid gcode ID:32","G2 and G3 arcs require at least one in-plane axis word."
"33","Invalid gcode ID:33","Motion command target is invalid."
"34","Invalid gcode ID:34","Arc radius value is invalid."
"35","Invalid gcode ID:35","G2 and G3 arcs require at least one in-plane offset word."
"36","Invalid gcode ID:36","Unused value words found in block."
"37","Invalid gcode ID:37","G43.1 dynamic tool length offset is not assigned to configured tool length axis."
Error Code in v1.1+ ,Error Message in v1.0-, Error Description
1,Expected command letter,G-code words consist of a letter and a value. Letter was not found.
2,Bad number format,Missing the expected G-code word value or numeric value format is not valid.
3,Invalid statement,Grbl '$' system command was not recognized or supported.
4,Value < 0,Negative value received for an expected positive value.
5,Setting disabled,Homing cycle failure. Homing is not enabled via settings.
6,Value < 3 usec,Minimum step pulse time must be greater than 3usec.
7,EEPROM read fail. Using defaults,An EEPROM read failed. Auto-restoring affected EEPROM to default values.
8,Not idle,Grbl '$' command cannot be used unless Grbl is IDLE. Ensures smooth operation during a job.
9,G-code lock,G-code commands are locked out during alarm or jog state.
10,Homing not enabled,Soft limits cannot be enabled without homing also enabled.
11,Line overflow,Max characters per line exceeded. Received command line was not executed.
12,Step rate > 30kHz,Grbl '$' setting value cause the step rate to exceed the maximum supported.
13,Check Door,Safety door detected as opened and door state initiated.
14,Line length exceeded,Build info or startup line exceeded EEPROM line length limit. Line not stored.
15,Travel exceeded,Jog target exceeds machine travel. Jog command has been ignored.
16,Invalid jog command,Jog command has no '=' or contains prohibited g-code.
20,Unsupported command,Unsupported or invalid g-code command found in block.
21,Modal group violation,More than one g-code command from same modal group found in block.
22,Undefined feed rate,Feed rate has not yet been set or is undefined.
23,Invalid gcode ID:23,G-code command in block requires an integer value.
24,Invalid gcode ID:24,More than one g-code command that requires axis words found in block.
25,Invalid gcode ID:25,Repeated g-code word found in block.
26,Invalid gcode ID:26,No axis words found in block for g-code command or current modal state which requires them.
27,Invalid gcode ID:27,Line number value is invalid.
28,Invalid gcode ID:28,G-code command is missing a required value word.
29,Invalid gcode ID:29,G59.x work coordinate systems are not supported.
30,Invalid gcode ID:30,G53 only allowed with G0 and G1 motion modes.
31,Invalid gcode ID:31,Axis words found in block when no command or current modal state uses them.
32,Invalid gcode ID:32,G2 and G3 arcs require at least one in-plane axis word.
33,Invalid gcode ID:33,Motion command target is invalid.
34,Invalid gcode ID:34,Arc radius value is invalid.
35,Invalid gcode ID:35,G2 and G3 arcs require at least one in-plane offset word.
36,Invalid gcode ID:36,Unused value words found in block.
37,Invalid gcode ID:37,G43.1 dynamic tool length offset is not assigned to configured tool length axis.
38,Invalid gcode ID:38,Tool number greater than max supported value.
1 Error Code in v1.1+ Error Message in v1.0- Error Description Error Description
2 1 Expected command letter G-code words consist of a letter and a value. Letter was not found.
3 2 Bad number format Missing the expected G-code word value or numeric value format is not valid.
4 3 Invalid statement Grbl '$' system command was not recognized or supported.
5 4 Value < 0 Negative value received for an expected positive value.
6 5 Setting disabled Homing cycle failure. Homing is not enabled via settings.
7 6 Value < 3 usec Minimum step pulse time must be greater than 3usec.
8 7 EEPROM read fail. Using defaults An EEPROM read failed. Auto-restoring affected EEPROM to default values.
9 8 Not idle Grbl '$' command cannot be used unless Grbl is IDLE. Ensures smooth operation during a job.
10 9 G-code lock G-code commands are locked out during alarm or jog state.
11 10 Homing not enabled Soft limits cannot be enabled without homing also enabled.
12 11 Line overflow Max characters per line exceeded. Received command line was not executed.
13 12 Step rate > 30kHz Grbl '$' setting value cause the step rate to exceed the maximum supported.
14 13 Check Door Safety door detected as opened and door state initiated.
15 14 Line length exceeded Build info or startup line exceeded EEPROM line length limit. Line not stored.
16 15 Travel exceeded Jog target exceeds machine travel. Jog command has been ignored.
17 16 Invalid jog command Jog command has no '=' or contains prohibited g-code.
18 20 Unsupported command Unsupported or invalid g-code command found in block.
19 21 Modal group violation More than one g-code command from same modal group found in block.
20 22 Undefined feed rate Feed rate has not yet been set or is undefined.
21 23 Invalid gcode ID:23 G-code command in block requires an integer value.
22 24 Invalid gcode ID:24 More than one g-code command that requires axis words found in block.
23 25 Invalid gcode ID:25 Repeated g-code word found in block.
24 26 Invalid gcode ID:26 No axis words found in block for g-code command or current modal state which requires them.
25 27 Invalid gcode ID:27 Line number value is invalid.
26 28 Invalid gcode ID:28 G-code command is missing a required value word.
27 29 Invalid gcode ID:29 G59.x work coordinate systems are not supported.
28 30 Invalid gcode ID:30 G53 only allowed with G0 and G1 motion modes.
29 31 Invalid gcode ID:31 Axis words found in block when no command or current modal state uses them.
30 32 Invalid gcode ID:32 G2 and G3 arcs require at least one in-plane axis word.
31 33 Invalid gcode ID:33 Motion command target is invalid.
32 34 Invalid gcode ID:34 Arc radius value is invalid.
33 35 Invalid gcode ID:35 G2 and G3 arcs require at least one in-plane offset word.
34 36 Invalid gcode ID:36 Unused value words found in block.
35 37 Invalid gcode ID:37 G43.1 dynamic tool length offset is not assigned to configured tool length axis.
36 38 Invalid gcode ID:38 Tool number greater than max supported value.
+10
View File
@@ -1,3 +1,13 @@
----------------
Date: 2016-12-19
Author: Sonny Jeon
Subject: Alarm handling bug fix.
- Applied an alarm handling bug fix that would not show the correct
alarm code, nor clear the alarm. It would occasionally go into an
infinite loop and would usually happen during a homing cycle fail.
----------------
Date: 2016-12-19
Author: Sonny Jeon
+3
View File
@@ -174,6 +174,7 @@ Every G-code block sent to Grbl and Grbl `$` system command that is terminated w
| **`35`** | A `G2` or `G3` arc, traced with the offset definition, is missing the `IJK` offset word in the selected plane to trace the arc.|
| **`36`** | There are unused, leftover G-code words that aren't used by any command in the block.|
| **`37`** | The `G43.1` dynamic tool length offset command cannot apply an offset to an axis other than its configured axis. The Grbl default axis is the Z-axis.|
| **`38`** | Tool number greater than max supported value.|
----------------------
@@ -567,6 +568,8 @@ Feedback messages provide non-critical information on what Grbl is doing, what i
- The usage of this data is generally for debugging an interface, but is known to be used to control some GUI-specific tasks. While this is disabled by default, GUIs should expect this data field to appear, but they may ignore it, if desired.
- IMPORTANT: Do not use this buffer data to control streaming. During a stream, the reported buffer will often be out-dated and may be incorrect by the time it has been received by the GUI. Instead, please use the streaming protocols outlined. They use Grbl's responses as a direct way to accurately determine the buffer state.
- NOTE: The buffer state values changed from showing "in-use" blocks or bytes to "available". This change does not require the GUI knowing how many block/bytes Grbl has been compiled with.
- This data field appears:
+4
View File
@@ -448,6 +448,10 @@
// work well and are cheap to find) and wire in a low-pass circuit into each limit pin.
// #define ENABLE_SOFTWARE_DEBOUNCE // Default disabled. Uncomment to enable.
// Configures the position after a probing cycle during Grbl's check mode. Disabled sets
// the position to the probe target, when enabled sets the position to the start position.
// #define SET_CHECK_MODE_PROBE_TO_START // Default disabled. Uncomment to enable.
// Force Grbl to check the state of the hard limit switches when the processor detects a pin
// change inside the hard limit ISR routine. By default, Grbl will trigger the hard limits
// alarm upon any pin change, since bouncing switches can cause a state check like this to
+6 -2
View File
@@ -25,6 +25,7 @@
// arbitrary value, and some GUIs may require more. So we increased it based on a max safe
// value when converting a float (7.2 digit precision)s to an integer.
#define MAX_LINE_NUMBER 10000000
#define MAX_TOOL_NUMBER 255 // Limited by max unsigned 8-bit value
#define AXIS_COMMAND_NONE 0
#define AXIS_COMMAND_NON_MODAL 1
@@ -297,7 +298,10 @@ uint8_t gc_execute_line(char *line)
// case 'Q': // Not supported
case 'R': word_bit = WORD_R; gc_block.values.r = value; break;
case 'S': word_bit = WORD_S; gc_block.values.s = value; break;
case 'T': word_bit = WORD_T; break; // gc.values.t = int_value;
case 'T': word_bit = WORD_T;
if (value > MAX_TOOL_NUMBER) { FAIL(STATUS_GCODE_MAX_VALUE_EXCEEDED); }
gc_block.values.t = int_value;
break;
case 'X': word_bit = WORD_X; gc_block.values.xyz[X_AXIS] = value; axis_words |= (1<<X_AXIS); break;
case 'Y': word_bit = WORD_Y; gc_block.values.xyz[Y_AXIS] = value; axis_words |= (1<<Y_AXIS); break;
case 'Z': word_bit = WORD_Z; gc_block.values.xyz[Z_AXIS] = value; axis_words |= (1<<Z_AXIS); break;
@@ -378,7 +382,7 @@ uint8_t gc_execute_line(char *line)
if (gc_block.modal.feed_rate == FEED_RATE_MODE_INVERSE_TIME) { // = G93
// NOTE: G38 can also operate in inverse time, but is undefined as an error. Missing F word check added here.
if (axis_command == AXIS_COMMAND_MOTION_MODE) {
if ((gc_block.modal.motion != MOTION_MODE_NONE) || (gc_block.modal.motion != MOTION_MODE_SEEK)) {
if ((gc_block.modal.motion != MOTION_MODE_NONE) && (gc_block.modal.motion != MOTION_MODE_SEEK)) {
if (bit_isfalse(value_words,bit(WORD_F))) { FAIL(STATUS_GCODE_UNDEFINED_FEED_RATE); } // [F word missing]
}
}
+1 -1
View File
@@ -23,7 +23,7 @@
// Grbl versioning system
#define GRBL_VERSION "1.1e"
#define GRBL_VERSION_BUILD "20161219.3"
#define GRBL_VERSION_BUILD "20170114"
// Define standard libraries used by Grbl.
#include <avr/io.h>
+1
View File
@@ -57,6 +57,7 @@
#define STATUS_GCODE_NO_OFFSETS_IN_PLANE 35
#define STATUS_GCODE_UNUSED_WORDS 36
#define STATUS_GCODE_G43_DYNAMIC_AXIS_ERROR 37
#define STATUS_GCODE_MAX_VALUE_EXCEEDED 38
// Define Grbl alarm codes. Valid values (1-255). 0 is reserved.
#define ALARM_HARD_LIMIT_ERROR EXEC_ALARM_HARD_LIMIT
+8 -8
View File
@@ -72,17 +72,11 @@ void spindle_stop()
// and stepper ISR. Keep routine small and efficient.
void spindle_set_speed(uint16_t pwm_value)
{
SPINDLE_OCR_REGISTER = pwm_value; // Set PWM output level.
if (pwm_value == SPINDLE_PWM_OFF_VALUE) {
spindle_stop();
SPINDLE_TCCRA_REGISTER &= ~(1<<SPINDLE_COMB_BIT); // Disable PWM. Output voltage is zero.
} else {
SPINDLE_OCR_REGISTER = pwm_value; // Set PWM output level.
SPINDLE_TCCRA_REGISTER |= (1<<SPINDLE_COMB_BIT); // Ensure PWM output is enabled.
#ifdef INVERT_SPINDLE_ENABLE_PIN
SPINDLE_ENABLE_PORT &= ~(1<<SPINDLE_ENABLE_BIT);
#else
SPINDLE_ENABLE_PORT |= (1<<SPINDLE_ENABLE_BIT);
#endif
}
}
@@ -139,6 +133,12 @@ void spindle_set_state(uint8_t state, float rpm)
if (state == SPINDLE_ENABLE_CCW) { rpm = 0.0; } // TODO: May need to be rpm_min*(100/MAX_SPINDLE_SPEED_OVERRIDE);
}
spindle_set_speed(spindle_compute_pwm_value(rpm));
#ifdef INVERT_SPINDLE_ENABLE_PIN
SPINDLE_ENABLE_PORT &= ~(1<<SPINDLE_ENABLE_BIT);
#else
SPINDLE_ENABLE_PORT |= (1<<SPINDLE_ENABLE_BIT);
#endif
}