I am sure that building and coding the table-top fan in the previous chapter was fun for you.In this chapter, we will be building a robot that can move without wheels both forward and backward. Have you ever thought about how to make things move from one place to another without wheels? Hint – it is there in your surroundings itself. Try to answer these questions:
There are other forms of movement as well, such as wiggling, jiggling, creep, leap, and bouncing, which we will explore later. Walking, hopping, slithering, and rolling are some of the most common locomotion techniques used by robots today, and we shall learn about these forms of movement in detail in this chapter.
In this chapter, we shall focus on the core robotics model and eventually increase the complexity of programming as well. In this chapter, you will build a robot that moves with the help of legs and linkages. Furthermore, you will strengthen your construction skills by building this robot using your LEGO BOOST kit.
In this chapter, we will cover the following topics:
We will end the chapter with some captivating challenges for you to solve. Let's discuss types of movement first.
Let's first try to understand the various ways in which we can make our robot move. These movements are like some animals' locomotion methods:
Let's move on to building this robot now.
In this chapter, you will need the following:
In this section, we are going to build a robot that can hop, as shown in the following image:
Let's build the robot by following these building instructions:
The robot that you have built moves in a similar way to a frog: hopping. It will be fun to write a program for this hopper bot.
Open Scratch 3.0 and connect your BOOST Hub to your laptop as per the instructions given in Chapter 2, Building Your First BOOST Robot – Tabletop Fan. While performing some activities today, we shall understand the difference between seconds-based and rotation-based programming.
Before we move on to the task, let's learn about two new programming blocks:
Set light color:
This is how the light color changes based on the value that you input:
I hope you remember the following tip – break down your problem statement into smaller problems.
Program your robot to move forward at 40% speed for 5 seconds. Mark the start (green sticky note) and stop (red sticky note) positions of your robot. Change the hub light color to blue for 2 seconds when the robot stops.
Let's break our problem statement into smaller steps:
Great! Your program is now ready to be downloaded to your BOOST Hub and run. See how your robot hops with this code.
Program your robot to move forward at 40% speed for 5 rotations. Make sure that your starting position is the same as in Activity #1. Mark the stopping position with an orange or any other color sticky note. Change the hub light color to green for 2 seconds when the robot stops.
Write down your problem fragmentation here:
Once you've done this, write your code in Scratch and run the robot.
Did you observe the difference between the two activities? Although your starting position and motor power are the same, your stopping position is different in each activity. It means that move for __ seconds and move for __ rotations are completely different.
Rotation-based movement gives precision to our robot's movement. Regardless of the battery level, your robot will always travel the same distance in rotation-based programming.
But in seconds-based programming, the distance traveled by your robot will be dependent on the battery level of your BOOST Hub. If the battery level is low, the distance traveled for the same time and at the same motor power will be less than if the battery was at full power. This reduces the consistency of your robot's performance. There are some advantages associated with seconds-based programming, which you will explore in the chapters coming up next.
Since you have marked the starting and stopping position of the robot in Activity #1 and Activity #2, let's use the ruler and measure the distance covered by your robot in each case:
Distance covered in activity #1 = ____________ cm
Distance covered in activity #2 = ____________ cm
As you can see by your answers, it is not true that the robot moves the same distance when it goes forward for either 5 seconds or 5 rotations. They are different.
Time to test your learning! Read the problem statement twice.
Challenge #1
Do you know that you can measure the speed of your robot if you have its distance traveled as well as the time taken? The formula to calculate speed is total distance traveled / total time taken. Try to calculate the speed of your robot in each case. You can use the empty spaces in the following sections to do the math work.
Distance traveled in Activity #1 = _________ cm
Time taken = 5 seconds
Speed = ______ cm/second
Distance traveled in Activity #2 = _________ cm
Time taken = _________ seconds (run your robot again and measure the time taken)
Speed = ______ cm/second
Challenge #2
Program your robot to move forward at 80% speed for 5 seconds. Mark the start and end positions and calculate the speed of your robot.
Distance traveled = _________ cm
Time taken = 5 seconds
Speed = ______ cm/second
Did you observe that your robot has traveled more distance in the same time of 5 seconds than in Challenge #1? In seconds-based programming, the distance traveled by the robot is purely based on the motor power and the amount of time the motor runs for. So, for the same period, the robot travels further if motor power is high, and it travels a shorter distance if the motor power is low.
Challenge #3
Program your robot to move forward at 80% speed for 4 rotations. Mark the start and end positions and calculate the speed of your robot.
Distance traveled = _________ cm
Time taken = ________ seconds
Speed = ______ cm/second
Did you observe that your robot has covered the same distance as in Challenge #2 but in less time because you increased the motor speed level? Rotation-based programming always adds consistency to your robot's performance.
In this chapter, you learned how to build a robot that can move forward and backward without wheels. You also learned about various ways in which things can move even without wheels, such as by hopping or slithering. A new programming block called brick light was introduced, which can change the light color of the BOOST Hub brick. You also learned the difference between rotation-based and seconds-based programming, with their respective advantages and disadvantages. In the next chapter, you will learn how to build a basic robot with wheels and learn more about programming, making your robot turn, and making shapes such as squares, circles, and triangles.
Do you know that satellites are objects launched by humans into orbit for various purposes? They revolve around the Earth, collect data as they are programmed to, and send the data back to Earth. This data is then used for various purposes. Google Maps and Apple Maps are dependent on data sent by satellites. You can read more about satellites at https://www.esa.int/kids/en/learn/Technology/Useful_space/Satellites.
3.15.27.232