This repository was archived by the owner on Sep 14, 2019. It is now read-only.
File tree Expand file tree Collapse file tree
Robot2018/src/org/usfirst/frc/team199/Robot2018 Expand file tree Collapse file tree Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments