Skip to content

Handling dt when updating integral and derivative terms #35

Description

@antoine-sac

To properly integrate and derivate, the PID needs to know dt.

If the PID updates are irregular, the only way to obtain correct values is to modify ki and kd on every iteration, which is clunky.

This is not really a problem if the pid updates are run regularly, because you can bake dt in ki and kd. But even then it's annoying because you have to modify ki and kd every time you modify your regulation interval.

Of course, we don't want to break the current interface, but we could introduce something like pid.next_control_output_with_dt(measurement, dt)...

And pid.next_control_output(measurement) would become a thin wrapper with dt = 1

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions