For a teacher with a class? The classroom edition has the full plan, slides and standards.

Homeschooling PDF

Family edition

Robot Soccer Lab: Get Behind the Ball, Why Driving Straight at It Fails

Ages 11-14 ยท about 45 minutes, in one sitting

In Robot Soccer Lab your child programs a soccer robot in Blocks, and finds out why driving straight at the ball scores in your own goal.

What you need

Before you start: try it once yourself

Open mytekdev.com/try/robotsoccerlab?lesson=get-behind-the-ball-why-driving-straight-fails&ref=fam-robotsoccerlab-1. A short guide opens over Level 1, Find the ball. The field is in the middle: green carpet, white lines, the yellow goal (the robot's own) and the blue goal it attacks. The red robot is round, with an arrow on top for its front, and the orange ball glows so the robot can find it. The box on the field says the level's goal and, after each run, what happened and why. The readings beside it show the ball clock, the heading, the speed and how far away the ball is.

  1. The starter. In Blocks: forever, if the ball clock is 12, move at angle 0 speed 80; else if it is 0, stop; else if it is 6 or less, turn at 40; else turn at -40. The robot turns to face the ball, which sits behind it, then drives at it.
  2. Card one. Show me the blocks in the box, then Put them in. The two turn blocks become move at angle: for clock 1 to 6, ball clock x 30 + 60; for 7 to 11, ball clock x 30 - 60; speed 70. The robot moves round the ball without turning until the ball is at 12, then pushes it ahead.
  3. The other levels. Levels, in the menu bar, opens any level; the program stays as it is. Levels 2 and 3 each have their own card in the box.
  4. Speed. Each level starts in real time. Speed up and Slower, under the field, change the speed; the round play button starts the level again from the beginning, with the program as it is now. Each press of play takes the next seed for the receivers' small noise, so times can differ by a few hundredths of a second between runs.
  5. Numbers to expect. Level 1: the starter scores in its own goal at about 2.9 s; card one scores in blue at 3.77 s. Card one with both 60s changed to 0: own goal, 2.1 s; 30: out of bounds at the wall, about 2.2 s; 90: a goal in about 5.5 to 5.8 s on most runs, and on some it goes out. Level 2: the starter turns and fails at once; card one goes wholly into its own penalty area at about 2.6 s and is called out; card two passes in about 4.2 s. Level 3: card two scores facing its own goal (heading 180), which the level refuses; card one scores an own goal at about 3.4 s; card three scores at about 2.4 s, facing 350 to 356.
In card three, changing 20 to 0 and 340 to 360 removes the buffer. The robot still scores, but watch the heading: after the first second it swings back and forth between about 333 and 18 instead of holding still at 356. That twitch is the reason for the buffer, and a good question to ask.

The ideas, in plain words

In child robot soccer the ball gives off infrared light, and the robot senses it with a ring of receivers. The strongest receiver says roughly where the ball is; the app gives it as a clock position, and the clock times 30 is the ball's angle from the robot's front, clockwise. The field and rules are modeled on the RoboCupJunior Soccer rules; the app is not affiliated with or endorsed by the RoboCup Federation.

Driving straight at the ball is the first idea every team has, and it only works from behind the ball. Real teams move round it first, aiming past it by an angle, then push it ahead. Omni wheels make this easy: they let the robot move in any direction while it keeps facing the same way. A compass keeps it pointed at the goal it attacks, and a buffer stops it correcting all the time.

Robot soccer has led to real companies: Raffaello D'Andrea, who coached Cornell's robot soccer team, went on to co-found Kiva Systems, whose warehouse robots Amazon bought in 2012. Robotics, mechanical, electrical and software engineers all work on robots like these.

Do it together

  1. Open mytekdev.com/try/robotsoccerlab?lesson=get-behind-the-ball-why-driving-straight-fails&ref=fam-robotsoccerlab-1 together. Ask where the ball will go, then press play.

    You'll know it worked when: The robot turns to the ball, drives at it and pushes it into its own yellow goal, in about 3 seconds.

  2. In the box on the field press Show me the blocks, then Put them in. Go back to Simulator and press play.

    You'll know it worked when: The robot moves round the ball and scores in the blue goal, in about 3.8 seconds.

  3. Open Blocks and change both 60s to 30. Play. Then try 0 and 90.

    If you get stuck: Change the 60 in both move at angle blocks: the ball can be on either side.

    You'll know it worked when: 0 scores an own goal again, 30 runs into the wall, 90 usually scores but takes longer.

  4. Put the 60s back, press Next: Level 2 and press play. Then try card two in the box.

    You'll know it worked when: Card one goes into its own penalty area and is called out; card two touches the ball three times without turning.

  5. Go on to Level 3 and try card two, then card three.

    You'll know it worked when: Card two scores facing backwards, which this level refuses; card three turns to face the blue goal with the compass and scores.

Talk about it

Ask these while you work together. A child who has understood it can answer them without help:

The second question is the one that matters. A child who says "4 times 30 is 120, plus 60 is 180, so it moves straight back, behind the ball" can read the program. A child who says "it goes round" has the result but not the idea.

For younger and older kids

Younger: For a younger child, stop after the four offsets on Level 1, and talk about what each one did.

Older: For an older child, go on to Level 4, where card one is not enough, and read the hint in the box.

Keep going

Bring it into other subjects

For your records

Ready to copy into an hour log, a portfolio or a transcript.

LessonRobot Soccer Lab: Get Behind the Ball, Why Driving Straight at It Fails
SubjectsComputer science
Time45 minutes
What we didProgrammed a simulated soccer robot in Blocks: found why driving straight at the ball scores an own goal, tested an offset at four values, and used a compass to keep the robot facing the goal.
Skills practicedConditionals; Testing a program; Angles and sensors

Robot Soccer Lab: Get Behind the Ball, Why Driving Straight at It Fails

Activity sheet (optional)

Name: ______________________________ Date: ______________

Open the app: scan the QR code, or go to mytekdev.com/try/robotsoccerlab?lesson=get-behind-the-ball-why-driving-straight-fails

Essential question: Why does driving straight at the ball fail, and what plan works instead?

Warm-up: The ball is between you and your own goal. What do you do before you kick it? ________________________

  1. Vocabulary. Sensor, ball clock, omni wheels, offset, compass heading, buffer: write each in your own words.
  2. The starter. The ball went into the ________ goal after about ____ seconds.
  3. My offset table. Both 60s changed to: 0: ________. 30: ________. 60: ________. 90: ________.
  4. Levels 2 and 3. Card one on Level 2: ________. Card two on Level 3: ________. Card three on Level 3: ________.

1. Why does driving straight at the ball fail from its wrong side?

2. What does the buffer in card three stop?

Quick check

Name: ______________________________

1. The ball is at 3 o'clock. Its angle from the robot's front is: (A) 3 degrees (B) 90 degrees (C) 180 degrees

2. Card one moves at the ball's angle plus 60 because: (A) it is faster (B) it goes round the ball to get behind it (C) the sensor is wrong

3. A friend's robot keeps scoring in its own goal. Use what you learned today to say what to change, and why.

Answers

QuestionAnswerWhy
1B3 times 30 is 90: straight to the right.
2BAiming past the ball takes the robot round it until the ball is in front, between the robot and the far goal.
3Open answerMove round the ball first, with an offset such as 60, so the robot pushes it from behind toward the right goal.

If your state or umbrella school asks, this lesson covers CSTA 2017 2-AP-12, CSTA 2017 2-AP-13, CSTA 2017 2-AP-17.