Sunday, June 26, 2011

How the Pancake Bot Works

The Pancake Bot (PB) is basically a 3 axis CNC made that uses the Z coordinate as the Pancake Batter Dispenser Control. This one just happens to be made out of LEGO.
The Pancake Bot is made up of the following parts:

1.  A set of linked base plates with 3 parallel tracks snapped on.  One track has a bunch of Technic, Gear Racks (1 x 4) riding along top which makes up the X axis.

2.  A moveable bridge that holds one NXT motor on one side and has free rolling wheels on the other.  The top of the bridge uses two tracks covered with gear racks that holds the Pancake Batter Dispenser Unit (BDU).  The track allows for Y Axis Control.

3.  A carrier gantry on top of the moveable bridge that rides on the gear racks and holds the PDU.

4.  The PDU consists of two ketchup bottles cut in half and glued together so you have two open ends.  This allows you to change the nozzle size on the bottom and allows for input of compressed air on top.

5.  Compressed Air Dispersal Apparatus (CADA) consists of an NXT Motor, two Pneumatic Cylinders, a tank and a bi-directional flexible switch.

The bi-directional flexible switch allows for the switch to be flipped based upon which direction the NXT motor turns.  If you notice in the video, on the close up of the motors turning, the cam is switching the flexible switch every time it rotates.  In the initial turn, the switch is flipped and stops and then continues to flex out of the way of the rotating cam.  When the motor turns the other way, the cam catches the switch, flips it back and changes the direction of the airflow.  It continues to flex as the cam passes over it.  This allows for air to be compressed when the motor turns clockwise, and then the air to be released when the motor turns counter-clockwise.
The reason I did this is because I only have 3NXT motors and needed to a way to change the direction of the air flow while at the same time, still compressing air.

The Program
Originally, the goal was to control this with Python NXT, an open source programming interface developed by Marcus Warner and the Python NXT group.  It worked like a charm at first but for some reason, I could no longer communicate with the brick, so I went back to using the less flexible LEGO Mindstorms programming.

The program itself is a variant of the the Etch-A-NXT program found in Extreme NXT, by By Michael Gasperi, Philippe E. Hurbain, and Isabelle L. Hurbain.  The original program just controlled two motors using an external text file.  I modified the program by adding the third motor.

The text file needed to draw with the Pancake Bot uses three coordinates, each with a character return afterwards.


This tells the NXT to rotate Motor A 360 degrees, Motor B 2400 degrees, and Motor C 500 degrees conterclockwise.  Depending on which gears you choose, one rotation can equal different numbers of units of movement.
I used the 8 tooth gear which with one rotation, moves 4 standard LEGO units.
Depending on the size of your electric griddle, you can calibrate how big you want your drawings.
A simple program in XL converts the LEGO units into degrees and outputs the text file.

Motor C in this case is the Z axis which controls the BDU.  It also acts as a timer for discharging the batter.

The parts that are exposed to the heat of the griddle are covered with a sheet of aluminum foil during cooking.  This reduces the chance of parts melting.

Making the batter.

The batter is made using Martha Stewart's Basic Pancake Recipe as the base.   I sometimes add cinnamon or different berries for flavors or color.
Once the batter is made it goes through a strainer and all the clumps are removed.  This makes the batter smooth and allows for continuous flow of the batter from the BDU.

Things to work on!
The BDU is not the best design but other attempts were not as successful for batter delivery.  I attempted using a standard RCX motor with a corkscrew that went to a funnel but the corkscrew was not as effective as using air pressure.
A corkscrew discharge would allow for controlled amount of flow vs. the air pressure discharge (10 turns equals 20cc's of pancake batter.  When you use the air pressure discharge you have the additional variable of batter viscosity and so any slight changes in batter recipe modifies the flow speed.
The advantage of the air pressure solution is that you don't need a mechanical means to extrude the batter, so even using a aquarium pump (thanks Bruce Shapiro from Egg-Bot) could be used to control the flow of the batter.