Happy Pi Day! the Circling Billboard
Introduction: Happy Pi Day! the Circling Billboard
The purpose of this Instructable is three-fold:
1) demonstrate the use of pi for calculating circumferences and circular movement,
2) celebrate Pi Day (3/14), and
3) continue the instructional sequence on using the 2020 Lego Mindstorm Robot Inventor Kit.
This Instructionable focuses on programming the Robot Inventor’s matrix and calculating values. It also elaborates on the movement commands which were first introduced in the “Lego Robot Inventor Kit - Blast: On His Own” Instructable along with motors and distance sensor.
Supplies
2020 Lego Mindstorm Robot Inventor Kit (51515)
Selected parts including 2 motors, 4 large wheels, and 1 hub.
Mindstorms software.
Step 1: Build the Moving Billboard
Put the Moving Billboard together using parts from the Lego Set 51515.
1) Set up two motors as shown in image 1.
2) Set up the hub as shown in image 2
3) Attach the motors to the hub as shown in image 3.
4) Attach the wheels to the motors as shown in image 4.
Images 5 - 7 show the completed Moving Billboard from various angles.
Step 2: Wire the Motors to the Hub
Facing forward from the back (see image 1).
1) Attach the left motor* to the D port (see images 1 and 2).
2) Attach the right motor* to the F port (see images 1 and 2).
*The rear of the billboard is at the bottom of the screen in image 1.
Step 3: Set Up the Mindstorm Program
1) Open Mindstorms App (see image 1).
2) Click on Projects (bottom of image 1).
3) Scroll down to Other (see image 2).
4) Click on Create new Project (see image 2).
5) Select Word Blocks and click Create (see image 3).
6) Click on the three vertical dots and select Rename Project - type Pi_Hello (see image 4).
7) The new project automatically gets the code line “When Program Starts” (see image 5).
Step 4: Outline the Programming Logic
The code (see image 1) instructs the Moving Billboard to:
* 1. Move in a circle based on the radius provided.
* 2. 141
Display the following message: Pi [symbol] 3.14 Happy Pi Day!
Step 5: Create Variables
1) Scroll down to Variables (see image 1).
2) Click on Create Variable (see image 2).
3) Name it pi and click OK (see image 3).
4) Repeat step 4 for the following variables (see image 4 after completion):
circle_radius
wheel_diameter
wheel_difference
wheel_circumference
inside_circum
outside_circum
ratio
Step 6: Initialize Variables (Constants)
The variables set in this section are actually constants that are used throughout the program. Word Blocks does not have a constant command therefore variables is used.
1) Measure the diameter of the wheels (2.25”).
2) Measure the distance between the outsides of the tires on the rear (4.25”).
3) Drag “Set pi to” from Variables Category (see image 1) to under “When program starts” (see image 2)
4) Set the pi variable to 3.14.
5) Repeat for circle_radius, wheel_diameter, and wheel_difference. (see image 3).
6) Set the circle_radius to the radius of the circle that the moving billboard travels (6 for 6 inches).
7) Set wheel_diameter to the wheel diameter measurement (2.25).
8) Set wheel_difference to the difference between the rear tires (4.25).
Step 7: Initialize Variables Using Other Variables
1) Drag “Set wheel_circumference to” under “Set wheel_difference to” (see image 1).
2) Repeat for inside_circum, outside_circum, and ratio (see image 2).
3) Drag multiplication command from under Operators (see image 3) over the white oval (see image 4) in the “set wheel circumference” command.
4) Drag wheel_diameter from under Variables (see image 5) to the first oval (see image 6).
5) Drag pi from under Variables (see image 5) to the second oval (see image 6).
6) Drag subtraction command (see image 7) to an open area in the coding section. 149