#include <sr_deadband.hpp>
Public Member Functions | |
HysteresisDeadband () | |
bool | is_in_deadband (T demand, T error, T deadband, double deadband_multiplicator=5.0, unsigned int nb_errors_for_avg=50) |
~HysteresisDeadband () | |
Private Attributes | |
T | deadband |
bool | entered_small_deadband |
T | last_demand |
std::deque< T > | last_errors |
Definition at line 51 of file sr_deadband.hpp.
sr_deadband::HysteresisDeadband< T >::HysteresisDeadband | ( | ) | [inline] |
Hysteresis deadband: we average the last N errors. If this average is less than a small deadband, we "enter the deadband zone" and send only a command of zero to the motor. We leave the deadband zone if the average of the error is getting bigger than x*deadband, or if we receive a new command.
Definition at line 60 of file sr_deadband.hpp.
sr_deadband::HysteresisDeadband< T >::~HysteresisDeadband | ( | ) | [inline] |
Definition at line 65 of file sr_deadband.hpp.
bool sr_deadband::HysteresisDeadband< T >::is_in_deadband | ( | T | demand, |
T | error, | ||
T | deadband, | ||
double | deadband_multiplicator = 5.0 , |
||
unsigned int | nb_errors_for_avg = 50 |
||
) | [inline] |
Are we in the hysteresis deadband? If we are in it, then we're just sending a force demand of 0.
demand | The demand |
error | The error (demand - actual value) |
deadband | the deadband value |
deadband_multiplicator | the value by which we multiply the deadband to have the bigger deadband against which we check for leaving the deadband zone |
nb_errors_for_avg | the nb of errors we keep for averaging |
Definition at line 82 of file sr_deadband.hpp.
T sr_deadband::HysteresisDeadband< T >::deadband [private] |
Definition at line 128 of file sr_deadband.hpp.
bool sr_deadband::HysteresisDeadband< T >::entered_small_deadband [private] |
Definition at line 134 of file sr_deadband.hpp.
T sr_deadband::HysteresisDeadband< T >::last_demand [private] |
Definition at line 132 of file sr_deadband.hpp.
std::deque<T> sr_deadband::HysteresisDeadband< T >::last_errors [private] |
Definition at line 133 of file sr_deadband.hpp.