Ball Sorter
The second part of this week's assignment is to build an improved
ping-pong-ball sorter that adheres to the following specifications:
- Your device should accept 7 ping-pong balls, some of which will
be white and some black.
- Once started, your machine should wait for 3 seconds, then start
releasing one ball at a time, and determine each ball's color as it
rolls by a sensor (as in the previous homework). The color may not be
sensed when the ball is resting in front of a sensor. There is no
restriction on how fast the balls are released, as long as your
machine can keep up with them and accurately determine the colors.
- As in the previous homework, your device should sort the balls
into two boxes. This time, however, the boxes are supplied by us, and
your machine must shoot the balls over their rims. Only the balls may rise
over the rims, but not your machine (or any part thereof, at any time).
The exact restriction on the dimensions are as follows:
- Your machine (including the handy board) must at all times fit within
an (imaginary) box that has a footprint of 12" x 12" and is 9.5" high;
- the two (real) boxes for the white and black ping-pong balls have
a footprint of 9.5" x 12" and are 9.5" high;
- the boxes for the balls are positioned directly adjacent to the
square area reserved for your machine (so that the entire footprint is
31" x 12").
This setup can be observed in the front of the lab.
- You may only use one regular motor to shoot the balls. You may
use another motor (any kind) to release the balls.
- Your machine must be entirely built from Legos. For example, you
may not use a "foundation" of books to raise it up, and you may not build
any parts from cardboard, wire, etc.
- After your machine has sorted the seven balls, it should stop, beep,
and print the number of white and black balls, as well as the total time
taken (not counting the initial pause of three seconds). The time should
be reported in seconds with one decimal place. Sample output:
white: 2 black: 5
time: 23.2 s
At the beginning of Monday's lab we will have a contest to test
your devices. Each sorter will be run three times with a random sequence of
7 balls. A score will be assigned based on the number of balls sorted
correctly, the speed of the sorting, and whether all specifications and
rules are met.
Notes:
- Your machine needs to have a place for holding 7 ping-pong balls
initially. You could use a slanted track as in HW 6, or something
entirely different.
- You may be able to reuse your program from HW 6 to detect the color
of the balls, or you can come up with a new way to do this.
- The hard part will be to build a mechanism that can shoot the
balls into the two boxes. Something like a
pitching machine or a catapult may work. Remember that you may only
use a single motor for the shooting. Also, you are not allowed to
"preload" your machine by hand (e.g., by tightening a rubber band) -
you may only press the start button before each run (or better yet, a
home-made start button using a bump sensor).
- Since speed will be part of your score, think hard about how this task
could be performed really fast (perhaps in less than 20 seconds??)