Skip to main content

Lesson 4: Moving Disks

Lesson 4: Moving Disks

In the previous Lesson, you learned how to collect (x, y, z) coordinates using the Brain. In this Lesson, you will use those coordinates to create a VEXcode project to move a Disk onto a pallet. You will learn how to: 

  • Open a project in VEXcode.
  • Build a VEXcode project to pick up and place a Disk on a pallet.
  • Download a project to the Brain.
  • Run a project on the Brain.
  • Incrementally test VEXcode projects.

At the end of this Lesson, you will code the 6-Axis Robotic Arm to pick up an additional Disk and place it on another pallet.

CTE Brain 6-Axis Arm Base with a red Disk on the center of each pallet.

Picking Up and Placing a Disk

In the previous course, you used a direct connection to code the 6-Axis Arm to pick up and move Cubes and Disks. In this Lesson, you will create an EXP Brain project in VEXcode EXP to pick up and move a Disk from the starting location to a pallet. This will follow the same process that you used to incrementally create and test VEXcode projects in the Introduction to the 6-Axis Arm course.

To begin, place a Disk on Tile location 17, as shown in this image. This is the same setup that was used in the previous Lesson's Activity.

CTE Brain 6-Axis Arm Base build with a red Disk placed on Tile location 17 on the Arm Tile.

Reviewing the Behaviors Needed to Move a Disk

In the Introduction to the 6-Axis Arm course, you learned how to make a plan for a project where you listed out the smallest possible behaviors in order. Previously, you made a plan for moving a Cube from the loading zone at Tile location 17 to the pallet. This same plan (shown below) can be used to move a Disk from Tile location 17 to the pallet now, as the behaviors are the same – only the object being moved changed. Record the plan to move a Disk from the loading zone to a pallet in your engineering notebook.

Move a Cube to the Loading Zone to a pallet
 
1. Pick up a Cube.
     a. Set the 6-Axis Arm's end effector to Magnet.
     b. Move the 6-Axis Arm to the Cube in the Loading Zone.
     c. Attach the Cube to the Magnet.
     d. Move the 6-Axis Arm above the Loading Zone.
 
2. Place the Cube on the pallet.
     a. Move the 6-Axis Arm above the pallet.
     b. Move the 6-Axis Arm down to place the Cube on the pallet.
     c. Release the Cube from the Magnet.
     d. Move the 6-Axis Arm above the pallet.

 

Opening the CTE 6-Axis Arm Base Template Project

In this Lesson, you will use the Brain CTE 6-Axis Arm Base Template Project to code the 6-Axis Arm to pick up and move Disks to the pallets. Follow along with the steps to open the project.

In VEXcode, open the File menu, and select Open Examples.

File Menu in VEXcode EXP open, with Open Examples highlighted. Open Examples is the fourth menu item after New Blocks Project, New Text Project, and Open.

Select the Brain CTE 6-Axis Arm Base template project. 

Note: If opening the project for the first time, you may be prompted to allow editing permissions. Be sure to enable saving if prompted.

Brain CTE 6-Axis Arm Base template icon.

Now you are ready to begin building your project.

The template project open in VEXcode, showing a When started block with no blocks attached to the left and a Note to the right. The note has space for the Project, Author, and Created sections to be entered. The Configuration reads EXP Brain CTE 6-Axis Arm Base; Signal Tower in Port 6; Arm in Port 10.

For Your Information

In the Brain CTE 6-Axis Arm Base template project the 6-Axis Arm and Signal Tower are already configured as connected devices. When creating a Brain project, a device, like the 6-Axis Arm, needs to be configured in order for the blocks to control that device to appear in the Toolbox. By using the template project, blocks in the Arm and Signal Tower categories will be available to use. You will learn more about configuring devices in a later Unit.VEXcode EXP with the Devices Window open, and a Signal Tower and Arm shown as configured devices for the project.

Pick Up the Disk

Before you begin to add blocks, name and save your project to your device. Open the File menu and select Save As. Rename your project Unit 1 Lesson 4.

Now your project will automatically save as you add and remove blocks.

File menu in VEXcode EXP open, with Save As highlighted in a red box. Save As is the sixth menu option, below New Blocks Project, New Text Project, Open, Open Examples, and Save.

Add Comment blocks for each of the two large steps from the plan above. 

Remember, comments help keep your project organized so that is it easy to identify reusable chunks of code as you are building and testing a project.

A VEXcode project with a When started block with two Comment blocks attached. The first comment reads Pick up a Disk. The second reads Place the Disk on the Pallet.

