A known issue with the common CNC6040 router and similar devices is very poor calibration / linearity of the spindle motor response to gcode Sx commands.
Above is the system block diagram. The grbl_ESP32 gcode interpeter processes a gcode S (speed) command, converting it to a variable duty cycle PWM waveform on parallel port pin 1. Continue reading CNC6040 router project – spindle speed linearisation