Abstract class for various speed controllers with stall protection.
More...
#include <LRTSpeedController.h>
|
void | Output () |
| Checks safety and sends the saved values to the speed controllers.
|
|
void | RegisterSafety (CounterBase *encoder, double timeoutSeconds, float threshold=0.01) |
| Registers an encoder with this speed controller for stall safety.
|
|
virtual void | SafetyCallback () |
| Called when safety fails on this speed controller.
|
|
virtual void | SetDutyCycle (float pwm)=0 |
| Sets the duty cycle of this speed controller.
|
|
virtual float | GetDutyCycle ()=0 |
| Returns the last set duty cycle of this speed controller.
|
|
virtual float | GetHardwareValue ()=0 |
| Returns the last duty cycle sent to the speed controller.
|
|
virtual void | Update ()=0 |
| Sends the saved values to the speed controllers.
|
|
virtual void | ConfigNeutralMode (LRTSpeedController::NeutralMode mode)=0 |
| Sets the neutral mode (brake or coast).
|
|
virtual NeutralMode | GetNeutralMode ()=0 |
| Gets the neutral mode (brake or coast).
|
|
virtual void | Log () |
| Logs data to the Logger.
|
|
virtual void | Send () |
| Sends data to the LiveNetworkSender.
|
|
|
static float | CurrentLimit (float dutyCycle, float speed, float forwardLimit, float reverseLimit) |
| Calculates a duty cycle with current limiting applied.
|
|
|
template<typename T > |
void | SendToNetwork (T value, std::string key, std::string table) |
| Sends a value to the network through LiveNetworkSender.
|
|
template<typename T > |
void | LogToFile (T *field, std::string name) |
| Saves a variable to the Logger for logging.
|
|
template<typename T > |
void | LogToFile (T *field, int count, std::string name) |
| Saves a dynamically allocated array to the Logger for logging.
|
|
template<typename T > |
void | LogToFile (T value, std::string name) |
| Saves a value to the Logger for logging.
|
|
Abstract class for various speed controllers with stall protection.
virtual void LRTSpeedController::ConfigNeutralMode |
( |
LRTSpeedController::NeutralMode |
mode | ) |
|
|
pure virtual |
float LRTSpeedController::CurrentLimit |
( |
float |
dutyCycle, |
|
|
float |
speed, |
|
|
float |
forwardLimit, |
|
|
float |
reverseLimit |
|
) |
| |
|
static |
Calculates a duty cycle with current limiting applied.
- Parameters
-
dutyCycle | the input duty cycle to limit |
speed | the normalized current speed of the motor |
forwardLimit | the current limit for acceleration |
reverseLimit | the current limit for reversing direction |
- Returns
- the duty cycle with current limiting applied
virtual float LRTSpeedController::GetDutyCycle |
( |
| ) |
|
|
pure virtual |
virtual float LRTSpeedController::GetHardwareValue |
( |
| ) |
|
|
pure virtual |
virtual NeutralMode LRTSpeedController::GetNeutralMode |
( |
| ) |
|
|
pure virtual |
void LRTSpeedController::RegisterSafety |
( |
CounterBase * |
encoder, |
|
|
double |
timeoutSeconds, |
|
|
float |
threshold = 0.01 |
|
) |
| |
Registers an encoder with this speed controller for stall safety.
- Parameters
-
encoder | the encoder to check for stalling |
timeoutSeconds | how long the motor is allowed to stall before turned off, in seconds |
threshold | the stall threshold |
virtual void LRTSpeedController::SetDutyCycle |
( |
float |
pwm | ) |
|
|
pure virtual |
The documentation for this class was generated from the following files: