Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore NaN and Inf Values in PID controler Inputs #162

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

timebis
Copy link

@timebis timebis commented Aug 24, 2024

Description

This merge request introduces checks to handle NaN and Inf values in the ControllerInput struct given in the update function.
If either the ReferenceSignal or ActualSignal contains invalid NaN or Inf values, the update process will safely terminate without affecting the controller's state.
It ensure that invalid inputs do not propagate through the system.

More question about your module

  1. Is there a specific reason why you fill SamplingInterval externally instead of calculating it as an internal variable?
    Are you using it with an external time source?
  2. I think it might be beneficial to define a Timeout in the controller : If the time since the last update exceeds the Timeout, the controller would skip adding the Integral term. Would you be interested in this? If so, I can create a pr.

@timebis timebis requested a review from a team as a code owner August 24, 2024 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant