From 5bfeae47244c3c91058205111c914689d88519ac Mon Sep 17 00:00:00 2001 From: bdring Date: Tue, 11 Sep 2018 15:53:53 -0500 Subject: [PATCH] Added spindle speed override to PWM calculationh - It was not being applied the pwm calculation - Note "ENABLE_PIECEWISE_LINEAR_SPINDLE" has not been implemented yet. --- Grbl_Esp32/spindle_control.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Grbl_Esp32/spindle_control.cpp b/Grbl_Esp32/spindle_control.cpp index 2046e169..f4cb5b92 100644 --- a/Grbl_Esp32/spindle_control.cpp +++ b/Grbl_Esp32/spindle_control.cpp @@ -78,6 +78,9 @@ void spindle_set_speed(uint8_t pwm_value) uint8_t spindle_compute_pwm_value(float rpm) { uint8_t pwm_value; + + rpm *= (0.010*sys.spindle_speed_ovr); + pwm_value = map(rpm, settings.rpm_min, settings.rpm_max, SPINDLE_PWM_OFF_VALUE, SPINDLE_PWM_MAX_VALUE); // TODO_ESP32 .. make it 16 bit