Troubleshooting Guide¶
Common problems and how to fix them.
"My Robot Won't Move!"¶
Checklist¶
flowchart TD
Start["Robot Won't Move"] --> B{"Battery charged?"}
B -->|No| BC["Charge battery"]
B -->|Yes| C{"Code downloaded?"}
C -->|No| CD["Download code from brain menu"]
C -->|Yes| M{"Motors plugged in?"}
M -->|No| MC["Check connections"]
M -->|Yes| P{"Ports correct in code?"}
P -->|No| PC["Match robot_config.py"]
P -->|Yes| K{"Controller connected?"}
K -->|No| KC["Check wireless link"]
K -->|Yes| OK["All checks passed - investigate further"]
Port Mismatch¶
# If motors are on ports 1,2,3,4 but code says 5,6,7,8:
left_motor_front = Motor(Ports.PORT1, ...) # ← Check this!
Motors Reversed Wrong¶
# If robot spins in circles instead of forward:
# Right motors should be reversed!
right_motor = Motor(Ports.PORT3, GearSetting.RATIO_18_1, True)
# ^^^^
"My Robot Moves Slowly"¶
Check Gear Setting¶
# Make sure code matches physical cartridge!
Motor(port, GearSetting.RATIO_18_1, ...) # Green = 200 RPM
Motor(port, GearSetting.RATIO_36_1, ...) # Red = 100 RPM
Check Velocity Setting¶
Battery Low¶
- Check battery percentage on brain screen
- Swap batteries if below 50%
"My Robot Drifts When Joystick Is Centered"¶
Add Deadband¶
def deadband(value, threshold=5):
if abs(value) < threshold:
return 0
return value
speed = deadband(controller.axis3.position())
Increase Threshold¶
"My Robot Overshoots When Turning"¶
Reduce Turn Velocity¶
Add Wait After Turn¶
Use Inertial Sensor¶
"Code Doesn't Download"¶
Check Connection¶
- USB-C cable connected to Brain?
- VEX Extension active in VS Code?
- Brain powered on?
Try Restart¶
- Power off brain
- Disconnect USB
- Power on brain
- Reconnect USB
- Try download again
Check File¶
- Make sure you're downloading
main.py - Check for syntax errors (red underlines)
"Controller Doesn't Work"¶
Check Pairing¶
- Both brain and controller powered on?
- Radio dongle plugged into brain?
- Try re-pairing (hold power buttons on both)
Wired Test¶
- Connect controller to brain with cable
- If works wired but not wireless, battery issue
Replace Batteries¶
- Controller takes AA batteries
- Replace if older than a few months
Common Code Errors¶
IndentationError¶
# WRONG:
def my_function():
print("Hello") # Not indented!
# RIGHT:
def my_function():
print("Hello") # 4 spaces
NameError¶
TypeError¶
# WRONG:
print("Speed: " + speed) # Can't add string + number
# RIGHT:
print("Speed: " + str(speed)) # Convert to string
SyntaxError¶
# WRONG:
if speed > 50 # Missing colon
print("Fast")
# RIGHT:
if speed > 50: # Colon required!
print("Fast")
Inertial Sensor Issues¶
Not Calibrated¶
Robot Moving During Calibration¶
- Robot must be STILL during calibration
- Place on flat surface
- Don't touch for 3 seconds
Heading Drift¶
- Normal over time
- Re-calibrate between matches
- Use
inertial_sensor.set_heading(0)to reset
Distance Sensor Issues¶
Reading Zero¶
- Object too far? (Max ~2000mm)
- Object too close? (Min ~50mm)
- Sensor blocked?
Inconsistent Readings¶
- Shiny surfaces reflect poorly
- Dark objects absorb light
- Try different target surface
Competition Checklist¶
timeline
title Competition Pre-Match Checklist
section BEFORE MATCH
Battery charged >70%
: Controller batteries fresh
: Code downloaded
: Correct autonomous selected
: Motors all working
: Sensors calibrated
section AT FIELD
Controller paired
: Alliance color set (if needed)
: Starting position correct
: Robot in legal position
section AFTER AUTONOMOUS
Ready to drive immediately
: Know the game situation
Getting More Help¶
- VEX Forum: www.vexforum.com
- VEX Knowledge Base: kb.vex.com
- Ask Your Mentor
- Check the Glossary (next page)