Build your own LEGO® Education SPIKE™ Prime robot to solve the Rubik's Cube®...
PrimeCuber is a robot that can be built from a single LEGO Education SPIKE Prime set (45678) to solve the well known Rubik's Cube puzzle.
All PrimeCuber software releases should work with LEGO Education SPIKE Prime firmware versions from Hub OS: 1.1.134 onwards. It is recommended that the Prime firmware is always updated to the latest version released from LEGO.
Construct the robot by carefully following the build instructions and then download and install the software described below.
PrimeCuber software consists of three components of which the third is optional and can be omitted or downloaded later:
A python project, PCSolver-v1p1, that contains two python modules and a data file:
Executing this program on the Spike hub will install the modules and data. After this, the PCSolver-v1p1 program may be overwritten or removed from the hub.
The main python program, PrimeCuber_v1p1, that uses the modules and data file installed by PCSolver_v1p1 to control the PrimeCuber mechanism and solve the Rubik's Cube. This program can be downloaded to any of the slots on the SPIKE hub and used to solve the puzzle at any time.
With these two components, PrimeCuber will solve the Rubik's Cube in an average of about 42 moves.
There is a third python project, PCMTab4-v1p1, that contains a large data file:
NOTE: This program takes a long time (around 30 minutes) to download and run on the SPIKE hub so please be patient and do not interrupt the process. It only needs to be run once to install the large lookup tables on the hub.
Once installed, PrimeCuber will then solve the Rubik's Cube more quickly in an average of about 31 moves.
Download the file to your computer:
Extract the files from this archive.
On a computer running Windows, find the file in Windows Explorer, click with the right mouse button and select Extract all...
This creates a folder, PrimeCuber-v1p1, containing:
Start the LEGO Education SPIKE Prime software and select the File menu then Open File.
Find the PCSolver-v1p1.llsp project file and Open it.
Connect to the SPIKE hub using either a USB cable or via bluetooth.
Expand the Console to see progress information about the software installation during the next step.
Download and Run the PCSolver-v1p1 program in an unused slot on the SPIKE hub.
The hub LED display shows progress:
And the console shows download information:
This installs primecuber_v1p1.py, pcsolver_v1p1.py and pcsolver_v1p1 on the hub for use by the main program.
The slot used to download and run the PCSolver-v1p1 may now be re-used for other programs.
Select the File menu then Open File as step 3. Then find the PrimeCuber-v1p1.llsp project file and Open it.
Download and Run the PrimeCuber-v1p1 program in an unused slot on the SPIKE hub. This can be the same slot as used in the previous steps to download and run the PCSolver-v1p1 program.
PrimeCuber is now ready to solve a Rubik's Cube!
Run the PrimeCuber program if it is not already running, using the buttons
on the SPIKE Prime hub. Press the right button to select the slot number
to which the program was downloaded. Then press the center button to
run the program.
Gently use your finger to rotate
the turntable in each direction to determine if it is aligned. It moves
slightly because of "play" in the gears connecting it to the motor.
There should be an equal amount of movement in each direction.
If necessary, use the left and right buttons on the hub to
adjust the position of the motor position. Each press nudges the motor by
a small angle.
Insert a scrambled Rubik's Cube into the turntable tray and
PrimeCuber will start to scan and solve the cube.
PrimeCuber may scan the cube up to three times if it is unable to determine the colors at first. If the scanned colors do not result in a valid pattern, PrimeCuber will stop after the third attempt and display ????????? If this happens, there may be a number of possible causes. See the troubleshooting section.
Please post a comment or message on the MindCuber Facebook page for help.
Like MindCuber on Facebook to share your experiences and help each other with troubleshooting.