Cube Arms
Two robot hands and a camera solve a Rubik's cube. The robot does not know the cube: it shows every side to the camera, works out the colours from the picture, plans the turns, and then one hand holds while the other turns. What you see is the digital twin of a machine you can build: the printed parts, servos, boards and cables are the real ones.
What the camera sees
The nine squares are where it measures the colour.
What the robot knows
The cube unfolded. Grey: not seen yet.
The plan
How it works
- Look. The camera on the right only ever sees one side. The hands pick the cube up and turn it until all six sides have faced the camera. For each picture the robot averages the colour in nine squares.
- Recognise. It never uses fixed colour values. The six centre squares tell it what "red" or "orange" look like in this light, and every other square gets the colour of the centre it resembles most. One fact about the cube helps: every colour exists exactly nine times, so the surest matches are fixed first. If the result still cannot be a real cube (say, a corner piece that does not exist), it looks again. Turn up "Bad light and noise" to see that happen: the light then changes from picture to picture.
- Plan. A two-phase search (Kociemba's method) finds solutions of about 20 turns in a fraction of a second (no cube needs more than 20; a beginner's method needs over 100). It keeps several and takes the one these two hands finish soonest, because a turn on the top or left is quick while the bottom or back needs the whole cube turned first. Letters name the side to turn clockwise: U up, D down, L left, R right, F front, B back; ' means anticlockwise, 2 a half turn.
- Turn. The left hand can turn the left layer, the top hand the top layer. To turn a layer, the other hand reaches across and clamps the other two layers. For any other side, one arm lets go and the other turns the whole cube until that side is on top or on the left.
- Grippers. The finger pads sit off-centre so the two hands never clamp the same squares. A hand that has turned must let go, pull back and straighten its wrist before it can grip again, which is why there are many more hand movements than cube turns.
What is simplified: the servos follow their commands exactly (no play, no motor errors), nothing can slip, and the cube turns without friction. The camera picture is real: it is rendered from the camera's position and the robot only gets those pixels. The speeds are those of the real servos.
The machine
- Two hands on rails. Each hand slides straight towards the cube on a printed rail (a servo with a pinion on a toothed rack), turns its wrist, and opens and closes two fingers with a second small rack. The left hand comes from the left, the top hand from above; both rails stand behind the cube.
- Seven identical servos. Three per hand and one for the stand that drops away under the cube. They are serial bus servos: one cable runs from servo to servo, and each reports its real position and load.
- A Raspberry Pi 5 with a Camera Module 3 does the thinking; one USB adapter drives the servo bus.
- Cables are held by clips on the board and by cable ties at the slots in the parts. Three of them move: the loop to each sliding carriage and the short one that winds round each wrist.
Build instructions · All printable parts (STL and STEP, zip) · every part can also be opened on its own below.