1
0
mirror of https://github.com/bdring/Grbl_Esp32.git synced 2025-08-29 09:10:03 +02:00

Rate Adjusting Fix

This commit is contained in:
bdring
2020-12-09 17:05:35 -06:00
parent 76f742682b
commit 1f372d3d58
2 changed files with 3 additions and 0 deletions

View File

@@ -476,6 +476,7 @@ Error gc_execute_line(char* line, uint8_t client) {
if (spindle->is_reversable || spindle->inLaserMode()) {
gc_block.modal.spindle = SpindleState::Ccw;
} else {
grbl_msg_sendf(CLIENT_SERIAL, MsgLevel::Info, "M4 requires laser mode or a reversable spindle");
FAIL(Error::GcodeUnsupportedCommand);
}
break;

View File

@@ -551,6 +551,8 @@ void st_prep_buffer() {
prep.current_speed = sqrt(pl_block->entry_speed_sqr);
}
st_prep_block->is_pwm_rate_adjusted = false; // set default value
// prep.inv_rate is only used if is_pwm_rate_adjusted is true
if (spindle->inLaserMode()) { //
if (pl_block->spindle == SpindleState::Ccw) {
// Pre-compute inverse programmed rate to speed up PWM updating per step segment.