Interface ControllerDeviceInterface
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ControllerDeviceBaseClass, IntegratedSafetySystemExample.ESDController, IntegratedSafetySystemExample.HIPPSController, ModelPredictiveController
- Version:
- $Id: $Id
- Author:
- Even Solbraa
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumAvailable tuning rules for step-response based auto-tuning. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddGainSchedulePoint(double processValue, double Kp, double Ti, double Td) Add a gain schedule point that switches controller parameters when the measured value exceeds the specified threshold.default voidautoTune(double ultimateGain, double ultimatePeriod) Auto tune controller using ultimate gain and period from a closed-loop test.default voidautoTune(double ultimateGain, double ultimatePeriod, boolean tuneDerivative) Auto tune controller using ultimate gain and period from a closed-loop test with optional derivative tuning.default booleanAutomatically tune the controller parameters using the recorded controller event log.default booleanautoTuneFromEventLog(boolean tuneDerivative) Automatically tune the controller parameters using the recorded controller event log with the option to omit derivative tuning.default voidautoTuneStepResponse(double processGain, double timeConstant, double deadTime) Auto tune controller from an open-loop step response using process gain, time constant and dead time.default voidautoTuneStepResponse(double processGain, double timeConstant, double deadTime, boolean tuneDerivative) Auto tune controller from an open-loop step response using process gain, time constant and dead time with optional derivative tuning.booleandoublegetControllerSetPoint.default List<ControllerEvent> Retrieve the controller event log.default doubleGet the integral of absolute error accumulated during the simulation.doublegetMeasuredValue.default doublegetMeasuredValue(String unit) getMeasuredValue.doublegetResponse.default doubleGet the settling time computed from the event log.Retrieve the currently selected step-response tuning correlations.getUnit()getUnit.inthashCode()booleanisActive()isActive.booleanisReverseActing.default voidReset the controller event log.default voidReset accumulated performance metrics.default voidrunTransient(double initResponse, double dt) runTransient.voidrunTransient(double initResponse, double dt, UUID id) runTransient.voidsetActive(boolean isActive) setActive.voidsetControllerParameters(double Kp, double Ti, double Td) Set PID tuning parameters.voidsetControllerSetPoint(double signal) setControllerSetPoint.default voidsetControllerSetPoint(double signal, String unit) setControllerSetPoint.default voidsetDerivativeFilterTime(double timeConstant) Set derivative filter time constant.default voidsetOutputLimits(double min, double max) Set minimum and maximum controller output for anti-windup handling.voidsetReverseActing(boolean reverseActing) setReverseActing.default voidSelect the tuning correlations that should be used when calling one of the step response auto-tuning helpers.voidsetTransmitter.voidsetUnit.
-
Method Details
-
getMeasuredValue
double getMeasuredValue()getMeasuredValue.
- Returns:
- a double
-
getMeasuredValue
-
setControllerSetPoint
void setControllerSetPoint(double signal) setControllerSetPoint.
- Parameters:
signal- a double
-
setControllerSetPoint
-
getControllerSetPoint
double getControllerSetPoint()getControllerSetPoint.
- Returns:
- current controller set point
-
getUnit
-
setUnit
-
setTransmitter
setTransmitter.
- Parameters:
device- aMeasurementDeviceInterfaceobject
-
runTransient
default void runTransient(double initResponse, double dt) runTransient.
Calculates controller output. Sets calc identifier UUID.- Parameters:
initResponse- Init value for response calculationdt- Delta time [s]
-
runTransient
runTransient.
Calculates controller output. Sets calc identifier UUID.- Parameters:
initResponse- Init value for response calculationdt- Delta time [s]id- Calculation identifier
-
getResponse
double getResponse()getResponse.
- Returns:
- a double
-
isReverseActing
boolean isReverseActing()isReverseActing.
- Returns:
- a boolean
-
setReverseActing
void setReverseActing(boolean reverseActing) setReverseActing.
- Parameters:
reverseActing- a boolean
-
setControllerParameters
void setControllerParameters(double Kp, double Ti, double Td) Set PID tuning parameters.
- Parameters:
Kp- Proportional gainTi- Integral time in secondsTd- Derivative time in seconds
-
setOutputLimits
default void setOutputLimits(double min, double max) Set minimum and maximum controller output for anti-windup handling.
- Parameters:
min- Minimum controller responsemax- Maximum controller response
-
setDerivativeFilterTime
default void setDerivativeFilterTime(double timeConstant) Set derivative filter time constant. Set to zero to disable filtering.
- Parameters:
timeConstant- Filter time constant in seconds
-
autoTune
default void autoTune(double ultimateGain, double ultimatePeriod) Auto tune controller using ultimate gain and period from a closed-loop test.
- Parameters:
ultimateGain- Ultimate gain where oscillations startultimatePeriod- Ultimate period of sustained oscillations [s]
-
autoTune
default void autoTune(double ultimateGain, double ultimatePeriod, boolean tuneDerivative) Auto tune controller using ultimate gain and period from a closed-loop test with optional derivative tuning.
- Parameters:
ultimateGain- Ultimate gain where oscillations startultimatePeriod- Ultimate period of sustained oscillations [s]tuneDerivative- true to tune derivative action, false to tune PI only
-
setStepResponseTuningMethod
Select the tuning correlations that should be used when calling one of the step response auto-tuning helpers.
- Parameters:
method- tuning rule to use
-
getStepResponseTuningMethod
Retrieve the currently selected step-response tuning correlations.
- Returns:
- the active tuning method
-
autoTuneStepResponse
default void autoTuneStepResponse(double processGain, double timeConstant, double deadTime) Auto tune controller from an open-loop step response using process gain, time constant and dead time.
- Parameters:
processGain- Process gain from step responsetimeConstant- Process time constant [s]deadTime- Process dead time [s]
-
autoTuneStepResponse
default void autoTuneStepResponse(double processGain, double timeConstant, double deadTime, boolean tuneDerivative) Auto tune controller from an open-loop step response using process gain, time constant and dead time with optional derivative tuning.
- Parameters:
processGain- Process gain from step responsetimeConstant- Process time constant [s]deadTime- Process dead time [s]tuneDerivative- true to tune derivative action, false to tune PI only
-
autoTuneFromEventLog
default boolean autoTuneFromEventLog()Automatically tune the controller parameters using the recorded controller event log. The implementation typically analyses a previously executed step test and estimates the process dynamics before calculating PID settings.
- Returns:
trueif tuning succeeded, otherwisefalse
-
autoTuneFromEventLog
default boolean autoTuneFromEventLog(boolean tuneDerivative) Automatically tune the controller parameters using the recorded controller event log with the option to omit derivative tuning.
- Parameters:
tuneDerivative- true to tune derivative action, false to tune PI only- Returns:
trueif tuning succeeded, otherwisefalse
-
addGainSchedulePoint
default void addGainSchedulePoint(double processValue, double Kp, double Ti, double Td) Add a gain schedule point that switches controller parameters when the measured value exceeds the specified threshold.
- Parameters:
processValue- Measurement threshold for parameter setKp- Proportional gain at this operating pointTi- Integral time [s] at this operating pointTd- Derivative time [s] at this operating point
-
getEventLog
Retrieve the controller event log.
- Returns:
- list of controller events
-
resetEventLog
default void resetEventLog()Reset the controller event log.
-
getIntegralAbsoluteError
default double getIntegralAbsoluteError()Get the integral of absolute error accumulated during the simulation.
- Returns:
- integral of absolute error
-
getSettlingTime
default double getSettlingTime()Get the settling time computed from the event log.
- Returns:
- settling time in seconds
-
resetPerformanceMetrics
default void resetPerformanceMetrics()Reset accumulated performance metrics.
-
equals
-
hashCode
-
setActive
void setActive(boolean isActive) setActive.
Set if controller is active- Parameters:
isActive- Set true to make controller active.
-
isActive
boolean isActive()isActive.
Specifies if controller is active- Returns:
- a boolean
-