I designed the machine in Bricklink Studio and built/programmed it over the course of three months in Summer 2022. I wanted to make a 6-axis robot but did not have time to add Lego colour sensors, so I used the webcam to take photos of the sides and a logistic regression model to analyze the cube state.
-
Webcam scanner to automatically detect the colours of cube given pictures of the sides, regardless of lighting conditions. After experimenting with neural networks and colour ranges, I trained a robust logistic regression on cubes in varying environments to identify the cube state (96% accuracy).
-
Kociemba algorithm to find the quickest solution, given a cube state. Average of 19 moves per solution.
-
Accurate-ish turning of the sides to excecute the solution. This was a challenge because turning over bluetooth instead of usb is way less accurate. There is also no official framework to control Mindstorms NXT from Python. I hot-glued a round brick to the center piece of the cube to enable turning.
My main inspiration was SquidCuber. I got help from:
- schodet's nxt python controller
- Wiston999's implementation of the Kociemba algorithm
- kkoomen's helper functions
- rutujapadgilwar06's webcam scanning grid
The Studio model can be found on Bricklink here.
I made a YouTube video.