LRT14  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
LRTSpeedController Class Referenceabstract

Abstract class for various speed controllers with stall protection. More...

#include <LRTSpeedController.h>

Inheritance diagram for LRTSpeedController:
Collaboration diagram for LRTSpeedController:

Public Member Functions

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 Public Member Functions

static float CurrentLimit (float dutyCycle, float speed, float forwardLimit, float reverseLimit)
 Calculates a duty cycle with current limiting applied.
 

Additional Inherited Members

- Protected Member Functions inherited from LiveNetworkSendable
template<typename T >
void SendToNetwork (T value, std::string key, std::string table)
 Sends a value to the network through LiveNetworkSender.
 
- Protected Member Functions inherited from Loggable
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.
 

Detailed Description

Abstract class for various speed controllers with stall protection.

Member Function Documentation

virtual void LRTSpeedController::ConfigNeutralMode ( LRTSpeedController::NeutralMode  mode)
pure virtual

Sets the neutral mode (brake or coast).

Parameters
modethe neutral mode (brake or coast)

Implemented in AsyncCANJaguar, LRTJaguar, LRTTalon, and LRTVictor.

float LRTSpeedController::CurrentLimit ( float  dutyCycle,
float  speed,
float  forwardLimit,
float  reverseLimit 
)
static

Calculates a duty cycle with current limiting applied.

Parameters
dutyCyclethe input duty cycle to limit
speedthe normalized current speed of the motor
forwardLimitthe current limit for acceleration
reverseLimitthe current limit for reversing direction
Returns
the duty cycle with current limiting applied

Here is the call graph for this function:

virtual float LRTSpeedController::GetDutyCycle ( )
pure virtual

Returns the last set duty cycle of this speed controller.

Returns
the last set duty cycle

Implemented in AsyncCANJaguar, LRTJaguar, LRTTalon, and LRTVictor.

Here is the caller graph for this function:

virtual float LRTSpeedController::GetHardwareValue ( )
pure virtual

Returns the last duty cycle sent to the speed controller.

Returns
the last duty cycle sent

Implemented in AsyncCANJaguar, LRTJaguar, LRTTalon, and LRTVictor.

virtual NeutralMode LRTSpeedController::GetNeutralMode ( )
pure virtual

Gets the neutral mode (brake or coast).

Returns
the neutral mode (brake or coast)

Implemented in AsyncCANJaguar, LRTJaguar, LRTTalon, and LRTVictor.

Here is the caller graph for this function:

void LRTSpeedController::RegisterSafety ( CounterBase *  encoder,
double  timeoutSeconds,
float  threshold = 0.01 
)

Registers an encoder with this speed controller for stall safety.

Parameters
encoderthe encoder to check for stalling
timeoutSecondshow long the motor is allowed to stall before turned off, in seconds
thresholdthe stall threshold
virtual void LRTSpeedController::SetDutyCycle ( float  pwm)
pure virtual

Sets the duty cycle of this speed controller.

Parameters
pwmthe duty cycle to set

Implemented in AsyncCANJaguar, LRTJaguar, LRTTalon, and LRTVictor.

Here is the caller graph for this function:


The documentation for this class was generated from the following files: