Skip to main content

Mars Rover-Exploring Mars Geology
Lab 3 - Sort your Samples

Teacher Portal

Part 1 - Step by Step

  1. InstructInstruct students that they are going to build on what they learned in Lab 2 to have the Code Base collect and sort a different Martian rock sample to a different area. The new sample will be represented by the Blue Disk. They will add to their Lab 2 projects to code their robot to sort the Disk, based on its color.
    • Show students the Field setup with the sorting areas marked with the ‘R,G, B.’  They will need to drop the Blue Disk in the Blue sorting area.

    image of Tile set up with blue disk and the red, green and blue sorting areas marked
    Field Setup

    • Students will build this project with you then test it on the Mars surface (the Field). This animation shows how the Code Base will move when this project is started.
    Video file
  2. ModelModel for students how to build the project in VEXcode GO and test their projects on the Field.

    Image showing the parameter set to blue in the Detects color block
    Set parameter to ‘blue’

    • Then, change the distance parameter in the [Drive for] blocks to 350 mm, to have the Code Base drive to and from the blue sorting area on the Field.

    image of distance in the Drive for blocks set to 350 mm
      Change distance

    image of project for sorting the blue disk
    Sort Blue Project

    Model for students how to test their project on the Field.

    • First, show them how to place their robot at the starting point (the Mars Base) and the Blue Disk on the Field as shown in the image below.  Use the gridlines on the Field to help with alignment. The Disk and the Electromagnet can both be lined up on intersecting grid lines of the Field, to make it easier for students to be set up for success when they test their projects.

    image of the Code Base at the starting location and the Blue Disk on the field
     Setup to Test

    • Once the Code Base is in place, select 'Start' in VEXcode GO to test the project.  Watch as the Code Base drives to collect the Blue Disk, return to the Mars Base, then deliver it to the blue sorting area.

    image of the Start button called out on the VEXcode GO Toolbar
     Select 'Start' to test the project

    • Students will need to select the 'Stop' button in the VEXcode GO Toolbar to stop the project.
    • For students who finish early and need additional challenges, have them place the Red Disk on the field in the same location, then start their project. Does the Code Base deliver the Red Disk to the red sorting area? What would happen if they tried their project with a Green Disk? Try it!
  3. FacilitateFacilitate a conversation with students as they test their projects.
    • How does the Code Base need to move to collect the Disk? Can you show me with your hands? 
    • Does the Code Base need to turn? How far? In which direction?
    • How will the Code Base move to deliver the Disk to the sorting area? Which direction will it turn? How far does it need to drive to reach the sorting area?
    • How does the Code Base know if the Disk is Blue or a different color? 
    • What blocks are used to have the Code Base detect the color of the Disk?
    • What would happen if the Code Base detected red? Would the Code Base deliver the Red Disk to the same location as the Blue Disk? Why not?

    Focus on the concept, not the precision.

    • The goal of this Lab is to focus on the concept of using the Electromagnet in a project. If students slightly misaligned their robot, or the Disk is not exactly in the right place when they drive to it, let them know that it's ok to move the Disk slightly to make sure it gets picked up by the Electromagnet.
    • Also, let students know that it’s okay to nudge the Disk into the sorting area if it is mostly, but not completely in the sorting area square. 
  4. RemindRemind students to check the parameters in the [Drive for] blocks to make sure the project has the correct distances needed to collect then sort the Disk.

    In order to encourage a growth mindset and help students embrace the trial and error that is a part of coding and encourage them to learn from the mistakes along the way, ask questions such as:

    • What mistake have you make that has taught you something?
    • What did you learn from this mistake? How can it help you when coding the Code Base next time?
    • What part of the Lab is tricky, or is making you think hard?
  5. AskAsk students how they might use an [If then] condition to code the Perseverance Rover to sort Martian rock samples into two categories: rocks that show signs of ancient life, and rocks that do not.

Mid-Play Break & Group Discussion

As soon as every group has tested their project to have the Code Base collect and deliver the Blue Disk to the sorting area, come together for a brief conversation.

Discuss what happens in the projects when the Code Base makes a decision based on the conditions created with the [If then] blocks. Show the animation below, or a Sort Blue project running in VEXcode GO. Draw students' attention to the highlight feature, and how the highlight skips the first [If then] block because the condition (Eye Sensor detects red) is False. The highlight shows how the project moves to the next [If then] block. Since the Eye Sensor detects blue, the condition is True, and the blocks inside the [If then] 'C' block will run. Make sure students understand that the blocks inside the [If then] block will only run if the condition is True.

Video file
  • Why is one of the [If then] blocks “skipped?” What is happening instead?
  • What happens in our project when the condition of the [If then] block is False? Do the blocks inside the [If then] 'C' block run? 
  • What happens if the condition of the [If then] block is True?
  • What if we had the Code Base collect a Green Disk? Would either of the [If then] blocks run? Why?
  • What if we wanted to have the Code Base sort a Green Disk? What would we need to add to our projects?

