Skip to content

Ignore single-shot hall signal inconsistency error #58

@at-wat

Description

@at-wat

// Check hall signal consistency
if (motor_param[i].enc_type == 2)
{
int err = motor_param[i].enc0 - enc0;
normalize(&err, -motor_param[i].enc_rev_h, motor_param[i].enc_rev_h, motor_param[i].enc_rev);
// In worst case, initial encoder origin can have offset of motor_param[i].enc_rev/12.
if (_abs(err) > motor_param[i].enc_rev / 6)
{
motor[i].error_state |= ERROR_HALL_ENC;
printf("PWM:enc-hall err (%d)\n\r", err);
}
}

like
if (driver_state.error.hall[i] > 12)
{
// エラー検出後、1周以内に再度エラーがあれば停止
motor[i].error_state |= ERROR_HALL_SEQ;
printf("PWM:hall err (%x-%x)\n\r", _hall[i], hall[i]);
}

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