Package io.openems.edge.common.filter
Class PidFilter
java.lang.Object
io.openems.edge.common.filter.PidFilter
- Direct Known Subclasses:
DisabledPidFilter
A proportional-integral-derivative controller.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
static final double
static final double
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
applyLowHighLimits
(int value) Applies the configured PID low and high limits to a value.int
applyPidFilter
(int input, int target) Apply the PID filter using the current Channel value as input and the target value.void
reset()
Reset the PID filter.void
Limit the output value.
-
Field Details
-
DEFAULT_P
public static final double DEFAULT_P- See Also:
-
DEFAULT_I
public static final double DEFAULT_I- See Also:
-
DEFAULT_D
public static final double DEFAULT_D- See Also:
-
ERROR_SUM_LIMIT_FACTOR
public static final int ERROR_SUM_LIMIT_FACTOR- See Also:
-
-
Constructor Details
-
PidFilter
public PidFilter(double p, double i, double d) Creates a PidFilter.- Parameters:
p
- the proportional gaini
- the integral gaind
- the derivative gain
-
PidFilter
public PidFilter()Creates a PidFilter using default values.
-
-
Method Details
-
setLimits
Limit the output value.- Parameters:
lowLimit
- lowest allowed output valuehighLimit
- 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 valuetarget
- 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
-