Spindle speed bug fix.

- Spindle speed updating wasn’t working in the g-code parser due to
some borked up logic on my part. Fixed it and should be operating as
intended for both normal and laser spindle modes.

- Elaborated a little more on the new sleep mode in the documentation.
This commit is contained in:
Sonny Jeon
2016-10-12 09:14:23 -06:00
parent d1037268c8
commit 6ab3cfbe7d
4 changed files with 50 additions and 7 deletions

View File

@ -900,11 +900,15 @@ uint8_t gc_execute_line(char *line)
// [4. Set spindle speed ]:
if (gc_state.spindle_speed != gc_block.values.s) {
#ifdef VARIABLE_SPINDLE
// Do not stop motion if in laser mode and a G1, G2, or G3 motion is being executed.
if ( (bit_isfalse(settings.flags,BITFLAG_LASER_MODE) && (axis_command == AXIS_COMMAND_MOTION_MODE) &&
((gc_block.modal.motion == MOTION_MODE_LINEAR ) || (gc_block.modal.motion == MOTION_MODE_CW_ARC) || (gc_block.modal.motion == MOTION_MODE_CCW_ARC)) ) ) {
// Update running spindle only if not in check mode and not already enabled.
if (gc_state.modal.spindle != SPINDLE_DISABLE) { spindle_run(gc_state.modal.spindle, gc_block.values.s); }
if (gc_state.modal.spindle != SPINDLE_DISABLE) {
if ( bit_istrue(settings.flags, BITFLAG_LASER_MODE) ) {
// Do not stop motion if in laser mode and a G1, G2, or G3 motion is being executed.
if (!( (axis_command == AXIS_COMMAND_MOTION_MODE) && ((gc_block.modal.motion == MOTION_MODE_LINEAR ) || (gc_block.modal.motion == MOTION_MODE_CW_ARC) || (gc_block.modal.motion == MOTION_MODE_CCW_ARC)) ) ) {
spindle_run(gc_state.modal.spindle, gc_block.values.s);
}
} else {
spindle_run(gc_state.modal.spindle, gc_block.values.s);
}
}
#else
if (gc_state.modal.spindle != SPINDLE_DISABLE) { spindle_run(gc_state.modal.spindle, gc_block.values.s); }

View File

@ -23,7 +23,7 @@
// Grbl versioning system
#define GRBL_VERSION "1.1c"
#define GRBL_VERSION_BUILD "20161011"
#define GRBL_VERSION_BUILD "20161012"
// Define standard libraries used by Grbl.
#include <avr/io.h>