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.
the part worth keeping
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.
Drive TeamWorked Examples & Mini-Projectslesson 2 of 5
Keep going
Take the quiz+10 XP with an accountMore in Worked Examples & Mini-Projects
where this came from
Sources and 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, in public, in the corrections log.
sources and further reading
- docs.wpilib.orgWPILib: Slew Rate Limiter
- docs.revrobotics.comREV: SPARK MAX Troubleshooting (brownouts/current)
clipped to this lesson
Articles that go further on this
The lesson gets you through the topic. These go wider on it, and they read in one sitting.
- 20 min readREV Robotics for FRC: NEO Motors, Spark MAX/Flex, PDH & MAXSwerveA 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./blogread it
- 13 min readFRC Code Structure Best Practices: Command-Based Project ArchitectureHow to structure an FRC command-based robot project the right way — subsystems, commands, RobotContainer, and Constants — verified against official WPILib docs./blogread it
- 7 min readFRC Brownout: Why Your Robot Goes Limp and How to Actually Fix ItThe 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./blogread it
answer sheet
Lesson quiz
All 3 right completes the lesson. Miss one and only that question comes back, anything you already answered correctly stays banked.
0 of 3 answered
01What is the brownout threshold on a roboRIO 1, below which it disables all actuator outputs?
02For a SlewRateLimiter constructed with a rate of 3.0, what does that value mean for the input it filters?
03How does the project stop drive-motor current spikes from browning out the robot?
Answer every question to submit.
All 34 lessons in Drive Teamopenclose
01 / prerequisites
02 / the-drive-team-and-its-roles
03 / driver-station-and-controls
04 / driver-practice-and-match-performance
05 / the-pit-and-match-turnaround
06 / worked-examples-mini-projects
- Not read yet:Project 1: A Production-Ready Driver Control Scheme
- Not read yet:Project 2: A Drivetrain That Survives a Whole Match
- Not read yet:Project 3: Build a Paper + Spreadsheet Scouting System
- Not read yet:Project 4: Pull Live OPR & EPA Data with Python
- Not read yet:Project 5: The One-Page Pre-Match Strategy Brief
07 / common-mistakes-troubleshooting
08 / advanced-strategy-case-studies