Autocube — FPGA Rubik’s Cube solver
Autocube solves a Rubik’s Cube on a DE2-115 FPGA. A finite-state controller identifies edges and corners in a 48-sticker representation, then selects move sequences for successive layer checkpoints. A separate motor controller translates those relative turns into physical face and direction commands for six stepper motors.
Watch on YouTube ↗DE2-115 FPGA
The board stores the cube state and advances through the layer-by-layer solving controller.
Motor interface
A queued face-and-direction command drives motor enable, direction, and step signals.
Six-motor cube fixture
Each motor turns one cube face. The hardware demonstration shows the controller and mechanism operating together.
Cube-state datapath
The cube is represented by 48 three-bit sticker values; face centers remain fixed. The state-update unit applies move combinations and returns the next state to the solving controller. The supplied top-level design initializes this path from a preset cube state.
Layer-by-layer solving
The algorithm controller advances through layer checkpoints and emits face-relative move combinations. Each checkpoint has its own substate and counter sequence; completion handshakes coordinate state updates and move translation.
Move translation and buffering
Face-relative operations are translated into physical motor commands. A 256-entry queue stores four-bit words: one direction bit and three motor-selection bits. The queue separates solution construction from mechanical execution.
System sequencing
The top controller sequences initialization, solution construction, idle, rotation, and completion. Solver and motor-queue completion determine when the design can advance to physical playback.
Motor sequencing
The driver consumes queued commands and generates direction and step outputs in the 2 kHz clock domain. Its internal states control pulse generation, inter-move sequencing, and completion.
Six-motor selection
The enable controller decodes the selected face into the motor-enable outputs. Direction and step pulses are shared with the selected motor driver.
Color acquisition
Two I²C sensor paths acquire corner and edge colors. Separate setup and read controllers sequence bus transactions before the classified colors are handed to the sticker assembler.
Sticker assembly
The state-preparation controller places acquired colors into the cube representation in scan order. This acquisition path is shown separately because the supplied top-level solver uses its preset initial state.