Как собрать кубик рубик из лего

Обновлено: 28.03.2024

Швейцарец – программист по имени Ханс Андерссон купил набор конструктора Лего, для своих двух дочерей, и сам увлёкся этим конструктором. Из конструктора он сделал робота, который собирает Кубик Рубика!

Tilted Twister (так был назван робот) решает кубик Рубика полностью автоматически. Ультразвуковой датчик сканирует кубик и определяет его цвета. Затем она вычисляет последовательность вращений для решения и выполняет повороты кубика.

А вот видео, демонстрирующее работу робота.

Как вам? Помоему круто!
Теперь о грустном:
Набор LEGO MINDSTORMS стоит около 15000 рублей.

А вот ещё одно видео. Робот тоже сделан из конструктора лего.

Вы умеете собирать кубик Рубика? Я практически нет. В детстве я мог собрать только пирамидку, а кубик просто раздирал на запчасти и собирал заново, после чего он стремительно разбалтывался. В прошлом году я съездил на сигграф и там на одном из выставочных стендов раздавали (ужасные по качеству, но зато с рекламой) кубики, после чего конференция для меня была практически потеряна, зато двенадцать часов в самолёте прошли незаметно.

Собирать кубик, подглядывая в уже готовые алгоритмы, мне было неинтересно, поэтому я его собрал пока что только один раз, это у меня заняло примерно полгода и приличную стопку исписанной бумаги. Между делом мне на глаза попался проект MindCub3r. Его автор даёт чертежи и ПО для роботов-сборщиков кубика из LEGO, причём эти чертежи есть для всех возможных комплектов, начиная от первого NXT и заканчивая EV3.


Эти роботы крайне хороши, я восхищён тем, их автор David Gilday использует для непосредственно сборки кубика только два сервомотора и ещё один для сканера. Надо учитывать, что стандартные наборы LEGO довольно скудны, и то, что такого робота можно собрать из одной коробки — это немалое достижение. Работает оно просто, сначала кубик сканируется: его датчик ставится напротив каждой этикетки кубика, затем софт решает кубик, выдавая цепочку необходимых вращений, которая потом и исполняется механически.

Решил я повторить этого робота, для начала мне просто хотелось получать собранный кубик, а задача максимум — это задать роботу нужную мне конфигурацию (не обязательно собранный кубик) и получить её на физическом кубике. Это мне позволит получить своего рода сейв, когда я буду собирать кубик вручную, и я смогу к нему вернуться в любой момент (вы помните, что я не хочу смотреть в готовые алгоритмы сборки, мне интересно научиться собирать самому?) На данный момент я записываю все ходы на бумаге, чтобы иметь возможность откатиться, и мне это порядком надоело.

Итак, собрал я хардварную часть робота, сборочные чертежи великолепны. Скачал софт, загрузил, с трепетом поставил кубик на платформу и жестоко обломался. Оказывается, этому роботу необходим официальный кубик Рубика, а я купил тот, что используется для спидкубинга. У него другие цвета граней (например, нет белого), и робот надорвался, не сумел его сосканировать. Хорошо, сказал я, поскрёб по сусекам, нашёл официальный кубик, правда, возрастом под два десятка лет. С его затёртыми и залапанными наклейками робот тоже работать не захотел.



Итак, постановка задачи: написать весь софт под существующий хард MindCub3r EV3, для начала софт должен просто собирать кубик. Минимизировать количество ходов в сборке меня не интересует, мне нужен как можно более простой код. Эта статья говорит только про то, как решать кубик, в следующей я опишу сканирование и управление сервами. В среднем решение получается длиной слегка за сто ходов.

Использованный метод

В мире огромное количество алгоритмов, наверное, самым правильным было бы запрограммировать вот этот. Но это надо думать, изобретать эвристики для A* с итеративным заглублением, а я ленивый. Кроме того, это надо думать, как его использовать, чтобы получить заданную конфигурацию, а я ленивый. Поэтому я буду пользоваться самым тупым и прямым методом: при помощи Cube Explorer записываем все последовательности поворотов, которые позволяют собрать

  • нижнее переднее ребро
  • нижний правый передний угол
  • переднее правое ребро
  • верхний правый передний угол
  • верхнее переднее ребро

Затем код будет выглядеть следующим образом:

В этой статье я описываю отдельностоящую программу, которая собирает кубик в командной строке. Как обычно, весь код я публикую на гитхабе. Примеры случайных конфигураций кубика можно брать здесь, там же и валидатор нашего решения.

Структура данных


Грани кубика назовём стандартно: F — передняя, R — правая, B — задняя, L — левая, U — верхняя, D — нижняя. Вот стандартные вращения:

Каждое ребро имеет две прилегающих грани, каждый угол имеет три прилегающих грани. Для представления кубика я использую два массива из двенадцати (по числу рёбер) и восьми (по числу углов) целых чисел. Итак, вот массив индексов:


Здесь красным даны индексы граней, синим — индексы углов. Когда в массиве рёбер я говорю про ребро номер три, это означает, что я говорю про ребро, которое в в собранном кубике должно находиться на верхней грани слева.

Каждое из рёбер может находиться в одном из двадцати четырёх положений, равно как и каждый угол можно поставить на двадцать четыре разных места в кубике. Вот таблица положений:


Собранный куб должен быть представлен парой массивов и , это рёбра и углы, соответственно. Например, ребро номер 4 в массиве должно иметь ориентацию 8.

Вот так выглядит представление кубика:

edges и corners — это массивы, где хранятся данные, how_edges_move и how_corners_move описывают преобразование индексов массивов edges и corners для вращения вокруг каждой из шести граней, а функция atomic_rotation() собственно и выполняет вращение одной данной грани.

Жёстко зашитые алгоритмы

Сложная часть закончилась, теперь начинатся скучная часть, открываем Cube Explorer и руками записываем некоторое количество алгоритмов для сборки.

Помните, что первым делом мы будем собирать нижнее переднее ребро? В полностью перемешанном кубике оно может находиться на любом из 24 возможных мест, поэтому массив alg_DF_edge даёт 24 разных последовательности, которые поставят ребро на место. Названия остальных массивов говорят сами за себя. Функция apply_sequence() разбивает строку на атомарные операции и вызывает atomic_rotation().

Непосредственно сборщик

Непосредственно сборщик выглядит прямым переводом псевдокода, данного в начале, на язык C++:

Обратите внимание, что rotate_entire_cube() каждый раз вызывается четыре раза, таким образом, между циклами наш куб всегда ориентирован как надо, но внутри цикла мы должны знать, как именно он ориентирован, чтобы скорректировать вывод решения на экран.

Запуск

Берём пример разобранного кубика здесь и запускаем программу:

Копируем вывод в веб-валидатор и получаем:

Итак, у нас есть солвер, в следующий раз будем управлять непосредственно роботом.

Вы можете помочь и перевести немного средств на развитие сайта


MindCuber ( Миндкубер ) – семейство из нескольких роботов, которые могут решать и собирать известную головоломку “Кубик Рубика”.

Инструкция по сборке и программированию
робота ЛЕГО EV3 на русском языке
( полный перевод с английского языка )

Для этого робота нужен только набор LEGO MINDSTORMS EV3 и Кубик Рубика



Далее здесь представлен краткий перевод на русский язык этой инструкции.

Как сделать робота, собирающего “Кубик Рубика”, с помощью набора LEGO MINDSTORMS EV3 (Home set 31313) ?

Роботы EV3 и инструкции по сборке.
Инструкция по сборке и программированию робота из наборов LEGO TECHNICS, LEGO MINDSTORMS EV3.

2. Установить необходимое программное обеспечение:

Убедитесь, что версия прошивки вычислительного блока EV3 – v1.06H или более свежая.

Всегда рекомендуется обновлять прошивку до последней версии на официальном сайте LEGO.

При необходимости скачиваем новую прошивку (встроенное ПО EV3 MIDSTORMS),

а также программное обеспечение LEGO EV3 MINDSTORMS ( PC или MAC ) ссылка.

Затем необходимо установить модифицированную поддержку Сенсора RGB (Color Sensor RGB Block) – датчика, который определяет цвет объекта.

Скачиваем файл нового блока ColorSensorRGB-v1.00.ev3b. И устанавливаем новый блок в оболочку программы LEGO EV3 MINDSTORMS на компьютере.

Для этого используем в программе меню Tools и Block Import.

Следующий этап – установка самой программы для робота, которая считает, решает головоломку и управляет механизмом для вращения граней “Кубика Рубика”.

Закачиваем версию для LEGO MINDSTORMS EV3 (Home set 31313 – домашняя версия, именно она продается в магазинах LEGO) ссылка для загрузки.

Распаковываем архив. Мы имеем три файла.

Первый файл MindCub3r-v1p6.ev3 – файл проекта для программного обеспечения на компьютере.

Второй файл mc3solver-v1p6.rtf – запускаемая на центральном блоке EV3 программа для робота,
выполняет поиск решения для Кубика Рубика.

Третий файл InstallMC3-v1p6.rbf – установщик для предыдущей программы.

Теперь открываем файл проекта MindCub3r-v1p6.ev3 в программном обеспечении на компьютере с помощью меню File и Open Project.

Перевод инструкции по сборке
EV3 MINDSTORMS MindCuber на русский язык.


Примечание:
Если MindCub3r собирает кубик неправильно, ошибки следует искать в механической части (провороты, пропуски движения)
или в ошибке распознавания цветов граней Кубика Рубика.
Грани должны быть стандартных цветов, кубик должен крутиться, поворачиваться очень легко, без торможения и заеданий.

MindCub3r использует стандартный алгоритм сборки Кубика Рубика.
После определения цвета каждого элемента всех граней, значения цветов заносятся в многомерный массив и производится вычисление кратчайшего решения головоломки.
Затем в дело вступает чистая механика.

7 ВОПРОСЫ И ОТВЕТЫ

Вопрос для тех кто собирал , при сканировании цветов на системном обеспечении пишется сканер ерор , это вызванно тем что датчик некоторые цвета ,например белый и жёлтый видит как один , можете подсказать оттенки цветов которые вы использовали .

Настя, некоторые кубики имеют не очень яркие цвета граней. Самый простой и быстрый способ решения – поменять кубик, выбрать наклейки с яркими плотными насыщенными цветами.

Дополнительный вопрос к тем кто подобрал кубик с насыщенными цветами. И робот собранб, и RUbiks куплен и все ровно ERROR. Причина?

Не так давно обзавелся набором LEGO MINDSTORMS EV3 (31313) и с удивлением обнаружил, что в русскоязычном сегменте интернета довольно мало интересных материалов и инструкций по сборке и настройке роботов из этого набора. Решил, что нужно это дело исправлять.

Эта инструкция представляет собой вольный перевод материалов с официального сайта проекта MindCub3r и дополнена опытом самостоятельной сборки этого робота, способного собрать кубик Рубика меньше чем за 2 минуты.

Подробнее о LEGO MINDSTORMS EV3 можно почитать на этом сайте.

Вот, что у нас должно получится в итоге:

image

MindCub3r можно построить из одного комплекта Lego Mindstorms EV3 (31313, Home Edition).

Также вам понадобится инструкция по сборке и программное обеспечение, разработанное авторами проекта.

Буквально позавчера автор проекта объявил в своем ФБ, что подправил программное обеспечение для своего робота, и теперь оно работает со «штатной» прошивкой «кирпича» 1.06Н. На главной странице проекта эта информация также уже появилась, архив MindCub3r-v1p1a.zip, содержащий, среди прочего, и обновленную версию программы, уже доступен для загрузки. Загрузка и установка блока для датчика цвета по-прежнему необходима.

Дальнейший текст статьи исправлен с учетом последних изменений на сайте проекта!

Инструкцию по сборке MindCub3r смотрим или скачиваем здесь.
Прошивку (на момент написания статьи EV3-Firmware-V1.06H.bin) для кирпича скачиваем с официального сайта LEGO MINDSTORMS здесь.
Архив MindCub3r-v1p1a.zip с файлами проекта (MindCuber-v1p1.ev3, autorun.rtf и mc3solver-v1p1.rtf) качаем тут.
Еще нам понадобится прошивка для датчика цвета, которую берем здесь. Все дело в том, что стандартные настройки этого датчика не корректно определяют цвета в режиме RGB.

После того, как вы соберете робота и скачаете себе на компьютер все необходимое, можно приступать к настройке.

Если вы еще не обновили прошивку «кирпича» первым делом устанавливаем новую версию ПО для главного блока Mindstorms EV3:

1. Запускаем программное обеспечение LEGO MINDSTORMS EV3;
2. Выбираем Инструменты — Обновление встроенного ПО;

image

3. В появившемся диалоговом окне нажимаем «Просмотреть», находим предварительно закаченный файл EV3-Firmware-V1.06H.bin и жмем «Открыть»;

image


4. В диалоговом окне в таблице «Доступные файлы встроенного ПО» выбираем EV3-Firmware-V1.06H и жмем «Загрузить». Ждем окончания загрузки;


5. Перезагружаем главный блок (выключаем и снова включаем).

Далее устанавливаем прошивку для датчика цвета:
1. В ПО LEGO MINDSTORMS EV3 открываем новый пустой проект;
2. Выбираем Инструменты — Мастер импорта блоков;

image

3. В появившемся диалоговом окне нажимаем «Просмотреть», находим предварительно загруженный файл ColorSensorRGB-v1.00.ev3b и жмем «Открыть»;

image

image

4. В диалоговом окне в таблице «Выбрать блоки для импорта» выбираем ColorSensorRGB-v1.00.ev3b и жмем «Импорт».

image

5. Для завершения установки закройте диалоговое окно и выйдите из программного обеспечения LEGO MINDSTORMS EV3.

Теперь самый ответственный момент — загрузка программы робота в кирпич:
1. Распаковываем предварительно загруженный архив MindCub3r-v1p1a.zip;


2. Запускаем ПО LEGO MINDSTORMS EV3;
3. Выбираем Файл — Открыть проект, ищем файл MindCub3r-v1p1.ev3, распакованный из архива MindCub3r-v1p1.zip и жмем «Открыть»;

image

4. После открытия проекта загружаем его в «кирпич». Загружаем, но НЕ ЗАПУСКАЕМ.

image

5. Идем в Инструменты — Обозреватель памяти (Ctrl+I);

image

6. Выбираем (выделяем) во вкладке «Модуль» или «SD-карта» папку проекта «MindCub3r-v1p1»;
7. Нажимаем «Загрузить»;

image

8. Находим файл mc3solver-v1p1.rtf, распакованный из архива MindCub3r-v1p1a.zip и нажимаем «Открыть»;
9. Еще раз нажимаем «Загрузить», предварительно убедившись, что папка проекта «MindCub3r-v1p1» все еще выделена;
10. Находим файл InstallMC3-v1p1.rbf, распакованный из архива MindCub3r-v1p1a.zip и нажимаем «Открыть»;

Примечание: файл mc3solver-v1p1.rtf имеет текстовое расширение .rtf. Пожалуйста, не пытайтесь открыть этот файл с помощью текстового редактора.

11. Закройте диалоговое окно, выйдите из программы и перезагрузите модуль.

Последний этап — устанавливаем приложение MC3 Solver на главном модуле:

1. Включаем блок:


2. Находим во второй вкладке папку проекта MindCub3r-v1p1 (в памяти блока или на SD-карте):


3. Выбираем файл InstallMC3-v1p1 и нажимаем на центральную кнопку модуля для установки:


4. В третьей вкладке проверяем наличие установленного приложения MC3 Solver v1p1:



5. Перезагружаем блок.

6. В третьей вкладке блока запускаем приложение «MC3 Solver v1p1» для начала работы программы mc3solver-v1p1.rtf:


Всё! MindCub3r готов к использованию!

7. Запускаем программу в первой или во второй вкладке блока:


После запуска программы робот попросит вложить кубик («Insert cube») и начнет его сканировать датчиком цвета.
После сканирования робот ненадолго задумается и начнет сборку.
Удачное решение задачи ознаменуется радостным вращением кубика.

Вот, собственно, процесс работы робота:

Выше описан идеальный сценарий, на практике же все немного хуже — датчик может не правильно определить цвета — всего робот может провести 3 (три) цикла сканирования до того, как выдаст ошибку (Scan error). После этого нужно изъять кубик и снова вложить в робота. Причиной этому может быть или низкий заряд батареи модуля или «неправильный» кубик.
У меня иногда проходило по 3-5 повторов (3 цикла сканирования и одно изъятие) прежде чем робот принимался за сборку, но результат того однозначно стоит.

Если у вас остались вопросы, задавайте их в комментариях к статье, с удовольствием на них отвечу.

  • Инструкция по сборке v1.0 (Набор EV3 31313): загрузить
  • Инструкция по сборке v1.1 (Набор EV3 Education 45544+45560): загрузить
  • EV3 Программа для Color Sensor RGB Block v1.00: смотреть далее
  • EV3 Основная программа: смотреть далее

1. Описание

MindCub3r – робот, которого можно собрать из одного набора LEGO MINDSTORMS EV3 Обычная версия (31313) или из наборов EV3 Education Core и Expansion sets (45544+45560).
Этот робот способен полностью решить и правильно собрать известную головоломку Кубик Рубика (Rubik’s Cube puzzle).

Все программы для MindCub3r будут правильно работать с прошивкой LEGO firmware v1.06H (home) или v1.06E (Education), а также с последующими новыми версиями прошивок.
Рекомендуется всегда обновлять программное обеспечение центрального блока EV3 ( прошивку) до самой последней официальной версии от LEGO.

Аккуратно соберите робота по инструкции Инструкция по сборке (Обычная версия EV3 31313) или Инструкция по сборке (Образовательная версия EV3 Education 45544) , затем загрузите и установите программное обеспечение, как описано далее.

Программное обеспечение MindCub3r состоит из трех частей:

  1. Файл проекта: MindCub3r-v1p8.ev3 or MindCub3r-Ed-v1p8.ev3, который содержит программу управления моторами и сенсорами.
    Она создана в стандартном визуальном редакторе программ и проектов LEGO MINDSTORMS EV3
  2. Дополнительная запускаемая программа: mc3solver-v1p8.rtf, которая написана на C++ и реализует более эффективный и быстрый алгоритм решения головоломки, чем тот, который использовался для предыдущей версии NXT MindCuber ( для набора LEGO NXT)
  3. Приложение для EV3: “MC3 Solver v1p8”, которое используется для запуска программы mc3solver-v1p8.rtf

The main program and mc3solver-v1p8.rtf executable program communicate with each other via shared files on the EV3.
Примечаниеe: Файл v1p8 использует расширение .rtf для возможности загрузки его в блок EV3 с помощью стандартного программного обеспечения LEGO MINDSTORMS EV3 для персонального компьютера.
Расширение .rtf , которое обычно используется для текстовых файлов, в данном случае применяется к запускаемой программе, в качестве альтернативы.
Пожалуйста, не открывайте этот файл с помощью обычного текстового редактора.

MindCub3r использует датчик EV3 color sensor (сенсор цвета) в режиме RGB, чтобы сделать возможным распознавание тех оттенков цветов, которые обычно не определяются в стандартном режиме сенсора, по умолчанию используемом в программном обеспечении LEGO MINDSTORMS EV3 .
Программа Color Sensor RGB Block должна быть импортирована в программное обеспечение LEGO MINDSTORMS EV3 для персонального компьютера, чтобы поддерживать режим RGB для сенсора.

2. Программное обеспечение

Примечание: Используйте ссылки Загрузить следующим образом:

    • На Windows – клик правой кнопкой мыши на ссылке Загрузить
    • На Mac – при нажатой клавише control(ctrl), кликните на ссылку Загрузить

    В появившемся меню выберите один вариант:

    • Сохранить ссылку как…
    • Сохранить содержимое как…
    • Загрузить содержимое ссылки как…

    Затем выберите папку на вашем компьютере, куда вы собираетесь сохранить файл.

    2.1 Установка Color Sensor RGB Block

        блок, ColorSensorRGB-v1.00.ev3b, на ваш компьютер.
        Иногда при загрузке этот файлe может быть переименован в ColorSensorRGB-v1.00.zip . В этом случае после загрузки, переименуйте его снова в ColorSensorRGB-v1.00.ev3b
      1. Запустите программное обеспечение LEGO MINDSTORMS EV3 на персональном компьютере и создайте новый пустой проект.


        1. Найдите загруженный ранее файл ColorSensorRGB-v1.00.ev3b на вашем компьютере и нажмите Open(Открыть).


          1. Выберите ColorSensorRGB-v1.00.ev3b из списка Select Blocks to Import( Выбрать Блоки для Импорта) и нажмите Import(Импорт).

            1. Чтобы правильно завершить установку , нажмите Сlose (Закрыть) , а после этого также закройте программное обеспечение LEGO MINDSTORMS EV3 полностью.

            2.2 Загрузка проекта MindCub3r

                  Загрузите соответствующий вашей системе файл на ваш компьютерe:
                    (Обычный набор EV3 31313) (Education набор EV3 45544+45560)
                • Файл проекта с основной программой MindCub3r-v1p8.ev3 или MindCub3r-Ed-v1p8.ev3 project file with the main program
                • Запускаемый файл программы mc3solver-v1p8.rtf
                • InstallMC3-v1p8.rbf – приложение для запуска файла mc3solver-v1p8.rtf


                  1. Запустите программное обеспечение LEGO MINDSTORMS EV3 для персонального компьютера, выберите в меню команду File(Файл)
                    и затем выберите пункт Open Project( Открыть проект ).


                    1. Найдите файл проекта MindCub3r-v1p8.ev3 или MindCub3r-Ed-v1p8.ev3 и нажмите кнопку Open(Открыть).


                      1. Download (Загрузить) – с помощью этой кнопки загрузите программу MindCub3r в блок EV3 (но пока не запускайте ее).


                        1. Find the folder on the computer where the files were extracted from MindCub3r-v1p8.zip or MindCub3r-Ed-v1p8.zip. Select mc3solver-v1p8.rtf and Open to download this program to the EV3.


                          1. Find the folder on the computer where the files were extracted from MindCub3r-v1p8.zip or MindCub3r-Ed-v1p8.zip. Select InstallMC3-v1p8.rbf and Open to download this file to the EV3.

                          2.3 Install the MC3 Solver Application

                            1. Press the right button on the EV3 to move to the File Navigation screen. Select the MindCub3r-v1p8 or MindCub3r-Ed-v1p8 folder and press the center button to open it. If there is a micro-SD card in the EV3, select and open the SD_Card folder first.

                              1. Use the down button to Select InstallMC3-v1p8 and press the center button to run it. The EV3 will make a short beep.

                                This installs “MC3 Solver v1p8” application on the Brick Apps screen.

                                1. Turn off the EV3 brick to ensure all the files are saved to the flash memory and then turn it on again.

                                MindCub3r is now ready to use!

                                3. Operation


                                  1. Run the “MC3 Solver v1p8” application on the EV3 from the Brick Apps screen to start the mc3solver-v1p8.rtf executable program.

                                    This is only necessary once each time the EV3 is turned on as the program will continue to run in the background until the EV3 is turned off.

                                    1. Run the MindCub3r program on the EV3 from the Run Recent screen or from the File Navigation screen if it is the first time it has been run.


                                      The program first resets the position of the scan arm (holding the color sensor) and then the tilt arm. If the turntable starts to rotate or the two arms do not move in this order, please carefully check that cables have been connected to the correct ports on the EV3 as shown by the color coding in the build instructions. During this period, the EV3 buttons flashes red.The program then connects to the mc3solver-v1p8.rtf program that was downloaded to the EV3. If the program is found, the EV3 makes a short beep and continues. If the solver program is not running, the buttons continues to flash red and the message “Find solver” is displayed on the EV3 screen. If this happens, please check that the “mc3solver-v1p8.rtf” program has been downloaded to the MindCub3r-v1p8 or MindCub3r-Ed-v1p8 project folder on the EV3 and that the “MC3 Solver v1p8” application has been installed and run once.When MindCub3r is ready to start, the EV3 buttons turn orange and the message “Insert cube…” is displayed on the screen.

                                      1. Gently turn the turntable in each direction with your finger so that it moves slightly because of “play” in the gears connecting it to the motor. If necessary, adjust the position of the motor so that there is an equal mount of play in each direction. Use the left and right buttons on the EV3 to do this. A short press nudges the motor by a small angle. Holding the button for longer moves it by larger angles more quickly.
                                        1. Insert a scambled Rubik’s Cube into the turntable tray and MindCub3r will start to scan and solve the cube.MindCub3r 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, MindCub3r will stop after the third attempt and display the message “Scan error” on the EV3 display. If this happens, there may be a number of possible causes. See the troubleshooting section.If there is a cube present before MindCub3r is ready, the buttons will stay red and the message “Remove cube…” is displayed for you to remove the cube. If this happens even when no cube is present or if MindCub3r does not start to scan the cube when it is inserted, please check that the cables to the infra red or ultrasonic and color sensors are connected to the correct ports on the EV3 as shown in by the color coding in the build instructions.

                                        4. Troubleshooting Tips

                                        4.1 Scanning

                                        If MindCub3r attempts to scan the cube 3 times and displays the message “Scan error” the following tips may help.

                                        1. MindCub3r is designed to work with an official Rubik’s Cube branded by Rubik’s. However, it should work with most cubes provided one set of stickers is white and the others are distinct colors. It is optimized to work with white, yellow, red, orange, green and blue stickers.
                                        2. Cubes with a white plastic body may scan less reliably that those with a black body but may work reasonably well if there are no other issues.
                                        3. A standard cube is about 57mm along each edge. MindCub3r will work most reliably with a cube this size although cubes that are only slightly larger or smaller may work. It has been known to solve some cubes as small as 55mm but not all.
                                        4. Make sure latest release of the MindCub3r software is installed including the latest enhanced firmware. Version v1p8 has some improvements in the position of the scan arm and the underlying algorithm for discriminating the colors.
                                        5. Check that the scan arm has been built exactly as shown in the build instructions. Small differences such as how the black 5-hole beams on either side of the scan arm are connected can alter the position of the color sensor during the scan or even jam the scan arm so it stops during the scan. In particular, if the color sensor looks as though it is over the edge of the cube or too close to the middle while scanning the corner or edge, please check the build instructions again.
                                        6. Make sure that the turntable is carefully aligned before inserting the cube as described here. This is required to ensure that the cube is positioned correcetly under the color sensor during the scan.
                                        7. Use new or well charged batteries as the reset position of the scan arm can be affected by low battery levels.
                                        8. Try the scan in dim lighting conditions as the color sensor can become saturated in bright lights.
                                        9. Try to bend the cable connecting the color sensor to the EV3 in its most natural direction (swap the two ends if necessary) and through the clip at the bottom of the scan arm to minimize any force that the cable applies to the position of the color sensor during the scan.

                                        If this does not help, please upload a video showing a failing scan with close up views of the scan arm from different angles and the position of the color sensor over the cube as the scan arm moves and post a link on the MindCuber Facebook pageand I will try to help.

                                        Like MindCuber on Facebook to share your experiences and help each other with troubleshooting.

                                        Copyright © 2013-2015 David Gilday

                                        LEGO and MINDSTORMS are trademarks of the LEGO Group
                                        Rubik’s Cube is a trademark of Seven Towns Limited

                                        Disclaimer: thoughts and opinions expressed here are my own (David Gilday)

                                        10626342_498293940309318_2959390588190050098_o

                                        MindCuber ( Миндкубер ) – семейство из нескольких роботов, которые могут решать и собирать известную головоломку “Кубик Рубика”.

                                        Инструкция по сборке и программированию
                                        робота ЛЕГО EV3 на русском языке
                                        ( полный перевод с английского языка )

                                        Для этого робота нужен только набор LEGO MINDSTORMS EV3 и Кубик Рубика



                                        Далее здесь представлен краткий перевод на русский язык этой инструкции.

                                        Как сделать робота, собирающего “Кубик Рубика”, с помощью набора LEGO MINDSTORMS EV3 (Home set 31313) ?

                                        Роботы EV3 и инструкции по сборке.
                                        Инструкция по сборке и программированию робота из наборов LEGO TECHNICS, LEGO MINDSTORMS EV3.

                                        2. Установить необходимое программное обеспечение:

                                        Убедитесь, что версия прошивки вычислительного блока EV3 – v1.06H или более свежая.

                                        Всегда рекомендуется обновлять прошивку до последней версии на официальном сайте LEGO.

                                        При необходимости скачиваем новую прошивку (встроенное ПО EV3 MIDSTORMS),

                                        а также программное обеспечение LEGO EV3 MINDSTORMS ( PC или MAC ) ссылка.

                                        Затем необходимо установить модифицированную поддержку Сенсора RGB (Color Sensor RGB Block) – датчика, который определяет цвет объекта.

                                        Скачиваем файл нового блока ColorSensorRGB-v1.00.ev3b. И устанавливаем новый блок в оболочку программы LEGO EV3 MINDSTORMS на компьютере.

                                        Для этого используем в программе меню Tools и Block Import.

                                        Следующий этап – установка самой программы для робота, которая считает, решает головоломку и управляет механизмом для вращения граней “Кубика Рубика”.

                                        Закачиваем версию для LEGO MINDSTORMS EV3 (Home set 31313 – домашняя версия, именно она продается в магазинах LEGO) ссылка для загрузки.

                                        Распаковываем архив. Мы имеем три файла.

                                        Первый файл MindCub3r-v1p6.ev3 – файл проекта для программного обеспечения на компьютере.

                                        Второй файл mc3solver-v1p6.rtf – запускаемая на центральном блоке EV3 программа для робота,
                                        выполняет поиск решения для Кубика Рубика.

                                        Третий файл InstallMC3-v1p6.rbf – установщик для предыдущей программы.

                                        Теперь открываем файл проекта MindCub3r-v1p6.ev3 в программном обеспечении на компьютере с помощью меню File и Open Project.



                                        Продолжение следует…

                                        Перевод инструкции по сборке
                                        EV3 MINDSTORMS MindCuber на русский язык.

                                        Перевод на русский язык инструкции по сборке робота MindCuber LEGO EV3 MINDSTORMS. Based on mindcuber.com

                                        Примечание:
                                        Если MindCub3r собирает кубик неправильно, ошибки следует искать в механической части (провороты, пропуски движения)
                                        или в ошибке распознавания цветов граней Кубика Рубика.
                                        Грани должны быть стандартных цветов, кубик должен крутиться, поворачиваться очень легко, без торможения и заеданий.

                                        MindCub3r использует стандартный алгоритм сборки Кубика Рубика.
                                        После определения цвета каждого элемента всех граней, значения цветов заносятся в многомерный массив и производится вычисление кратчайшего решения головоломки.
                                        Затем в дело вступает чистая механика.

                                        • Building instructions v1.0 (Home set 31313): download
                                        • Building instructions v1.1 (Education sets 45544+45560): download
                                        • EV3 Color Sensor RGB Block v1.00: see here
                                        • EV3 Program: see here

                                        1. Description

                                        MindCub3r is a robot that can be built from a single LEGO MINDSTORMS EV3 home set (31313) or from EV3 Education Core and Expansion sets (45544+45560) to solve the well known Rubik's Cube puzzle.

                                        All MindCub3r software releases should work with LEGO EV3 firmware versions from v1.06H (home) and v1.06E (Education) onwards. It is recommended that the EV3 firmware is always updated to the latest version released from LEGO.

                                        Construct the robot by carefully following the build instructions (Home) or build instructions (Education) and then download and install the software described below.

                                        a project file: MindCub3r-v2p2.ev3 or MindCub3r-Ed-v2p2.ev3, containing the motor and sensor control program created using the standard LEGO MINDSTORMS EV3 graphical programming environment

                                        an executable program: mc3solver-v2p2.rtf, compiled from C++ that implements an efficient solving algorithm that can find much shorter solutions than the NXT MindCuber variants

                                        an EV3 application: "MC3 Solver v2p2", that is used to launch the mc3solver-v2p2.rtf program

                                        Note: release v2p2 uses the .rtf extension to enable the files to be downloaded using the standard LEGO MINDSTORMS EV3 software. The .rtf extension is intended to be used for files containing text so using if for the executable program is a work-around. Please do not try to open this file with a text editor.

                                        MindCub3r uses the EV3 color sensor in RGB mode to enable it to measure colors that cannot be distingished by the standard color mode provided by the standard LEGO MINDSTORMS EV3 software. The Color Sensor RGB Block must be imported into the LEGO MINDSTORMS EV3 software to support this mode.

                                        NOTE: LEGO MINDSTORMS EV3 software for Mac OS from version 1.4.0 no longer supports importing blocks such as the ColorSensorRGB block. In this case there is an alternative method to download the MindCub3r software to the EV3 using a micro-SD card.

                                        2. Software

                                        • On Windows - right click on the link
                                        • On Mac - click on the link while holding the control(ctrl) key
                                        • Save link as.
                                        • Save Target As.
                                        • Download Linked File As.

                                        2.1 Install Color Sensor RGB Block

                                        Extract the file from this archive.

                                        On a computer running Windows, find the file in Windows Explorer, click with the right mouse button and select Extract all.

                                        • the ColorSensorRGB-v1.00.ev3b file with the ColorSensorRGB block.

                                        Start the LEGO MINDSTORMS EV3 software and create a new, empty project.

                                        Select the Tools menu and then Block Import.

                                        In the Block Import and Export dialog, select Browse.

                                        Find the file ColorSensorRGB-v1.00.ev3b on your computer and Open it.

                                        Select ColorSensorRGB-v1.00.ev3b from Select Blocks to Import and then select Import.

                                        To complete the installation, close the dialogs and exit from LEGO MINDSTORMS EV3 software.

                                        2.2 Download MindCub3r Program

                                        • download MindCub3r-v2p2.zip (Home set 31313)
                                        • download MindCub3r-Ed-v2p2.zip (Education sets 45544+45560)

                                        Note: previous versions are still available here

                                        Extract all 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.

                                        • the MindCub3r-v2p2.ev3 or MindCub3r-Ed-v2p2.ev3 project file with the main program
                                        • the mc3solver-v2p2.rtf executable program
                                        • InstallMC3-v2p2.rbf to install an application to launch mc3solver-v2p2.rtf

                                        Start the LEGO MINDSTORMS EV3 software and select the File menu then Open Project.

                                        Find the MindCub3r-v2p2.ev3 or MindCub3r-Ed-v2p2.ev3 project file and Open it.

                                        Download the MindCub3r program to the EV3 (but do not run it yet).

                                        Select the Tools menu and then Memory Browser.

                                        Select Brick (or SD Card if there is a micro-SD card in the EV3) and find and select MindCub3r-v2p2 or MindCub3r-Ed-v2p2 in the Projects folder and then select Download.

                                        Find the folder on the computer where the files were extracted from MindCub3r-v2p2.zip or MindCub3r-Ed-v2p2.zip. Select mc3solver-v2p2.rtf and Open to download this program to the EV3.

                                        Select Download again from the Memory Browser dialog.

                                        Find the folder on the computer where the files were extracted from MindCub3r-v2p2.zip or MindCub3r-Ed-v2p2.zip. Select InstallMC3-v2p2.rbf and Open to download this file to the EV3.

                                        Close the Memory Browser dialog.

                                        2.3 Install the MC3 Solver Application

                                        Go to the Run Recent screen on the EV3.

                                        Press the right button on the EV3 to move to the File Navigation screen. Select the MindCub3r-v2p2 or MindCub3r-Ed-v2p2 folder and press the center button to open it. If there is a micro-SD card in the EV3, select and open the SD_Card folder first.

                                        Use the down button to Select InstallMC3-v2p2 and press the center button to run it. The EV3 will make a short beep.


                                        This installs "MC3 Solver v2p2" application on the Brick Apps screen.

                                        Turn off the EV3 brick to ensure all the files are saved to the flash memory and then turn it on again.

                                        MindCub3r is now ready to use!

                                        3. Operation

                                        Run the "MC3 Solver v2p2" application on the EV3 from the Brick Apps screen to start the mc3solver-v2p2.rtf executable program.


                                        This is only necessary once each time the EV3 is turned on as the program will continue to run in the background until the EV3 is turned off.

                                        Run the MindCub3r program on the EV3 from the Run Recent screen or from the File Navigation screen if it is the first time it has been run.



                                        The program first resets the position of the scan arm (holding the color sensor) and then the tilt arm. If the turntable starts to rotate or the two arms do not move in this order, please carefully check that cables have been connected to the correct ports on the EV3 as shown by the color coding in the build instructions. During this period, the EV3 buttons flashes red.

                                        The program then connects to the mc3solver-v2p2.rtf program that was downloaded to the EV3. If the program is found, the EV3 makes a short beep and continues. If the solver program is not running, the buttons continues to flash red and the message "Find solver" is displayed on the EV3 screen. If this happens, please check that the "mc3solver-v2p2.rtf" program has been downloaded to the MindCub3r-v2p2 or MindCub3r-Ed-v2p2 project folder on the EV3 and that the "MC3 Solver v2p2" application has been installed and run once.

                                        When MindCub3r is ready to start, the EV3 buttons turn orange and the message "Insert cube. " is displayed on the screen.

                                        Gently turn the turntable in each direction with your finger so that it moves slightly because of "play" in the gears connecting it to the motor. If necessary, adjust the position of the motor so that there is an equal mount of play in each direction. Use the left and right buttons on the EV3 to do this. A short press nudges the motor by a small angle. Holding the button for longer moves it by larger angles more quickly.

                                        Insert a scrambled Rubik's Cube into the turntable tray and MindCub3r will start to scan and solve the cube.

                                        MindCub3r 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, MindCub3r will stop after the third attempt and display the message "Scan error" on the EV3 display. If this happens, there may be a number of possible causes. See the troubleshooting section.

                                        MindCub3r can solve the cube directly into patterns or scramble it. Before inserting the cube, use the up and down buttons on the EV3 to select a specific pattern, "All" to create each pattern in turn or "Random" to cause MindCub3r to solve normally and occasionally generate a random pattern. Selecting "Scramble" will make MindCub3r scramble the cube without scanning it.

                                        If there is a cube present before MindCub3r is ready, the buttons will stay red and the message "Remove cube. " is displayed for you to remove the cube. If this happens even when no cube is present or if MindCub3r does not start to scan the cube when it is inserted, please check that the cables to the infra red or ultrasonic and color sensors are connected to the correct ports on the EV3 as shown in by the color coding in the build instructions.

                                        4. Troubleshooting Tips

                                        4.1 General

                                        NOTE: LEGO MINDSTORMS EV3 software for Mac OS from version 1.4.0 no longer supports importing blocks such as the ColorSensorRGB block. In this case there is an alternative method to download the MindCub3r software to the EV3 using a micro-SD card.

                                        The video of the home variant of MindCub3r shows a prototype. The scan arm support was improved before the build instructions were published so do not worry if your MindCub3r does not look quite like the video. There are many other videos of MindCub3r built by other people in this playlist

                                        If MindCub3r stops with the message "Reset scan" and no motors are turning the following tips may help:

                                        Check that the scan arm mechanism is built exactly as shown in the build instructions. If not, it may cause the motor to jam during the reset.

                                        Check that the cable connecting the medium motor under the scan arm to the EV3 is plugged in firmly at both ends. If not, the EV3 may not be able to sense the position of the motor correctly during the reset.

                                        If none of the above help then try connecting the medium motor to port D in the EV3 instead of port C (which is the port shown in the build instructions). Then re-run the program. The MindCub3r program from v2p2 onwards will detect whether a motor is connected to either port C or port D and use whichever it detects for the scan arm. Some people have found that there can be a problem with port C not being able to sense the motor position. If the software gets past the "Reset scan" message with the motor connected to port B then it is highly recommended to contact LEGO Customer Services as this may indicate there is a fault with port C of the EV3.

                                        If this does not help, please upload a video showing how how the mechanism moves when the program is started and post a link on the MindCuber Facebook page for further help.

                                        4.2 Tilting

                                        If MindCub3r fails to tilt the cube correctly the following tip may help:

                                        Check that the tilt arm has been built exactly as shown in the build instructions. In particular, carefully check the position of the grey connectors and pegs that connect the tilt arm to the levers from the tilt motor.

                                        4.3 Scanning

                                        If MindCub3r attempts to scan the cube 3 times and displays the message "Scan error" the following tips may help.

                                        MindCub3r is designed to work with an official Rubik's Cube branded by Rubik's. However, it should work with most cubes provided one set of stickers is white and the others are distinct colors. It is optimized to work with white, yellow, red, orange, green and blue stickers.

                                        NOTE: cubes with very bright, vivid, "fluorescent" stickers may not scan reliably because the LEGO color sensor can return similar values for colors that look different to us. If none of the other tips help and you think this may be an issue, please consider replacing the stickers with more conventional colors or try an alternative cube.

                                        Cubes with a white plastic body may scan less reliably that those with a black body but may work reasonably well if there are no other issues.

                                        A standard cube is about 57mm along each edge. MindCub3r will work most reliably with a cube this size although cubes that are only slightly larger or smaller may work. It has been known to solve some cubes as small as 55mm but not all.

                                        Make sure latest version of the EV3 firmware from LEGO is installed on the EV3.

                                        Make sure latest release of the MindCub3r software is installed.

                                        Check that the scan arm has been built exactly as shown in the build instructions. Small differences such as how the black 5-hole beams on either side of the scan arm are connected can alter the position of the color sensor during the scan or even jam the scan arm so it stops during the scan. In particular, if the color sensor looks as though it is over the edge of the cube or too close to the middle while scanning the corner or edge, please check the build instructions again.

                                        Even if the cube appears to tilt each time during the scan, it may be that the cube is being pushed too far across the turntable affecting its position under the color sensor. Check that the tilt arm has been built exactly as shown in the build instructions. In particular, carefully check the position of the grey connectors and pegs that connect the tilt arm to the levers from the tilt motor.

                                        If the EV3 is positioned one hole too far towards the turntable, the corner of the turntable may catch on the edge of the screen causing it to "jump" a little as the turntable rotates. Check that the EV3 is positioned exactly as shown in the build instructions.

                                        Make sure that the turntable is carefully aligned before inserting the cube as described here. This is required to ensure that the cube is positioned correcetly under the color sensor during the scan.

                                        Use new or well charged batteries as the reset position of the scan arm can be affected by low battery levels.

                                        Try the scan in dim lighting conditions as the color sensor can become saturated in bright lights.

                                        Try to bend the cable connecting the color sensor to the EV3 in its most natural direction (swap the two ends if necessary) and through the clip at the bottom of the scan arm to minimize any force that the cable applies to the position of the color sensor during the scan.

                                        If this does not help, please upload a video showing a failing scan with close up views of the scan arm from different angles and the position of the color sensor over the cube as the scan arm moves and post a link on the MindCuber Facebook page for further help.

                                        Like MindCuber on Facebook to share your experiences and help each other with troubleshooting.

                                        Copyright © 2013-2020 David Gilday

                                        LEGO and MINDSTORMS are trademarks of the LEGO Group
                                        Rubik's Cube is a trademark of Rubiks Brand Limited

                                        Читайте также: