grblHAL / Plugins_spindle

grblHAL plugins for spindle control
Other
8 stars 12 forks source link

Speed tolerance based on present speed instead of top speed #12

Open Meliusja opened 2 years ago

Meliusja commented 2 years ago
    if(settings.spindle.at_speed_tolerance > 0.0f) {
        spindle_data.rpm_low_limit = rpm / (1.0f + settings.spindle.at_speed_tolerance);
        spindle_data.rpm_high_limit = rpm * (1.0f + settings.spindle.at_speed_tolerance);
    }

This code from huanyang.c applies speed tolerance percentage to the present speed setpoint which implies that speed accuracy of VFDs improve as the speed decreases. For example a 10000 RPM motor with a 1% speed tolerance would be +/- 100 RPM at 10000RPM but +/- 10 RPM at 1000RPM. The physics governing speed accuracy on VFDs cause the the speed accuracy to be the same or worse as the speed decreases. I believe the speed tolerance should always be based on percentage of top speed. Thanks, Jeff

terjeio commented 2 years ago

I believe the speed tolerance should always be based on percentage of top speed.

I do not believe so - but maybe there is a case for making it configurable?