From e54444e948df641480a1444547fb1f4868df78ef Mon Sep 17 00:00:00 2001 From: Sonny Jeon Date: Thu, 23 Feb 2017 12:52:35 -0700 Subject: [PATCH] Restrict coincident target updates to M3 constant laser only. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Restrict M3 forced updates when there is a motion block with a coincident target. Force syncing of the spindle state can lead to some pauses during a job that has coincident targets. That’s not particularly desirable. This ensures M4 dynamic mode is not effected by this force-sync. --- doc/log/commit_log_v1.1.txt | 11 +++++++++++ grbl/motion_control.c | 7 +++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/doc/log/commit_log_v1.1.txt b/doc/log/commit_log_v1.1.txt index 7ed80ef..ff24533 100644 --- a/doc/log/commit_log_v1.1.txt +++ b/doc/log/commit_log_v1.1.txt @@ -1,3 +1,14 @@ +---------------- +Date: 2017-02-23 +Author: Sonny Jeon +Subject: 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. + + ---------------- Date: 2017-01-31 Author: Sonny Jeon diff --git a/grbl/motion_control.c b/grbl/motion_control.c index 9ef588b..6e11e35 100644 --- a/grbl/motion_control.c +++ b/grbl/motion_control.c @@ -67,8 +67,11 @@ void mc_line(float *target, plan_line_data_t *pl_data) // Plan and queue motion into planner buffer 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); + // Correctly set spindle state, if there is a coincident position passed. Forces a buffer + // sync while in M3 laser mode only. + if (pl_data->condition & PL_COND_FLAG_SPINDLE_CW) { + spindle_sync(PL_COND_FLAG_SPINDLE_CW, pl_data->spindle_speed); + } } } }