Add a Set end effector block below the first Comment block to set the 6-Axis Arm's end effector to Magnet. 

The same project, with a set end effector block added beneath the first comment. The start of the project now reads When started, Pick up a disk, set arm end effector to magnet.

Add a Move to position block beneath to the project.

The same project with a move to position block added beneath the set end effector block. The start of the project now reads When started, pick up a disk, set arm end effector to magnet, move arm to position x 120, y 0, z 100 mm.

Set the x, y, z-parameters to the coordinates of the top of the Disk in the loading zone (Tile location 17). You recorded these coordinates in your engineering notebook in the previous Lesson's Activity.

Note that the (x, y, z) coordinates shown here are an example. Yours may be slightly different based on the position of the Disk and the 6-Axis Arm when you manually gathered the values. Be sure to use your coordinates in your project.

The same project as above with the x y and z parameters of the move to position block set to x 52, y 159, z 14, and highlighted in a red box.

Add a Set magnet block to the project. Be sure the parameter is set to engaged.

You must use a Set magnet block to engage the Magnet in order to attract the Disk to pick it up. 

The same project with a set magnet block added after the move to position block. The first comment section of the project now reads Pick up a disk; set arm end effector to magnet; move arm to position x 52, y 159, z 14 mm; set arm magnet to engaged.

Add an Increment position block to your project and set the z-parameter to 50. 

This will cause the 6-Axis Arm to lift along the z-axis, picking up the Disk from the loading zone at Tile location 17.

The same project with an increment position block added beneath the set magnet block. The z parameter of the increment position block is set to 50mm, so the block reads Increment arm position by z 50 mm.

Run the Project on the Brain

Now that the Brain is being used as the programmable logic controller (PLC), VEXcode projects will need to be downloaded to the Brain. You will download and run projects on the Brain throughout this course. Follow these steps to download and run your project. 

Be sure the Brain is powered on and connected to VEXcode EXP. Review the steps in Lesson 2 of this Unit to help you connect the Brain if needed. 

The Brain icon in the Toolbar will show green when the Brain is connected.

Green Brain icon shown in the VEXcode EXP Toolbar, highlighted in a red box, between the Controller icon to the left and the Download button to the right.

Select Download to download the project to the Brain.

The Download button in the VEXcode EXP Toolbar, to the right of the Brain icon, highlighted in a red box.

You will see the project on the Brain screen once it is downloaded.

EXP Brain with the screen showing the downloaded project open. The top reads Unit 1 Lesson 4, and the bottom reads Run. The Run icon on the far left is highlighted.

Press the Check button on the Brain to run the project. Observe the behaviors of the 6-Axis Arm.

The EXP Brain with the Unit 1 Lesson 4 project open on the screen and the Check button to the right highlighted in a red box. The check button is on top of the diamond of buttons.

When the 6-Axis Arm is finished moving, press the button on the Brain to stop the project. 

Did the 6-Axis Arm pick up the Disk from the loading zone as intended? Why or why not?

The EXP Brain while the project is running, with the screen showing black with a running timer across the top, that reads 39 seconds. To the right, the X button is highlighted with a red box. The X button is at the bottom of the diamond of buttons.

Place the Disk on the Pallet

Now that the Disk is picked up by the 6-Axis Arm, it can be moved to the pallet. The 6-Axis Arm will move the Disk above the drop off location on the pallet. Then it will lower the Disk to the pallet and release the Magnet to place the Disk, as described in the plan above.

Add a Move to position block to the project beneath the second Comment block, to align with the next behavior listed in the plan.

The same project from above, with a move to position block added beneath the second comment. The project now reads When started, Pick up a disk, set arm end effector to magnet, move arm to position x 52, y 159, z 14 mm, set arm magnet to engaged, increment arm position by z 50 mm. Then Place the Disk on the Pallet, move arm to position x 120, y 0, z 100 mm.

Set the x, y, z-parameters to the coordinates of the drop off location – the top of the Disk on the pallet. You recorded these coordinated in your engineering notebook in the previous Lesson's Activity.

Be sure to use your coordinates, as the ones shown here are an example, and may vary from your own.

The same project with the x, y, and z parameters set to x 171, y 167, and z 26. The second comment section of the project now reads Place the Disk on the Pallet, move arm to position x 171, y 167, z 26 mm.

Add approximately 50 to your z-coordinate in the Move to position block.

This is added because the 6-Axis Arm needs to move the Disk above the drop off location. By increasing the z-coordinate, you ensure that the Disk is positioned over the correct location. This also ensures that the 6-Axis Arm avoids any obstacles that may be present.

