Last Updated: Competition prep - Week before competition
📁 RobotConstants.java (TeamCode/src/main/java/org/firstinspires/ftc/teamcode/core/constants/)
All competition teleop settings are here:
- PIDF gains (kP, kI, kD, kF)
- Default RPM
- All 7 shooting ranges (distances, RPM, hood positions)
- Hood positions
- Transfer ramp positions
- Drive control settings
- Turret control settings
- Limelight camera specs
📁 - DEPRECATED - Kept for backwards compatibility onlyTeleOpConstants.java
Steps:
- Run
FlywheelPIDFTunerOpMode - Tune gains using gamepad controls
- Press B to save gains to telemetry log
- Open RobotConstants.java
- Go to lines 20-23
- Update these values:
public static final double FLYWHEEL_KP = 0.00035; // Copy from telemetry public static final double FLYWHEEL_KI = 0.000025; // Copy from telemetry public static final double FLYWHEEL_KD = 0.00015; // Copy from telemetry public static final double FLYWHEEL_KF = 0.000215; // Copy from telemetry
- Recompile and test in teleop
Telemetry log format:
=== TUNED GAINS - COPY TO RobotConstants.java ===
FLYWHEEL_KP = 0.000350;
FLYWHEEL_KI = 0.000025;
FLYWHEEL_KD = 0.000150;
FLYWHEEL_KF = 0.000215;
DEFAULT_TARGET_RPM = 3500;
Update these in RobotConstants.java lines 20-23!
Steps:
- Set up robot at test distance (e.g., 4.0 ft)
- Use distance lock and shoot
- If shots fall short → Increase RPM
- If shots overshoot → Decrease RPM
- Open RobotConstants.java
- Find the appropriate range (e.g., RANGE_4 at line 60)
- Update RPM value:
// Before: public static final double RANGE_4_FLYWHEEL_RPM = 3400; // After testing - shots fell short: public static final double RANGE_4_FLYWHEEL_RPM = 3500; // Increased by 100
- Recompile and re-test
Range locations in RobotConstants.java:
- Range 1 (2.47-2.84 ft): Lines 40-43
- Range 2 (2.84-3.2 ft): Lines 46-49
- Range 3 (3.21-4.0 ft): Lines 52-55
- Range 4 (4.0-4.5 ft): Lines 58-61
- Range 5 (4.6-5.0 ft): Lines 64-67
- Range 6 (4.84-5.25 ft): Lines 70-73
- Range 7 (5.2-5.7 ft): Lines 76-79
- Far Zone (5.7+ ft): Lines 82-84
| What to Change | Line Number | Constant Name |
|---|---|---|
| Default flywheel RPM | 20 | DEFAULT_TARGET_RPM |
| Default hood position | 32 | HOOD_DEFAULT_POSITION |
| Transfer ramp up position | 35 | TRANSFER_UP_POSITION |
| Transfer ramp down position | 36 | TRANSFER_DOWN_POSITION |
| Turret center position | 95 | TURRET_CENTER_POSITION |
| Driving speed when shooting | 78 | SPEED_SHOOTING_MULTIPLIER |
| Enable/disable PIDF mode | 15 | USE_VELOCITY_CONTROL |
If PIDF velocity control causes problems during competition:
RobotConstants.java line 15:
// Change this:
public static final boolean USE_VELOCITY_CONTROL = true;
// To this:
public static final boolean USE_VELOCITY_CONTROL = false; // FALLBACK TO POWER MODERecompile - flywheel will use old power percentage mode instead.
ONLY UPDATE VALUES IN:
TeamCode/
└── src/main/java/org/firstinspires/ftc/teamcode/core/constants/
└── RobotConstants.java ← UPDATE HERE ONLY!
Files that AUTO-USE these values:
- ✅
CompetitionTeleOpBase.java(competition teleop) - ✅
Launcher.java(flywheel component) - ✅
FlywheelPIDFTuner.java(tuning program) - ✅
DistanceCalculator.java(limelight distance)
After updating RobotConstants.java:
- Save file
- Recompile (Build → Make Project)
- Deploy to robot
- Test changes
- PIDF gains tuned and updated in RobotConstants.java
- All 7 shooting ranges tested and RPM values confirmed
- Hood positions verified for each range
- Default values set correctly
- Compiled and deployed to robot
- Full shooting workflow tested
Remember: RobotConstants.java is your SINGLE SOURCE OF TRUTH! Update values there, recompile, and everything else updates automatically.