Color Sensor
6 Minutes · Module 6 - Disk Placer
VEXcode VR Disk Mover programming for students: learn how to pick and place disks using magnets and eye sensors in this Tamil robotics lesson.
- Opening the VEX VR Disk Mover playground
- Using the electromagnet and Down Eye sensor
- Repeating the program to pick and place three disks
What this lesson teachesRead the lesson as text
A pick and place robot simulation moves objects from one location to another using programmed driving paths, sensors, and holding tools like electromagnets. In the VEXcode VR Disk Mover playground, an automated robot collects colored disks and delivers them back to a starting base.
How the robot collects a disk
The robot starts by moving forward with its magnet energized to boost, which creates magnetic attraction to grab a disk. To know when to stop moving forward, the program uses a wait until block paired with a sensing block. While the sensing category includes a front eye sensor, the program changes this to the Down Eye sensor so the robot detects when an object is directly under it. Once the disk is detected and held by the boosted magnet, the forward motion stops.
Returning and releasing the disk
The robot must return to its starting mark by driving in reverse. To find the exact distance needed to travel backward, the program uses a subtraction operator block that subtracts the initial coordinate of minus 800 millimeters from the robot's current position Y in millimeters. Once the robot reaches its initial position, the magnet block is set from boost to drop, releasing the disk in the target area. The robot then drives forward 200 millimeters to clear the drop location.
Steps to collect three disks
- Drive forward with the magnet energized to boost to attract the disk.
- Wait until the Down Eye sensor senses that the robot is near the object.
- Drive in reverse for the distance found by subtracting the initial minus 800 coordinate from the current Y position.
- Change the energized magnet setting to drop so the disk is placed at the starting base.
- Enclose the full sequence inside a repeat block set to three so the robot stops after picking three blue disks.
Using repeat blocks to control loops
To collect multiple disks, the sequence is placed inside a repeat block from the control category. If the repeat block is left at the default setting of ten, the robot continues moving without stopping when the task is done. Setting the repeat block count to three makes the robot perform the pick and place sequence exactly three times, bringing three blue disks to the initial position while leaving the red and green disks on the field.
Part of the course
ROBOTIC SIMULATION