Skip to content

Unexpected Spindle Linearization Treatment of PWM/rpm Min Values #555

@engigeer

Description

@engigeer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions