Rubik's cube solver

HomeForumsMonoBrick EV3 FirmwareRubik's cube solver

This topic contains 20 replies, has 6 voices, and was last updated by Author Image Helmut Wunder 2 years, 1 month ago.

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #5018
    Author Image
    Jacek S
    Participant

    Hi,

    This is my implementation of the Cube Solver robot using MonoBrick.
    Based on the construction plan from http://mindcuber.com/ and Herbert Kociemba Two Phase solving algorithm.

    https://onedrive.live.com/redir?resid=D80891353BE56D44!3341&authkey=!ANthpij1gpwP7Xk&ithint=video%2cmov

    Jacek

    • This topic was modified 2 years, 12 months ago by Author Image Jacek S.
    #5020
    Author Image
    Anders Søborg
    Key Master

    Hi Jacek

    Very nice work… maybe you would be interested in sharing the code as part of our Git repository. Also is there a youtube video that I can embed on the firmware page?

    /Anders

    #5021
    Author Image
    Jacek S
    Participant

    Hi Anders,

    Sure, but is not ready yet. It needs some modifications and code cleaning. Also there are still problems with motor movement waithandle in the base repo. Now this working only with my modified firmware lib.
    Yes, I will prepare a better video to youtube.

    Jacek

    #5022
    Author Image
    Anders Søborg
    Key Master

    Great

    Please let me know how it goes…

    /Anders

    #5108
    Author Image
    Jacek S
    Participant
    #5113
    Author Image
    Anders Søborg
    Key Master

    Hi Jacek

    Merry christmas. This is awesome. I will post it right away. Could I maybe steel the code and place in our Git repository – just as an example?

    /Anders

    #5133
    Author Image
    Anders Søborg
    Key Master

    Hi Again

    Your video was shared on MindCubers Facebook page, MonoBrick’s twitter and Facebook page as well as the EV3 Fan Group Facebook page. Let’s see how it goes…

    /Anders

    #5149
    Author Image
    Jacek S
    Participant

    Hi,

    Thank you. Feel free to put the sources in the monobrick github.

    Jacek

    #5153
    Author Image
    Anders Søborg
    Key Master

    Hi Jacek

    Did you AOT compile your program? If not I think you will see a big improvement in speed if you do. Also I noticed that in your main loop you are using a button listener. This will poll for button changes every 50 ms which will load the CPU unnecessary. In the next release it will be possible to set this interval when creating the button listener so you might consider adding this.

    /Anders

    #5154
    Author Image
    Jacek S
    Participant

    Hi,

    I didn’t try AOT. Poll for button is not a part of the main loop, is only when the sensor is moved to the start position.
    The most performance issue is the binaryformatter and deserializing 4mb file (data for algorithm) that takes about 2-3 minutes then algorithm calculates solution within 3 seconds. Maybe the low class sd card is the problem?

    Jacek

    #5157
    Author Image
    Anders Søborg
    Key Master

    Hi Again

    Sorry if I was not clear enough on the poll thing. In your main program which looks like this:

    static class Program
        {
            static void Main(string[] args)
            {
                var terminateProgram = new ManualResetEvent(false);
                var cubeSolver = new CubeSolver();
                var buts = new ButtonEvents();
    
                buts.EscapePressed += () => terminateProgram.Set();
    
                Task.Factory.StartNew(cubeSolver.Run);
    
                terminateProgram.WaitOne();
                cubeSolver.Stop();
    
                //var solution = Search.solution(Tools.randomCube(), 26, false);
            }
        }

    you create a ButtonEvents() so you can terminate the program. This will create a thread that polls for changes very 50 ms – so if your program uses a lot of threads your program might end up spending time switching threads instead of doing actual calculations. Anyway you can have a look at what the ButtonEvent class does here, but when you described what you program is actually doing it does not sound like this is really an issue -:)

    /Anders

    #5161
    Author Image
    Jacek S
    Participant

    Hi Again,

    Oh, sorry for misunderstanding and thank you for info. I didn’t know that button is pooled every 50ms. (I never looked at this source code)

    Jacek

    #5456

    Hi guys,

    This is my first post here. I decided to post it after playing with Monobrick around for a while, it’s a great initiative and it made my life so much easier to program for it. @Anders, for that I thank you.

    @Jacek, I was inspired by your design and of other Lego robots that I’ve seen on youtube and decided to build my own implementation using only the components of the Education Core set and this is the result:

    Also, thanks for converting Kociemba’s algorithm to C#, it saved me a lot of time :) .

    I’ve decided to share my whole experience, as well as the blueprints and code, if anyone is interested:

    http://edusrandomstuff.blogspot.nl/

    Cheers,
    Edu

    #5482
    Author Image
    Anders Søborg
    Key Master

    Nice job… I will share it on facebook. Keep up the good work…

    /Anders

    #5487
    Author Image
    Helmut Wunder
    Participant

    I’m actually curious if there is already Cubesolver code running on the EV3 which performs Kociemba’s algorithm autonomously, without using lookup tables etc?
    E.g., is this what Jacek S’ code is doing?

    • This reply was modified 2 years, 1 month ago by Author Image Helmut Wunder.
Viewing 15 posts - 1 through 15 (of 21 total)

You must be logged in to reply to this topic.

Posted in

Make a donation