diff --git a/wpimath/src/main/java/edu/wpi/first/math/system/plant/DCMotor.java b/wpimath/src/main/java/edu/wpi/first/math/system/plant/DCMotor.java index cd431f73402..ee0b2c79f06 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/system/plant/DCMotor.java +++ b/wpimath/src/main/java/edu/wpi/first/math/system/plant/DCMotor.java @@ -86,7 +86,8 @@ public double getVoltage(double torqueNm, double speedRadiansPerSec) { * @return The speed of the motor. */ public double getSpeed(double torqueNm, double voltageInputVolts) { - return voltageInputVolts - 1.0 / KtNMPerAmp * torqueNm * rOhms * KvRadPerSecPerVolt; + return voltageInputVolts * KvRadPerSecPerVolt + - 1.0 / KtNMPerAmp * torqueNm * rOhms * KvRadPerSecPerVolt; } /**