Package com.jackmeng.stl
Class stl_PIDController
java.lang.Object
com.jackmeng.stl.stl_PIDController
public class stl_PIDController
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description private double
D
private double
deadband
private double
dt
private double
errorSum
private boolean
firstRun
private double
I
private boolean
isOnTarget
private double
lastError
private double
lastTime
private double
maxErrorSum
private double
maxOutput
private double
minOutput
private int
onTargetCount
private int
onTargetCountMax
private double
onTargetError
private double
P
private double
setpoint
-
Constructor Summary
Constructors Constructor Description stl_PIDController(double P, double I, double D)
-
Method Summary
Modifier and Type Method Description double
calculate(double processVariable)
private void
checkOnTarget(double error)
boolean
isOnTarget()
void
reset()
void
setDeadband(double deadband)
void
setDt(double dt)
void
setMaxErrorSum(double maxErrorSum)
void
setMaxOutput(double maxOutput)
void
setMinOutput(double minOutput)
void
setOnTargetCountMax(int onTargetCountMax)
void
setOnTargetError(double onTargetError)
void
setSetpoint(double setpoint)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
P
private final double P -
I
private final double I -
D
private final double D -
setpoint
private double setpoint -
errorSum
private double errorSum -
lastError
private double lastError -
maxErrorSum
private double maxErrorSum -
maxOutput
private double maxOutput -
minOutput
private double minOutput -
lastTime
private double lastTime -
dt
private double dt -
deadband
private double deadband -
firstRun
private boolean firstRun -
isOnTarget
private boolean isOnTarget -
onTargetError
private double onTargetError -
onTargetCount
private int onTargetCount -
onTargetCountMax
private int onTargetCountMax
-
-
Constructor Details
-
stl_PIDController
public stl_PIDController(double P, double I, double D)
-
-
Method Details
-
setSetpoint
public void setSetpoint(double setpoint) -
setMaxErrorSum
public void setMaxErrorSum(double maxErrorSum) -
setMaxOutput
public void setMaxOutput(double maxOutput) -
setMinOutput
public void setMinOutput(double minOutput) -
setDt
public void setDt(double dt) -
setDeadband
public void setDeadband(double deadband) -
setOnTargetError
public void setOnTargetError(double onTargetError) -
setOnTargetCountMax
public void setOnTargetCountMax(int onTargetCountMax) -
calculate
public double calculate(double processVariable) -
checkOnTarget
private void checkOnTarget(double error) -
isOnTarget
public boolean isOnTarget() -
reset
public void reset()
-