A machine designed to sort out to small marbles and two ping-pong balls,one regular and one filled with water,as end-of-course project for one of my college courses (I'm studying mechanical engineering).
The rules are these:
1.) the goal of the machine is to sort the balls in the following order: marble,marble,light ping-pong ball,heavy ping-pong ball.
2.) once the first ball enters the machine,there will be no interaction with the machine except inserting new balls.
3.)The order in which the balls are inserted to the machine is unknown,except for the fact that the last one entering the machine is the heavy ping-pong ball.
4.) score is given for the timing the first ball exits the machine in the following fashion: 100% is given if the first ball exits the machine exactly 15 seconds after the last ball has entered. 5 points deduced on every 0.5 second before or after the 15 second target. for example,timing of 14.32 will get a scoring of 95% because it is within the 2nd segment of 0.5 second below 15 seconds target (1st segments,below or above 15 seconds, are for 100%)
This is how my machine accomplishes the target:
1.) Splitting between ball diameters is the first task achieved by a funnel in the bottom of the first rail.ping-pongs continues straight,marbles go down the shute onto other rail.
2.) every rail guides the corresponding balls to a binary gate-the same kind of mechanism used by physical binary calculator (search Youtube for "Binary calculator matthias wandel").
this gate insures only one ball goes into every socket on the final carriage before exiting the machine.
2.) timing is achieved via an Arduino controlling a servo which holds a full water bottle from pulling the carriage out of the machine.There is a microswitch on the first rail which the light ping-pong ball haven't got enough mass to press it but the heavy ping-pong does have the amount of mass (light weighs 2 grams,heavy 33 grams). Once the microswitch pressed,the amount of time waited before the servo retracts the copper pin from the knot on the string connecting the carriage and the water bottle is determined by the position of a potentiometer- the Arduino converts the relative voltage drop on the potentiometer to a range of 5 to 15 seconds and after that time,activates the servo.
The correct position of the potentiometer to achieve as close as possible results to 15 seconds is determined via trial and error.
Best results:
My time achieved results ranging from 14.97 seconds to 15.20 seconds-well within the 100%