Spike Prime - Average Speed

From RoboWiki
Jump to: navigation, search

(back to list of projects)

Let's begin

Imagine your family is traveling with a train from city A to city C, but the train passes through city B on the way (without stopping). The tracks were reconstructed between B and C, so the train can travel much faster between those cities. By a coincidence, the distance from A to B is the same as from B to C. We are going to measure the time it takes to travel both parts, calculate velocities on both segments, and then estimate the average speed based on the two speeds. At the first sight, since the distances are the same, it may look like we obtain the average velocity simply by averaging the two velocities, i.e. (v1 + v2) / 2. However, the average velocity can clearly be calculated by dividing the total distance by the total time. In this exercise we will compare the two values - we they be the same?



model of vehicle


vehicle vehicle

Building instructions:

Download building instructions:

Download stud.io model:

Prepare your track - use a black tape to mark the locations of the cities A, B, and C with a black line on the floor perpendicular to the "train" movement. Use a measuring tape to make sure that the distance from A to B is the same as the distance from B to C. We have used 100 cm. If you use a different distance, consider changing the program to see the velocities in easy to understand units (cm/s).


Program - driving Program - calculating

Download: average_speed.llsp

The robot starts moving with 30% of its maximum speed until it arrives to the mark of city A (the start). At that time, it resets the timer, and continues the same speed until the city B, where it speeds up to 70% of its maximum speed, stores the time A -> B into a variable t1 and resets the timer again. In the city C, it stops, stores the time of travel B -> C into variable t2.

In the second part, it calculates the velocities v1, and v2, and shows on its display the average of the two values v1 and v2, and also the average speed calculated by dividing the total distance by total time.

Measure, analyze, think

  • Make your own recording

Example result of measurement:

result of measurement

  • Perform measurements with your model and discuss in your group what has happened.
  • Can you explain why the two values are different?

Explore and modify

  • Modify the program to use different velocities and repeat the experiment.
  • Modify the program so that it will use the rotations sensor to measure the distance and thus it will be able to calculate the average speed even if the distances between the cities are not the same.


  • Prepare a short presentation for other groups. Tell others about how your measurement went, what issues did you have to solve. What do they mean and why did they happen?

Additional resources