Disclaimer
This page is not connected with or endorsed by

The LEGO Company.

LEGO, LEGOLAND, LEGO SYSTEM, LEGO TECHNIC, DUPLO, LEGO PRIMO and LEGO MINDSTORMS are trademarks of The LEGO Company.

 

 

 

 

 

Home

NXT Robotics

 

Lego Rubik Utopia

                     NXT Rubik's cube solver

 

Realized in Spring 2007

Published on 1st May 2007

Updated on August 2007

 

 

Daniele Benedettelli

 

In the last three months (February, March, April 2007)

 I have been very busy preparing University exams.

The one which certainly caught my attention most was AI,

that taught me about various aspects of Artificial Intelligence.

 

This exam gave me the conscience that Artificial Intelligence

has been invented to cure natural Idiocy, and has been an occasion to realize

 an impossible dream, or better an utopia!

 

I wrote a software that can solve the famous Rubik's cube puzzle,

using IDA* heuristic search algorithm.

In my mind that software was only a small part of the

Lego Rubik Utopia project.

 

 

This is the latest version of the robot, dated February 2008. It has been redesigned to be built only with the NXT retail set parts. This time is really fast! It can solve any 3x3 cube in a minute max.

 

 

Maybe you have already seen the cube-kun, a massive expensive industrial robot made by Kawasaki that can solve a Rubik's cube. Around in the web, the robot is told to be able

to solve a Rubik's cube in seconds: this is FALSE!

In fact, it can FIND THE SOLUTION in seconds (like my LRU)

while it takes minutes to actually solve the cube!

LRU is faster, as you can see.

 

Check out the

LEGO RUBIK UTOPIA

Hall of Fame!

 

 

 

Planning to build a Lego Rubik's cube solver ( LRU from now on ), I obviously had to face the inheritance of a great robot of the RCX era,

JP Brown's Lego Rubik Solver. He used 2 RCX, many motors and sensors, a webcam, a custom interface program on PC and already-done sub-optimal algorithm found on web at that time.

 

I studied the situation, having now a more powerful hardware, and

a self-made software that solves the cube optimally (the solution, if found, is the shortest possible), and I came up to the first design, showing right here.

 

You can notice that is quite inspired by JP Brown's robot. Even if it misses an arm, it can grab, rotate the cube and a single face. The overall impression is about a cool streamlined robot, but it do not work so well and it is very slow, it takes 2'10" to scan the entire cube.

 

Main mechanical features are optical zeroing on both wrists and a torque-based limit switch on both grabbers (using servomotor overload detection); grabbers use the new rubber elements to emprove the grip.

It uses 2 NXT bricks (communicating via Bluetooth), 4 servomotors and 2 light sensors.

 

 

I knew it can be done better. In this second version, the cube handling is more accurate and stable. The robot has 4 motors, hence 4 degrees of freedom: the nest that holds the cube can rotate and can go up and down, the portal over the cube can flip back and forth and grab the cube with a similar strategy of LRU 1.

 

The finest feature is the lifter mechanism, smooth and solid. Again, here are involved 2 NXT bricks, while all the movements are monitored by 5 touch sensors.

 

OK, better than before, but this prototype gains in precision

but not in speed: it takes 2'00" to scan a cube.

 

 Suddenly I realized that I forgot the basic rule in this kind of projects: I forgot to KISS!

KISS, as many of you might already know, is not related to

effusions with such machines, but means:

" KEEP IT SIMPLE, STUPID! "

So I did.I rolled back to draft and thought about how to get the movements needed with only 3 motors, and so with only one NXT brick.

 

A motor actuates a prismatic joint that pushes the side of the cube (the red side in the photo);

another rotates the cube's support; the third one has the double function to help the pusher arm to accomodate the cube on the support and to hold the cube while the bottom face is rotated. The robot uses 2 touch sensors as limit switches for the arms and a light sensor to zero the rotating base.

It's not useful to waste more words on mechanics, to understand the whole thing it's better to take a look at the video!

 

Note how the cube is (Italian) patriotic in this photo!

 

  Click to enlarge

This is the main software interface (R 2.0). In future versions, it will be able to communicate to NXT via USB and automatically scan the cube with a webcam.

For now, you can input the cube in three ways:

you can start from a random cube ( I suggest to not exceed 10-11 moves depth ),

you can rotate faces with the Minicube buttons,

you can input any consistent configuration, editing every facelet color (Edit Mode).

Algorithm used is Iterative Deepening A*, a memory saving optimal algorithm very often used in problem solving.

   

diseņo tiendas online Madrid Pasteurizador Industrial fertilidad free resume templates curso adwords campaņas adwords

 

 

2nd of May, 2007 - Here's a simple software to scan Rubik's cube faces and recognize its colors correcly.

Now I miss only three steps to have the project finished:

this piece of code must be integrated into IDA* solver;

the solver must be able to exchange  data with NXT;

the solver algorithm needs to be optimized in terms of memory usage.

 

 

16th of May, 2007 - Lego Rubik Utopia project is done.

The LRU software v 3.0 now supports USB communication with NXT brick,

webcam capture and color recognition algorithm.

Also, the GUI has been emproved, making access to all functions easier.

 

The downloadable version of the software cannot work without the NXC program running on NXT. The whole project is not open source by now, hence the building instructions for the robot and the software code are not shared.

 

Give LRU a scrambled cube, press a single button and

you will have your cube solved in a flash!

 

 

     
   

 

Downloads:

 

Download Rubik's cube IDA* solver (580KB)

Download Rubik's cube scanner (256KB)

Download Lego Rubik Utopia software (532KB) - Fantom drivers needed!

Download Mindstorms NXT driver from Lego official site