RuCuS - Autonomous Rubik's Cube Solving Robot using NI Hardware and Software Products

breezebongΤεχνίτη Νοημοσύνη και Ρομποτική

6 Νοε 2013 (πριν από 3 χρόνια και 9 μήνες)

76 εμφανίσεις

RuCuS
-

Autonomous Rubik's Cube Solving Robot using NI
Hardware and Software Products


b
y


Christian
V.
Madritsch

Electronic

and Equipment Engineering

Carinthia
University of Applied Sciences

Austria


A
ndreas

Bachinger,
G
erald

Stanje,
D
ominik

Kropiunik,
C
h
ristian

Cemernjak,
S
tefan

Lanschützer

Students of Electronic Engineering

Carinthia
University of Applied Sciences

Austria


Dr. Thomas Klinger

Head of School

Carinthia

University of Applied Sciences

Austria


Category:

Control


Products Used:

NI LabVIEW™ 7.1, NI Vision Builder AI™ 2.0, NI Vision Assistant™ 7.1, NI Vision Development Module™ 7.1,
NI Compact Vision System™ 145
5
, NI
cRIO
-
9004
,
NI cRio
-
9474
,
NI cRio
-
9263
,
NI cRio
-
9215
,
NI cRio
-
9411


The Challenge:

To develop an autonomous robotic s
ystem which automatically detects the state of a Rubik's Cube, computes, using
a known solving algorithm, the necessary movements to solve the cube, and finally controls the robotic system to
solve the Rubik's Cube.


The Solution:

Using NI hardware and sof
tware products in all phases of system design and implementation: Vision Assistant,
Vision Builder AI, and Compact Vision
System

to develop the image processing and analysis methods, LabVIEW
and the Real
-
Time I/O Module to develop the solving
algorithm

and

to perform the robot control.


Abstract

A group of five electronic

engineering

students decided to design and develop a challenging autonomous Rubik's
Cube Solving Robot
-

RuCuS. The objective was to design a system

which is able to automatically detect t
he
scrambled state of a Rubik's Cube using image processing and analysis methods. The state information is used as an
input for the computation of the solving algorithm. The output of the solving algorithm is a list of necessary
movements to bring the cube

into its initial ordered state
. Finally, three grippers are

be
ing

contr
olled to carry out
the
comput
ed movements
.


Introduction


The Rubik'
s Cube, invented by Erno Rubik in 1974, is the best selling toy puzzle in history. In
a
Rubik's Cube,
twenty
-
six ind
ividual little c
ubes or cubies make up the big c
ube. Each layer of nine cubies can twist and the layers
can overlap. Any three squares in a row, except diagonally, can join a new layer.

A Rubik's Cube can have about 43
quintillion (a one with 18 zeros) dif
ferent positions. Despite the vast number of
possible
positions, all cubes can be
solved in 29 moves or fewer.


The autonomous Rubik
'
s Cube Solving Robot (RuCuS) consists of three main subsystems: image processing and
analysis, solving
-
algorithm
computatio
n
, and the robot control. The purpose of the image processing and analysis
subsystem is to detect t
he scrambled state of the Rubik
'
s Cube. The cube can be placed

into the system

in any valid
scrambled state; the image analysis detects the position of all c
ubies and their corresponding colors. The output of
the image analysis is a string containing the color information of all 54 color planes
using

the format:
RGGRWRWY…;

eac
h letter corresponds to a color;

the position of the letters corresponds to the posit
ion on the
cube.

This
information

is sent to the solving
-
algorithm
computation

subsystem. This subsystem use
s an existing
solving algorithm

and the input color string to compute a list of movements which will transform the cube into the
solved state.

Those

movements are performed by the robot control subsystem using three independent grippers.


Figure 1 shows an overview of

the complete system including information about the
communication
. The image
processing and analysis is realized using a Sony DFW
-
VL500

digital camera with FireWire
-
interface and the NI
Compact Vision System CVS145
5
. The output
string

is sent via Ethernet to the NI
c
RIO
-
9004

module. There
,

the
solving
-
algorithm subsystem and the robot control subsystem are being executed. After the solvin
g
-
algorithm
computed the necessary movements
,

this information is passed to the robot control. The robot control interconnects
to the hardware using digital and analog
I/O

lines.




Figure 1: Overview of

the Autonomous RuCuS System


The system development

was done using a PC with LabVIEW and the image processing tools (IMA
Q Vision, Vision
Builder, etc.).

A
fter the prototyping phase was completed, the developed software components were migrated onto
the target platforms CVS and cRIO.


Image Processing and A
nalysis


The purpose of the image processing and analysis is to detect the scrambled state of the cube. Therefore, three of the
six
sides

of the cube need to be analyzed. The remaining three
sides

can be calculated. This color information is
passed to the
solving algorithm.


The hardware setup for the image processing and analysis consists of a Sony DFW
-
VL500 digital camera with
FireWire interface.
The illumination of the system is realized using LED
-
rows of different colors. During
development, NI Vision
Builder and Vision Assistant have been used. Different processing and analysi
s methods
have been tried out. The final version comprises

of only a Color Threshold in combination with a Count Pixel
function. The color threshold is set to one of the six possi
ble colors (blue, white, red, orange, yellow,
and
green).
Using the count pixel method, each cubie is analy
zed

if

at least 50 pixels of the checked area are of the selected color

(see Figure 2)
.




Figure 2:
Screenshot of the Analyze Cube Functionality


I
f this is the case, the color of the cubie is detected
;

if not, the whole process is repeated using a different color
threshold.

The output of the image analysis is a string containing the color information of all color planes
.

This
information is sent to
the solving
-
algorithm subsystem

using Ethernet
.


Comput
ation

of the Rubik'
s Cube Solving Algorithm


The solving subsystem uses the
Two
-
phase algorithm

which

performs an iterative search on a unary tree using
additional heuristical information. The memor
y
consumption is less than 20MB

and the average computed solution
length is about 20

moves
. Using the cRIO
-
9004 system as target platform, the calculation of the list of necessary
moveme
nts usually does not take

more than a few

seconds.
The calculated list c
onsists of rotation operations by 90
-

or 180
-
degrees for e
ach side of the cube (e.g. R, L'
, F
2

means: rotate left side by 90
-
degrees clockwise, rotate left
side by 90
-
degrees counterclockwise, rotate front side by 180
-
degrees).
The results of the solving a
lgorithm are
passed to the robot control subsystem.


Robot Control using NI
c
RIO Hardware


The robot control subsystem consists of three

independent grippers with

two degrees of freedom each. The grippers
can be opene
d, closed, and turned around their

main

axi
s using two DC
-
motors. During cube movement
,

usually two
grippers hold the cube and the third gripper performs
the

rotation operation.

All mechanical components have been
manufactured in house usin
g a 3D
-
plotter based on plastic

strings
.


The DC
-
motor

boosters and the sensors are connected to the I/O
-
modules of the cRIO system. Furthermore, a simple
user interface is realized using start/stop buttons and a LCD
-
display to output status information.

During robot
control, the list of movements from the so
lving algorithm is transformed into indivi
dual movements of each gripper.
After all movements have bee
n carried out, the solved Rubik'
s Cu
be can removed from the system.


Conclusion


The RuCuS student project is an ideal example of problem bas
ed learning. Different concepts

like image processing
and analysis, comput
ation
-
intensive search algorithms, and robot control could be combined into one system. The
attending students have become experts
in
using hardware and software components from NI
.