When the robot does something wrong, resist the urge to start changing code. Bugs are won by observing, not guessing. Use this triage order every time.
1. Read the Driver Station first#
The DS is your ground truth. Check, in order: is the robot Communications light green (RIO reachable)? Is Robot Code green (your program is actually running)? Are there red text errors in the message box? A common panic -- "my code does nothing" -- is just code that crashed on boot; the DS message log shows the stack trace.
2. Check the CAN/Power tab#
This tab shows CAN Bus Utilization and the 12V fault counter. High CAN utilization (>90%) causes dropped frames and laggy control. A 12V fault increment means a brown-out happened -- more on that in its own lesson.
3. Replay the match with the DS Log Viewer#
After a match, the Driver Station Log File Viewer plots voltage, trip time, roboRIO CPU%, lost packets, and robot mode over time, with event dots overlaid. Brown-outs show as a bright orange line. This is how you answer "why did the robot die for two seconds in the middle of teleop" without being there -- the log already recorded it.
4. Inspect live data with AdvantageScope or Glass#
AdvantageScope visualizes NetworkTables, WPILib data logs, and DS logs -- live or from a file. Its purpose-built tabs (Line Graph, Swerve, Odometry, 3D Field) turn raw numbers into pictures: plot a setpoint against its measured value to see a tuning problem instantly. Glass is the lighter live dashboard for plotting NetworkTables values and viewing field pose in real time.
5. Log structured data, not print statements#
WPILib's Epilogue (new for 2025, Java-only) auto-generates logging from a @Logged annotation. Annotate your robot and subsystem classes and call Epilogue.bind(this) in the constructor; optionally DataLogManager.start() to mirror to disk:
@Logged
public class Robot extends TimedRobot {
private final Arm arm = new Arm();
public Robot() {
DataLogManager.start(); // also persist to a .wpilog file
Epilogue.bind(this);
}
}
Logged fields appear under structured NetworkTables paths derived from your class and field names, ready to plot. This is vastly better than System.out.println -- which, as the next lesson explains, can actually cause loop overruns.
The mindset#
Form a hypothesis ('the elevator overshoots because kD is zero'), find the one piece of data that confirms or kills it (the position-vs-setpoint plot), and only then change code. One change at a time, re-test, keep notes. Reproduce the bug reliably before you believe any fix.
the part worth keeping
Key takeaways
- Triage in order: DS status lights -> message log -> CAN/Power tab -> DS log viewer -> AdvantageScope/Glass.
- The Driver Station Log Viewer replays past matches with voltage, CPU, packet loss, and brown-out markers.
- AdvantageScope and Glass turn NetworkTables/log data into plots and field views for live or post-match analysis.
- Prefer structured Epilogue (@Logged, new for 2025) telemetry over print statements; observe before you change code.
Programming, Controls & SensorsCommon Mistakes and Troubleshootinglesson 1 of 5
Keep going
Take the quiz+10 XP with an accountMore in Common Mistakes and Troubleshooting
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: Driver Station Log File Viewer
- docs.wpilib.orgWPILib: AdvantageScope
- docs.wpilib.orgWPILib: Robot Telemetry with Annotations (Epilogue)
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.
- 19 min readAdvantageScope: Logging and Reviewing FRC Robot DataLearn AdvantageScope, the free FRC tool for logging and reviewing robot data: connect live NetworkTables, open WPILOG and DS logs, and debug with every tab./blogread it
- 8 min readThe FRC Software Toolbox: Driver Station, Dashboards, AdvantageScope & SysIdA beginner-friendly tour of the FRC software ecosystem beyond robot code: Driver Station, dashboards (Glass, Elastic, AdvantageScope), SysId, and vendor tools./blogread it
- 7 min readFRC "No Robot Code" & Driver Station Won't Connect: Full Fix ChecklistA verified, step-by-step FRC troubleshooting decision tree for "No Robot Code" and a Driver Station that won't connect to the roboRIO — most common causes first./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 recommended first step in a systematic FRC debugging workflow before attempting any fix?
02Which tool lets you answer "why did the robot die for two seconds mid-teleop" without having been there watching?
03When isolating the cause of a bug, what practice makes it easiest to identify which change fixed or broke the behavior?
Answer every question to submit.
All 51 lessons in Programming, Controls & Sensorsopenclose
01 / prerequisites
02 / foundations-tools-and-first-program
03 / robot-program-and-command-based
04 / motors-and-control
05 / autonomous-trajectories-simulation
06 / sensing-fundamentals
07 / encoders
08 / gyros-imus-orientation
09 / closed-loop-control
10 / vision-pose-estimation
11 / worked-examples-mini-projects
- Not read yet:Mini-Project: A Closed-Loop Elevator with Motion Magic
- Not read yet:Mini-Project: A Velocity-Controlled Shooter on REVLib
- Not read yet:Mini-Project: A Teleop Swerve Drive Subsystem
- Not read yet:Mini-Project: An Autonomous Routine with PathPlanner
- Not read yet:Mini-Project: Vision-Aligned Scoring with Limelight
12 / common-mistakes-troubleshooting
13 / advanced-techniques-case-studies
- Not read yet:State-Space Control and Kalman Filtering
- Not read yet:Log Replay Architecture with AdvantageKit
- Not read yet:Advanced Pose Estimation: Multi-Tag Fusion and Standard Deviations
- Not read yet:Robot Coordination, Alerts, and Operator Feedback
- Not read yet:Case Study: Hardening Software Before an Event