The robot arm is controlled using Dynamixel Motors and an Arduino (see Arm Building). The motors have their own microprocessors inside which allows them to keep track of position. This in turn allows for precise speed and position control. Using a proportional controller, the arm is able to swiftly get from one location to the next with overshooting and oscillation.
The code had preset locations for each of the 15 cards, plus a draw deck and win pile. Once the vision processing code found a set in the 15 cards that were laid out, it writes a serial string with the location of the three specified locations correlating to a set (see Vision Processing). The arduino reads in the string, parses it to get the locations (0, 1, 2, etc) and puts the three numbers into an array.
When the arduino gets the three location points in an array, it first picks up the card by moving to the first location (first number in the array), turning on the pump to pickup the card, then moving to its own "win pile" and droping the card there. Then the arm moves to the next locations, again, picks up the card and drops it off at the "win pile". It does the same for the third card.
Once it has collected its set, it much replace the cards with cards from the draw pile. It does this by picking up a new card from the preset draw pile location, then moving to the first location to drop it off in that spot. Then it moves back to the draw pile to pick up a new card and put it in the subsequent spot. It repeats the process again.
After the robot has played its turn, it goes back to resting in the "home" position, and waits for the human player to pick up their set.