Introduction: CUBOTino Pocket: Optimal Solver Robot for Rubik's Cube 2x2x2

About: I born in Italy in 1971, and since few years I live with my family in The Netherlands. On free time I like to build "useless devices", a pretest to learn coding and control theory

Yet another Rubik's cube solver robot: "CUBOTino Pocket".

This version works with a 2x2x2 Rubik's cube, also called Pocket, and it delivers the optimal solution (minimum quantity of moves).

The robot is very small, rather simple, fully 3D printed, and it works autonomously.

It takes around 45 seconds to scan and solve a scrambled cube: Not a fast robot, as the targets are simplicity and cost effectiveness.

Main characteristics are

  • The robot is fully autonomous.
  • It works with a 2x2x2 Rubik's cube (side ~50mm).
  • Kociemba solver is used, to get THE optimal solution.
  • PiCamera and Raspberry Pi Zero2W (or ZeroW) is used for the computer vision part.
  • All coded in Python.
  • Display to feedback on the robot action and solving progress.
  • Solving time is tipically 45 seconds; 20s are needed for the cube status detection, and 25s to solve the cube. This timing once the robot is optimized, as per posted movies.
  • The robot can be slowed down, for demonstartion purpose (it sounds ridiculus, yet it's true).
  • After physically solving the cube, the robot shows the solving animation on the display.
  • The robot has a Virtual Solver, useful to virtually test random generated cube's status. This has been usefull to verify the robot solver effectiveness, after further reductions of the robot movements.
  • The Virtual Solver is also called by a function testing all the 3'674'160 permutations a 2x2x2 Rubik's cube has; Despite no graphical feedback, testing all the permutations takes a couple of days.

The name of this robot is CUBOTino: Apart from the obvious CUbe+roBOT, "ino" is the italian suffix standing for small..... a "small" touch recalling my origins and the very small robot dimensions.


This robot is part of the CUBOTino series, and it shares most of the concepts and parts. Other CUBOTino versions:

1) The "Base version", characterized by lower costs and lower complexity (it uses the PC webcam), is available at: https://www.instructables.com/CUBOTino-a-Small-Simple-3D-Printed-Inexpensive-Rub/ .

2) The "Autonomous version", fully autonomous (with many replicates around the World), is available at: https://www.instructables.com/CUBOTino-Autonomous-Small-3D-Printed-Rubiks-Cube-R/ .

3) The "Micro version", fully autonomous yet using a smaller Rubik's cube (30mm), is available at: https://www.instructables.com/CUBOTtino-Micro-the-Worlds-Smallest-Rubiks-Cube-So/ .


Tip: At Step2 of these Instructables it is embedded a pdf file "How_to_build_ ..._yyyymmdd.pdf", of about 160 pages, containing all the needed details to build, program, tune, troubbleshoot the robot.

Credits to:

  • Mr. Kociemba, for his optimal solver, and the python version he has made available to the comunity.
  • Yheneaul for simplifying the installation, Vanblok for designing the PCB, Denis for improving the instructions.
  • All of you who have provided feedback, making possible to improve the project.

Supplies

The material cost has been about 100 Euro; The more expensive parts are of the project are:

  • Raspberry Pi Zero2WH (likely, the Raspberry Pi Zero2W shortage seems now solved.).
  • microSD card 16Gb Class10.
  • Picamera (V1.3).
  • Flex cable (PiCamera - Raspberry Pi Zero).
  • Two servos ( TD-8325MG, 180deg 25Kg metal, with metal arm “25T” ).
  • Display (1.77" TFT, SPI).
  • ca 500 grams of filament.
  • 3W led, with integrated driver.
  • Capcitive touch sensor.
  • Step-down Voltage regulator.
  • USB-C breakout board.
  • 2x2x2 Rubik's cube (side ~50mm).

Some little electronic components (prototype board, capacitors, connectors, etc), and screws.

For the power it is needed 1x3A power supply with USB-C connector (official Raspberry Pi is recommended).

In the instructions are listed possible servos alternatives.

On the annex Components_list.pdf file the detailed list, included the link to the shops I've used ... and related cost.

Step 1: Info and Advise

Despite this little robot looks simple, and for some aspects it really is, there still is some complexity.

Be prepared the robot won't magically work right after assembling it: Tuning is needed!

If you haven't built other "robots" before, i'd recommend you to start with the Base version, that has lower complexity.

Step 2: Read First (embedded Pdf Instructions File)

The below annex "How_to_make_ ...._yyyymmdd.pdf" file provides detailed info on how to build the robot, further than many other aspects.

The document has about 150 pages, providing detailed guidance to build the robot, and side informations (a bit of knowledge sharing).

I advise to read the document, in case you're interested to make this project.

My second advise is to read the document a second time :-) .


