Skip to content

PID issue with negative error #4

Description

@keck9939

If the error term in the PID calculation is negative, I believe the PID calculation falls apart. For example, if iLimit is 1.0 and iSource is 1.1, it calculates grossSetPoint = 0, fineSetPoint = 65533. Since for iSource = 0.9 you get grossSetPoint = 1 and fineSetPoint = 2, and for 0 error you get 0, there is clearly something wrong (the PID output should be a continuous function of the input). Looking at the code, it is clear there was no thought given to handling negative PID output. While it is possible the load may appear to operate correctly, I strongly suspect it is subject to overshoot and instability.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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