A fast robot that browns out mid-match is slower than a smooth one that never quits. This project hardens your drivetrain against the two most common failure modes: jerky acceleration that wears drivers out, and current spikes that drop system voltage and disable the robot.
Step 1 — Smooth the inputs with a slew rate limiter. A SlewRateLimiter caps how fast a value can change, in units per second. Construct one per axis (the filter has memory, so each input stream needs its own instance).
import edu.wpi.first.math.filter.SlewRateLimiter;
// 3.0 means "full stick (0->1) takes 1/3 second"
private final SlewRateLimiter xLimiter = new SlewRateLimiter(3.0);
private final SlewRateLimiter yLimiter = new SlewRateLimiter(3.0);
private final SlewRateLimiter rotLimiter = new SlewRateLimiter(3.0);
public void driveFieldRelative(double x, double y, double rot) {
x = xLimiter.calculate(x);
y = yLimiter.calculate(y);
rot = rotLimiter.calculate(rot);
// ... feed to kinematics / drive ...
}
The WPILib docs show the same pattern (drivetrain.arcadeDrive(filter.calculate(forward), turn)). Higher numbers = snappier; lower = gentler. WPILib notes slew limiting is especially handy for robots that are very top-heavy or that have very powerful drives, but gives no fixed numeric range — tune the value empirically for your robot. Tune on the practice field by feel.
Step 2 — Cap current at the motor controllers. Brownouts happen when transient current spikes drop the battery below the roboRIO threshold (6.3 V on roboRIO 1; 6.75 V default Stage-2 on roboRIO 2, which is software-settable), which disables all actuators. The fix is a smart current limit on each drive motor. On a REV SPARK MAX driving a NEO:
import com.revrobotics.spark.config.SparkMaxConfig;
SparkMaxConfig cfg = new SparkMaxConfig();
cfg.smartCurrentLimit(40); // 40 A is a common, safe drivetrain limit
motor.configure(cfg, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters);
A 40–50 A limit is a common community sweet spot: responsive enough that drivers don't notice it, but it keeps the robot out of brownout. (On CTRE TalonFX, the equivalent is a CurrentLimitsConfigs stator/supply limit.) Remember the battery is a single 12 V 18 Ah SLA (the MK ES17-12 is one common, legal example part); under hard driving four unlimited drive motors plus a mechanism can demand far more transient current than the battery can supply without sagging, which is exactly what triggers a brownout.
Step 3 — Verify. Open the Driver Station charts and watch battery voltage during a hard acceleration test. Before limits, you may see deep dips toward the brownout floor; after limits, voltage should stay comfortably higher under the same driving. Drive a full match's worth (REBUILT is a 20-second auto plus a 2:20 teleop, about 2:40 total) of aggressive sprints and stops on one battery; if it never disables and the battery still reads healthy, you're match-ready.
Key takeaways
- SlewRateLimiter(rate) caps change in units/sec; 3.0 means full stick takes ~1/3 second. Use one instance per axis.
- Set SPARK MAX smartCurrentLimit to ~40A on drive motors to prevent brownouts (roboRIO disables at 6.3V / 6.75V).
- Verify on the Driver Station voltage chart: under hard driving, voltage should stay well above the brownout floor.
Keep going
Take the quiz · +10 XP with an accountMore in Worked Examples & Mini-Projects
Sources & corrections
This lesson is AI-assisted: drafted from primary sources, then reviewed and edited by hand. Errors still get through. When one is reported we fix it and write down what changed — publicly, in the corrections log.
Sources and further reading
- WPILib: Slew Rate Limiterdocs.wpilib.org
- REV: SPARK MAX Troubleshooting (brownouts/current)docs.revrobotics.com
Read next
Articles on this, for competition day
The lesson covers how it works. These cover what to do when it breaks.
- 20 min read
REV Robotics for FRC: NEO Motors, Spark MAX/Flex, PDH & MAXSwerve
A practical guide to the REV Robotics FRC ecosystem: NEO, NEO Vortex and NEO 550 motors, Spark MAX and Spark Flex controllers, the PDH, and MAXSwerve.
Read - 13 min read
FRC Code Structure Best Practices: Command-Based Project Architecture
How to structure an FRC command-based robot project the right way — subsystems, commands, RobotContainer, and Constants — verified against official WPILib docs.
Read - 7 min read
FRC Brownout: Why Your Robot Goes Limp and How to Actually Fix It
The exact roboRIO brownout voltage stages, how to spot one in the Driver Station log, and the fixes ranked by payoff: current limits, battery health, gearing, and compressor scheduling.
Read
Lesson quiz
RequiredAll 3 right completes the lesson. Miss one and only that question comes back — anything you already answered correctly stays banked.
0 of 3 answered
01.What is the brownout threshold on a roboRIO 1, below which it disables all actuator outputs?
02.For a SlewRateLimiter constructed with a rate of 3.0, what does that value mean for the input it filters?
03.How does the project stop drive-motor current spikes from browning out the robot?
Answer every question to submit.
All 34 lessons in Drive Team
- Not started:Project 1: A Production-Ready Driver Control Scheme
- Not started:Project 2: A Drivetrain That Survives a Whole Match
- Not started:Project 3: Build a Paper + Spreadsheet Scouting System
- Not started:Project 4: Pull Live OPR & EPA Data with Python
- Not started:Project 5: The One-Page Pre-Match Strategy Brief