Restrict coincident target updates to M3 constant laser only.

- 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.
This commit is contained in:
Sonny Jeon 2017-02-23 12:52:35 -07:00
parent bdc853e557
commit e54444e948
2 changed files with 16 additions and 2 deletions

View file

@ -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);
}
}
}
}