Explorer: Drive back and forth
The lesson teaches how the eXperiBot moves between two stations, adjusts its speed, and takes breaks.

Learn how to tell your eXperiBot to travel back and forth between two stations and take breaks.
Learning goals
Overall learning objective (overarching)
Students develop a functional program that allows the eXperiBot to navigate between several stations in a targeted manner. They use appropriate motor commands, perform various driving maneuvers, and integrate additional actions such as pauses and melodies. In doing so, they understand the importance of infinite loops for automating repetitive processes.
Knowledge-related learning goals (cognitive)
Students will be able to…
automate recurring program sequences using an endless loop.
analyze which programming blocks are required for movements, pauses, and melodies and how they interact.
Skill-related learning goals (procedural)
Students can…
create a program that moves the eXperiBot between two or more stations.
use appropriate blocks from the “Motor”, “Powerbrain”, and “Loops” categories.
test their program and adjust it as needed to ensure the desired sequence.
Attitude-related learning goals (affective)
Students…
demonstrate perseverance and remain motivated when they fail by reflecting on and improving their programs.
understand that using an endless loop shortens the program code and thus makes programming more efficient.
Prior learning
Learners will be able to:
operate the programming environment (select blocks, start/stop program),
use simple statements from the “Motor” category (e.g., “Motor drive forward,” “Motor turn right.”),
create sequences (multiple statements in the correct order),
make the eXperiBot drive straight ahead and turn,
adjust driving times,
play a sound with the Powerbrain.
You should ideally complete the following lessons in advance:
First steps (introduction to the programming environment and getting to know the Powerbrain),
Travel movements (basic statements from the “Motor” category and Sequences).
Lesson planning
The lesson introduces the control structure Infinite Loop.
Introduction (approx. 10 minutes)
Method: Class discussion in plenary session
Story for starting the lesson: Serving robots in everyday life
Have you ever seen robots bringing food to tables in a restaurant or café? Restaurants and cafés use such serving robots more and more frequently—especially in places where staff must deliver many orders quickly and reliably. They drive autonomously between the kitchen and the tables, stop, and give a signal such as a sound or a melody to let guests know that their food has arrived. Then they turn around and drive back to pick up new orders.
Questions to stimulate discussion in class
Why are such robots practical?
They save time and reduce the workload for staff.
They work reliably and can take on many units.
They are particularly helpful when there are large numbers of guests or staff shortages.
Where else could we use such robots?
In hospitals (delivering medication or food).
In hotels (luggage service).
In factories or warehouses (transporting goods).
In care facilities (assisting residents).
What units must a robot perform in order to work reliably?
Move safely (drive between stations, avoid obstacles).
Give signals (sound or light to attract attention).
Stop and wait (e.g., take breaks).
Orient yourself and turn to find the right direction.
Transition to the lesson “Drive back and forth”
Formulate the task: Today, your eXperiBot will become a serving robot! To do this, work through the “Drive back and forth” lesson in the eXperiBot Blockly app.
Independent study of the lesson (approx. 25 minutes)
Method: Independent programming on the robot
Learners complete the units in their preferred working method—step by step or independently—and at their own pace, depending on how many units they can complete.
The 25-minute time limit assumes that all students will meet the minimum requirements. This means that they should complete all units; bonus units are optional, and students can complete them depending on their pace and the time available.
The first unit, which involves assembling and preparing the eXperiBot, is expected to take 10 minutes, but the actual time may vary depending on the learners’ prior experience. In later lessons, learners usually complete this part more quickly because they are already familiar with the assembly process.
Reflection phase (approx. 10 minutes)
Method: Class discussion in plenary session
Expected outcome of reflection
Learners recognize the importance of control structures (Loops, Sequences).
Learners understand how the program structure influences the robot’s behavior.
Learners can establish the connection to the real-world application (serving robot).
Key questions
Name the functions that your eXperiBot performs at each station.
Play the melody, pause, turn, continue.
Students should recognize that the robot performs several statements at each station: it pauses briefly, plays a melody, and turns around before continuing on its way. These functions are central to the unit and reflect the requirements of a serving robot.
Describe the order of the blocks in your program.
Sequence: Drive, melody, stop, turn, return trip
The expected description includes the logical sequence:
First, the robot moves to the station, then plays the melody, stops, and turns. After that, it starts the return trip. Learners should understand how the correct sequence ensures the robot behaves correctly.
Explain why you used the Infinite Loop.
It ensures that the journey between stations is repeated indefinitely.
Learners should explain that the Infinite Loop is necessary to continuously repeat the journey between the two stations. Without this Loop, the robot would only travel the route once and would not complete the Unit.
Explain what happens when a block is in the wrong place in the Loop.
Faulty sequences, e.g., the melody repeats continuously or rotation occurs at the wrong place.
Learners should recognize that incorrectly positioning blocks leads to erroneous behavior, e.g., playing the melody with every movement or rotating at the wrong place. This illustrates the importance of correct program structure.
Compare your program with the behavior of a real serving robot.
Both travel between stations, stop, and signal; real robots have additional sensors (obstacle detection).
Learners should identify similarities and differences: both travel between stations, stop, and give a signal. However, a real serving robot also has sensors for obstacle detection and can react flexibly to changes.
Rate how well your program would be suited for use in a restaurant.
It fulfills the basic function, but it lacks obstacle detection and flexible route planning.
Learners should recognize that the program fulfills its basic function, but that important elements are still missing for real-world use, such as obstacle detection, flexible route planning, and safety mechanisms.
Ideas for classroom discussions
Terminating an infinite loop
Discussion question:
How could a robot in a factory stop working if it detects a hazard?
Discussion points:
Infinite Loops run indefinitely if the program does not specify a termination condition.
They do not terminate automatically. In practice, operators manually interrupt technical systems (e.g., by pressing an emergency stop) or control them through programmed conditions.
Sensors detect conditions (e.g., an obstacle) and provide data, but only the program logic evaluates these sensor values and decides whether to interrupt or terminate the loop.
Objective:
To develop an understanding that Infinite Loops without programmed termination conditions do not end automatically.
To illustrate that uncontrolled Infinite Loops in technical systems are risky and therefore additional safety and control mechanisms are necessary.
Expected outcome:
Learners name manual stopping (e.g., emergency stop) and recognize that automatic termination of a loop requires additional conditions and control structures in the program.
Advantages of the infinite loop
Stimulus question:
Why does it make sense for a robot vacuum cleaner to use a loop?
Discussion points:
The robot must constantly repeat certain steps (e.g., driving and vacuuming) without having to write the program code multiple times.
Loops enable efficient, clear, and maintainable programming.
Objective:
To illustrate how loops—including Infinite Loops—can be used effectively in everyday robots for recurring units, provided conditions control them and they are securely embedded.
Model solutions
Unit 1
No program code is required for this unit. The eXperiBot just needs to be made ready to start, which means:
Assemble the eXperiBot completely.
Establish a connection to the app.
Unit 2
Note on the solution:
The solution assumes that the two stations are in a straight line with each other. If this is not the case, you must insert additional movement instructions from the “Motor” category before playing the sound.
The solution uses a sample time value for the Travel movements, so it may vary. You must adjust these values depending on the desired distance or speed of the eXperiBot.
The example solution plays only a single note, but you can also program several notes or a complete melody.
The solution also assumes that the eXperiBot uses the same route for the outward and return journeys, but this is not mandatory.
Solution file to download and import into the eXperiBot Blockly app.
Bonus unit 1
The proposed solution meets the minimum requirement by including a curved movement. However, you can also integrate several curves, provided you adapt the program accordingly.
The sample solution uses example time values for the travel movements, so they may vary. You must adjust these values depending on the desired distance or speed of the eXperiBot.
For sound, the sample solution plays back a single note, but you can also program several notes or a complete melody.
The solution also assumes that the eXperiBot uses the same route for the outward and return journeys, but this is not mandatory.
Lesson contents
Unit 1
Connect your eXperiBot to the app.
Proceed as follows:
Switch on your eXperiBot.
Then press the “Connect” button at the top right of the screen. Follow the instructions to connect your eXperiBot to the app.



