Skip to content
This repository was archived by the owner on Sep 14, 2019. It is now read-only.

Commit 9159815

Browse files
committed
changed the rpm to radians per second
1 parent dd737a3 commit 9159815

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Robot2018/src/org/usfirst/frc/team199/Robot2018/RobotMap.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,14 @@ public double calcDefkD() {
212212
* half of the drivetrain only has to support half of the robot), and radius of
213213
* the drivetrain wheels squared. It's inversely proportional to the stall
214214
* torque of the shaft, which is found by multiplying the stall torque of the
215-
* motor with the gear reduction by the amount of motors.
215+
* motor with the gear reduction by the amount of motors. The omegaMax needs to
216+
* be converted from rpm to radians per second, so divide by 60 and multiply to
217+
* get radians.
216218
*/
217219
double gearReduction = Robot.getBool("High Gear", false) ? Robot.getConst("High Gear Gear Reduction", 5.392)
218220
: Robot.getConst("Low Gear Gear Reduction", 12.255);
219221
double radius = Robot.getConst("Radius of Drivetrain Wheel", 0.0635);
220-
double timeConstant = Robot.getConst("Omega Max", 5330) / gearReduction
222+
double timeConstant = Robot.getConst("Omega Max", 5330) / gearReduction / 60 * 2 * Math.PI
221223
* convertLbsTokG(Robot.getConst("Mass of Robot", 150)) / 2 * radius * radius
222224
/ (Robot.getConst("Stall Torque", 2.41) * gearReduction * 2);
223225
double cycleTime = Robot.getConst("Code cycle time", 0.1);

0 commit comments

Comments
 (0)