![]() |
Controlpp
|
A P (Proportional) controller. More...
#include <controlpp/TimeVariantControl.hpp>
Public Types | |
| using | value_type = T |
Public Member Functions | |
| constexpr | PControl (const PControl &)=default |
| Default copy constructor. | |
| constexpr | PControl (const T &kp) |
| Construct a P (Proportional) controller with a constant gain. | |
| constexpr void | kp (const T &kp) |
| sets the proportional gain | |
| constexpr const T & | kp () const |
| returns the current gain | |
| constexpr T | input (const T &u) |
| Adds a new sample. | |
| constexpr T | input (const T &u, const T &Ts) |
| Adds a new sample. | |
| constexpr T | operator() (const T &u) |
| Adds a new sample. | |
| constexpr T | operator() (const T &u, const T &Ts) |
| Adds a new sample. | |
| constexpr void | reset () |
| resets the internal states of the filter | |
Friends | |
| constexpr ValueSampletimePair< T > | operator>> (const ValueSampletimePair< T > &p, PControl &c) |
A P (Proportional) controller.
has the following transfer function
\[ y_k = k_p u_k \]
where:
| T | the data type the controller uses, like float or double |
| using controlpp::timevar::PControl< T >::value_type = T |
|
constexprdefault |
Default copy constructor.
|
inlineconstexpr |
Construct a P (Proportional) controller with a constant gain.
| kp | the proportional gain of the controller |
|
inlineconstexpr |
Adds a new sample.
| u | the new sample input |
|
inlineconstexpr |
Adds a new sample.
| u | the new sample input |
| Ts | sample time (unused - there for compatibility) |
|
inlineconstexpr |
returns the current gain
|
inlineconstexpr |
sets the proportional gain
| kp | the new proportional gain for the next sample value |
|
inlineconstexpr |
Adds a new sample.
| u | the new sample input |
|
inlineconstexpr |
Adds a new sample.
| u | the new sample input |
| Ts | sample time (unused - there for compatibility) |
|
inlineconstexpr |
resets the internal states of the filter
For P control elements this is a no-op.
|
friend |