How does it work?
Our project is a 2-axis gantry attached to a dispenser that interprets image-processing and movement code from an arduino to replicate a user inputted picture. First, the image processing code interprets the user's image makes it into "mixels" or M&M-sized pixels. Then the movement-related code translates the sprixel pattern into a series of movements and communicates them to the gantry. The dispenser on the rods of the gantry is moved by a series of belts along rods, pausing occasionally to release an M&M onto the icing-coated surface beneath it. This icing-coated surface's height can be adjusted by moving the build plate up and down teeth on the comb-like structures on which it rests.
Mechanical System
The gantry is a 2-axis gantry composed of rods held up by rail-shaft guide supports screwed into the a lasercut hardboard structure. Stepper-motor controlled gears across from pulleys are aligned with both axes. The gears and pulleys hold thin rubber belts that are moved by the stepper-controlled gears. The stepper motors themselves sit on tiny platforms in the corners of the gantry. The belt on the on the front-back axis attaches to a hardboard structure encasing the gear on the end of the left-right pair of rods. The belt on the left-right axis attaches to the dispenser structure. The entire left-right axis including the dispenser moves along the front-back axis with the help of linear bearings embedded in the hardboard structures at the end of the left-right axis. Similarly, the dispenser uses two linear bearings in its hardboard structure to move along the left-right axis. The build plate beneath the entire structure moves up and down depending on what notches on four comb-like devices the build plate is placed on.
The dispenser itself is entirely 3D printed. It consists of two tubes attached to the dispenser itself, which then attaches to the hardboard piece that moves along the left-right axis. The top tube is wide enough to loosely fit an M&M, which was established to help prevent jamming, and is tall enough to hold many vertically stacked M&Ms at a time. The dispenser itself includes a cylinder with a circular cup-shaped divot spun by a mini servo motor inside of a structure that holds it between the top tube. The bottom tube, which is the same diameter as the top, but reaches down about half an inch above the build plate. The bottom tube also attaches to the hardboard piece moving along the left-right axis via a small rectangle that fits around the structure. The structure that holds the tubes above and below the dispenser also includes a small shield to prevent M&Ms from falling forward while the cylinder is turning. The M&M drops down the top tube into the cup on the cylinder, which is then turned in such a way that it drops down into the bottom tube and lands on the build plate.
Electrical System
The electrical system ensures that everything in the system is working smoothly. The limit switches mounted on the gantry help the steppers keep track of the dispenser's location and calibrates the motors if needed. In addition to the limit switches, the stepper motors and servos are connected to the firmware through jumper wires for secure connections.
Software System
The image processing software as written in Python. It utilizes the OpenCV packages to process user-inputted images and convert them to stepper motor commands. The software takes in some black and white image, and resizes it to a 30 by 30 pixel
matrix before identifying each pixel’s color. It then converts the color information into a series of motor commands, telling the gantry motors when and how far to move the dispenser. This information is sent through the serial stream to provide
commands to the firmware.
Firmware System
Using the signals from the software's input from serial, the Arduino Uno and Adafruit Motor Shield uses Arduino C to convert those commands to determine which coils within the stepper motor should be magnetized. Those commands also indicate when to turn the servo motor in the dispenser. When the gantry stepper motors translate the dispenser to the next destination, the servo motor on the dispenser receives the command to turn and dispense an M&M.