RIT VEXU Core API
|
#include <bang_bang.h>
Public Member Functions | |
BangBang (double tolerance, double setpoint) | |
double | calculate (double measurement, double setpoint) |
double | calculate (double measurement) |
bool | at_setpoint () |
A BangBang controller is a simple feedback controller that outputs either 1 or 0, 1 if the measurement is less than the setpoint, and 0 otherwise. Multiply by the maximum voltage you're willing to use.
This should really only be used for velocity control of high inertia systems like flywheels, where high acceleration is most important. For anything else don't use this.
DO NOT use this with a motor that isn't in coast mode since it will oscillate very fast and probably burn it out.
|
inline |
Constructs a BangBang controller with the given tolerance and setpoint.
tolerance | The tolerance for the setpoint. |
setpoint | The setpoint to compare against. |
|
inline |
Checks if the current measurement is at the setpoint within the tolerance.
|
inline |
Calculates the output based on the current measurement and setpoint.
measurement | The current measurement value. |
|
inline |
Calculates the output based on the current measurement and setpoint.
measurement | The current measurement value. |
setpoint | The setpoint to compare against. |