You’ve assembled your eXperiBot and connected it to the app—now you’re ready to go!
Unit 2
Define two stations. For example, place two pens on the floor.
Place your eXperiBot at station 1.

Program your eXperiBot to drive to Station 2. Use the appropriate blocks from the “Motor” category.
Are the stations far apart? Adjust the travel time.
Does your eXperiBot need to navigate a curve? Select the appropriate block.
Your eXperiBot is at Station 2!
First, have it play a melody and then pause for 3 seconds. Use the appropriate blocks from the “Powerbrain” category. Add the blocks to your program.

Now your eXperiBot should turn around and face Station 1 again. Use a suitable block from the “Motor” category to do this.
Rotate your eXperiBot so that it faces station 1 again.
This means: a half turn around itself. In other words, a 180° turn.
Then your eXperiBot will return to Station 1. It will stop there and play a melody again.
Add the appropriate blocks to your program.
Test your program.

Check your code—does your eXperiBot do the following?
Does your eXperiBot stop at Station 2 and play a melody?
Does it turn around and drive back to Station 1?
Does it play a melody again there?
Your eXperiBot should repeat the sequence over and over again: from station 1 to station 2 and back—with pauses and melodies.
If you write each driving instruction individually, the program will become long and confusing. It is easier to use the Infinite Loop. Use the appropriate block from the “Loops” category and add it to your program.
What is an Infinite Loop?
An Infinite Loop repeats statements over and over again without stopping on its own. You must stop the program because the Infinite Loop will keep running.
When do you need an Infinite Loop?
Use it when you want your robot to do the same thing continuously. For example, you can instruct it to move from station 1 to station 2 and back again—over and over—so you don’t have to write the same statements multiple times.
How do you insert an Infinite Loop?
Drag the "Repeat forever“block from the”Loops" category and place all the statements you want to repeat inside the loop.
Test your program.

