CS Level 1 - VEXcode VR Python

Unit 8 - Moving Disks with Loops

# Lesson 1: What is an Electromagnet?

In this Lesson, you will learn about the Electromagnet on the VR Robot. You will learn how to use the Electromagnet in a project.

## Learning Outcomes

• Identify where the Electromagnet is on the VR Robot and how it works.
• Identify how the Electromagnet is used in a project.
• Identify that the energize command has two different modes: boost or drop.
• Identify that the energize command, when set to 'boost', attracts a disk to the Electromagnet.
• Identify that the energize command, when set to 'drop', releases the disk that the Electromagnet is holding.
• Identify that the energize command can be used with Drivetrain commands to pick up disks.
• Describe why an Electromagnet would be used in a project.

## Electromagnet

An electromagnet is a type of magnet where a magnetic field is produced by an electric current. The VEX VR Robot has an Electromagnet to pick up and put down disks that contain metal cores.

Disks with metal cores can be found on specific VR Playgrounds, and can be used with the Electromagnet on the VR Robot.

There are disks on specific VR Playgrounds such as the Disk Mover Playground that can be used with the Electromagnet. In the following example, the VR Robot will drive to the first disk on the Disk Mover Playground, pick it up, then drive back to start and drop the disk.

Video file

### Energize Command

For the Electromagnet to be able to pick up or drop a disk, the magnetic current must be energized to either attract or repel the metal core of the disk. Use the energize command in a Text project to use the Electromagnet to move disks.

The energize command has two different modes: ‘BOOST’ and ‘DROP.’  Setting the parameter to ‘BOOST’ turns on the Electromagnet and creates the electromagnetic field needed to attract a disk to the Electromagnet. Setting the parameter to ‘DROP’ reverses the current of the Electromagnet and releases any disks being held by the Electromagnet.

The energize command is typically used with Drivetrain commands to enable the VR Robot to drive toward a disk to pick it up (boost), and then to a different location to drop the disk. In this Unit, the energize command will be used to move disks in the Disk Mover Playground in different ways.