WPILibC++  unspecified
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Pages
CANSpeedController Class Referenceabstract

Interface for "smart" CAN-based speed controllers. More...

#include <CANSpeedController.h>

Inheritance diagram for CANSpeedController:
SpeedController PIDOutput CANJaguar CANTalon

Public Types

enum  ControlMode {
  kPercentVbus = 0, kCurrent = 1, kSpeed = 2, kPosition = 3,
  kVoltage = 4, kFollower = 5, kMotionProfile = 6
}
 
enum  Faults {
  kCurrentFault = 1, kTemperatureFault = 2, kBusVoltageFault = 4, kGateDriverFault = 8,
  kFwdLimitSwitch = 0x10, kRevLimitSwitch = 0x20, kFwdSoftLimit = 0x40, kRevSoftLimit = 0x80
}
 
enum  Limits { kForwardLimit = 1, kReverseLimit = 2 }
 
enum  NeutralMode { kNeutralMode_Jumper = 0, kNeutralMode_Brake = 1, kNeutralMode_Coast = 2 }
 
enum  LimitMode { kLimitMode_SwitchInputsOnly = 0, kLimitMode_SoftPositionLimits = 1, kLimitMode_SrxDisableSwitchInputs = 2 }
 

Public Member Functions

virtual bool IsModePID (ControlMode mode) const =0
 
virtual float Get () const =0
 Common interface for getting the current set speed of a speed controller. More...
 
virtual void Set (float value, uint8_t syncGroup=0)=0
 Common interface for setting the speed of a speed controller. More...
 
virtual void StopMotor ()=0
 Common interface to stop the motor until Set is called again.
 
virtual void Disable ()=0
 Common interface for disabling a motor.
 
virtual void SetP (double p)=0
 
virtual void SetI (double i)=0
 
virtual void SetD (double d)=0
 
virtual void SetPID (double p, double i, double d)=0
 
virtual double GetP () const =0
 
virtual double GetI () const =0
 
virtual double GetD () const =0
 
virtual float GetBusVoltage () const =0
 
virtual float GetOutputVoltage () const =0
 
virtual float GetOutputCurrent () const =0
 
virtual float GetTemperature () const =0
 
virtual double GetPosition () const =0
 
virtual double GetSpeed () const =0
 
virtual bool GetForwardLimitOK () const =0
 
virtual bool GetReverseLimitOK () const =0
 
virtual uint16_t GetFaults () const =0
 
virtual void SetVoltageRampRate (double rampRate)=0
 
virtual uint32_t GetFirmwareVersion () const =0
 
virtual void ConfigNeutralMode (NeutralMode mode)=0
 
virtual void ConfigEncoderCodesPerRev (uint16_t codesPerRev)=0
 
virtual void ConfigPotentiometerTurns (uint16_t turns)=0
 
virtual void ConfigSoftPositionLimits (double forwardLimitPosition, double reverseLimitPosition)=0
 
virtual void DisableSoftPositionLimits ()=0
 
virtual void ConfigLimitMode (LimitMode mode)=0
 
virtual void ConfigForwardLimit (double forwardLimitPosition)=0
 
virtual void ConfigReverseLimit (double reverseLimitPosition)=0
 
virtual void ConfigMaxOutputVoltage (double voltage)=0
 
virtual void ConfigFaultTime (float faultTime)=0
 
- Public Member Functions inherited from SpeedController
virtual void SetInverted (bool isInverted)=0
 Common interface for inverting direction of a speed controller. More...
 
virtual bool GetInverted () const =0
 Common interface for returning the inversion state of a speed controller. More...
 
- Public Member Functions inherited from PIDOutput
virtual void PIDWrite (float output)=0
 

Detailed Description

Interface for "smart" CAN-based speed controllers.

See Also
CANJaguar
CANTalon

Member Enumeration Documentation

Enumerator
kLimitMode_SwitchInputsOnly 

Only use switches for limits.

kLimitMode_SoftPositionLimits 

Use both switches and soft limits.

kLimitMode_SrxDisableSwitchInputs 

Disable switches and disable soft limits.

Enumerator
kNeutralMode_Jumper 

Use the NeutralMode that is set by the jumper wire on the CAN device.

kNeutralMode_Brake 

Stop the motor's rotation by applying a force.

kNeutralMode_Coast 

Do not attempt to stop the motor.

Instead allow it to coast to a stop without applying resistance.

Member Function Documentation

virtual float CANSpeedController::Get ( ) const
pure virtual

Common interface for getting the current set speed of a speed controller.

Returns
The current set speed. Value is between -1.0 and 1.0.

Implements SpeedController.

Implemented in CANTalon, and CANJaguar.

virtual void CANSpeedController::Set ( float  speed,
uint8_t  syncGroup = 0 
)
pure virtual

Common interface for setting the speed of a speed controller.

Parameters
speedThe speed to set. Value should be between -1.0 and 1.0.
syncGroupThe update group to add this Set() to, pending UpdateSyncGroup(). If 0, update immediately.

Implements SpeedController.

Implemented in CANTalon, and CANJaguar.


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