Movement (Drive Base)
Movement blocks treat two drive motors as one drive base - the workhorse of FLL navigation.
Set movement motors first
No Movement block works until you declare which motors are the wheels:
when program starts
set movement motors [A+E] ← left wheel A, right wheel E
set movement speed [50] %
set 1 motor rotation to [17.5] cm distance moved ← optional: calibrate to use cm- Port order matters: first is the left wheel, second the right. Swap them and the robot drives backwards.
- The two drive motors must be the same type (both large or both medium) - mixed types don't track each other.
- "1 rotation distance" = wheel circumference (diameter x 3.14159) - for direct drive; if the wheels sit behind a gear train, factor in the gear ratio. Calibrate it and "move 20 cm" becomes accurate.
Put these three blocks at the top of every program
Every FLL run program starts with the same init section. Once you learn My Blocks you'll wrap it into one block.
Driving straight
move [forward] for [2] rotations
move [backward] for [20] cm
move [forward] for [360] degrees
move [forward] for [1] secondsUnits: rotations / degrees / cm / seconds. Use rotations or cm, never seconds: battery level changes time-based distances, while encoder counts are battery-independent (wheel slip still causes error, so don't overdo the speed either).
Steering
Movement's steering parameter is a number from -100 to 100:
| steering | Effect |
|---|---|
| 0 | straight |
| 100 | spin right in place (wheels counter-rotate) |
| -100 | spin left in place |
| 50 | right wheel stopped, pivot around it |
| 1~30 | wide right arc |
move [steering 100] for [180] degrees ← spin right (degrees of WHEEL rotation, not body angle!)
move [steering 30] for [3] rotations ← drive a right arcWheel degrees ≠ body angle
In "steering 100 for 180 degrees", 180 is how far the wheels turn. The body angle depends on track width and wheel size - measure it, or better, use gyro turns, which is the real FLL answer.
Continuous movement (non-blocking)
start moving [forward]
wait until <color sensor [C] color = [black]>
stop moving"start moving" doesn't block; pairing it with a sensor condition is the standard pattern for "drive until you see the line".
Choosing speed
- Long straight runs: 70-100%.
- Precision moves (aligning to models, pushing levers): 20-40%.
- Too fast = wheel slip; slip = encoder error = lost position. Test on the actual mat.
Exercises
- Calibrate your wheel circumference: command "move 10 rotations", measure the real distance, compute cm per rotation and set it.
- Use steering 50 to pivot a 90° arc around the right wheel.
- Write "drive forward until distance sensor < 10 cm" (come back after the distance sensor lesson).
Next lesson: Events.