Fixed issue with M3 laser state changes and coincident targets.

[fix] When in M3 constant laser power mode, a change from G0 to G1
would not set the laser on, if G1 was passed with a coincident target.
Motion controller now checks for a coincident target situation and will
force a spindle sync when detected.
This commit is contained in:
Sonny Jeon 2017-02-23 12:00:20 -07:00
parent f51268e855
commit bdc853e557
3 changed files with 20 additions and 3 deletions

View file

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

View file

@ -65,8 +65,12 @@ void mc_line(float *target, plan_line_data_t *pl_data)
} while (1);
// Plan and queue motion into planner buffer
// uint8_t plan_status; // Not used in normal operation.
plan_buffer_line(target, pl_data);
if (plan_buffer_line(target, pl_data) == PLAN_EMPTY_BLOCK) {
if (bit_istrue(settings.flags,BITFLAG_LASER_MODE)) {
// Correctly set laser state, if there is a coincident position passed. Forces a buffer sync.
spindle_sync((pl_data->condition & (PL_COND_FLAG_SPINDLE_CW|PL_COND_FLAG_SPINDLE_CCW)), pl_data->spindle_speed);
}
}
}