Project #24 Mazing 2
I mentioned this briefly before but I tidied it up a lot in time for the maker faire and added a few features to it.
It's a CNC controlled marble in a maze, the X and the Y are belt driven rather than the more common tilt mechanism. The intent was to persuade people to type in a series of simple programming type commands to drive the ball around the maze from the start point to the end point. I'm pretty sure people didn't see it as programming which is probably a good thing as they were too busy having fun with it. I housed the electronics on top of the board so people could see the details, put in a compass and a scale and gaffa taped a hinge so that the whole thing could flip up and people could see the underneath. (svg here)
24 Projects/ 28 weeks
For a project on such a short time scale you have to use what's at hand. The XY frame is from a 3020 laser cutter spares I had lying around after the laser cutter fire. The stepper motor drivers are big beefy Keling 4030s I had left over from my failed CNC milling machine and surely everyone must have an arduino or two kicking around by now. Magnets from the gauss gun kits and ball bearings from Donkey Kong. In fact the coding took significantly longer than the mechanical design and assembly.
Version 1 of the code featured a very simple parser of the incoming serial string, it only recognised N,S,E,W and only in capitals. After the first day of the maker faire I vowed to make some serious changes to the way it worked and an extra hour of coding on the Sunday morning made a world of difference. The final version of the code accepts upper or lower case, NE,SE,NW,SW for diagonal movements (although NE10, moves north 10 and east 10 which imo is simpler than calculating the hypotenuse and having to type NE14), and some limit checks which count the number of steps made in any direction and stop you from running it into walls. These step counts are also used to return the ball to the start at the end of every run meaning that you have to type a complete string of instructions to achieve the goal.
Even though it's nothing special I thought I'd share the source code too.
I figure this is the optimal route through the maze.