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

Commit 7e4e9bf

Browse files
committed
Added division by 2 because each side of the drivetrain only supports half of the drivetrain. Changed SmartDashboard to lbs, and converts to kg inside the code
1 parent d6ab7d9 commit 7e4e9bf

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ public double calcDefkD() {
196196
double gearReduction = Robot.getBool("High Gear", false) ? Robot.getConst("High Gear Gear Reduction", 5.392)
197197
: Robot.getConst("Low Gear Gear Reduction", 12.255);
198198
double timeConstant = Robot.getConst("Omega Max", 5330) / gearReduction
199-
* Robot.getConst("Mass of Robot", 54.4311) * Robot.getConst("Radius of Drivetrain Wheel", 0.0635)
199+
* convertLbsTokG(Robot.getConst("Mass of Robot", 150)) / 2
200+
* Robot.getConst("Radius of Drivetrain Wheel", 0.0635)
200201
* Robot.getConst("Radius of Drivetrain Wheel", 0.0635)
201202
/ (Robot.getConst("Stall Torque", 2.41) * gearReduction);
202203
double cycleTime = Robot.getConst("Code cycle time", 0.1);
@@ -207,4 +208,9 @@ public double calcDefkD() {
207208
double denominator = 1 - Math.pow(Math.E, -1 * cycleTime / timeConstant);
208209
return 1 / denominator;
209210
}
211+
212+
private double convertLbsTokG(double lbs) {
213+
// number from google ;)
214+
return lbs * 0.45359237;
215+
}
210216
}

0 commit comments

Comments
 (0)