Rubik’s cube! One of the most fascinating and challenging puzzles for man and machine. Many have come up with an easy and fast solution to this. Rubik's Cube Solving Robot is a robotic system that solves a Rubik's Cube puzzle autonomously. This robot aims to solve the cube in the fastest way possible.
Materials Used:
- Stepper motors
- Stepper motor drivers
- ESP8266
- Webcam
- PC
- Rubik’s Cube
- 3D printed frame
Electronics:
Stepper Motor interface with ESP8266
Stepper Motor is a Brushless DC Motor. Stepper motor receives control signals to rotate it in steps. Since the stepper motors require high current which cannot be handled by a microcontroller or a microprocessor, the motors are wired to stepper motor drivers. All the 6 stepper motor drivers are then connected to ESP8266. We used A4988 is a bipolar stepper motor driver.
- Connect the Vmot and GND pins of A4988 motor driver across a battery.
- Connect the stepper motor to 1A, 1B, 2A, and 2B pins of A4988 stepper motor driver.
- Connect the STEP pin and DIR pin of A4988 stepper motor driver to the digital pins of ESP8266
- Interconnect the RESET and SLEEP pins of the A4988 stepper motor driver.
Mechanism and Algorithm:
Mechanism
Firstly, using a webcam, the image of each face of the cube is taken in a specific order. Using OpenCV, colour sequences of each face is identified from the image. With God's algorithm, the quickest solution to solve the cube is determined by using the same. The output is a series of moves to resolve the cube. This output is converted into a set of instructions for the six stepper motors interacting with the Rubik's Cube. Each stepper motor is controlled by stepper motor drivers. The sequence of moves produced to solve the cube is executed by driving the stepper motors.
God's Algorithm
God's algorithm is a concept that arose from discussions of how to solve Rubik's cube, but it can also be extended to other mathematical puzzles and games. It refers to an algorithm, which generates a solution with the least possible number of moves. The maximum number of moves it takes to solve a Rubik's Cube is 20 which is also known as God's Number.
Working Video:
Assembling:
- Fix the 6 stepper motor in the 3D printed frame.
- Construct the stepper motor interface with ESP.
- Connect the ESP to the PC.
- Connect a webcam to the PC.
- After taking the images with webcam, place the Rubik’s cube within the framework.