WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::math::DCMotor Class Reference

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

#include <wpi/math/system/DCMotor.hpp>

Public Types

using radians_per_second_per_volt_t
using newton_meters_per_ampere_t

Public Member Functions

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

Static Public Member Functions

static constexpr DCMotor CIM (int numMotors=1)
 Returns a gearbox of CIM motors.
static constexpr DCMotor MiniCIM (int numMotors=1)
 Returns a gearbox of MiniCIM motors.
static constexpr DCMotor Bag (int numMotors=1)
 Returns a gearbox of Bag motor motors.
static constexpr DCMotor Vex775Pro (int numMotors=1)
 Returns a gearbox of Vex 775 Pro motors.
static constexpr DCMotor RS775_125 (int numMotors=1)
 Returns a gearbox of Andymark RS 775-125 motors.
static constexpr DCMotor BanebotsRS775 (int numMotors=1)
 Returns a gearbox of Banebots RS 775 motors.
static constexpr DCMotor Andymark9015 (int numMotors=1)
 Returns a gearbox of Andymark 9015 motors.
static constexpr DCMotor BanebotsRS550 (int numMotors=1)
 Returns a gearbox of Banebots RS 550 motors.
static constexpr DCMotor NEO (int numMotors=1)
 Returns a gearbox of NEO brushless motors.
static constexpr DCMotor NEO550 (int numMotors=1)
 Returns a gearbox of NEO 550 brushless motors.
static constexpr DCMotor Falcon500 (int numMotors=1)
 Returns a gearbox of Falcon 500 brushless motors.
static constexpr DCMotor Falcon500FOC (int numMotors=1)
 Return a gearbox of Falcon 500 motors with FOC (Field-Oriented Control) enabled.
static constexpr DCMotor RomiBuiltIn (int numMotors=1)
 Return a gearbox of Romi/TI_RSLK MAX motors.
static constexpr DCMotor KrakenX60 (int numMotors=1)
 Return a gearbox of Kraken X60 brushless motors.
static constexpr DCMotor KrakenX60FOC (int numMotors=1)
 Return a gearbox of Kraken X60 brushless motors with FOC (Field-Oriented Control) enabled.
static constexpr DCMotor KrakenX44 (int numMotors=1)
 Return a gearbox of Kraken X44 brushless motors.
static constexpr DCMotor KrakenX44FOC (int numMotors=1)
 Return a gearbox of Kraken X44 brushless motors with FOC (Field-Oriented Control) enabled.
static constexpr DCMotor Minion (int numMotors=1)
 Return a gearbox of Minion brushless motors.
static constexpr DCMotor NeoVortex (int numMotors=1)
 Return a gearbox of Neo Vortex brushless motors.

Public Attributes

wpi::units::volt_t nominalVoltage
 Voltage at which the motor constants were measured.
wpi::units::newton_meter_t stallTorque
 Torque when stalled.
wpi::units::ampere_t stallCurrent
 Current draw when stalled.
wpi::units::ampere_t freeCurrent
 Current draw under no load.
wpi::units::radians_per_second_t freeSpeed
 Angular velocity under no load.
wpi::units::ohm_t R
 Motor internal resistance.
radians_per_second_per_volt_t Kv
 Motor velocity constant.
newton_meters_per_ampere_t Kt
 Motor torque constant.

Detailed Description

Holds the constants for a DC motor.

Member Typedef Documentation

◆ newton_meters_per_ampere_t

Initial value:
wpi::units::unit_t<wpi::units::compound_unit<
wpi::units::newton_meters, wpi::units::inverse<wpi::units::ampere>>>

◆ radians_per_second_per_volt_t

Initial value:
wpi::units::unit_t<
wpi::units::compound_unit<wpi::units::radians_per_second,
wpi::units::inverse<wpi::units::volt>>>

Constructor & Destructor Documentation

◆ DCMotor()