Note: If you want to slow down the project flow even further, Step through the project using the Stepping Feature, and discuss why the first [If then] block is “skipped.” For more information on how to use the Project Stepping feature, view the Stepping Through Blocks tutorial in VEXcode GO.

Part 2 - Step by Step

  1. InstructInstruct students that they are going to apply what they learned in Play Part 1 and add to their projects to have the Code Base collect and sort the Green Disk. They will need to change parameters in their projects to have the Code Base deliver the Disk to the green sorting area.

    Once they have successfully sorted the Green Disk, they will experiment with all three Disks. Can they have the Code Base rover collect and deliver all three Disks to the proper sorting areas?

    • Show students the new Field setup and provide them with the drive distances to the green sorting area so that they can focus on the code for this project. The Code Base will need drive 250 millimeters (mm) (~10 inches (in)) from the Mars Base to and from the Green sorting area.

    image of play part to field setup, the green disk is on the field and the red, green and blue sorting areas are marked
    Play Part 2 Field Setup

    • The following animation shows one possible way that the Code Base can move to collect and sort the Green Disk.
    Video file
  2. ModelModel for students how to get started with their projects in VEXcode GO.

    If necessary, model for students how to test their project on the Field.

    • Show them how to set up to test by placing the Code Base at the Mars Base.

    image of field setup -  the Code Base on the field and the green disk placed
    Set up to test

    • Once the Code Base is in place, select 'Start' in VEXcode GO to test the project. 
    • Students will need to select the 'Stop' button in the VEXcode GO Toolbar to stop the project.

    Once students have successfully delivered the Green Disk to the correct sorting area, have them test their project with all three colored Disks. Can they code the robot to deliver all three Disks to the correct sorting areas? 

    • They should place the Disk, then start their project. Does the Code Base deliver it to the correct sorting area?
    • Once the Code Base sorts a Disk successfully, they can try again with another Disk. Can the sort all three? Try starting with a Blue Disk, then a Green Disk and finally a Red Disk.
       
  3. FacilitateFacilitate a conversation with students as they build and test their projects with questions such as:
    • What do you have to add to your project to have the Code Base rover detect the Green Disk? 
    • What parameters do you have to change to have the Code Base rover drop the Disk at the new sorting area?
    • How does the Code Base detect the color of a Disk?  How does the Code Base know where to deliver the Disk?

    Prepare students for the trial and error that is an intrinsic part of this challenge. You may want to use the Problem-solving Cycle graphic from the Background page as a visual aide to establish a structure for the problem-solving process with your students.

    image of the student problem solving cycle
     Student Problem-solving Cycle

    There are many possible solutions for this challenge. The following is one example.

    image of a possible solution for this challenge
    Sort All Project

    Focus on the concept, not the precision.

    • The goal of this Lab is to focus on the concept of using the Electromagnet in a project. If students slightly misaligned their Code Base, or the disk is not exactly in the right place when they drive toward it, remind them that it is ok to move the disk slightly to make sure it gets picked up by the Electromagnet.
    • Also, let students know that it’s okay to nudge the Disk into the sorting area if it is mostly, but not completely in the sorting area square.

    If students need additional support to connect the behaviors of the Code Base with the block commands in their project, use the Project Stepping feature to help students go through their project one block at a time to see how each block is being executed in their project. For more information on how to use the Project Stepping feature, view the Stepping Through Blocks tutorial in VEXcode GO.

    image of icon for the Stepping Through Blocks Tutorial in VEXcode GO
    Stepping Through Blocks Tutorial in VEXcode GO

  4. RemindRemind students to check the order (or sequence) of the blocks, and the parameters of the blocks in their projects before they test on the Field.
    • How does the Code Base need to move to collect then sort the Disk? Can you show me with your hands? 
    • Does the Code Base need to turn? How far? In which direction?
    • What blocks are inside each of the [If then] blocks? Will these drive the Code Base rover to the correct sorting area?
    • Was the sorting area further away? How can you change the parameter in the [Drive for] block to have the Code Base drive to the correct sorting area (250 mm to green sorting area)?
    • Is the <Detects color> block set to ‘green’ (the color of the Disk)?

    Talk students through problem-solving each issue as you circle the classroom. This will be an iterative process, so remind students that scientists who code the Mars rovers also have to try multiple times to get the rover to move how they intended. 

    • What mistake have you made that has taught you something? What did you learn from this mistake? How can it help you when coding the Code Base next time?
    • What did you change in your project to make it work better?
    • What change did you make that made your project less successful? How did you fix it?
    • What is something you learned in other Labs that you used to help you in this Lab?
  5. AskAsk students to think about how their project has changed from Lab 2 to Lab 3.
    • How has your project changed from Lab 2 until now?  What have you added? How has this changed the behaviors of the Code Base?
    • What could the Code Base rover do in Lab 2? What can it do now? What have you added to your project to make this happen?