Package edu.wpi.first.math.system.plant
Class DCMotor
java.lang.Object
edu.wpi.first.math.system.plant.DCMotor
- All Implemented Interfaces:
ProtobufSerializable,StructSerializable,WPISerializable
Holds the constants for a DC motor.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal doubleCurrent draw under no load.final doubleAngular velocity under no load.final doubleMotor torque constant.final doubleMotor velocity constant.final doubleVoltage at which the motor constants were measured.static final DCMotorProtoDCMotor protobuf for serialization.final doubleMotor internal resistance.final doubleCurrent draw when stalled.final doubleTorque when stalled.static final DCMotorStructDCMotor struct for serialization. -
Constructor Summary
ConstructorsConstructorDescriptionDCMotor(double nominalVoltageVolts, double stallTorqueNewtonMeters, double stallCurrentAmps, double freeCurrentAmps, double freeSpeedRadPerSec, int numMotors) Constructs a DC motor. -
Method Summary
Modifier and TypeMethodDescriptionstatic DCMotorgetAndymark9015(int numMotors) Return a gearbox of Andymark 9015 motors.static DCMotorgetAndymarkRs775_125(int numMotors) Return a gearbox of Andymark RS775-125 motors.static DCMotorgetBag(int numMotors) Return a gearbox of Bag motors.static DCMotorgetBanebotsRs550(int numMotors) Return a gearbox of Banebots RS 550 motors.static DCMotorgetBanebotsRs775(int numMotors) Return a gearbox of Banebots RS775 motors.static DCMotorgetCIM(int numMotors) Return a gearbox of CIM motors.doublegetCurrent(double torqueNm) Calculate current drawn by motor for a given torque.doublegetCurrent(double speedRadiansPerSec, double voltageInputVolts) Calculate current drawn by motor with given speed and input voltage.static DCMotorgetFalcon500(int numMotors) Return a gearbox of Falcon 500 motors.static DCMotorgetFalcon500Foc(int numMotors) Return a gearbox of Falcon 500 motors with FOC (Field-Oriented Control) enabled.static DCMotorgetKrakenX60(int numMotors) Return a gearbox of Kraken X60 brushless motors.static DCMotorgetKrakenX60Foc(int numMotors) Return a gearbox of Kraken X60 brushless motors with FOC (Field-Oriented Control) enabled.static DCMotorgetMiniCIM(int numMotors) Return a gearbox of MiniCIM motors.static DCMotorgetNEO(int numMotors) Return a gearbox of NEO motors.static DCMotorgetNeo550(int numMotors) Return a gearbox of NEO 550 motors.static DCMotorgetNeoVortex(int numMotors) Return a gearbox of Neo Vortex brushless motors.static DCMotorgetRomiBuiltIn(int numMotors) Return a gearbox of Romi/TI_RSLK MAX motors.doublegetSpeed(double torqueNm, double voltageInputVolts) Calculates the angular speed produced by the motor at a given torque and input voltage.doublegetTorque(double currentAmpere) Calculate torque produced by the motor with a given current.static DCMotorgetVex775Pro(int numMotors) Return a gearbox of 775Pro motors.doublegetVoltage(double torqueNm, double speedRadiansPerSec) Calculate the voltage provided to the motor for a given torque and angular velocity.withReduction(double gearboxReduction) Returns a copy of this motor with the given gearbox reduction applied.
-
Field Details
-
nominalVoltageVolts
Voltage at which the motor constants were measured. -
stallTorqueNewtonMeters
Torque when stalled. -
stallCurrentAmps
Current draw when stalled. -
freeCurrentAmps
Current draw under no load. -
freeSpeedRadPerSec
Angular velocity under no load. -
rOhms
Motor internal resistance. -
KvRadPerSecPerVolt
Motor velocity constant. -
KtNMPerAmp
Motor torque constant. -
proto
DCMotor protobuf for serialization. -
struct
DCMotor struct for serialization.
-
-
Constructor Details
-
DCMotor
public DCMotor(double nominalVoltageVolts, double stallTorqueNewtonMeters, double stallCurrentAmps, double freeCurrentAmps, double freeSpeedRadPerSec, int numMotors) Constructs a DC motor.- Parameters:
nominalVoltageVolts- Voltage at which the motor constants were measured.stallTorqueNewtonMeters- Torque when stalled.stallCurrentAmps- Current draw when stalled.freeCurrentAmps- Current draw under no load.freeSpeedRadPerSec- Angular velocity under no load.numMotors- Number of motors in a gearbox.
-
-
Method Details
-
getCurrent
Calculate current drawn by motor with given speed and input voltage.- Parameters:
speedRadiansPerSec- The current angular velocity of the motor.voltageInputVolts- The voltage being applied to the motor.- Returns:
- The estimated current.
-
getCurrent
Calculate current drawn by motor for a given torque.- Parameters:
torqueNm- The torque produced by the motor.- Returns:
- The current drawn by the motor.
-
getTorque
Calculate torque produced by the motor with a given current.- Parameters:
currentAmpere- The current drawn by the motor.- Returns:
- The torque output.
-
getVoltage
Calculate the voltage provided to the motor for a given torque and angular velocity.- Parameters:
torqueNm- The torque produced by the motor.speedRadiansPerSec- The current angular velocity of the motor.- Returns:
- The voltage of the motor.
-
getSpeed
Calculates the angular speed produced by the motor at a given torque and input voltage.- Parameters:
torqueNm- The torque produced by the motor.voltageInputVolts- The voltage applied to the motor.- Returns:
- The angular speed of the motor.
-
withReduction
Returns a copy of this motor with the given gearbox reduction applied.- Parameters:
gearboxReduction- The gearbox reduction.- Returns:
- A motor with the gearbox reduction applied.
-
getCIM
Return a gearbox of CIM motors.- Parameters:
numMotors- Number of motors in the gearbox.- Returns:
- A gearbox of CIM motors.
-
getVex775Pro
Return a gearbox of 775Pro motors.- Parameters:
numMotors- Number of motors in the gearbox.- Returns:
- A gearbox of 775Pro motors.
-
getNEO
Return a gearbox of NEO motors.- Parameters:
numMotors- Number of motors in the gearbox.- Returns:
- A gearbox of NEO motors.
-
getMiniCIM
Return a gearbox of MiniCIM motors.- Parameters:
numMotors- Number of motors in the gearbox.- Returns:
- A gearbox of MiniCIM motors.
-
getBag
Return a gearbox of Bag motors.- Parameters:
numMotors- Number of motors in the gearbox.- Returns:
- A gearbox of Bag motors.
-
getAndymarkRs775_125
Return a gearbox of Andymark RS775-125 motors.- Parameters:
numMotors- Number of motors in the gearbox.- Returns:
- A gearbox of Andymark RS775-125 motors.
-
getBanebotsRs775
Return a gearbox of Banebots RS775 motors.- Parameters:
numMotors- Number of motors in the gearbox.- Returns:
- A gearbox of Banebots RS775 motors.
-
getAndymark9015
Return a gearbox of Andymark 9015 motors.- Parameters:
numMotors- Number of motors in the gearbox.- Returns:
- A gearbox of Andymark 9015 motors.
-
getBanebotsRs550
Return a gearbox of Banebots RS 550 motors.- Parameters:
numMotors- Number of motors in the gearbox.- Returns:
- A gearbox of Banebots RS 550 motors.
-
getNeo550
Return a gearbox of NEO 550 motors.- Parameters:
numMotors- Number of motors in the gearbox.- Returns:
- A gearbox of NEO 550 motors.
-
getFalcon500
Return a gearbox of Falcon 500 motors.- Parameters:
numMotors- Number of motors in the gearbox.- Returns:
- A gearbox of Falcon 500 motors.
-
getFalcon500Foc
Return a gearbox of Falcon 500 motors with FOC (Field-Oriented Control) enabled.- Parameters:
numMotors- Number of motors in the gearbox.- Returns:
- A gearbox of Falcon 500 FOC enabled motors.
-
getRomiBuiltIn
Return a gearbox of Romi/TI_RSLK MAX motors.- Parameters:
numMotors- Number of motors in the gearbox.- Returns:
- A gearbox of Romi/TI_RSLK MAX motors.
-
getKrakenX60
Return a gearbox of Kraken X60 brushless motors.- Parameters:
numMotors- Number of motors in the gearbox.- Returns:
- a gearbox of Kraken X60 motors.
-
getKrakenX60Foc
Return a gearbox of Kraken X60 brushless motors with FOC (Field-Oriented Control) enabled.- Parameters:
numMotors- Number of motors in the gearbox.- Returns:
- A gearbox of Kraken X60 FOC enabled motors.
-
getNeoVortex
Return a gearbox of Neo Vortex brushless motors.- Parameters:
numMotors- Number of motors in the gearbox.- Returns:
- a gearbox of Neo Vortex motors.
-