Загрузка страницы

LEGO Robot Inventor 51515 Rubik's Cube Solver

A Rubik's cube solver based on the great design by David Gilday (mindcuber.com). Thank you David!

My son (10) has done the mechanical part by using PrimeCuber instructions and (only!) the Robot Inventor 51515 parts. I am more than satisfied with the results. :)

The Python code is copied from the LEGO SPIKE app to the Mindstorms app. I have installed the LEGO Education SPIKE app, opened PrimeCuber projects (without connecting the hub) and C&P-ed the code to empty Python projects in Mindstorms app.
The main code worked with the Mindstorms FW but the parameters for the scanning arm had to be changed as the design is quite different than the original (the part 6302830 rack 13M is missing in the 51515 set). The large solving table could not be loaded for some reason, but I have not investigated as it is optional, and the solving is fast enough without it).

The hub was not updated with Spike Prime FW and only the Mindstorms app was used. The code used in PrimeCuber is using "hub" library and not the "PrimeHub" library. It worked, but a few times a message popped-up in the Mindstorms app that the hub FW should be updated which maybe could be connected with the way David is loading the program into the hub.

If you know where to find the reference for the "hub" library or the Mindstorms "MSHub" library, please let me now. If you need more information about the design, also let me know.

As requested, here is some addtional info.

There are no assembly instructions (other than the original PrimeCuber instructions) but maybe a photo album could help someone: photos.app.goo.gl/BWX9FABtCkdACyXWA

I am not sure if I am allowed to share the David Gilday's code (please check at mindcuber.com), but the only changes are in the "PCSolver-v1p4" module. Here is the changed part (in the ScanFace function):

#### # MD: middle: was +485
#### self.run_to(self.motor_scan, self.motor_scan_base+195, 100)
#### self.ScanRGB(f, 8)
#### self.motor_tilt.brake()
#### if self.slower:
#### self.slower = False
#### self.scan_speed -= 1
#### # MD: decommented:
#### print("Scan speed "+str(self.scan_speed))
#### self.run_nw(self.motor_turn, self.motor_turn_base+self.turn_ratio*360, self.scan_speed)
#### for i in range(4):
#### # MD: corner: was 300
#### self.ScanPiece(145, f, o, i)
#### # MD: side: was 365
#### self.ScanPiece(165, f, o+1, i+4)
Also, in the video, the motors and sensors are connected into different ports. No need for this change if the original PrimeCuber instructions are followed.:
####class primecuber():
...
#### self.sensor_color = self.check_port(hub.port.B, False, [61], 4, 0)
#### self.sensor_dist= self.check_port(hub.port.C, False, [62], 0, 2)
#### self.motor_scan= self.check_port(hub.port.D, True,[48, 75], 4, 2)
#### self.motor_turn= self.check_port(hub.port.F, True,[48, 75], 4, 4)
#### self.motor_tilt= self.check_port(hub.port.E, True,[48, 75], 0, 4)
After the solving program is started, a pixel will be lighted near by the offending port if the expected motor/sensor is not found.
Finally, at the beginning of the same module (at the line 54), the following code was inserted so the program would be reinstalled in the hub even if it already exists:

# MD: force reinstallation
installed = False
After the solving program is started, the left/right buttons on the hub can be used to correct the cube cradle position - before a cube is inserted.
I hope this helps. Please let me know in the comments if you build it and it works! :)

Update: David Gilday (the MindCuber designer) has mentioned in the comments that he is working on a new version built for the 51515 set and using all 4 motors (!).
Update 2: Some additional info in the description. Also, I have created a GitHub repository with Mindstorms project files: github.com/mycropht/PrimeCuber-for-Mindstorms-51515

Видео LEGO Robot Inventor 51515 Rubik's Cube Solver канала Mladen D.
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
26 декабря 2020 г. 19:04:42
00:02:39
Яндекс.Метрика