Class PIDController
java.lang.Object
neqsim.process.ml.controllers.PIDController
- All Implemented Interfaces:
Serializable, Controller
PID controller for setpoint tracking with integral and derivative action.
action = Kp * error + Ki * integral(error) + Kd * d(error)/dt
- Version:
- 1.0
- Author:
- ESOL
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final doubleprivate final doubleprivate final doubleprivate final intprivate booleanprivate doubleprivate final doubleprivate final doubleprivate final doubleprivate final Stringprivate doubleprivate static final long -
Constructor Summary
ConstructorsConstructorDescriptionPIDController(String name, int errorIndex, double kp, double ki, double kd, double actionMin, double actionMax, double dt) Create PID controller. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]computeAction(double[] observation) Compute control action based on observation.doubleGet current integral value.getName()Get controller name.voidreset()Reset controller state (for stateful controllers like PID).
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
name
-
errorIndex
private final int errorIndex -
kp
private final double kp -
ki
private final double ki -
kd
private final double kd -
actionMin
private final double actionMin -
actionMax
private final double actionMax -
dt
private final double dt -
integral
private double integral -
previousError
private double previousError -
firstStep
private boolean firstStep
-
-
Constructor Details
-
PIDController
public PIDController(String name, int errorIndex, double kp, double ki, double kd, double actionMin, double actionMax, double dt) Create PID controller.- Parameters:
name- controller nameerrorIndex- index of error in observation arraykp- proportional gainki- integral gainkd- derivative gainactionMin- minimum action valueactionMax- maximum action valuedt- time step for integration
-
-
Method Details
-
computeAction
public double[] computeAction(double[] observation) Description copied from interface:ControllerCompute control action based on observation.- Specified by:
computeActionin interfaceController- Parameters:
observation- normalized observation array- Returns:
- action array
-
reset
public void reset()Description copied from interface:ControllerReset controller state (for stateful controllers like PID).- Specified by:
resetin interfaceController
-
getName
Description copied from interface:ControllerGet controller name.- Specified by:
getNamein interfaceController- Returns:
- name
-
getIntegral
public double getIntegral()Get current integral value.- Returns:
- integral
-