Teacher Toolbox - Activity Outline
-
This exploration will introduce students to basic programming of the V5 Clawbot's Arm Motor.
-
Learning to program the Arm Motor enables students to properly control the V5 Clawbot's arm movements. For more information about the blocks used, visit the help information.
The V5 Clawbot is ready to reach!
This exploration will give you the tools to be able to start creating some cool projects that use the V5 Clawbot's arm.
- VEXcode V5 that will be used in this exploration include:
- To find out more information about the block, open the Help and then select the [Spin for] block.
- Make sure you have the hardware required, your engineering notebook, and VEXcode V5 downloaded and ready.
Teacher Tips
If this is the student’s first time using VEXcode V5, they can reference the Tutorials at any time during this exploration. The Tutorials are located in the toolbar
Quantity | Materials Needed |
---|---|
1 |
VEX V5 Classroom Starter Kit (with up-to-date firmware) |
1 |
VEXcode V5 |
1 |
Engineering Notebook |
1 |
Clawbot (Drivetrain 2-motor, No Gyro) example project |
Step 1: Preparing for the Exploration
Before you begin the activity, do you have each of these items ready? Check each of the following:
-
Are the motors plugged into the correct ports?
-
Are the smart cables fully inserted into all of the motors?
-
Is the Brain turned on?
-
Is the battery charged?
Teacher Tips
Model each of the troubleshooting steps for the students.
Step 2: Start a New Project
Before you begin your project, select the correct template project. The Clawbot (Drivetrain 2-motor, No Gyro) template example project contains the Clawbot's motors configuration. If the template is not used, your robot will not run the project correctly.
Complete the following steps:
- Open the File menu.
- Select Open Examples.
- Select and open the Clawbot (Drivetrain 2-motor, No Gyro) template example project.
- Since we will be programming to control the arm, rename your project ArmControl.
- Save your project.
- Check to make sure the project name ArmControl is now in the window in the center of the toolbar.
Teacher Tips
-
Since this is a beginning activity with programming, the teacher should model the steps, and then ask the students complete the same actions. The teacher should then monitor the students to ensure that they are following the steps correctly.
-
Make sure that the students have selected Open Examples from the File menu.
-
Make sure that the students have selected the Clawbot (Drivetrain 2-motor, No Gyro) template example project.
You can point out to the students that there are several selections to pick from on the Examples page. As they build and use other robots, they will have a chance to use different templates.
-
You can ask students to add their initials or the name of their group to the project name. This will help differentiate the projects if you ask the students to submit them.
Teacher Toolbox - Saving Projects
Point out that when they first opened VEXcode V5, the window was labeled VEXcode Project and it was not saved (indicated on the toolbar). VEXcode Project is the default project name when VEXcode V5 is first opened. Once the project was renamed ArmControl and saved, the display updated to Saved. Using this window in the toolbar, it is easy to check that the students are using the correct project and it is saved.
Once a project is initially saved, VEXcode V5 autosaves any subsequent changes, as indicated by the message next to the project name.
Tell the students that they are now ready to begin their first project. Explain to the students that by just following a few simple steps, they will be able to create and run a project that will raise and lower the Clawbot's arm.
Teacher Toolbox - Stop and Discuss
This is a good point to pause and have the student groups review the steps that were just completed on starting a new project in VEXcode V5.
Step 3: Move the Arm Up
We are now going to begin by programming the arm to raise!
- Add the [Spin for] block below the {When started} block in the programming area.
- Watch the Moving the Arm Tutorial in VEXcode V5 if you would like a demonstration.
- Click on the Slot icon. You can download your project to one of the available slots in the Robot Brain. Click on Slot 1.
- Connect the robot to your computer or tablet. The Brain icon in the toolbar turns green after a successful connection has been made.
- Click the Download button on the toolbar to download the Drive project to the Robot Brain.
Teacher Toolbox - Help with Blocks
-
Point out that in the programming area, there is already a {When started} block located there by default. Every project will begin with this block. When the project is started the connected blocks will be followed in the sequence in which they are placed.
Demonstrate clicking on the [Spin for] block and dragging it to the programming area, connecting it to the {When started} block. You will hear a click when as it attaches.
-
If you are using a computer, the student should have VEX V5 Robot Brain connected to the computer using a USB cable. If you are using a tablet, the VEX V5 Robot Brain should be connected to the tablet using the Smart Radio.
-
If the students are using a computer, ask them now to disconnect the USB cable from the Robot Brain. Having the robot connected to a computer while running a project could cause the robot to pull on the connection cable.
- Check that the ArmControl project has downloaded to the brain in the slot you chose.
Teacher Toolbox - Option to Model First
Model running the project in front of the class before having all of the students try at once. Gather the students in one area and leave enough room for the Clawbot to move its arm. Demonstrate how to end the project and have the Clawbot's arm lower back to its resting position.
Tell the students it is now their turn to run their projects. Make sure that they have adequate space to safely have the Clawbot's arm raise.
- Run the project on the Clawbot by making sure the project is selected and then press the Run button. Congratulations on creating your first Claw Arm project!
Step 4: Try This: Program the Arm Down
Now that you have programmed the arm to move up, you will now program the arm to lower or move down.
- Add a [Wait] block and a second [Spin for] block to your ArmControl project so that the arm raises to 90 degrees, waits 3 seconds, and then returns back down.
Hint: You will need to change the direction within the [Spin for] block. For more information about the [Wait] block, see VEXcode V5 Help feature. - Test that your revised project moves the arm up for 90 degrees, waits three seconds, and then moves the arm down for 90 degrees by downloading and running your ArmControl project.
- Notice that the arm holds its position while the [Wait] block is running. The motor draws power from the battery to hold the arm up against the force of gravity. That's because the default setting for having the motor stop is the <Hold> setting. There are two other settings for stopping - <Brake> and <Coast>. You will learn about those in another lab.
Teacher Toolbox - Solution
The arm was previously moved upward by using a [Spin for] block with parameters set to "Up" and for "90 degrees." Students should now add a [Wait] block set to "3 seconds" and a second [Spin for] block set to "Down." The parameter of 90 degrees does not need to be changed in order for the arm to return to its original position.
While the [Wait] block is running, the arm will hold its position because "Hold" is the default type of stopping of the V5 Smart Motor. It is important to note that if the Stopping type was set to brake or coast, the arm would begin to fall back downward due to its weight and the force of gravity.
Step 5: Complete the Flight Traffic Controller Challenge
In the Flight Traffic Controller Challenge, the Clawbot must move its arm up and down each for 90 degrees, wait 3 seconds, move the arm up and down twice each for 45 degrees twice, wait 5 seconds, and then move the arm up and down three times for 90 degrees.
Here is a list of the Clawbot's behaviors:
- Move arm up and then down for 90 degrees.
- Wait 3 seconds.
- Move arm up and then down for 45 degrees.
- Move arm up and then down for 45 degrees.
- Wait 5 seconds.
- Move arm up and then down for 90 degrees.
- Move arm up and then down for 90 degrees.
- Move arm up and then down for 90 degrees.
Teacher Toolbox - Solution
Most of the blocks within this challenge are [Spin for] blocks. After adding a [Spin for] block for moving the arm upward and one for moving the arm downward, you can right- or long-click on the first [Spin for] block and choose Duplicate to add third and fourth [Spin for] blocks and so on. Twelve [Spin for] blocks are needed for this challenge in total. Then the parameters can be changed to meet the challenge and [Wait] blocks can be added between the [Spin for] blocks.
-
Review example Flight Traffic Controller Challenge solutions (Google Doc / .docx / .pdf )
-
Programming Rubric (Google Doc / .docx / .pdf )