Skip to content

Derivative error time factor equation #11

@td0g

Description

@td0g

It appears that the equation for the derivative error (line 62) uses the wrong operator to convert from milliseconds to seconds. The integral error (line 60) uses Seconds (_dT / 1000) as the time unit, but the derivative error uses Microseconds (_dT * 1000).

I think the correct formula would include a pair of brackets as follows in order to keep the units consistent with the integral error:

 double _dError = (_error - _previousError) / (_dT / 1000.0);   //derivative

In order to use multiplication instead of division, the formula could be rewritten as follows:

 double _dError = (_error - _previousError) * 1000.0 / _dT;   //derivative

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions