Skip to content

Final Project

For my final project, I would like to build a Rubik's cube solver, which would take the cube into its rotational arms, proceed to inspection and solve it at last.

The cube inspection would work as follows: there will be a color sensor pointing at one place, and the arms will take all cube pieces and display them to the color sensor. After the inspection, the solve begins.

The main goal is to have a functional solver. Bonus would be if the machine solves the cube on average quicker than me (ten seconds would be optimal).


Design Concept

V1

V2

This design was inspired by aaedmusa, who builds random awesome stuff. He also built a second version using brushless dc motors, which is much faster.

V2 result

What needs to be done

  • The cube is solved, but there is a lot of trying to calibrate the steppers. The cube needs to be either manually or automatically calibrated to fit the cube precisely.
  • The manual Rubik's cube definition takes too long. The next step would be to add a camera and auto scan the cube.
  • The solving is dependent on the solver API. It would be nice to have a self-sustained system without the need of network access. Probably Raspberry Pi is a good fit for this task.

Stepper calibration

I implemented magnetic encoders for each stepper motor. Before the solve begins, it calibrates the cube, so it starts from aligned position. Moreover, each turn is self-checked, meaning that the turn ends only when the rotation reaches desired angle. Steppers miss steps quite often in this build. It is due to their low torque and imperfect cube alignment after each turn. The speed of the steppers is fine-tuned so even if the stepper misses some steps, it is still faster than ever before.

Solving algorithm

For the solving algorithm I used Two-Phase algorithm. I call the library with 100 ms time limit, but if it finds solution in 20 moves or less, it can end faster than that.

Results

The robot can solve the cube on average under two seconds.

The speed depends on several factors:

  • Many double moves e.g. U2 R2 etc.
  • Raspberry Pi does not calculate solution efficient enough
  • Cube is not aligned well

Slow motion

Solve with jam

Full solve

Conclusion

The main goal was to have functional solver. Ideally a sub-10 seconds solver. The solver I built solves the cube on average under 2 seconds, and with the magnetic encoders it finishes every time.