Does your eXperiBot travel back and forth between station 1 and station 2? Does it pause and play a melody?
If not, consider: Which blocks do you need to change in your program so that your eXperiBot executes the correct statements?
Check your Infinite Loop. Remove any blocks that should not be repeated—otherwise, your eXperiBot will move incorrectly.
Now your eXperiBot can travel back and forth between two stations, take breaks, and even play a melody.
Bonus unit 1
Position your two stations so that your eXperiBot has to make at least one turn when traveling back and forth.

Change your program so that your eXperiBot now also reaches station 2.
Everything else should remain the same:
Your eXperiBot travels from station 1 to station 2.
At station 2, it plays a melody again and pauses briefly.
Then it returns to station 1.
Your eXperiBot should repeat this sequence over and over again, driving back and forth between the two stations.
Test your program.

Does your eXperiBot travel back and forth between station 1 and station 2? Does it have to make at least one turn? Does it pause at both stations and play a melody?
If not, consider: Which blocks do you need to change or add so that your eXperiBot executes the correct statements?
Now your eXperiBot can drive back and forth between two stations, make turns, take breaks, and even play a melody.
Bonus unit 2
Define three stations. For example, place three pens on the floor. To avoid confusion, label the stations A, B, and C.
Place your eXperiBot at station A.

Program your eXperiBot to:
travel from station A to station B,
then back to station A,
then to station C,
and back to station A again.
Play a melody at each station and pause briefly.
Program your eXperiBot to execute this sequence.
Test your program.

Does your eXperiBot travel back and forth between Station A, Station B, and Station C in the correct order:
from Station A to Station B,
then back to Station A,
then to station C, and back to station A?
Does it pause at each station and play a melody?
If not, think about which blocks you need to change or add so that your eXperiBot executes the correct statements.
Your eXperiBot drives to A, B, and C in sequence and plays a melody at each station.
