It seems that when spindle linearization is enabled, the values of $31 (Setting_RpmMin) and $35 (Setting_PWMMinValue), are not used for computing the conversion from pwm_data to pwm_value.
|
pwm_value = floorf((pwm_data->piece[idx].start * rpm - pwm_data->piece[idx].end) * pwm_data->pwm_gradient); |
This could potentially lead to unexpected results (if these settings are non-zero), since the values are still used when computing the gradient.
|
pwm_data->pwm_gradient = (float)(pwm_data->max_value - pwm_data->min_value) / (spindle->rpm_max - spindle->rpm_min); |
I’m wondering if there is any reason not to compute the pwm_data the same as without spindle linearization, i.e.,:
pwm_value = floorf((pwm_data->piece[idx].start * rpm - pwm_data->rpm_min - pwm_data->piece[idx].end) * pwm_data->pwm_gradient) + pwm_data->min_value;
I think this should still work with the spindle linearization python code so long as the values remain unchanged from those used to generate the input data.
It seems that when spindle linearization is enabled, the values of $31 (Setting_RpmMin) and $35 (Setting_PWMMinValue), are not used for computing the conversion from pwm_data to pwm_value.
core/spindle_control.c
Line 716 in 1c1519d
This could potentially lead to unexpected results (if these settings are non-zero), since the values are still used when computing the gradient.
core/spindle_control.c
Line 772 in 1c1519d
I’m wondering if there is any reason not to compute the pwm_data the same as without spindle linearization, i.e.,:
I think this should still work with the spindle linearization python code so long as the values remain unchanged from those used to generate the input data.