article headline

Review: LEGO Ideas Set - Maze






Mar 01, 2016 7:00 am
by Joe Meno
more photos

Article and Photography by Geoff Gray

box


LEGO Ideas Set: Maze (21305)
769 pieces, $69.99 
Out April 2016 

BrickJournal received an early copy of the new 21305 Maze, another set from the Ideas theme (http://www.lego.com/en-us/ideasproducts) which are products designed by fans. This particular set was designed by Jason Allemann, who also has the distinction of being the subject for the cover story of the very first issue of BrickJournal ever released (Story: “The Ships of 2001”). The Maze is based on the idea of the old wooden maze games where you have to navigate a ball through a maze by turning levers which make the board tilt and cause a steel ball to roll. The catch is that you need to avoid holes placed throughout the maze.

Jason explains in the instruction manual how he came up with the idea and why he modified the basic design by using a solid base for the maze instead of creating actual holes. The game will still work the same, but is lighter, more sturdy and easier to make new mazes than if it implemented actual holes.

The idea of this set is simple and elegant. It set comes with enough pieces to create the full working base with the tilt levers, a maze base “board” and extra pieces to create several different mazes. The instructions include two mazes; a simple maze with plain walls and holes, and a more complex maze that looks like a “Putt-Putt” golf course with obstacles and tunnels, etc. It is easy to pop the maze board out, pull off the maze pieces and then design a new maze. 

Pieces

For those people that like classic games and puzzles like this one, this set will definitely be a good one to consider purchasing. It offers the ability to build, to design, to play and to re-use. This is one of the hallmarks of good set design for construction toys, and Jason certainly hit the mark on all of these. 

Building a remote control for the Maze Game using a MINDSTORMS EV3 set

Just for fun, I designed a quick motor mount set to attach two MINDSTORMS EV3 large motors to the controls. I then created a very simple program to allow you to move the board using the buttons on the front of the EV3. I suspect that people will start coming up with all sorts of cool ways to add EV3 functionality to this set, including scanning the board to determine the path and then trying to have the EV3 solve it autonomously. Why don’t you let your imagination go wild with this.

The only modification needed for the MAZE set is for the second motor I added. It requires you to remove the main wheel, insert the beam as shown and then replace the wheel before attaching the motor set.

Motor1

motor1

The first motor attaches to the right side control wheel and is held in place by the two friction pins pushed into the vertical 5-long beams.

motor2
motor2

The red arrow goes to the mount shown below.
 mount 2

The second motor cage attaches to the lower control wheel. Be sure to add the two pieces shown above before trying to attach the motor set.

connected

Once both motor sets are attached, be sure to add a gray 3-long axle between the motor sets so they stay attached.

Programming the Maze Controller - The Software and Lessons Learned

After building the motor cages, I started writing the software to control the motors. The requirements were simple. When the UP button is pressed, the first motor spins backwards until the button is released. When the DOWN button is pressed, the first motor spins forward until released. When the RIGHT button is pressed, the second motor spins backwards until the button is released. When the LEFT button is pressed, the second motor spins forward until released. 

I whipped up a program in a few minutes and tested it out. It all looked good. Then I realized that the program had a serious design flaw. Since it was later in the evening and I wanted to take a break, I decided to start over in the morning. When I sat down the next day to work through the issue, I was able to easily fix it AND also make the program much simpler and smaller. First, let me show you the original application:

main loop

Here is the main program, with a teal MyBlock called MoveMotor.

my block

This is the MoveMotor block that is called whenever a button is pushed.

The Flaw:

My initial program easily handled the button pushes, the motor spins, and stopping the motors when released. However, it did NOT account for the possibility of needing to press and release two buttons simultaneously. The Maze Game does not restrict a person to a single axis of motion at a time. 

The Trap:

Since I do a combination of application development, testing and consulting for a living, thisI want to show you both of the programs and to explain what trap I fell into and why I fell into the trap. It is important because I did not follow my own advice and it cost me. It is especially important to my EV3 programming because I am very new to writing programs in a LabView type environment. Most of my development work is in Microsoft .NET (C#/XAML), T-SQL, Robot-C or Assembler.

The first thing I tell anyone about developing an application (regardless of the size or complexity of the program) is to write down ALL requirements of the application before writing any code. This is so easy to tell others to do, but sometimes so difficult to follow myself. Instead of doing this, I immediately started thinking about how to handle the combination of SWITCH and WAIT blocks. This led me to think about the need to create a “My Block”, which led me to creating the block. By this point, I was so deep into working through the logic of the app that I lost sight of the final goal of the app.

The Fix:

When I started the following morning, I wrote down the requirements [notice that above I said “the requirements were simple.” I quoted them for you in this article, but I had not written them down.] When I wrote them down, I added one more requirement: The two motors can run concurrently. By adding this, I had to change the behavior of the SWITCH block. The quickest way that I could think of was to simply make each button have its own program. This way the EV3 would handle the concurrency and the program would be much simpler.

NOTE: There is still one major flaw in the application. I will detail it for you after the below picture. If you want to guess what the issue is, stop reading here.

New program

The new program, which is actually 4 sequence beams - multithreads with each button handled separately.

The Last Issue:

(at least I hope this is the last issue). If you read my last requirement, I mentioned that the two motors need to be independent, but I actually wrote the program to make the buttons independent. The program works just fine the way it is, but it has the possibility of trying to make one motor perform two different motions at the same time. A good program should not only ALLOW all desired actions, it should also PREVENT all undesired actions. Therefore, the application should really only have two programs and each program should handle both buttons for a single motor. I leave the exercise of fixing the second program up to you.

 
completed