In this post, we will explore the concept of a spin turn, its significance in robotics, and the process of creating an EV3 spin turn My Block. Additionally, we will delve into the geometric principles that underpin the calculation of the spin turn degree versus wheel motor degree ratio. Finally, we will provide a step-by-step guide on how to use the EV3 spin turn My Block to turn your robot 90 degrees.
By utilizing reusable code such as the Move Straight Inch My Block in combination with the EV3 spin turn My Block, we were able to successfully execute tight turns in limited spaces. We hope that by sharing our experience, this post will assist you in creating your own efficient and reusable EV3 Spin Turn My Block in Mindstorms.
If you’re interested in FLL robot design, please check out our robot design principle posts. We welcome your feedback and suggestions.
Pivot turn is one wheel turn, that is, one wheel moves forward or backward and the other doesn’t move.
Spin turn is a two-wheel turn, that is, one wheel moves forward or backward and the other wheel moves in opposite direction.
Spin turn is very useful when we have limited space. Otherwise pivot turn is relatively more consistent and is suitable for most cases.
There are two kind of spin turns: spin turn left and spin turn right. We will create an EV3 Spin Turn My Block which can do both spin turns.
Spin Turn Degree vs Motor Degree Ratio
Let’s define the track as the distance between two wheels. We will use L for the track. To spin turn our robot in Theta degrees, a wheel needs to travel the following distance:
Travel distance = Theta * L / 2
For a wheel with diameter D, to travel the same distance the wheel need to rotate in motor Degrees, we will have:
Travel distance = Theta * L / 2 = Degrees * D / 2.
Now let’s define Spin Turn Degree vs Motor Degree Ratio as:
Ratio = L / D
Spin Turn Degree vs Motor Degree Ratio means that to spin turn 1 degree, motors B and C needs to rotate L/D degrees in opposite direction.
The geometry of Spin Turn Degree vs Motor Degree Ratio is illustrated in the following image:
For example, if the wheel diameter D is 6.88 cm. and the track length L is 11 cm. the ratio will be calculated as:
Ratio =L/D = 11 / 6.88 = 1.6
Once we have the SpinTurn Degree vs Motor Degree Ratio we can use a math block to simplify the input motor Degree calculation based on the degree a robot needs to spin turn.
Using Spin Turn Degree vs Motor Degree Ratio
Once we have the Spin Turn Degree vs Motor Degree Ratio, we can calculate the Spin Turn Degrees we wanted. The following screenshot shows how to program using a Move Tank block and a Math block.
Reusable EV3 Spin Turn My Block
In our post “Inspiring Mindstorms EV3 Programming for FLL Part 2: Reusable EV3 Pivot Turn My Block“, we have described the steps to create an EV3 Spin Turn My Block. Following the same steps, we can create a reusable EV3 Spin Turn My Block as shown below.
The Spin Turn My Block (MySpinTurn) has three input parameters:
b: motor B power; c: motor C power; and spin turn degree.
To spin turn left, set motor B power negative and C power positive.
To spin turn right, set motor B power positive and C power negative.
Using the Spin Turn My Block
After creating the EV3 Spin Turn My Block (MySpinTurn), we can reuse it whenever necessary. The following screenshot provides an illustration of its practical application. It is worth noting that we programmed one motor with a positive power and the other with a negative power, causing them to rotate in opposite directions and enabling the robot to execute a spin turn.