Class PidFilter

java.lang.Object
io.openems.edge.common.filter.PidFilter
Direct Known Subclasses:
DisabledPidFilter

public class PidFilter extends Object
A proportional-integral-derivative controller.
See Also:
  • Field Details

  • Constructor Details

    • PidFilter

      public PidFilter(double p, double i, double d)
      Creates a PidFilter.
      Parameters:
      p - the proportional gain
      i - the integral gain
      d - the derivative gain
    • PidFilter

      public PidFilter()
      Creates a PidFilter using default values.
  • Method Details

    • setLimits

      public void setLimits(Integer lowLimit, Integer highLimit)
      Limit the output value.
      Parameters:
      lowLimit - lowest allowed output value
      highLimit - highest allowed output value
    • applyPidFilter

      public int applyPidFilter(int input, int target)
      Apply the PID filter using the current Channel value as input and the target value.
      Parameters:
      input - the input value, e.g. the measured Channel value
      target - the target value
      Returns:
      the filtered set-point value
    • reset

      public void reset()
      Reset the PID filter.

      This method should be called when the filter was not used for a while.

    • applyLowHighLimits

      protected int applyLowHighLimits(int value)
      Applies the configured PID low and high limits to a value.
      Parameters:
      value - the input value
      Returns:
      the value within low and high limit