48 FIVEPOINTSTENCIL = 1 << 1,
49 THREEPOINTSKEWEDSTENCIL = 1 << 2,
87 std::vector<agx::Real> m_fivePoints;
104 std::vector<agx::Real> m_threePoints;
263 agx::Vec2 m_manipulatedVariableAccelerationLimit;
270 std::deque<agx::Real> m_cost;
271 std::deque<agx::TimeStamp> m_costTime;
280 bool m_doIntegralWindupProtection;
283 static const int MAX_COST_HISTORY;
#define AGX_DECLARE_POINTER_TYPES(type)
A simple base class for a controller with a set point and an out signal.
Differentiate a PID controller signal with the "five-point stencil" method.
DerivativeFivePointStencil()
virtual agx::Real calculate(const agx::TimeStamp &time, agx::Real value) override
Calculate five-point stencil derivative.
Differentiate a PID controller signal with the "three-point stencil" method.
DerivativeThreePointSkewedStencil()
virtual agx::Real calculate(const agx::TimeStamp &time, agx::Real value) override
Calculate three-point skewed stencil derivative.
Differentiate a PID controller signal with a two point estimation.
agx::TimeStamp m_lastTime
virtual agx::Real calculate(const agx::TimeStamp &time, agx::Real value)
A PID controller with the classic gain coefficients for proportional, integral, and derivative gain.
void enablePidController()
Enable the PID controller.
void setGains(agx::Real proportionalGain, agx::Real integralGain, agx::Real derivativeGain)
Set the gains.
const agx::Vec2 & getManipulatedVariableLimit() const
void setIntegralGain(agx::Real integralGain)
Set the integral gain, K_i.
virtual void reset() override
Reset calculated gain, error, and cost to 0.
bool hasEnabledIntegralWindupProtection() const
virtual void update(const agx::TimeStamp &time, agx::Real measuredProcessVariable) override
Update the measured Process Variable and calculate a new value for the Manipulated Variable.
virtual agx::Real getManipulatedVariable() const override
agx::Real getDerivativeTime()
agx::Vec3 getGains() const
void setFrequency(agx::Real frequency)
Set PID frequency for gain compensation of the derivative and integral term, default values is 1.
agx::Real getIntegraTerm() const
void disablePidController()
Disable the PID controller. The Manipulated Value will be zero.
agx::Real getMeasuredProcessVariable() const
void setIntegralTime(agx::Real integralTime)
Set the integral time defined as T_i = K_p / K_i.
void setManipulatedVariableLimit(agx::Real lowerLimit, agx::Real upperLimit)
Limit the Manipulated Variable between this lower and upper limit. Default limits are +/- agx::Real m...
void setIntegralWindupProtection(bool doIntegralWindupProtection)
Enable or disable the integral windup backward calculation.
void setDerivativeGain(agx::Real derivativeGain)
Set the derivative gain, K_d.
void setDerivationMethod(Derivative *derivationMethod)
Change the derivation method. Default is the first order numerical derivation method.
virtual void setSetPoint(agx::Real setPoint) override
Set the current Set Point for the controller.
virtual agx::Real getSetPoint() const override
void setIntegralWindupClamping(agx::Real lowerLimitIntegralTerm, agx::Real upperLimitIntegralTerm)
Set the lower and upper limit of the integral gain term, getIntegraTerm().
agx::Real getError() const
void setManipulatedVariableAccelerationLimit(agx::Real lowerLimit, agx::Real upperLimit)
Limit the Manipulated Variable acceleration dMV/dt between this lower and upper limit....
agx::Real getDerivativeGain() const
agx::Real getIntegralTime()
agx::Real getProportionalGain() const
const agx::Vec2 & getManipulatedVariableAccelerationLimit() const
agx::Real getDerivativeTerm() const
agx::Real getProportionalTerm() const
const agx::Vec2 & getIntegralWindupClamping() const
agx::Real getFrequency() const
void setDerivationType(DerivationMethod derivationMethod)
Change the derivation method. Default is the first order numerical derivation method DerivationMethod...
agx::Real calculateCostFunctionValue(agx::Real deltaTime) const
This will calculate the cost function value between the last time update() was called and last time m...
void setDerivativeTime(agx::Real derivativeTime)
Set the derivative time defined as T_d = K_d / K_p.
agx::Real getIntegralGain() const
void setProportionalGain(agx::Real proportionalGain)
Set the proportional gain, K_p.
Base class providing referencing counted objects.
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.