Proportional-derivative feedback loop for adjusting a control variable towards a desired setpoint based on a measured process variable in the form of a discrete-time input signal.
More...
#include <GREM/core/control.hpp>
|
| constexpr | PDController ()=default |
| | Default-construct a PD controller.
|
| constexpr | PDController (T error) |
| | Construct a PD controller with specific initial values.
|
| constexpr void | reset () |
| | Reset the PD controller to the default state.
|
| constexpr void | reset (T newError) |
| | Reset the PD controller to a specific value.
|
| template<typename Coefficient> |
| constexpr auto | update (T newSignalError, Coefficient proportionalGain, Coefficient derivativeGain) |
| | Update the controller state and get the next control variable value to use in order to steer the process variable towards a given setpoint based on the next discrete input signal sample value.
|
template<typename T>
class grem::PDController< T >
Proportional-derivative feedback loop for adjusting a control variable towards a desired setpoint based on a measured process variable in the form of a discrete-time input signal.
- Template Parameters
-
| T | signal value type. Must be a type that behaves like a number. |
◆ PDController() [1/2]
Default-construct a PD controller.
◆ PDController() [2/2]
Construct a PD controller with specific initial values.
- Parameters
-
| error | initial value to set the latest error value to. |
◆ reset() [1/2]
Reset the PD controller to the default state.
◆ reset() [2/2]
Reset the PD controller to a specific value.
- Parameters
-
| newError | new value to set the latest error value to. |
◆ update()
template<typename T>
template<typename Coefficient>
| auto grem::PDController< T >::update |
( |
T | newSignalError, |
|
|
Coefficient | proportionalGain, |
|
|
Coefficient | derivativeGain ) |
|
inlinenodiscardconstexpr |
Update the controller state and get the next control variable value to use in order to steer the process variable towards a given setpoint based on the next discrete input signal sample value.
- Parameters
-
| newSignalError | error between the new sample value of the input signal and the desired setpoint to steer towards, calculated as desiredSignalValue - newSignalValue. |
| proportionalGain | how much the current error should contribute to the output. |
| derivativeGain | how much the change in error should contribute to the output. Should be inversely proportional to the sample interval duration. |
The documentation for this class was generated from the following file: