An Investigation Into SPIKE Steering
By Catherine Porter
An interesting question came up during our most recent online training for SPIKE Prime. The SPIKE Prime programming software has a move block with a steering wheel... but it doesn't behave exactly like the steering wheel in your car. We wondered exactly what was the relationship between the values in the block and the turns on the robot, so we put on our scientist hats and started an investigation! I was able to test my SPIKE Prime robot, named TACObot, programmed in the LEGO Education SPIKE App to come up with an answer.
Note: This explanation only relates to SPIKE Prime.
Say we want to program TACObot to make a swing turn around an object.
First we need to know how many centimeters the robot moves with 1 rotation. This is actually already a known factor. If using the wheels from the Lego Education SPIKE Prime Set, the wheels have a diameter of 5.6cm and travel 17.6cm per rotation. (You can find this on Lego’s website).
With that as a baseline, we can now solve for steering. The way that I chose to go about this was by finding out how many rotations at each steering interval it took for the robot’s body to rotate in a 180 degree circle.
Below are my findings:
Steering |
Rotation |
20 |
7.4 |
30 |
4.8 |
40 |
3.4 |
50 |
2.5 |
60 |
1.9 |
70 |
1.55 |
80 |
1.25 |
If you graph these; you can see that there is an exponential relationship with an equation of f(x) = a * bx. So for example, f(20) equals a * b20= 7.4 and f(30) equals a *b30= 4.8 . Using these formulas, we can solve for a, then for b using substitution. Therefore, we know that the line is f(x) = 17.587 ( 0.957637)x.
We can also multiply the number of rotations by the distance traveled in (cm) in 1 rotation to find the amount of cm traveled around the half circle.
Steering |
Rotation |
Distance Traveled (cm) |
20 |
7.4 |
130.24 |
30 |
4.8 |
84.48 |
40 |
3.4 |
59.84 |
50 |
2.5 |
44 |
60 |
1.9 |
33.44 |
70 |
1.55 |
27.28 |
80 |
1.25 |
22 |
So; now let's say the diameter of the object that we need to navigate around is 20cm. Therefore, at a minimum, the diameter of the circle that we want to move has to be greater than 20 cm. To find the diameter of the circular path we want the robot to drive in, we should find the circumference of the full circle of the robot’s path.
We have already calculated half the full circumference above for the 180 degree turn on each steering scenario. Therefore, we can just multiply the distance traveled in cm by 2 to get the circumference of the robot’s circular path.
Steering |
Rotation |
Distance Traveled (cm) |
Circumference |
20 |
7.4 |
130.24 |
260.48 |
30 |
4.8 |
84.48 |
168.96 |
40 |
3.4 |
59.84 |
119.96 |
50 |
2.5 |
44 |
88 |
60 |
1.9 |
33.44 |
66.88 |
70 |
1.55 |
27.28 |
54.56 |
80 |
1.25 |
22 |
44 |
Once we have the circumference; we can calculate diameter:
Steering |
Rotation |
Distance Traveled (cm) |
Circumference (cm) |
Diameter (cm) |
20 |
7.4 |
130.24 |
260.48 |
82.95541401 |
30 |
4.8 |
84.48 |
168.96 |
53.8089172 |
40 |
3.4 |
59.84 |
119.96 |
38.11464968 |
50 |
2.5 |
44 |
88 |
28.02547771 |
60 |
1.9 |
33.44 |
66.88 |
21.29936306 |
70 |
1.55 |
27.28 |
54.56 |
17.37579618 |
80 |
1.25 |
22 |
44 |
14.01273885 |
The diameter has to be larger than the object that we want to navigate around. Therefore, if you selected a steering of 60, you would only have 1.2 cm of buffer while steering around the object. Therefore, in this example; 50 or 55 steering may be the safer bet. Likewise, if you select a steering of 70 or greater, you will run into the object as you are taking too sharp of a turn (17cm < 20 cm diameter of object).
If you would like to calculate other steering values, you can save time by using the equation f(x) = a * bx without having to execute the full investigation. When using the formula, you will still need to account for variations in builds, floor friction, and other side effects. The formula will give you an estimate. But it is important to remember that you may need to adjust for real world conditions.