grblHAL / core

grblHAL core code and master Wiki
Other
326 stars 85 forks source link

Change of maximum spindle rpm $30 to higher value as before generates wrong PWM without reboot #426

Closed rcp1 closed 8 months ago

rcp1 commented 9 months ago

Board: T41U5XBB Version: Webbuilt VER:1.1f.20231229, default settings

Hi,

I've just encountered some weird behavior of the PWM on my machine (flushed the EEPROM before flashing firmware): If I increase the $30 maximum spindle RPM above the previous / default setting (e.g., from 1000 to 24000), the resulting PWM values do not fit at all. Only if the new $30 setting is below the previous setting, the resulting / new PWM values are correct.

A hard reboot fixes the wrong PWM. Is this behavior intended? In old versions (autumn 2022) a switch of the $30 did not need a reboot at all to produce correct PWM.

Gcode and settings switch to replicate:

M3 S500 M5 M3 S1000 M5 $30=24000 M3 S12000 M5 M3 S24000 M5

terjeio commented 8 months ago

Not intended, and is due to not propagating min/max settings values correctly. This "bug" has been present for quite some time, will fix in next commit.