Skip to content

New "LPF" filter for PID Conrolers in motor.cpp producing "NaN´s" after some (long) time..... #161

@MrTreeBark

Description

@MrTreeBark

What the description said, possibly due to an overflow. Observed a long time and validated with console, mower conrol loop runs with 50Hz. Mower will stop after ~ 1 - 2 hours and drives are dead, because pid is outputting 0, beside rpm set is given.
It just stops working and there are sudden NaN´s coming from function call motorRightOrLeftLpf(motorRightOrLeftRpmCurr); (logged)

motorRightPID.TaMax = 0.25; //motorRightPID.x = motorRightLpf(motorRightRpmCurr); //gives a NaN after some time.................. motorRightPID.x = motorRightRpmCurr; motorRightPID.w = motorRightRpmSet; motorRightPID.y_min = -pwmMax; motorRightPID.y_max = pwmMax; motorRightPID.max_output = pwmMax; motorRightPID.output_ramp = MOTOR_PID_RAMP; motorRightPID.compute(); motorRightPWMCurr = motorRightPWMCurr + motorRightPID.y;

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