Current Limiting Test
The current limiting test runs your robot at different speeds and logs how much current the drivetrain pulls. This lets you set a safe current limit to prevent voltage dips that can cause erratic behavior during autonomous.
Why It Matters
Swerve and mecanum drives can pull massive current during aggressive acceleration, causing battery voltage to drop. Voltage dips cause motors to behave inconsistently and throw off localization.
How It Works
This is an automatic tuner. The robot runs through speed increments and logs the draw at each step. You then use that data to decide on a safe limit.
How to Run
- Battery: Ensure you have a fully charged battery.
- Space: Place your robot on a flat, open area.
- Select: Open
CurrentLimitingTeston your Driver Station. - Run: Press Play — the robot will run automatically.
- Analyze: Check the telemetry output or log file.
Reading the Results
Look for where the current spikes sharply. Set your limit just below that spike:
| Speed | Current Draw | Notes |
|---|---|---|
| 25% | ~4A | Safe range |
| 50% | ~8A | Safe range |
| 75% | ~14A | Watch here |
| 100% | ~22A | Often too high |
Your actual values will vary based on your motors and battery health.
Applying the Limit
Once you have your target value, set it in your drivetrain config:
Java
// Set limit in Amps
motor.setCurrentLimit(CurrentUnit.AMPS, 15); Important: Running this test on a low battery will show artificially low readings. Always use a fresh battery for tuning.
Compatibility
- ✅ Mecanum Drive
- ✅ Swerve Drive