12 double minOut = -std::numeric_limits<double>::infinity();
13 double maxOut = std::numeric_limits<double>::infinity();
50 double Output(
double error,
double integratedError,
double time)
const;
56 void Accept(
double error,
double time);
59 double IntegralPart(
double integratedError)
const;
62 bool m_hasLast =
false;
63 double m_lastError = 0.0;
64 double m_lastTime = 0.0;
65 double m_heldErrorRate = 0.0;
PID controller for use inside a SimObject, whose integral is a state that FhSim integrates.
Definition PidWithExternalState.h:44
double Output(double error, double integratedError, double time) const
void Accept(double error, double time)
Stores the error of an accepted step and updates the held derivative from the previous one.
double IntegralRate(double error, double integratedError) const
The rate of the integral state: the error, or zero while the integral part is past a bound (anti-wind...
The gains and limits of a PidWithExternalState. The defaults leave every limit open.
Definition PidWithExternalState.h:7
double I
Integral gain.
Definition PidWithExternalState.h:9
double D
Derivative gain.
Definition PidWithExternalState.h:10
double minOut
Lower bound of the output.
Definition PidWithExternalState.h:12
double P
Proportional gain.
Definition PidWithExternalState.h:8
double maxDerivativePart
Clamps |derivative part|.
Definition PidWithExternalState.h:17
double initOutput
The integral part while the integral state is zero.
Definition PidWithExternalState.h:15
double maxIntegratorPart
The integral freezes while |integral part| is past this.
Definition PidWithExternalState.h:16
double maxOut
Upper bound of the output.
Definition PidWithExternalState.h:13