The same project as above, with the z parameter of the final move to position block set to 85.

Add an Increment position block to the project. Set the z parameter to -50. 

This will move the 6-Axis Arm down 50mm to place the Disk on the pallet.

The same project as above with a an increment position block added after the final move to position block, with the z parameter set to negative 50. The second comment section of the project now reads Place the Disk on the Pallet, move arm to position x 171, y 167, z 85 mm; increment arm position by z negative 50 mm.

Add a Set magnet block to the project. Set the parameter to released

This will disengage the Magnet so that the Disk is released on the pallet.

The same project with a set magnet block added to the end of the stack. The magnet parameter drop down is open and released is selected.

Add an Increment position block to the project. Set the z-parameter to 50.

This will raise the 6-Axis Arm to place the Disk on the pallet.

The same project, with an increment position block added after the set magnet block. The second comment section of the project now reads Place the Disk on the pallet, move arm to position x 171, y 167, z 85 mm; increment arm position by z negative 50 mm; set arm magnet to released, increment arm position by z 50 mm.

Download and Run the Project on the Brain

Now that you are running the project directly from the Brain, the project needs to be downloaded to the Brain each time it is edited. This ensures that the project running on the 6-Axis Arm is the same as the project you are building in VEXcode. 

Be sure the Brain is powered on and connected to VEXcode. Select Download in the Toolbar to download the project to the Brain. 

The Download button in the Toolbar of VEXcode EXP, to the right of the green Brain icon.

Once the project is downloaded, press the Check button on the Brain to run the project. 

Observe the behaviors of the 6-Axis Arm.

EXP Brain with the project downloaded and opened. The Brain screen reads Unit 1 Lesson 4 at the top, and Run on the bottom, and the Run icon to the far left is highlighted. To the right of the screen, the Check button, at the top of the diamond of buttons is highlighted in a red box.

When the 6-Axis Arm has finished moving, press the button on the Brain to stop the project.

Did the 6-Axis Arm pick up and place the Disk on the pallet as intended? Why or why not?

EXP Brain while the project is running. The screen is black with the timer running across the top. The timer reads 39 seconds. The X button to the right, at the bottom of the diamond of buttons on the Brain, is highlighted in a red box.

For Your Information

While your Brain is connected to VEXcode EXP with the USB-C cord, you can also use the Run and Stop buttons in the Toolbar to start and stop your project. When the Brain is connected to VEXcode with the cord, the Brain icon in the Toolbar will show green, and the Download, Run, and Stop buttons will be enabled, as shown here. VEXcode Toolbar with the Brain icon showing green and the Download, Run, and Stop buttons enabled.

When the Brain is not connected to VEXcode, the Brain icon will show white, and the Download, Run, and Stop buttons will be disabled, as shown here. When the Brain is not connected, the buttons on the Brain must be used to run the project. The VEXcode Toolbar with the Brain icon showing white, and the Download, Run, and Stop buttons are grayed out and disabled.

Activity

Now that you have opened, downloaded, and run your project on the Brain, and moved one Disk from the loading zone to the pallet, you will practice these skills. In this activity, you will build on your project from this Lesson to code the 6-Axis Arm to pick up a second Disk from the loading zone (Tile location 17) and place it on the second pallet.

CTE Brain 6-Axis Arm Base build with a red Disk in the center of each of the pallets.

Activity: Code the 6-Axis Arm to place one Disk on each pallet.

  1. Plan how you will build onto your project from this Lesson. In this project, you will code the 6-Axis Arm to pick up a second Disk from the loading zone and place it on the second pallet with your group. Be sure that you are all agreed on your approach before you begin editing the project. 
    1. Document your plan in your engineering notebook.
  2. Open the File menu in VEXcode and select Save As. Rename your project Unit 1 Lesson 4 Activity.
  3. Edit the project in VEXcode to match the plan your group agreed upon.
  4. Download and run the project to test it. Manually place the second Disk at the loading zone once the first has been placed.
  5. Does the 6-Axis Arm successfully move both Disks as you intended? There should be one Disk on each pallet. If not, continue to edit the project until you have successfully placed both Disks, one on each pallet. 

Check Your Understanding

Before moving on to the next Lesson, ensure that you understand the concepts in this Lesson by answering the following questions in your engineering notebook. 

Check Your Understanding questions >  (Google Doc / .docx / .pdf)


Select Next > to move on to the Putting It All Together Activity.