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
In my mind that software
was only a small part of the
Lego Rubik Utopia
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
industrial robot made by
Kawasaki that can solve a Rubik's cube. Around
in the web, the robot is told to be able
a Rubik's cube in seconds: this is
it can FIND THE SOLUTION in seconds (like my LRU)
takes minutes to actually solve the cube!
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
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,
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
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
It uses 2 NXT
bricks (communicating via Bluetooth), 4 servomotors and 2 light
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.
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
such machines, but means:
" KEEP IT SIMPLE,
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.
motor actuates a prismatic joint that pushes the side of the cube
(the red side in the photo);
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!
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 ),
rotate faces with the Minicube buttons,
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
2nd of May, 2007 - Here's a simple software to scan Rubik's
cube faces and recognize its colors correcly.
miss only three steps to have the project finished:
piece of code must be integrated into IDA* solver;
solver must be able to exchange data with NXT;
solver algorithm needs to be optimized in terms of memory
16th of May, 2007 - Lego Rubik Utopia project is done.
software v 3.0 now supports USB communication with NXT brick,
capture and color recognition algorithm.
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.
a scrambled cube, press a single button and