Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public class ArmElevatorConstants {
private static final SimpleSensor REVERSE_LIMIT_SENSOR = SimpleSensor.createDigitalSensor(REVERSE_LIMIT_SENSOR_CHANNEL, REVERSE_LIMIT_SENSOR_NAME);

private static final double
ARM_GEAR_RATIO = 40,
ELEVATOR_GEAR_RATIO = 4;
ARM_GEAR_RATIO = 42,
ELEVATOR_GEAR_RATIO = 3;
private static final double REVERSE_LIMIT_RESET_POSITION_ROTATIONS = 0;
private static final double
ARM_MOTOR_CURRENT_LIMIT = 50,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class EndEffectorConstants {
static final SimpleSensor DISTANCE_SENSOR = SimpleSensor.createDigitalSensor(DISTANCE_SENSOR_CHANNEL, DISTANCE_SENSOR_NAME);

static final boolean FOC_ENABLED = true;
private static final double END_EFFECTOR_GEAR_RATIO = 17;
private static final double END_EFFECTOR_GEAR_RATIO = 12.82;
private static final int END_EFFECTOR_MOTOR_AMOUNT = 1;
private static final DCMotor END_EFFECTOR_GEARBOX = DCMotor.getKrakenX60Foc(END_EFFECTOR_MOTOR_AMOUNT);
private static final double
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class IntakeConstants {

private static final double
INTAKE_MOTOR_GEAR_RATIO = 4,
ANGLE_MOTOR_GEAR_RATIO = 28;
ANGLE_MOTOR_GEAR_RATIO = 40;
static final boolean FOC_ENABLED = true;
Comment on lines 52 to 54
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Update gravity feedforward after gear ratio change.

Switching the angle motor reduction from 28:1 to 40:1 increases mechanical leverage, so the existing config.Slot0.kG (0.32151 real / 0.35427 sim) is now ~40% too large. On the real robot this constant is the only non-zero loop gain, so it will overdrive the wrist upward and fight the limit switches. Please re-identify the wrist feedforward gains (at minimum scale kG by 28/40 ≈ 0.7, plus rerun SysId for the sim gains) so they match the new reduction before merging. (api.ctr-electronics.com)

Apply this diff as a first-order fix, then re-tune to measured values:

-        config.Slot0.kG = RobotHardwareStats.isSimulation() ? 0.35427 : 0.32151;
+        config.Slot0.kG = RobotHardwareStats.isSimulation() ? 0.248 : 0.225;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
INTAKE_MOTOR_GEAR_RATIO = 4,
ANGLE_MOTOR_GEAR_RATIO = 28;
ANGLE_MOTOR_GEAR_RATIO = 40;
static final boolean FOC_ENABLED = true;
// Scale kG by 28/40≈0.7 after changing the gear ratio from 28:1→40:1
config.Slot0.kG = RobotHardwareStats.isSimulation() ? 0.248 : 0.225;


private static final int
Expand Down
Loading