Add 2023 arm design code
The C++ was better for design than the python...
Change-Id: Ic606a8a728527668b7335eb7a94cbfd69e272774
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
Signed-off-by: Xander Yee <xander.yee@gmail.com>
diff --git a/y2018/constants.h b/y2018/constants.h
index 2a6f0ac..6adcb8a 100644
--- a/y2018/constants.h
+++ b/y2018/constants.h
@@ -51,7 +51,7 @@
}
static constexpr double kMaxProximalEncoderPulsesPerSecond() {
return control_loops::superstructure::arm::kArmConstants.free_speed /
- (2.0 * M_PI) / control_loops::superstructure::arm::kArmConstants.g1 /
+ (2.0 * M_PI) / control_loops::superstructure::arm::kArmConstants.g0 /
kProximalEncoderRatio() * kProximalEncoderCountsPerRevolution();
}
static constexpr double kProximalPotRatio() { return (12.0 / 60.0); }
@@ -60,7 +60,7 @@
static constexpr double kDistalEncoderRatio() { return (12.0 / 60.0); }
static constexpr double kMaxDistalEncoderPulsesPerSecond() {
return control_loops::superstructure::arm::kArmConstants.free_speed /
- (2.0 * M_PI) / control_loops::superstructure::arm::kArmConstants.g2 /
+ (2.0 * M_PI) / control_loops::superstructure::arm::kArmConstants.g1 /
kDistalEncoderRatio() * kProximalEncoderCountsPerRevolution();
}
static constexpr double kDistalPotRatio() {
diff --git a/y2018/control_loops/superstructure/arm/arm_constants.h b/y2018/control_loops/superstructure/arm/arm_constants.h
index 9ac7020..1697a8e 100644
--- a/y2018/control_loops/superstructure/arm/arm_constants.h
+++ b/y2018/control_loops/superstructure/arm/arm_constants.h
@@ -14,22 +14,22 @@
constexpr double kStallCurrent = 89.0;
constexpr ::frc971::control_loops::arm::ArmConstants kArmConstants = {
- .l1 = 46.25 * 0.0254,
- .l2 = 41.80 * 0.0254,
- .m1 = 9.34 / 2.2,
- .m2 = 9.77 / 2.2,
+ .l0 = 46.25 * 0.0254,
+ .l1 = 41.80 * 0.0254,
+ .m0 = 9.34 / 2.2,
+ .m1 = 9.77 / 2.2,
// Moment of inertia of the joints in kg m^2
- .j1 = 2957.05 * 0.0002932545454545454,
- .j2 = 2824.70 * 0.0002932545454545454,
+ .j0 = 2957.05 * 0.0002932545454545454,
+ .j1 = 2824.70 * 0.0002932545454545454,
// Radius of the center of mass of the joints in meters.
- .r1 = 21.64 * 0.0254,
- .r2 = 26.70 * 0.0254,
+ .r0 = 21.64 * 0.0254,
+ .r1 = 26.70 * 0.0254,
// Gear ratios for the two joints.
- .g1 = 140.0,
- .g2 = 90.0,
+ .g0 = 140.0,
+ .g1 = 90.0,
// MiniCIM motor constants.
.efficiency_tweak = kEfficiencyTweak,