Template Class Gains
Defined in File gains.hpp
Class Documentation
-
template<typename MessageRefType, typename FloatFieldType, typename BoolFieldType, typename FloatEnumType, typename BoolEnumType>
class Gains Public Functions
-
inline Gains(MessageRefType &internal, FloatEnumType kp_gain, BoolEnumType d_on_error_gain)
-
inline Gains(const MessageRefType &internal, FloatEnumType kp_gain, BoolEnumType d_on_error_gain)
-
inline FloatFieldType &kP()
Proportional PID gain.
-
inline const FloatFieldType &kP() const
Proportional PID gain.
-
inline FloatFieldType &kI()
Integral PID gain.
-
inline const FloatFieldType &kI() const
Integral PID gain.
-
inline FloatFieldType &kD()
Derivative PID gain.
-
inline const FloatFieldType &kD() const
Derivative PID gain.
-
inline FloatFieldType &feedForward()
Feed forward term (this term is multiplied by the target and added to the output).
-
inline const FloatFieldType &feedForward() const
Feed forward term (this term is multiplied by the target and added to the output).
-
inline FloatFieldType &deadZone()
Error values within +/- this value from zero are treated as zero (in terms of computed proportional output, input to numerical derivative, and accumulated integral error).
-
inline const FloatFieldType &deadZone() const
Error values within +/- this value from zero are treated as zero (in terms of computed proportional output, input to numerical derivative, and accumulated integral error).
-
inline FloatFieldType &iClamp()
Maximum allowed value for the output of the integral component of the PID loop; the integrated error is not allowed to exceed value that will generate this number.
-
inline const FloatFieldType &iClamp() const
Maximum allowed value for the output of the integral component of the PID loop; the integrated error is not allowed to exceed value that will generate this number.
-
inline FloatFieldType &punch()
Constant offset to the PID output outside of the deadzone; it is added when the error is positive and subtracted when it is negative.
-
inline const FloatFieldType &punch() const
Constant offset to the PID output outside of the deadzone; it is added when the error is positive and subtracted when it is negative.
-
inline FloatFieldType &minTarget()
Minimum allowed value for input to the PID controller.
-
inline const FloatFieldType &minTarget() const
Minimum allowed value for input to the PID controller.
-
inline FloatFieldType &maxTarget()
Maximum allowed value for input to the PID controller.
-
inline const FloatFieldType &maxTarget() const
Maximum allowed value for input to the PID controller.
-
inline FloatFieldType &targetLowpass()
A simple lowpass filter applied to the target set point; needs to be between 0 and 1. At each timestep: x_t = x_t
a + x_{t-1} * (1 - a).
-
inline const FloatFieldType &targetLowpass() const
A simple lowpass filter applied to the target set point; needs to be between 0 and 1. At each timestep: x_t = x_t
a + x_{t-1} * (1 - a).
-
inline FloatFieldType &minOutput()
Output from the PID controller is limited to a minimum of this value.
-
inline const FloatFieldType &minOutput() const
Output from the PID controller is limited to a minimum of this value.
-
inline FloatFieldType &maxOutput()
Output from the PID controller is limited to a maximum of this value.
-
inline const FloatFieldType &maxOutput() const
Output from the PID controller is limited to a maximum of this value.
-
inline FloatFieldType &outputLowpass()
A simple lowpass filter applied to the controller output; needs to be between 0 and 1. At each timestep: x_t = x_t * a + x_{t-1} * (1 - a).
-
inline const FloatFieldType &outputLowpass() const
A simple lowpass filter applied to the controller output; needs to be between 0 and 1. At each timestep: x_t = x_t * a + x_{t-1} * (1 - a).
-
inline BoolFieldType &dOnError()
Controls whether the Kd term uses the “derivative of error” or “derivative of measurement.” When the setpoints have step inputs or are noisy, setting this to
false
can eliminate corresponding spikes or noise in the output.
-
inline const BoolFieldType &dOnError() const
Controls whether the Kd term uses the “derivative of error” or “derivative of measurement.” When the setpoints have step inputs or are noisy, setting this to
false
can eliminate corresponding spikes or noise in the output.
-
inline Gains(MessageRefType &internal, FloatEnumType kp_gain, BoolEnumType d_on_error_gain)