Working with Rotation Sensors PART II
Programming a Vehicle to Move a Certain Distance
So far you have programmed your robots to go certain distances by telling them how much time they should travel. This worked well for many problems you solved, but it has its limitations. For example, as the batteries grow weaker and the robot slows down, it’s going to go a shorter distance for the same amount of time. The same can happen as you move from hardwood or vinyl floors to carpeted floors. Using input from a rotation sensor can help you overcome some of these problems.

What to do:
You will now measure the distance GEARBOT travels first with a set of large wheels in the back and then with a pair of smaller back wheels. For each set of wheels, you will push GEARBOT twice—first until the sensor value reads 16 and then until it reads 32. You will then record your measurements in a chart on the next page.


Now, complete the column “distance traveled” in the chart on the next page. You already have the measurement for the first trial. Get the second measurement for the
large wheel (32 sensor ticks), then move the front wheels to the back, replacing the large wheels. Use the smallest wheels in the kit for the front.
Be sure to draw a new line when you replace the large wheels with the smaller ones.
Important note: You have only one set of medium size wheels in your kit. When you replace the large wheels with the smaller ones, move the front wheels to the back and place the smallest wheels in the kit in the front.
Wheel 
Sensor value (Number of sensor ticks) 
Number of rotations (turning full circle) 
Distance Traveled 
Wheel Measured 
Circumference Calculated* 
16  1  
32  
Remove back wheels. Move front wheels to the back. Mount smallest wheels in front.  
16  
32 
* The end of this worksheet will remind you of how to calculate the circumference of a wheel. You may choose to do it now or later, after you have finished the rest of the activity. Ask your teacher, if needed.
Figure out how the distance traveled is related to the wheel size (circumference).
Fold the sheet of paper along the line traveled by the large wheel.
Place one end of the line at the dot on the tire and wrap the line around the tire. Stop at the dot when one end of the line touches the other.
Think about it: What is the wheel circumference? How is it related to the length of the line traveled?
Look at the illustrations of a rolling wheel, page 8. Suppose the circumference of the wheel is 3”. Use the illustrations to help you think about how to figure out the number of rotations a wheel made, the number of sensor ticks, or the distance the wheel traveled.
 In the first 3 examples, the Distance Traveled is given. Figure out how many rotations the wheel made in each trial and how many sensor ticks that would be.
 In the rest of the examples, the wheel circumference is given to you plus one other value. Figure out the rest.
Wheel Circumference 
Distance Traveled 
Number of Rotations

Number of Ticks (sensor value) 
3” 
3” 


3” 
6” 


3” 
9” 


3” 

5 

3” 


64 
3” 
21” 


3” 
45” 


Find a way to explain to someone how to figure out the number of sensor ticks to enter in a program if you know the wheel circumference and you know the distance you want it to travel.
In short:
 You know the circumference and the distance
 You need to figure out the number of sensor ticks that would be.
How to use the number of sensor ticks in a program.
Now that you know how to figure out the number of sensor ticks, learning how to use it in a program is very simple. If you remember how you used input from a light sensor in a program, this is about the same.
Here is a sample program, telling Roverbot to go forward and to stop after 160 sensor ticks.


What is the distance Roverbot would travel if its wheel circumference is 6”? _____________




Circumference = 3”
Distance Traveled = 9”
What’s the number of rotations? _____
How many sensor ticks would that be? ________
How to calculate the circumference of a wheel.
In the previous problem you measured the circumference of your robot’s wheels. There is also a way to calculate the circumference of a wheel (or a circle), which you may have learned in geometry classes.
For every circle, the circumference is 3.14 times bigger than its diameter. This number is called Pi, and its common symbol is .
To calculate the circumference of a wheel, you will have to accurately measure the diameter first. Once you know the diameter, multiply it by 3.14 to get the circumference.

____________ x 3.14 = Diameter 
___________ Circumference 

____________ x 3.14 = Diameter 
___________ Circumference 
Write the circumferences you calculated here in the chart “calculated” column in the chart on page 5. Are they the same as the circumferences you measured? If they are different, what do you think could be the reason?