Electromagnet Issues

I’m having issues with the Electromagnet picking up discs that I don’t want it to! We are trying to do the lesson on Mars geology/sorting and I’m using the code attached. No matter what color disc is there, it still picks it up. Kind of defeats the purpose of teaching decision making and conditionals with the robots. Any advice? I read the topic below about the fixes they had with the electromagnet, but modifying the build doesn’t always work either. Moving the wheel back one pin hole makes it not even pick up the disc at all - no matter the color.

Hi Amy,

The VEX GO Electromagnet, by default, will pick up objects very close to the tip of the Electromagnet due to its natural magnetism.

When the Electromagnet is “boosted”, current flows through the magnet and increases its magnetism (in effect, boosting its performance).

When the Electromagnet is “dropped”, current flows through the magnet in an opposite direction which negates the magnetic force and causes it to “drop” whatever is being held.

The “boosted” and “dropped” states only last for about 1 second each, since during this time the magnet becomes warm with the current flowing through it. After the 1 second period, the magnet returns to its natural weak magnetic force, but it is still strong enough to pick up an object that crosses directly over the electromagnet.

Here’s some sample code that may assist with this issue by adding a conditional to do the boost/drop based on the color seen.

Also, to help troubleshoot, you can use the “monitor” feature in VEXcode in order to see what color the Eye sensor is detecting while your project is running by checking the box next to the sensing block.

Let me know if you have any other questions. Thanks!

I just started telling them (2nd and 3rd graders) that the default for the electromagnet is “boost” and that it will always pick up the disk. If they don’t want the disk to be picked up, they must use a “drop disk” block. We operated under this premise today and things went better! Just had to change my mindset from teaching my 4th - 6th graders the same lesson, but with the basebot with claw. :wink: