Rubik's Cube Solving Robot


For the cube solver, I just used DS3218 and HS311


@69developer I took a look at the LewanSoul LX-16A looks like it uses a proprietary bus controller, were you able to get EZB to talk to their bus controller (looks like the bus controller supports TX RX Serial connect so theoretically we should be able to connect via the UART port) or could you get the servos to work direct off EZB controller ( dynamixel compatible ?)

Edit: I ordered a starter pack (5 servo's and controllers) from Amazon for $110 Canadian (on it's $89 US) The servo's are $20 CDN each if you buy separately or in US ($14). I will report back with findings but if they work off EZB direct would be huge and would solve a lot of problems.


Those servos are not new here in the forum, the first time i spot them was this thread:

To avoid hijack Bob's thread (Cube) let's use the above thread for information related to the LewanSoul servo.

Today I'm in the Kitchen cooking (Thanksgiving) so limited computer access.


Testing Color Detection:

EZ-Builder Project:

Automatic Color Detection is not easy.

No servos are needed to run this project.

Feedback is welcome.

Soon I'll start again on the Rubik's cube (ROBOT).

I would like to thank:

1) Bob for the new Grippers , I damaged the initial ones.

2) A member of the forum for a generous donation : EZ-Robot Camera and 2 HDD Servos.

The above tests have been done with a Microsoft USB Camera, the next step is to test the new EZR Camera (I'll be more careful this time!)

Thanks for reading!


Are you using the multicolor rob or ycbr color detection? Try enabling histogram on those detections - that'll assist with lighting conditions and angles.

The good news is that the camera and cube would always be the same angle in the real version - unlike holding it with your hand at random angles. So lighting would be more consistent.


I am looking forward to seeing an Inmov solving the puzzle?


The detection is done for each square.

I'm using HSV colors:

User-inserted image

User-inserted image

Hue is 360/2 = 0..179 (byte)

1) detect red-orange-yellow: They are very close e.g. The distance between Orange and Red and Yellow is only 7.5 points.

2) White
There is no white on the wheel, so need to look for saturation and value too, that is the reason why Blue is being recognized as White.

3) Middle cube with the brand sticker.
Is not only a color issue but a contour issue too... What a pin in the neck.

I didn't tried combining the HSL model:
User-inserted image

Regarding the Angles:
Assuming 0 is the middle, i need to detect the perspective, the problem is left or right, i need to review the calculation, I'm using an average angle, but after a specific rotation (cube corners (TL-BR) swap direction) and the global perspective is affected.


The good news is that the camera and cube would always be the same angle in the real version - unlike holding it with your hand at random angles. So lighting would be more consistent.

Correct I'm trying the worst scenario.

Regarding the colors the problem is not finding 6 different colors the main problem is calling them a name.

I saw some internet rubik's cube videos, and they scan the 6 faces and the color clustering is done after, so is more easy to divide to color 1-6 (color distance) and present a BGR square color in the screen versus identifying the color.

I believe i'll handle both approaches:

A) Cube Robot: Color Distances (A-B-C-D-E-F) for solving.

B) Free movements, Color Recognition. If i can't find an automatic model, the user will need to adjust the intervals.

This is like magic... If you solve the cube without naming the colors, you have the idea the Robot recognizes identifies the color.



The Inmoov project is almost a lifetime project, I still have some questions:
1) Finger control & usability
2) Legs are for walking ?


I know this is a challenging project. Way over my head if I had tried to conceive it. However I looked at your coding to try to learn something. You make it look so easy. What a wonderful process. Smile



Thanks for the words.

The idea is to make others challenges more EZ Smile

I believe your are talking about the EZ-script:


SayWait("I see ")

if ($cell=1)
$color = "Blue"
ElseIf ($cell=2)
$color = "Red"
ElseIf ($cell=3)
$color = "Orange"
ElseIf ($cell=4)
ElseIf ($cell=5)
ElseIf ($cell=6)


i used the KISS principle ( Smile

The $CubeVisionSequenceCounter is incremented every time a complete different sequence is found.

So the idea is to monitor that variable and do something after.

I couldn't find a blocky equivalent for WaitForChange