WPILibC++ 2023.4.3-108-ge5452e3
frc::DCMotor Class Reference

Holds the constants for a DC motor. More...

#include <frc/system/plant/DCMotor.h>

Public Types

using radians_per_second_per_volt_t = units::unit_t< units::compound_unit< units::radians_per_second, units::inverse< units::volt > > >
 
using newton_meters_per_ampere_t = units::unit_t< units::compound_unit< units::newton_meters, units::inverse< units::ampere > > >
 

Public Member Functions

constexpr DCMotor (units::volt_t nominalVoltage, units::newton_meter_t stallTorque, units::ampere_t stallCurrent, units::ampere_t freeCurrent, units::radians_per_second_t freeSpeed, int numMotors=1)
 Constructs a DC motor. More...
 
constexpr units::ampere_t Current (units::radians_per_second_t speed, units::volt_t inputVoltage) const
 Returns current drawn by motor with given speed and input voltage. More...
 
constexpr units::newton_meter_t Torque (units::ampere_t current) const
 Returns torque produced by the motor with a given current. More...
 
constexpr units::volt_t Voltage (units::newton_meter_t torque, units::radians_per_second_t speed) const
 Returns the voltage provided to the motor for a given torque and angular velocity. More...
 
constexpr units::radians_per_second_t Speed (units::newton_meter_t torque, units::volt_t inputVoltage) const
 Returns the speed produced by the motor at a given torque and input voltage. More...
 
constexpr DCMotor WithReduction (double gearboxReduction)
 Returns a copy of this motor with the given gearbox reduction applied. More...
 

Static Public Member Functions

static constexpr DCMotor CIM (int numMotors=1)
 Returns instance of CIM. More...
 
static constexpr DCMotor MiniCIM (int numMotors=1)
 Returns instance of MiniCIM. More...
 
static constexpr DCMotor Bag (int numMotors=1)
 Returns instance of Bag motor. More...
 
static constexpr DCMotor Vex775Pro (int numMotors=1)
 Returns instance of Vex 775 Pro. More...
 
static constexpr DCMotor RS775_125 (int numMotors=1)
 Returns instance of Andymark RS 775-125. More...
 
static constexpr DCMotor BanebotsRS775 (int numMotors=1)
 Returns instance of Banebots RS 775. More...
 
static constexpr DCMotor Andymark9015 (int numMotors=1)
 Returns instance of Andymark 9015. More...
 
static constexpr DCMotor BanebotsRS550 (int numMotors=1)
 Returns instance of Banebots RS 550. More...
 
static constexpr DCMotor NEO (int numMotors=1)
 Returns instance of NEO brushless motor. More...
 
static constexpr DCMotor NEO550 (int numMotors=1)
 Returns instance of NEO 550 brushless motor. More...
 
static constexpr DCMotor Falcon500 (int numMotors=1)
 Returns instance of Falcon 500 brushless motor. More...
 
static constexpr DCMotor RomiBuiltIn (int numMotors=1)
 Return a gearbox of Romi/TI_RSLK MAX motors. More...
 

Public Attributes

units::volt_t nominalVoltage
 
units::newton_meter_t stallTorque
 
units::ampere_t stallCurrent
 
units::ampere_t freeCurrent
 
units::radians_per_second_t freeSpeed
 
units::ohm_t R
 
radians_per_second_per_volt_t Kv
 
newton_meters_per_ampere_t Kt
 

Detailed Description

Holds the constants for a DC motor.

Member Typedef Documentation

◆ newton_meters_per_ampere_t

◆ radians_per_second_per_volt_t

Constructor & Destructor Documentation

◆ DCMotor()

constexpr frc::DCMotor::DCMotor ( units::volt_t  nominalVoltage,
units::newton_meter_t  stallTorque,
units::ampere_t  stallCurrent,
units::ampere_t  freeCurrent,
units::radians_per_second_t  freeSpeed,
int  numMotors = 1 
)
inlineconstexpr

Constructs a DC motor.

Parameters
nominalVoltageVoltage at which the motor constants were measured.
stallTorqueTorque when stalled.
stallCurrentCurrent draw when stalled.
freeCurrentCurrent draw under no load.
freeSpeedAngular velocity under no load.
numMotorsNumber of motors in a gearbox.

Member Function Documentation

◆ Andymark9015()

static constexpr DCMotor frc::DCMotor::Andymark9015 ( int  numMotors = 1)
inlinestaticconstexpr

