Lesson 05 · 60 minutes
Sideways Is a Direction
Mecanum wheels and adding arrows
Today's goal
Predict how the robot will move from the direction of each wheel, then drive a path a normal car cannot.
Ideas in this lesson
- Each mecanum wheel pushes at 45 degrees
- Four 45-degree pushes add up to forward, sideways, diagonal or spin
- Moving and turning are separate: you can do both at once
- Adding arrows (vectors) is how the robot plans every move
Sense → Think → Do
DO gets interesting. The robot works out four wheel speeds from three wishes: how fast forward, how fast sideways, how fast turning.
How the session runs
- Look at the rollers: they form an X seen from above. Draw each wheel's push arrow on a whiteboard.
- Act it out: four kids are wheels, each pushing at 45 degrees. Who pushes which way to go sideways?
- Drive with the app's pad: w forward, d strafe right, q and e spin. Feel the difference between strafing and turning. With an IMU, the robot holds its nose steady while you strafe.
- Try the two-stick controller page (sticks.html): the left stick sets the speed and turns, the right stick picks which way to slide, so it can slide and turn at the same time. Move and turn at the same time.
- Program tab: open 'Example: crab box' and RUN it: slide right, forward, slide left, back, nose always pointing the same way. Then build a crab zigzag yourself: a repeat with 'drive toward 45 degrees' and 'drive toward -45 degrees' inside.
- Run circle strafe face-in (pk, or 9 on the remote) with a person standing at the middle. The robot circles them, staring at them the whole way.
- Use the Demos tab size slider to shrink circle strafe to 25% for small rooms. Look at its preview: the ticks show where the nose points.
- Program tab: 'Example: J-turn there and back' drives a straight line while the body spins 180. The path stays straight even though the robot is turning.
Try this
- Walk the crab box yourself, keeping your face pointing one way.
- Which of these moves would a normal car find impossible? Which would it find easy?
- Drive a square without ever turning the nose (only w, d, s, a).
When it goes wrong
| What you see | What it means |
|---|---|
| Strafing drifts forward or backward | Floor or roller differences. Calibrate (lesson 4); on a slippery floor it gets better, on thick carpet worse. |
| The robot spins instead of strafing | A motor is wired backwards or on the wrong corner. Check with t0-t3. |
| A move slower than expected | The robot slowed the move to keep every wheel under its top speed (it says 'move: slowing to N%'). |
Notes for the grown-up
The 'four kids as wheels' activity is worth the chaos. Vectors land far better acted out than drawn.
Ages: K-5: 'walk sideways while looking at the teacher', remote driving, the crab box program. 6-12: write the wheel equations (forward + strafe + spin, forward - strafe - spin, ...) and build a program that needs all three at once.
Materials: Robot, IR remote, app (Drive, Program and Demos tabs), whiteboard, open floor about 2 m by 2 m.