Pit Crew Code Lab Activity
VEXcode IQ Blocks • Pre-Build Sandbox
PIT CREW CODE LAB
Name: ___________________________
Date: ____________ Brain #: ______
Mission Briefing
Before you build a high-speed robot for the designated-distance track, every pit crew must master the VEX IQ Robot Brain. Today, you will wire up a bench-test motor & wheel rig and run 5 coding challenges to control speed, direction, and distance.
Bench Rig Checklist
-
- Power Brain ON & open VEXcode IQ.
-
- Plug 1–2 Smart Motors into Ports (e.g., 1 & 6) with wheels + tape flags.
-
- Add Motors in Devices to match ports.
Key VEXcode IQ Blocks Match port names in Devices before downloading!
when started set Motor velocity to (50) % spin Motor (forward) for (1) turns spin Motor (forward) wait (2) seconds stop Motor
Challenge 1 Spin & Flag Check (Precision Control)
1 Motor + Tape Flag
Code one motor to spin forward for 1 turn (360°) at 50% velocity, wait 1 second, then spin reverse for 1 turn. Run it twice and watch your tape flag.
Observation: Did the tape flag return to its exact starting spot? Why or why not?
Challenge 2 Need for Speed (Velocity vs. Rotations)
3-Second Timed Runs
Use spin Motor forward + wait 3 seconds + stop Motor. Test three velocities and count full wheel rotations.
| Velocity Setting |
Rotations in 3 sec |
Motor Sound, Spin-Up & Stopping Notes |
| 25% Velocity |
|
|
| 50% Velocity |
|
|
| 100% Velocity |
|
|
Challenge 3 Twin-Motor Sync (Tank-Drive Prep)
2 Motors (Left & Right)
Hold two motors side-by-side like wheels on a car. Program both to spin forward at 75% velocity for 2 seconds at the exact same time. (Tip: check the and don't wait option or use a Drivetrain!)
Troubleshooting: If your two wheels spun in opposite directions, how did you fix it?
PIT CREW CODE LAB — TRACK STRATEGY & DEBRIEF
Page 2 of 2
Challenge 4 Track Distance Math on the Bench
1 Wheel Turn = 200 mm
A standard VEX IQ wheel travels 200 mm (20 cm) in 1 full turn. Suppose our speed track is 2.0 meters (2,000 mm) long.
A. Predict: How many wheel turns are needed to travel 2,000 mm? Show your calculation below.
B. Code & Time It: Program your motor to spin for your predicted turns at 100% velocity. Measure the run time!
Predicted Turns
Actual Time (seconds)
Wheel Speed (2.0 m ÷ time)
Challenge 5 Pit Crew Freestyle ("Make It Do Something Cool!")
4–6 Blocks Minimum
Experiment! Create your own custom motor-and-wheel routine using at least 3 different Motion or Control blocks (for example: turbo burst, spin-and-slam-brake, or alternating left/right wheel dance).
Sketch & Label Your Block Stack
Describe What Your Wheels Actually Did
Pre-Build Engineering Debrief (Connect Code to Design)
1. Based on your 100% velocity test, what mechanical problem could happen if we attach wheels to a robot and launch at 100% power right away? (Think about traction, wheel slip, or weight distribution.)
2. What is ONE design feature your team will build into your physical robot frame so your code can push it to maximum speed down the track?
Pit Crew Code Lab Answer Key
VEXcode IQ Blocks • Teacher Guide & Answer Key
PIT CREW CODE LAB — KEY
Teacher Copy
Teacher Quick-Start: 4 Common VEXcode IQ Hiccups (and Easy Fixes)
1. "My motor won't spin!" Check the Devices icon (top-right). Students must add the Motor and match the exact Smart Port # (1–12) on the Brain.
2. "Only 1 motor moves at a time." By default, spin for turns waits to finish. Click the arrow on the first block and pick and don't wait.
3. "Where did my code go?" In VEXcode IQ, pick a Brain Slot (1–4), click Download, then press the Check button on the Brain to run it.
4. "The wheel keeps coasting." That's normal! You can show students the set motor stopping to (brake) block if they want a crisp stop.
Challenge 1 Key Spin & Flag Check (Precision Control)
Sample Block Stack
when started
set Motor velocity to (50) %
spin Motor (forward) for (1) turns
wait (1) seconds
spin Motor (reverse) for (1) turns
Expected Student Observation:
Yes—the tape flag returns almost exactly to its starting spot. VEX IQ Smart Motors have built-in encoders that count exact degrees (360° = 1 turn). Tiny differences (a few degrees) happen if the axle wiggles or the motor coasts slightly at the end.
Challenge 2 Key Need for Speed (Velocity vs. Rotations)
100% ≈ 120 RPM (2 turns/sec)
| Velocity |
Expected Rotations (3s) |
Typical Student Notes |
| 25% Velocity |
~1.5 rotations |
Quiet, smooth, easy to count; stops almost immediately. |
| 50% Velocity |
~3.0 rotations |
Noticeable hum; doubles the rotations of 25% (proportional!). |
| 100% Velocity |
~6.0 rotations |
Fastest spin, louder whine, slight coasting after stop Motor. |
Challenge 3 Key Twin-Motor Sync (Tank-Drive Prep)
Crucial Pre-Build Concept
Expected Troubleshooting Fix: When two motors face opposite sides of a robot chassis, they are mirror images—so both set to forward will spin the wheels in opposite directions (making the robot spin in circles!).
Two Valid Fixes: (1) Open Devices, select one motor (e.g., RightMotor), and toggle Reverse ON; or (2) in code, set LeftMotor to forward and RightMotor to reverse. Also remind students to use spin forward (not spin for turns) or select and don't wait so both motors start together.
PIT CREW CODE LAB — TEACHER ANSWER KEY
Page 2 of 2
Challenge 4 Key Track Distance Math on the Bench
2,000 mm ÷ 200 mm = 10 Turns
A. Prediction Math: \(\text{Turns} = \frac{2,000\text{ mm}}{200\text{ mm/turn}} = \mathbf{10\text{ turns}}\) (or \(2.0\text{ m} \div 0.20\text{ m} = 10\text{ turns}\)).
B. Expected Bench Timing (at 100% velocity):
Predicted Turns
10 turns
Typical Actual Time
~4.8 – 5.2 seconds
Direct-Drive Wheel Speed
~0.38 – 0.42 m/s
Teacher Note: A direct-drive motor is only ~0.40 m/s! Ask students: "How could we beat 5 seconds on a 2-meter track?" (Answer: bigger wheels or speed gear ratios!)
Challenge 5 Key Pit Crew Freestyle ("Make It Do Something Cool!")
Circulate & Check Criteria
What to Look For: Students should use 4–6+ blocks with at least 3 different Motion or Control blocks (e.g., set velocity, spin for turns, wait, repeat, stop, or set stopping to brake).
Quick Extension Prompt: If a group finishes early, challenge them to code a "2-stage dragster launch"—start at 40% velocity for 1 turn (for traction), then ramp up to 100% velocity for 5 turns!
Pre-Build Engineering Debrief — Sample Strong Answers
1. Mechanical problems at 100% instant launch:
Launching at 100% power immediately can cause wheel spin / loss of traction (tires slip on the track), tipping or wheelies if the center of mass is too high/back, or veering sideways if one wheel has slightly more friction or weight than the other.
2. Design features for maximum track speed:
Accept any sound engineering idea: using a speed gear ratio (large driving gear → small driven gear), choosing larger-diameter wheels, keeping the chassis lightweight and rigid, placing weight over the drive wheels for grip, or minimizing axle friction.
Bridge to Building Day: Remind students that code alone can't fix a wobbly frame—next class they'll engineer a chassis & gear train to beat today's 0.40 m/s bench speed!