Returns instance of Andymark 9015.

◆ Bag()

static constexpr DCMotor frc::DCMotor::Bag ( int  numMotors = 1)
inlinestaticconstexpr

Returns instance of Bag motor.

◆ BanebotsRS550()

static constexpr DCMotor frc::DCMotor::BanebotsRS550 ( int  numMotors = 1)
inlinestaticconstexpr

Returns instance of Banebots RS 550.

◆ BanebotsRS775()

static constexpr DCMotor frc::DCMotor::BanebotsRS775 ( int  numMotors = 1)
inlinestaticconstexpr

Returns instance of Banebots RS 775.

◆ CIM()

static constexpr DCMotor frc::DCMotor::CIM ( int  numMotors = 1)
inlinestaticconstexpr

Returns instance of CIM.

◆ Current()

constexpr units::ampere_t frc::DCMotor::Current ( units::radians_per_second_t  speed,
units::volt_t  inputVoltage 
) const
inlineconstexpr

Returns current drawn by motor with given speed and input voltage.

Parameters
speedThe current angular velocity of the motor.
inputVoltageThe voltage being applied to the motor.

◆ Falcon500()

static constexpr DCMotor frc::DCMotor::Falcon500 ( int  numMotors = 1)
inlinestaticconstexpr

Returns instance of Falcon 500 brushless motor.

◆ MiniCIM()

static constexpr DCMotor frc::DCMotor::MiniCIM ( int  numMotors = 1)
inlinestaticconstexpr

Returns instance of MiniCIM.

◆ NEO()

static constexpr DCMotor frc::DCMotor::NEO ( int  numMotors = 1)
inlinestaticconstexpr

Returns instance of NEO brushless motor.

◆ NEO550()

static constexpr DCMotor frc::DCMotor::NEO550 ( int  numMotors = 1)
inlinestaticconstexpr

Returns instance of NEO 550 brushless motor.

◆ RomiBuiltIn()

static constexpr DCMotor frc::DCMotor::RomiBuiltIn ( int  numMotors = 1)
inlinestaticconstexpr

Return a gearbox of Romi/TI_RSLK MAX motors.

◆ RS775_125()

static constexpr DCMotor frc::DCMotor::RS775_125 ( int  numMotors = 1)
inlinestaticconstexpr

Returns instance of Andymark RS 775-125.

◆ Speed()

constexpr units::radians_per_second_t frc::DCMotor::Speed ( units::newton_meter_t  torque,
units::volt_t  inputVoltage 
) const
inlineconstexpr

Returns the speed produced by the motor at a given torque and input voltage.

Parameters
torqueThe torque produced by the motor.
inputVoltageThe input voltage provided to the motor.

◆ Torque()

constexpr units::newton_meter_t frc::DCMotor::Torque ( units::ampere_t  current) const
inlineconstexpr

Returns torque produced by the motor with a given current.

Parameters
currentThe current drawn by the motor.

◆ Vex775Pro()

static constexpr DCMotor frc::DCMotor::Vex775Pro ( int  numMotors = 1)
inlinestaticconstexpr

Returns instance of Vex 775 Pro.

◆ Voltage()

constexpr units::volt_t frc::DCMotor::Voltage ( units::newton_meter_t  torque,
units::radians_per_second_t  speed 
) const
inlineconstexpr

Returns the voltage provided to the motor for a given torque and angular velocity.

Parameters
torqueThe torque produced by the motor.
speedThe current angular velocity of the motor.

◆ WithReduction()

constexpr DCMotor frc::DCMotor::WithReduction ( double  gearboxReduction)
inlineconstexpr

Returns a copy of this motor with the given gearbox reduction applied.

Parameters
gearboxReductionThe gearbox reduction.

Member Data Documentation

◆ freeCurrent

units::ampere_t frc::DCMotor::freeCurrent

◆ freeSpeed

units::radians_per_second_t frc::DCMotor::freeSpeed

◆ Kt

newton_meters_per_ampere_t frc::DCMotor::Kt

◆ Kv

◆ nominalVoltage

units::volt_t frc::DCMotor::nominalVoltage

◆ R

units::ohm_t frc::DCMotor::R

◆ stallCurrent

units::ampere_t frc::DCMotor::stallCurrent

◆ stallTorque

units::newton_meter_t frc::DCMotor::stallTorque

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