Fix some wrong drivetrain constants.
Change-Id: I40989297b4bf20de68562c99ac7988b6c0034086
diff --git a/y2016/constants.h b/y2016/constants.h
index 87b56cf..3b84c44 100644
--- a/y2016/constants.h
+++ b/y2016/constants.h
@@ -28,12 +28,14 @@
// The ratio from the encoder shaft to the drivetrain wheels.
static constexpr double kDrivetrainEncoderRatio =
- (18.0 / 36.0) /*output reduction*/ * (44.0 / 30.0);
+ (18.0 / 36.0) /*output reduction*/ * (30.0 / 44.0) /*encoder gears*/;
// The gear ratios from motor shafts to the drivetrain wheels for high and low
// gear.
- static constexpr double kLowGearRatio = 18.0 / 60.0 * 18.0 / 36.0;
- static constexpr double kHighGearRatio = 28.0 / 50.0 * 18.0 / 36.0;
+ static constexpr double kLowGearRatio =
+ 14.0 / 48.0 * 18.0 / 60.0 * 18.0 / 36.0;
+ static constexpr double kHighGearRatio =
+ 14.0 / 48.0 * 28.0 / 50.0 * 18.0 / 36.0;
static constexpr double kTurnWidth = 0.601; // Robot width.
diff --git a/y2016/control_loops/python/drivetrain.py b/y2016/control_loops/python/drivetrain.py
index f94b456..94905a2 100755
--- a/y2016/control_loops/python/drivetrain.py
+++ b/y2016/control_loops/python/drivetrain.py
@@ -76,10 +76,10 @@
self.J = 2.8
# Mass of the robot, in kg.
self.m = 68
- # Radius of the robot, in meters (from last year).
- self.rb = 0.647998644 / 2.0
+ # Radius of the robot, in meters (requires tuning by hand)
+ self.rb = 0.601 / 2.0
# Radius of the wheels, in meters.
- self.r = .04445
+ self.r = 0.097155
# Resistance of the motor, divided by the number of motors.
self.resistance = 12.0 / self.stall_current
# Motor velocity constant
@@ -88,8 +88,8 @@
# Torque constant
self.Kt = self.stall_torque / self.stall_current
# Gear ratios
- self.G_low = 18.0 / 60.0 * 18.0 / 50.0
- self.G_high = 28.0 / 50.0 * 18.0 / 50.0
+ self.G_low = 14.0 / 48.0 * 18.0 / 60.0 * 18.0 / 36.0
+ self.G_high = 14.0 / 48.0 * 28.0 / 50.0 * 18.0 / 36.0
if left_low:
self.Gl = self.G_low
else: