Skip to main content
Teacher Portal

Teacher Toolbox icon Teacher Toolbox - Activity Outline

  • This exploration will introduce students to basic programming of the V5 Clawbot's Claw Motor.

  • Learning to program the Claw Motor enables students to properly control how the V5 Clawbot grasps objects in its environment. For more information about the blocks used, visit the help information.

The V5 Clawbot is ready to grasp!

This exploration will let you start creating some cool projects that use the V5 Clawbot's claw to grasp objects.

  • VEXcode V5 that will be used in this exploration include:

Spin for block reads spin Claw Motor open for 90 degrees.

  • To find out more information about the block, open the Help and then select the [Spin for] block.

VEXcode V5 showing the Spin for block in the workspace on the left and the Help open to the right. The Help reads that the Spin for block spins a V5 Smart Motor for a given distance, and gives information about how to use the block in a project.

  • Make sure you have the hardware required, your engineering notebook, and VEXcode V5 downloaded and ready.

Teacher Tips icon 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.

Tutorials

Materials Required:
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) template example project

1

Aluminum can

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 icon 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 motor configuration. If the template is not used, your robot will not run the project correctly.

VEXcode V5 Toolbar with the File menu open and Open Examples highlighted in a red box. Open Examples is the fourth menu item beneath New Blocks Project, New Text Project, and Open.

Complete the following steps:

  • Open the File menu.
  • Select Open Examples.

Icon reads Clawbot (Drivetrain 2-motor, No Gyro) on the bottom and shows a gray robot icon on top indicating which template project to open.

  • Select and open the Clawbot (Drivetrain 2-motor, No Gyro) template example project.
  • Since we will be programming to control the claw, rename your project ClawControl.
  • Save your project.
  • Check to make sure the project name ClawControl is now in the window in the center of the toolbar.

Project name dialog box in the VEXcode V5 Toolbar reads Claw Control. Slot 1 is selected and the Toolbar reads Saved to the right.

Teacher Tips icon 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 icon 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:  Program the V5 Claw to Open

We are now going to begin by programming the claw to open!

VEXcode V5 project begins with a When started block with two blocks attached. The blocks read, from top to bottom, Set Claw Motor timeout to 2 seconds; spin claw motor open for 60 degrees.

  • Add the set motor timeout and [Spin for] blocks to the {When started} block and set their parameters as shown above.
  • Notice that the set motor timeout block appears first in the stack. It sets how long the Claw Motor can run and stops it after that time.
    • The set motor timeout block in this project is set to 2 seconds. So even if the motor does not move a full 60 degrees, the project stops the Claw Motor after 2 seconds have passed.

VEXcode V5 Toolbar with Tutorials highlighted in a red box. The Toolbar shows, from left to right, the V5 logo, a globe icon, File, and Tutorials. To the right of Tutorials are additional icons and functionality.

  • Watch the Opening the Claw Tutorial in VEXcode V5  if you would like a demonstration.

Slot selection in the VEXcode V5 Toolbar, with slot 1 selected and highlighted with a red box.

  • Click on the Slot icon. You can download your project to one of the available slots in the Robot Brain. Click on Slot 1.

Brain icon shows green in the VEXcode V5 Toolbar, to the right of a disabled Controller icon, and to the right of the Download icon. The Brain icon is highlighted with a red box.

  • Connect the robot to your computer or tablet. The Brain icon in the toolbar turns green after a successful connection has been made.

The Download button in the VEXcode V5 Toolbar is highlighted with a red box. The Download icon is to the right of a green Brain icon and to the left of the Run button.

  • Click the Download button on the toolbar to download the Drive project to the Robot Brain.

V5 Brain Home screen shows the Arm Control project in slot one in the lower left corner. The row of icons above it read Drive, Devices, Settings, and a VEX folder.

  • Check that the ClawControl project has downloaded to the brain in the slot you chose.

Teacher Toolbox icon 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 position the Clawbot so that its claw can be seen by all. If you plan to demonstrate more than once, you can gently push the claw closed between runs.
Tell the students it is now their turn to run their projects.

  • Run the project on the Clawbot by making sure the project is selected and then press the Run button. Congratulations on creating your first project for moving the Claw!

Step 4: Try This: Close the V5 Claw

Now that you have programmed the claw to open, you will now program it to close.

Close up top down image of a closed V5 Claw.

The image shows a close-up view of the claw on the Clawbot. The claw is constructed from red and black plastic components, with metal bolts securing the structure. The claw features two parallel arms with red rubber bands providing tension, enabling the claw to open and close. Above the claw is a VEX motor, identifiable by the VEX logo printed in red on a black casing, which powers the mechanism, allowing it to grip or release objects. The gears within the structure are visible, indicating the mechanical function of the clawNow that you can open the claw, you will want to close it as well.

  • Return to your ClawControl project and add a [Spin for] block to have the Claw Motor spin closed for 30 degrees. The claw should close half of the way because it spun open for 60 degrees.
  • Test that your revised project has the claw open for 60 degrees and then close for 30 degrees by downloading and running your ClawControl project.

Teacher Toolbox icon Teacher Toolbox - Solution

Previously, the claw opened for 60 degrees. Included in that project was a set motor timeout block because it is an important practice to set a timeout when powering a manipulator that could have its movement restricted in some way. Setting a timeout prevents unnecessary wear on a motor.

The following is this step's solution:

VEXcode V5 project begins with a When started block with three blocks attached. In order, from top to bottom, the blocks read Set Claw Motor timeout to 2 seconds; Spin claw motor open for 60 degrees; spin claw motor close for 30 degrees.

Step 5:  Try This: Sequencing Multiple Movements

Top down close up image of an open V5 claw. In the center of the claw are arrows pointing in and out, indicating the opening and closing motion of the claw.

Closeup image of the open claw of the Clawbot. Arrows below the claw indicate the direction of movement, suggesting that the claw can move both inward (to close) and outward (to open). The structure is secured with metal bolts, and the motor is identifiable by the VEX logo on its casing.Not everything that you pick up with the claw will be the same size. Try opening the claw to different positions along the range of motion.

  • Spin the motor in order to:
    • Open for 70 degrees
    • Close for 20 degrees
    • Open for 10 degrees
    • Close for 30 degrees
    • Close for 25 degrees
  • Remember to use the [Set motor timeout] block to set a timeout of 2 seconds.
  • If the Claw Motor starts at 0 degrees, how many degrees is the Claw Motor open at the end of the project?

Teacher Toolbox icon Teacher Toolbox - Solution

The solution to this step is presented below.
The Claw Motor is still open at 5 degrees at the end of the project: 70 - 20 = 50 --> 50 + 10 = 60 --> 60 - 30 = 30 --> 30 - 25 = 5 degrees.

VEXcode V5 project with a When started block and six motion blocks attached. In order from top to bottom, the blocks read: Set claw motor timeout to 2 seconds; spin claw motor open for 70 degrees; spin claw motor close for 20 degrees; spin claw motor open for 10 degrees; spin claw motor close for 30 degrees; spin claw motor close for 25 degrees.

Step 6: Completing the Lock Tight Challenge

Close up side view of a V5 Claw grasping a can.

 

The image depicts a close-up view of the claw holding a silver aluminum can. The claw consists of black and red plastic components with red rubber bands wrapped around the arms for added tension and grip. The claw is attached to a motor, visible on the right side of the image, which powers the opening and closing motion. The claw firmly holds the can, demonstrating its ability to securely grasp objects. The mechanism is connected to a metal frame, likely part of a larger robotic system

Program the Clawbot to securely close the claw on an empty 12-ounce aluminum can without crushing the sides.

  • Have the Clawbot hold onto the can while it raises and lowers its arm for 45 degrees.
  • The Clawbot should then release the can and back away from it.
  • Start the challenge with an opened claw and an empty can within it.

Teacher Tips icon Teacher Tips

  • Have students start the challenge with an opened claw and an empty can within it.

  • If the can gets crushed or falls out of the claw, the challenge must be restarted after adjusting the project.

Teacher Toolbox icon Teacher Toolbox - Solution

Here is an example solution:

VEXcode V5 project starts with a When started block with a Set Claw motor timeout to 2 seconds block attached. Next are 4 spin for blocks that read spin Claw motor close for 170 degrees; spin arm motor up for 45 degrees; spin arm motor down for 45 degrees; spin claw motor open for 150 degrees. Last there is a Drivetrain block that reads Drive reverse for 150 mm.

  • The project sets the timeout, closes the claw around the can, lifts and lowers the can, releases it, and then backs away.
  • Programming Rubric  (Google Doc / .docx / .pdf )