DCMotor

class wpimath.system.plant.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: int = 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: int = 1) wpimath._controls._controls.plant.DCMotor

Returns a gearbox of CIM motors.

property Kt wpimath.units.volt_seconds

Motor torque constant.

property Kv wpimath.units.radians_per_second_per_volt

Motor velocity constant.

static NEO(numMotors: int = 1) wpimath._controls._controls.plant.DCMotor

Returns a gearbox of NEO brushless motors.

static NEO550(numMotors: int = 1) wpimath._controls._controls.plant.DCMotor

Returns a gearbox of NEO 550 brushless motors.

property R wpimath.units.ohms

Motor internal resistance.

static RS775_125(numMotors: int = 1) wpimath._controls._controls.plant.DCMotor

Returns a gearbox of Andymark RS 775-125 motors.

WPIStruct = <capsule object "WPyStruct">
static andymark9015(numMotors: int = 1) wpimath._controls._controls.plant.DCMotor

Returns a gearbox of Andymark 9015 motors.

static bag(numMotors: int = 1) wpimath._controls._controls.plant.DCMotor

Returns a gearbox of Bag motor motors.

static banebotsRS550(numMotors: int = 1) wpimath._controls._controls.plant.DCMotor

Returns a gearbox of Banebots RS 550 motors.

static banebotsRS775(numMotors: int = 1) wpimath._controls._controls.plant.DCMotor

Returns a gearbox of Banebots RS 775 motors.

current(speed: wpimath.units.radians_per_second, inputVoltage: wpimath.units.volts) wpimath.units.amperes

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

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

  • inputVoltage – The voltage being applied to the motor.

static falcon500(numMotors: int = 1) wpimath._controls._controls.plant.DCMotor

Returns a gearbox of Falcon 500 brushless motors.

static falcon500FOC(numMotors: int = 1) wpimath._controls._controls.plant.DCMotor

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

property freeCurrent wpimath.units.amperes

Current draw under no load.

property freeSpeed wpimath.units.radians_per_second

Angular velocity under no load.

static krakenX60(numMotors: int = 1) wpimath._controls._controls.plant.DCMotor

Return a gearbox of Kraken X60 brushless motors.

static krakenX60FOC(numMotors: int = 1) wpimath._controls._controls.plant.DCMotor

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

static miniCIM(numMotors: int = 1) wpimath._controls._controls.plant.DCMotor

Returns a gearbox of MiniCIM motors.

static neoVortex(numMotors: int = 1) wpimath._controls._controls.plant.DCMotor

Return a gearbox of Neo Vortex brushless motors.

property nominalVoltage wpimath.units.volts

Voltage at which the motor constants were measured.

static romiBuiltIn(numMotors: int = 1) wpimath._controls._controls.plant.DCMotor

Return a gearbox of Romi/TI_RSLK MAX motors.

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

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

property stallCurrent wpimath.units.amperes

Current draw when stalled.

property stallTorque wpimath.units.newton_meters

Torque when stalled.

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.

static vex775Pro(numMotors: int = 1) wpimath._controls._controls.plant.DCMotor

Returns a gearbox of Vex 775 Pro motors.

voltage(torque: wpimath.units.newton_meters, speed: 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.

  • speed – The current angular velocity of the motor.

withReduction(gearboxReduction: float) wpimath._controls._controls.plant.DCMotor

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

Parameters:

gearboxReduction – The gearbox reduction.