Tune drivetrain.
Add force knob, efficiency, IMU
Change-Id: I4fd12665490d4e535d5890c2edf8ae611938333d
diff --git a/y2018/control_loops/drivetrain/drivetrain_base.cc b/y2018/control_loops/drivetrain/drivetrain_base.cc
index d589bc1..838b5ad 100644
--- a/y2018/control_loops/drivetrain/drivetrain_base.cc
+++ b/y2018/control_loops/drivetrain/drivetrain_base.cc
@@ -21,7 +21,8 @@
static DrivetrainConfig kDrivetrainConfig{
::frc971::control_loops::drivetrain::ShifterType::HALL_EFFECT_SHIFTER,
::frc971::control_loops::drivetrain::LoopType::CLOSED_LOOP,
- ::frc971::control_loops::drivetrain::GyroType::SPARTAN_GYRO,
+ ::frc971::control_loops::drivetrain::GyroType::IMU_Z_GYRO,
+ ::frc971::control_loops::drivetrain::IMUType::IMU_Y,
::y2018::control_loops::drivetrain::MakeDrivetrainLoop,
::y2018::control_loops::drivetrain::MakeVelocityDrivetrainLoop,
@@ -35,7 +36,7 @@
true /* default_high_gear */, 0 /* down_offset if using constants use
constants::GetValues().down_error */,
0.8 /* wheel_non_linearity */, 1.2 /* quickturn_wheel_multiplier */,
- 1.1 /* wheel_multiplier */,
+ 1.5 /* wheel_multiplier */,
};
return kDrivetrainConfig;
diff --git a/y2018/control_loops/python/drivetrain.py b/y2018/control_loops/python/drivetrain.py
index 988ac74..64217a0 100644
--- a/y2018/control_loops/python/drivetrain.py
+++ b/y2018/control_loops/python/drivetrain.py
@@ -15,16 +15,20 @@
#J needs updating
kDrivetrain = drivetrain.DrivetrainParams(
- J=2.5,
+ J=6.0,
mass=68.0,
robot_radius=0.616 / 2.0,
- wheel_radius=0.127 / 2.0,
+ wheel_radius=0.127 / 2.0 * 120.0 / 118.0,
G_low=46.0 / 60.0 * 20.0 / 48.0 * 14.0 / 62.0,
G_high=62.0 / 44.0 * 20.0 / 48.0 * 14.0 / 62.0,
q_pos_low=0.12,
q_pos_high=0.14,
q_vel_low=1.0,
q_vel_high=0.95,
+ efficiency=0.70,
+ has_imu=True,
+ force=True,
+ kf_q_voltage=13.0,
controller_poles=[0.82, 0.82],
)