This document will be periodically updated (filename ends with yyyymmdd), in particular during the first weeks; Please report eventual errors, unclear parts, tips, etc.

Step 3: Make the Connection Board

The connections board connects all the devices (servos, display, touch button and led breakout board) to the Raspberry Pi.

It is not complex, but it requires more time and attention compared to the one for the Cubotino Base version; In case of mistakes, it will be difficult to de-solder the 2x20 header, perhaps better to buy few spares in advance.

The board is made out of a prototype board (two sides), mainly by connecting different connectors and few capacitors.

Better to use insulated wire, when crossing other lines, even if these are located on the other board side.

Differently, it is possible to order the pcb, therefore limiting the effort and possible mistakes; Purchasing the components and soldering still need to be done.

Gerber files made available by Chad; V1.6 version is stored at GitHub: https://github.com/AndreaFavero71/cubotino/tree/main/connections_board/gerber.

Additional info at "How_to_make_ .... .pdf" doc, also on how to download the Gerber files from GitHub.

Step 4: Setting Up Raspberri Pi

All the relevant files and settings are store in a GitHub repository: https://github.com/AndreaFavero71/cubotino_pocket.

Follows the few instructions that are provided on the home page of that repository.

All tyhe steps are also detailed in the "How_to_make_ .... .pdf" doc.

Step 5: Set the Servos Angle for Correct Assembly

Set both the servos to the mid angle; This can be done via below steps:

  1. connect the servos to the Connections_board.
  2. enter the robot code folder, by typing 'cd cubotino_pocket/src' from the root.
  3. activate the virtual environment, by typing 'source .virtualenvs/bin/activate'.
  4. set the servos to the mid angle, by typing 'python Cubotino_P_servos.py --set 0'.

On the servo for the Top_cover: Connect the T25 arm oriented as per picture.

This also is a good moment to verify if the rotation range of the received servos, as well as the Pulse Width, are as expected.


More info in the annex "How_to_make_ .... .pdf".

Step 6: 3D Prints

There are a total of 13 parts to be 3D printed, for about 400 grams (when PETG is used).

All parts have been designed to be printed:

  • on printers with at least 200x200mm printing plate.
  • without supporting the overhangs.

Note: Parts with "2x2x2" is the name are specific for this CUBOTino Pocket version. The other parts are the same of Autonomous and base versions.

In case you'd like to modify the parts/project, the step files at stored at GitHub: https://github.com/AndreaFavero71/cubotino_pocket/tree/main/stp


More info, like the suggested print orientation, in the annex "How_to_make_ .... .pdf".

Step 7: Assemble the Robot

All parts are connected by screws.

Some little hot glue to keep the touch button in position.

Add four self-adhesive rubber feet underneath the base.

In the annex "How_to_make_ .... .pdf", the assembly steps and details are provided.

Step 8: Tune the Robot

As mentioned above, be prepared the robot won't magically work right after assembling it.

A graphic user interface (GUI) makes the servos tuning process more intuitive; Image cropping and warping can be tuned by same GUI.


In the annex "How_to_make_ .... .pdf", you'll find listed the foreseen parameters

Step 9: Enjoy Your Built

Enjoy your build, and inspire jouth :-)

Step 10: Provide Feedback

If you've enjoyed the project and/or you've suggestions, please feedback

Anything Goes Contest

Participated in the
Anything Goes Contest