We (Dad & daughter) are always looking for something new to do. Here, we decided to create a computer-controlled, labyrinth-like, marble maze.
Our goal was to program a computer to move a marble from the start to the end of the maze.
Our objectives for this project were to work an engineering project that was:
- Something Dad & daughter can build and program together
Here is what we used.
Building a Simple Marble Maze
- A 4-Motor Servo Kit from Trossen Robotics (Only 2 Servo Motors are used)
- Foam Board
- Hot Glue
- A marble
The Maze Board
We built a maze board as in this picture. We simply drew a grid on a piece of foam board and glued straws onto it to make a maze.
On the back of the top-left of the board we taped some washers for weight. (Why? You’ll see below.)
The Tilting Control
We built a “containing fence” structure using foam board and hot melt glue. In it we constructed a “tilt-on” post (out of more foam board pieces) and hot melted two servos to the base at the top and at the left as pictured. The “tilt-on” post is directly centered. The control horns of the servos are centered on each side.
Now you can see that once the top-left-weighted maze board is placed into this base (such that it is loose fitting), each servo will lift the maze on its side when its horn is moved up. When a horn is moved down, the weight on the top left will cause the board to move back down on that side.
Creating a Program
Dad: My only goal with my daughter in the programming part of this project was to teach her about simple subroutines and parameters. I let her come up with names for the servo controller object and routines to tip the board and pause. Here were her choices for these things:
Thing -- Her Name -- Notes
Servo Controller -- GreenThing -- Hey – It is a green thing. Sorry, Phidget Company – Having this class called Phidgets.Servo is not named well. It is not a servo itself.
Tip Board routine -- Tip
Pause -- Freeze -- Need to pause execution while waiting for the marble to arrive at each waypoint.
Watch it Run!
Here a YouTube video of the computer moving the marble through the maze.The Source Code
We coded the program using Visual Basic .NET. Note that we are not .NET experienced programmers. The source code is attached to this post.
In the video, you’ll see that the program causes the marble to pass by a couple of “correct path” intersections and then work back to them. What we found was that when we programmed the marble to make one of these intersections via precise timing, later runs were not always successful. We found that our primitive tilting mechanics are just not precise enough. It appears that the “floating” maze board (and the “unroundness” of most marbles?) makes the predictability of making these intersections not so great.