public class PIController extends Object
Description: This PI_Controller class implements a proportional, integral feedback loop controller for use in the thermal control of the LSST camera electronics. The functionality includes anti-windup.
| Constructor and Description |
|---|
PIController(double Init_gain,
double Init_timeConstant)
Allocate a PI object with the given constants for P, I
|
| Modifier and Type | Method and Description |
|---|---|
double |
getError()
Returns the current difference of the input from the setpoint
|
double |
getI()
Get the Integral coefficient
|
double |
getIntegral()
Returns the current error integral
|
double |
getP()
Get the Proportional coefficient
|
double |
getSetpoint()
Returns the current setpoint of the PIDController
|
double |
getSmooth()
Returns the current smoothed input
|
boolean |
onTarget()
Return true if the error is within the percentage of the input range,
determined by setTolerance.
|
double |
performPI(double[] input,
double time)
Return the current PI result.
|
void |
reset()
Reset the previous error, the integral, and disable the controller.
|
void |
setAwGain(double gain)
Sets the anti-windup gain.
|
void |
setBaseOutput(double value)
Sets the base output.
|
void |
setInputRange(double minimumInput,
double maximumInput)
Sets the maximum and minimum values expected from the input.
|
void |
setIntegral(double value)
Sets the error integral
|
void |
setOutputRange(double minimumOutput,
double maximumOutput)
Sets the minimum and maximum values to write.
|
void |
setPID(double p,
double intTime)
Set the PI Controller gain parameters.
|
void |
setSetpoint(double setpnt)
Set the setpoint for the PIDController
|
void |
setSmoothTime(double time)
Sets the smoothing time.
|
void |
setTolerance(double percent)
Set the percentage error which is considered tolerable for use with
OnTarget.
|
public PIController(double Init_gain,
double Init_timeConstant)
Init_gain - the loop gain coefficientInit_timeConstant - the integration time constant (seconds)public double performPI(double[] input,
double time)
input - The array of input valuestime - The measurement timepublic void setPID(double p,
double intTime)
p - Proportional coefficient (overall loop gain)intTime - Integral coefficient (integration time constant)public double getP()
public double getI()
public void setSmoothTime(double time)
time - the smoothing timepublic void setAwGain(double gain)
gain - the anti-windup gainpublic void setBaseOutput(double value)
value - the base output valuepublic void setTolerance(double percent)
percent - error which is tolerablepublic void setInputRange(double minimumInput,
double maximumInput)
minimumInput - the minimum value expected from the inputmaximumInput - the maximum value expected from the outputpublic void setOutputRange(double minimumOutput,
double maximumOutput)
minimumOutput - the minimum value to write to the outputmaximumOutput - the maximum value to write to the outputpublic void setSetpoint(double setpnt)
setpnt - the desired setpointpublic double getSetpoint()
public double getError()
public double getIntegral()
public void setIntegral(double value)
value - the error integral value to setpublic double getSmooth()
public boolean onTarget()
public void reset()
Copyright © 2024 LSST. All rights reserved.