wpi::math::DCMotor::DCMotor ( wpi::units::volt_t nominalVoltage,
wpi::units::newton_meter_t stallTorque,
wpi::units::ampere_t stallCurrent,
wpi::units::ampere_t freeCurrent,
wpi::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()

constexpr DCMotor wpi::math::DCMotor::Andymark9015 ( int numMotors = 1)
inlinestaticconstexpr

Returns a gearbox of Andymark 9015 motors.

◆ Bag()

constexpr DCMotor wpi::math::DCMotor::Bag ( int numMotors = 1)
inlinestaticconstexpr

Returns a gearbox of Bag motor motors.

◆ BanebotsRS550()

constexpr DCMotor wpi::math::DCMotor::BanebotsRS550 ( int numMotors = 1)
inlinestaticconstexpr

Returns a gearbox of Banebots RS 550 motors.

◆ BanebotsRS775()

constexpr DCMotor wpi::math::DCMotor::BanebotsRS775 ( int numMotors = 1)
inlinestaticconstexpr

Returns a gearbox of Banebots RS 775 motors.

◆ CIM()

constexpr DCMotor wpi::math::DCMotor::CIM ( int numMotors = 1)
inlinestaticconstexpr

Returns a gearbox of CIM motors.

◆ Current() [1/2]

wpi::units::ampere_t wpi::math::DCMotor::Current ( wpi::units::newton_meter_t torque) const
inlineconstexpr

Returns current drawn by motor for a given torque.

Parameters
torqueThe torque produced by the motor.

◆ Current() [2/2]

wpi::units::ampere_t wpi::math::DCMotor::Current ( wpi::units::radians_per_second_t velocity,
wpi::units::volt_t inputVoltage ) const
inlineconstexpr

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

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

◆ Falcon500()

constexpr DCMotor wpi::math::DCMotor::Falcon500 ( int numMotors = 1)
inlinestaticconstexpr

Returns a gearbox of Falcon 500 brushless motors.

◆ Falcon500FOC()

constexpr DCMotor wpi::math::DCMotor::Falcon500FOC ( int numMotors = 1)
inlinestaticconstexpr

Return a gearbox of Falcon 500 motors with FOC (Field-Oriented Control) enabled.

◆ KrakenX44()

constexpr DCMotor wpi::math::DCMotor::KrakenX44 ( int numMotors = 1)
inlinestaticconstexpr

Return a gearbox of Kraken X44 brushless motors.

◆ KrakenX44FOC()

constexpr DCMotor wpi::math::DCMotor::KrakenX44FOC ( int numMotors = 1)
inlinestaticconstexpr

Return a gearbox of Kraken X44 brushless motors with FOC (Field-Oriented Control) enabled.

◆ KrakenX60()

constexpr DCMotor wpi::math::DCMotor::KrakenX60 ( int numMotors = 1)
inlinestaticconstexpr

Return a gearbox of Kraken X60 brushless motors.

◆ KrakenX60FOC()

constexpr DCMotor wpi::math::DCMotor::KrakenX60FOC ( int numMotors = 1)
inlinestaticconstexpr

Return a gearbox of Kraken X60 brushless motors with FOC (Field-Oriented Control) enabled.

◆ MiniCIM()

constexpr DCMotor wpi::math::DCMotor::MiniCIM ( int numMotors = 1)
inlinestaticconstexpr

Returns a gearbox of MiniCIM motors.

◆ Minion()

constexpr DCMotor wpi::math::DCMotor::Minion ( int numMotors = 1)
inlinestaticconstexpr

Return a gearbox of Minion brushless motors.

◆ NEO()

constexpr DCMotor wpi::math::DCMotor::NEO ( int numMotors = 1)
inlinestaticconstexpr

Returns a gearbox of NEO brushless motors.

◆ NEO550()

constexpr DCMotor wpi::math::DCMotor::NEO550 ( int numMotors = 1)
inlinestaticconstexpr

Returns a gearbox of NEO 550 brushless motors.

◆ NeoVortex()

constexpr DCMotor wpi::math::DCMotor::NeoVortex ( int numMotors = 1)
inlinestaticconstexpr

Return a gearbox of Neo Vortex brushless motors.

◆ RomiBuiltIn()

constexpr DCMotor wpi::math::DCMotor::RomiBuiltIn ( int numMotors = 1)
inlinestaticconstexpr

Return a gearbox of Romi/TI_RSLK MAX motors.

◆ RS775_125()

constexpr DCMotor wpi::math::DCMotor::RS775_125 ( int numMotors = 1)
inlinestaticconstexpr

Returns a gearbox of Andymark RS 775-125 motors.

◆ Torque()

wpi::units::newton_meter_t wpi::math::DCMotor::Torque ( wpi::units::ampere_t current) const
inlineconstexpr

Returns torque produced by the motor with a given current.

Parameters
currentThe current drawn by the motor.

◆ Velocity()

wpi::units::radians_per_second_t wpi::math::DCMotor::Velocity ( wpi::units::newton_meter_t torque,
wpi::units::volt_t inputVoltage ) const
inlineconstexpr

Returns the angular velocity 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.

◆ Vex775Pro()

constexpr DCMotor wpi::math::DCMotor::Vex775Pro ( int numMotors = 1)
inlinestaticconstexpr

Returns a gearbox of Vex 775 Pro motors.

◆ Voltage()

wpi::units::volt_t wpi::math::DCMotor::Voltage ( wpi::units::newton_meter_t torque,
wpi::units::radians_per_second_t velocity ) const
inlineconstexpr

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

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

◆ WithReduction()

DCMotor wpi::math::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

wpi::units::ampere_t wpi::math::DCMotor::freeCurrent

Current draw under no load.

◆ freeSpeed

wpi::units::radians_per_second_t wpi::math::DCMotor::freeSpeed

Angular velocity under no load.

◆ Kt

newton_meters_per_ampere_t wpi::math::DCMotor::Kt

Motor torque constant.

◆ Kv

radians_per_second_per_volt_t wpi::math::DCMotor::Kv

Motor velocity constant.

◆ nominalVoltage

wpi::units::volt_t wpi::math::DCMotor::nominalVoltage

Voltage at which the motor constants were measured.

◆ R

wpi::units::ohm_t wpi::math::DCMotor::R

Motor internal resistance.

◆ stallCurrent

wpi::units::ampere_t wpi::math::DCMotor::stallCurrent

Current draw when stalled.

◆ stallTorque

wpi::units::newton_meter_t wpi::math::DCMotor::stallTorque

Torque when stalled.


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