DCMotor

class wpimath.DCMotor(nominalVoltage: wpimath.units.volts, stallTorque: wpimath.units.newton_meters, stallCurrent: wpimath.units.amperes, freeCurrent: wpimath.units.amperes, freeSpeed: wpimath.units.radians_per_second, numMotors: SupportsInt | SupportsIndex = 1)

Bases: pybind11_object

Holds the constants for a DC motor.

Constructs a DC motor.

Parameters:
  • nominalVoltage – Voltage at which the motor constants were measured.

  • stallTorque – Torque when stalled.

  • stallCurrent – Current draw when stalled.

  • freeCurrent – Current draw under no load.

  • freeSpeed – Angular velocity under no load.

  • numMotors – Number of motors in a gearbox.

static CIM(numMotors: SupportsInt | SupportsIndex = 1) wpimath._wpimath.DCMotor

Returns a gearbox of CIM motors.

static NEO(numMotors: SupportsInt | SupportsIndex = 1) wpimath._wpimath.DCMotor

Returns a gearbox of NEO brushless motors.

static NEO550(numMotors: SupportsInt | SupportsIndex = 1) wpimath._wpimath.DCMotor

Returns a gearbox of NEO 550 brushless motors.

static RS775_125(numMotors: SupportsInt | SupportsIndex = 1) wpimath._wpimath.DCMotor

Returns a gearbox of Andymark RS 775-125 motors.

WPIStruct = <capsule object "WPyStruct">
static andymark9015(numMotors: SupportsInt | SupportsIndex = 1) wpimath._wpimath.DCMotor

Returns a gearbox of Andymark 9015 motors.

static bag(numMotors: SupportsInt | SupportsIndex = 1) wpimath._wpimath.DCMotor

Returns a gearbox of Bag motor motors.

static banebotsRS550(numMotors: SupportsInt | SupportsIndex = 1) wpimath._wpimath.DCMotor

Returns a gearbox of Banebots RS 550 motors.

static banebotsRS775(numMotors: SupportsInt | SupportsIndex = 1) wpimath._wpimath.DCMotor

Returns a gearbox of Banebots RS 775 motors.

current(*args, **kwargs)

Overloaded function.

  1. current(self: wpimath._wpimath.DCMotor, velocity: wpimath.units.radians_per_second, inputVoltage: wpimath.units.volts) -> wpimath.units.amperes

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

Parameters:
  • velocity – The current angular velocity of the motor.

  • inputVoltage – The voltage being applied to the motor.

  1. current(self: wpimath._wpimath.DCMotor, torque: wpimath.units.newton_meters) -> wpimath.units.amperes

Returns current drawn by motor for a given torque.

Parameters:

torque – The torque produced by the motor.

static falcon500(numMotors: SupportsInt | SupportsIndex = 1) wpimath._wpimath.DCMotor

Returns a gearbox of Falcon 500 brushless motors.

static falcon500FOC(numMotors: SupportsInt | SupportsIndex = 1) wpimath._wpimath.DCMotor

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

static krakenX44(numMotors: SupportsInt | SupportsIndex = 1) wpimath._wpimath.DCMotor

Return a gearbox of Kraken X44 brushless motors.

static krakenX44FOC(numMotors: SupportsInt | SupportsIndex = 1) wpimath._wpimath.DCMotor

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

static krakenX60(numMotors: SupportsInt | SupportsIndex = 1) wpimath._wpimath.DCMotor

Return a gearbox of Kraken X60 brushless motors.

static krakenX60FOC(numMotors: SupportsInt | SupportsIndex = 1) wpimath._wpimath.DCMotor

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

static miniCIM(numMotors: SupportsInt | SupportsIndex = 1) wpimath._wpimath.DCMotor

Returns a gearbox of MiniCIM motors.

static minion(numMotors: SupportsInt | SupportsIndex = 1) wpimath._wpimath.DCMotor

Return a gearbox of Minion brushless motors.

static neoVortex(numMotors: SupportsInt | SupportsIndex = 1) wpimath._wpimath.DCMotor

Return a gearbox of Neo Vortex brushless motors.

static romiBuiltIn(numMotors: SupportsInt | SupportsIndex = 1) wpimath._wpimath.DCMotor

Return a gearbox of Romi/TI_RSLK MAX motors.

torque(current: wpimath.units.amperes) wpimath.units.newton_meters

Returns torque produced by the motor with a given current.

Parameters:

current – The current drawn by the motor.

velocity(torque: wpimath.units.newton_meters, inputVoltage: wpimath.units.volts) wpimath.units.radians_per_second

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

Parameters:
  • torque – The torque produced by the motor.

  • inputVoltage – The input voltage provided to the motor.

static vex775Pro(numMotors: SupportsInt | SupportsIndex = 1) wpimath._wpimath.DCMotor

Returns a gearbox of Vex 775 Pro motors.

voltage(torque: wpimath.units.newton_meters, velocity: wpimath.units.radians_per_second) wpimath.units.volts

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

Parameters:
  • torque – The torque produced by the motor.

  • velocity – The current angular velocity of the motor.

withReduction(gearboxReduction: SupportsFloat | SupportsIndex) wpimath._wpimath.DCMotor

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

Parameters:

gearboxReduction – The gearbox reduction.