pid-go icon indicating copy to clipboard operation
pid-go copied to clipboard

Ignore NaN and Inf Values in PID controler Inputs

Open timebis opened this issue 1 year ago • 0 comments

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 avatar Aug 24 '24 21:08 timebis