PID
-
class PID : public vslib::Component
Public Functions
-
inline PID(std::string_view name, Component &parent)
PID controller constructor. Allows to set the name of the Component, set this controller as a child of a given parent Component, and specify an anti-windup function, which by default does not do anything.
- Parameters:
name – Name identification of the PID controller
parent – Parent of this controller
-
inline void updateInputHistories(const double reference, const double measurement) noexcept
Updates histories of measurements and references and moves the head of the history buffer.
- Parameters:
reference – Current value of the set-point reference
measurement – Current value of the process value
-
inline double control(const double reference, const double measurement) noexcept
Computes one iteration of the controller.
- Parameters:
reference – Reference value for the controller
measurement – Value of the controlled process
- Returns:
Result of this iteration
-
inline void updateReference(const double updated_actuation)
Updates the most recent reference in the history, used in cases actuation goes over the limit.
- Parameters:
updated_actuation – Actuation that actually took place after clipping of the calculated actuation
-
inline void reset() noexcept
Resets the controller to the initial state by zeroing the history.
-
inline const auto &getR() const
Returns the r polynomial coefficients.
- Returns:
r polynomial coefficients
-
inline const auto &getS() const
Returns the s polynomial coefficients.
- Returns:
s polynomial coefficients
-
inline const auto &getT() const
Returns the t polynomial coefficients.
- Returns:
t polynomial coefficients
Public Members
-
Parameter<double> c
Reference signal derivative gain scaling (from High-Performance Digital Control)
-
LimitRange<double> actuation_limits
Range limiting of the actuation output.
-
inline PID(std::string_view name, Component &parent)