Arduino Forum

Topics => Robotics => Topic started by: kas on Oct 10, 2014, 07:37 pm

Title: Rubik's cube Robot solver
Post by: kas on Oct 10, 2014, 07:37 pm
There are 100+ robots cube solver on the Web
Most of them are Lego Mindstorm based, some others use very expensive hardware
Few Arduino based robots in fact

I plan to build something like this:
(http://i.imgur.com/bJSaX6s.png)
  >> Video << (http://www.youtube.com/watch?v=S0dl4_A_0YY)
but... cheaper  :)



or more likely
(http://i.imgur.com/Id4lsjj.png)
  >> Video << (http://www.youtube.com/watch?v=VqDjESQaHvQ)
but with better gripping

The robot will be semi-autonomous
Color recognition and solving to be made at PC level
Cube movements performed under Arduino control, at robot level
(USB cable could be disconnected at this stage)

Solving will be done through already existing software, Cube Explorer (http://kociemba.org/cube.htm) appears to be a good candidate
A middleware will be developped  (using Processing or Python) to convey information back and forth
between Arduino and cube solver software

Road map:
- design a suitable gripper
- robot construction (2 grippers + frame), test and tuning
- develop Arduino code for moving the Cube
- develop the software link between solving and moving
- final integration

I will use this thread as a blog, to share success and failure
and possibly obtain ideas an advices from our community

Not sure to reach destination but the route itself is promising and definitely exciting

Stay tuned  ;)
Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 10, 2014, 07:39 pm
Reserved for additional information, photos and videos



Parts list     (PC/webcam version)


(http://i.imgur.com/72XtOIn.jpg)





Frame:
- Plywood 10mm


Grippers:

(http://i.imgur.com/JJrG8n1.png)


- Plywood 5mm (plexiglass, or PVC)
- 4 standard servo's
- M3 screws 10, 16, 20 and 24mm
- 3mm washers
- M3 nuts
- M3 Nylock nuts (http://hobbyking.com/hobbyking/store/__23717__Black_Anodised_Aluminum_M3_Nylock_Nuts_8pcs_.html)
- 14mm brass standoff spacers (http://www.ebay.com/itm/10x-Brass-Standoff-Spacer-M3-Female-x-M3-Female-14mm-/250955120249?hash=item3a6e173e79)
(http://i.imgur.com/vYWdVxd.jpg)
For Imperial people, use 1/8" hardware

Drawing (http://forum.arduino.cc/index.php?topic=271827.msg2397325#msg2397325)
Assembly video (https://www.youtube.com/watch?v=TduyjdRO1Dw&feature=youtu.be)


EDIT (feb 2018)
The grippers 3D printed version has been released on Thingiverse
 (https://www.thingiverse.com/thing:2800244)

This is the Fusion 360 final assembly, including the wrist servo:
(https://s17.postimg.cc/7z9lfzklr/Gripper_Fusion.jpg)


the embedded horns are designed for Futaba 25 teeth spline geometry (Futaba/TowerPro/Orion/Savox/ProTekAce/Bluebird...)
I will release the two specific parts for Hitech servo's family (24T) if required
Discussion starts at post #428


Cube:
I use a Dayan GuHong (57 mm), the DaYan ZhanChi is also very good
Do not use the not so smooth genuine Rubik's Cube(tm)
The reference site in China for cubes: http://lightake.com/c/DaYan_001001005 (http://lightake.com/c/DaYan_001001005)


Other parts:
- Flexible mini 28 LED USB lamp  (4 bucks shipped) (http://www.ebay.com/itm/Flexible-Bright-Mini-28-LED-USB-Light-Lamp-for-Notebook-Computer-PC-Desk-Reading-/351201559839?)
- Custom shield with 4 servo's sockets (http://forum.arduino.cc/index.php?topic=271827.msg2248638#msg2248638)
- Webcam with optional manual White Balance

Power supply: 6V, 2000mA
I use two 18650 LiFePO4 batteries for powering both Servo's and Arduino


Software:
Arduino:    CubeMover V1.3 (http://forum.arduino.cc/index.php?topic=271827.msg3283775#msg3283775)  NEW          VarSpeedServo Library  (https://github.com/netlabtoolkit/VarSpeedServo)
Python (PC):   RubikKasBot V1.3 (http://forum.arduino.cc/index.php?topic=271827.msg2094567#msg2094567)
Solving (PC):   Cube Explorer (http://kociemba.org/cube.htm)


Testing:
Make sure you test your hardware according to post #6 and post #13




Android version

Autonomous design w/o PC

Robotic hardware is unchanged, webcam is replaced by an Android smarphone
(https://s21.postimg.cc/e3h5j2shz/P1010370_LR.jpg)

This version works this way:

Smartphone   - take a picture from face #1 and perform color recognition for the 9 facelets
Smartphone   - send a Bluetooth command to Arduino to rotate cube to next face
Arduino           - rotate Cube to next face
Smartphone   - same for all 6 faces
Smartphone   - build and send via WiFi a query to a dedicated Rubik's solving server (Montréal, Canada)
Smartphone   - receive solution from server (Singmaster notation)
Smartphone   - send Bluetooth command to Arduino (Singmaster notation format)
Arduino            - move Cube according to command and put the cube in the right order

Typical query to server:
http://nova.polymtl.ca/~simark/solverB/query.php?b=WGGOOOGGG&l=OOGBBYOOY&f=YBBBRRBRR&r=ORBBGGBRR&u=YYRYYGRWW&d=OYYWWWWWW
 (http://nova.polymtl.ca/~simark/solverB/query.php?b=WGGOOOGGG&l=OOGBBYOOY&f=YBBBRRBRR&r=ORBBGGBRR&u=YYRYYGRWW&d=OYYWWWWWW)
Corresponding answer from server:     OK     F U F D'
Clic the query and see for yourself  ;)



Aditional hardware:
HC-05 or HC-06 Bluetooth board for smartphone/Arduino communication (3$ shipped on eBay)
(http://i.imgur.com/jzHoND9.jpg)

or a very convenient Arduino/HC-05 combo
(http://i.imgur.com/4HPW4Rc.jpg)



Software:
Arduino:    CubeMover V1.3 (http://forum.arduino.cc/index.php?topic=271827.msg3283775#msg3283775)  NEW         VarSpeedServo Library  (https://github.com/netlabtoolkit/VarSpeedServo)
Smartphone: Rubik's App is available on request (free)

You should understand smartphone connection with HC-05 / HC-06 Bluetooth board
The best approach is to have Joystick BT Commander (http://forum.arduino.cc/index.php?topic=173246.0) up and running (same protocol)



EDIT  July 28th, 2018

End of technical support


I have been supporting this project for nearly four years, this was an exciting experience
I have since moved to other projects and it's now time for me to retire

All possible questions have been answered in this thread, just read it  ;)
The Android App is here (https://www.dropbox.com/s/pj2jw52ypws5gzt/RubikCubeV120.apk?dl=0)
Feel free to use this thread on a peer to peer basis to share your experience
Please no more PM's

Thanks again for your interest and good luck for your projects


Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 17, 2014, 09:26 pm
Week one progress & report  ;)

I choosed the Dagu claw MK1 (http://www.communica.co.za/Catalog/Details/P1139999143) design as a starting point

(http://i.imgur.com/jrpTDqn.png)

The final claw should grip the cube (55mm) and open sufficiently (55 X 1.414, thanks pythagoras  ;)  ) to allow cube rotation


Here is a first working prototype made with plywood

(http://i.imgur.com/FzPely9.png)
  >> Video << (http://www.youtube.com/watch?v=k0ZR_jjt5S0)


During testing, the gripper is controlled with an Android smartphone, using   Joystick BT Commander (http://forum.arduino.cc/index.php?topic=173246.0?)


Title: Re: Rubik's cube Robot solver
Post by: zoomkat on Oct 19, 2014, 06:01 pm
That gripper may not have the strength and rigidly to grip and twist a Rubik's cube.
Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 19, 2014, 11:13 pm
Hi zoomkat, happy to see you here  ;)

This gripper is definitely not rigid enough
I just built three new prototypes with 5mm plywood (was 3mm)
the last one has four rods (versus two) and is now strong enough to twist the cube

Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 28, 2014, 10:12 am
OK, new Forum bugs are slowly desappearing, time to post again   :)

This is the (probably) final design
(http://i.imgur.com/KsIUSX6.png)
  >> Video << (http://www.youtube.com/watch?v=TJ_wd-ewadU&feature=youtu.be)

Time to start testing with a Rubik's cube




Title: Re: Rubik's cube Robot solver
Post by: kas on Nov 01, 2014, 12:28 pm
First test with a real Rubik's cube
(http://i.imgur.com/WrbkEFr.png)

>> Video << (http://youtu.be/pPuBbTL4boQ)


Here is the demo code

Code: [Select]
#define VERSION     "\n\nGripper demo V1.2- @kas2014\n"

// V1.2  use VarSpeedServo library
// V1.1  2 servo's
// V1.0  1 servo

#include <VarSpeedServo.h>

#define    rot_pin              10                  // Green
#define    pinch_pin             9                  // Yellow

#define    CLOSE                85                  // servo's limits
#define    OPEN                132
#define    CW                    0
#define    MID                  87
#define    CCW                 171

#define    SLOW                 30
#define    FAST                 80

VarSpeedServo pinch_servo;                          // create servo objects
VarSpeedServo rot_servo;

void setup()  {
  pinch_servo.attach(pinch_pin); 
  rot_servo.attach(rot_pin, 580, 2570);
  gripOpen(FAST);
  armCenter(FAST);
  delay(500);
}

void loop() {
  for(int i=0; i<3; i++)  {
    gripClose(SLOW);
    armRight(SLOW);
    gripOpen(SLOW);
    armCenter(SLOW);
  }
  delay(500);

  for(int i=0; i<3; i++)  {
    gripClose(FAST);
    armRight(FAST);
    gripOpen(FAST);
    armCenter(FAST);
  }
  delay(500);

  for(int i=0; i<2; i++)  {
    gripClose(SLOW);
    armLeft(SLOW);
    gripOpen(SLOW);
    armCenter(SLOW);
  }
  while(true);
}

void armRight(int speed)    { rot_servo.write(CW, speed, true); }
void armLeft(int speed)     { rot_servo.write(CCW, speed, true); }
void armCenter(int speed)   { rot_servo.write(MID, speed, true); }
void gripOpen(int speed)    { pinch_servo.write(OPEN, speed, true); }
void gripClose(int speed)   { pinch_servo.write(CLOSE, speed, true); }


For this project I chose the "VarSpeedServo" library which has some definite advantages
compared to the standard Servo library:
- adjustable servo's speed (see video)
- optional code pause until move is complete

Next stop: build a second gripper and assemble the final robot

** EDIT: see post #111 **


Title: Re: Rubik's cube Robot solver
Post by: PaulS on Nov 02, 2014, 04:26 pm
Nice looking setup. I'm assuming that the code actually makes the arm do what you claim. But, how is that going to be sufficient to solve a rubik's cube? How is the robot/Arduino going to know what moves to make to solve the cube? How is it going to know where to start? How is it going to know when to stop?
Title: Re: Rubik's cube Robot solver
Post by: kas on Nov 03, 2014, 08:29 am
Hi Paul,

Quote
Nice looking setup
Thanks


Quote
how is that going to be sufficient to solve a rubik's cube?
How is the robot/Arduino going to know what moves to make to solve the cube?
Please refer to post#1, the solving itself will be performed using Cube Explorer (http://kociemba.org/cube.htm)
Solution will be passed to Arduino using  Singmaster notation (http://en.wikipedia.org/wiki/Rubik%27s_Cube#Move_notation)
(look here for a visual approach (https://www.youtube.com/watch?v=kRN4_8Vt7vs))

Arduino will convert notation into real world moves


Title: Re: Rubik's cube Robot solver
Post by: kas on Nov 07, 2014, 06:15 pm
The Rubik's cube Robot solver, together with my assistant   ;)

(http://i.imgur.com/VIBaZ0q.jpg)


The hardware side is finished, let's produce some code to make it alive


Title: Re: Rubik's cube Robot solver
Post by: PaulS on Nov 07, 2014, 09:06 pm
Quote
together with my assistant
Your assistant does not look impressed. You need another groupie.
Title: Re: Rubik's cube Robot solver
Post by: zoomkat on Nov 08, 2014, 02:15 am
Nicely laid out and good fit.
Title: Re: Rubik's cube Robot solver
Post by: kas on Nov 08, 2014, 07:00 am
Quote
Your assistant does not look impressed
She is just a bit jealous of this time consuming project  ;)



Quote
Nicely laid out and good fit
Thanks zoomkat


Title: Re: Rubik's cube Robot solver
Post by: kas on Nov 15, 2014, 07:05 am
First cube moves according to Singmaster notation (see post #8)
    < D,  B,  B',  D' >
This sequence will finally bring back the cube to its initial position

(http://i.imgur.com/V6hQ5Eu.jpg)
 >> Video << (http://youtu.be/1QmT9pcLVms)


Those 4 moves are hard coded in the Arduino sketch


I will now prepare a sketch with all possible moves:
F (Front),  B (Back),  U (Up),  D (Down),  L (Left),  R (Right),  plus the  " ' "  and  " 2 "  variants

For debugging purpose, moves will be entered through Arduino's serial monitor

EDIT: see post #242 (code)

Title: Re: Rubik's cube Robot solver
Post by: bjim525 on Nov 22, 2014, 06:37 pm
Hi Looking for something to build. I am a relative newbie to Arduino and have made a finished a robot car using a uno board and Robot Shield. I found this quite easy and want to make the rubixcube solver. How hard was this build on a scale of 1-10? Looks good. Need one as I can complete a rubixcude in a couple of days.
Title: Re: Rubik's cube Robot solver
Post by: kas on Nov 22, 2014, 09:42 pm
Hi bjim525

You just passed from "Lurker" status to "Active Contributor"
Congratulation !!  ;)

Quote
How hard was this build on a scale of 1-10?
I would say...  6

The project is challenging both on the Hardware and Software sides
To create the grips, you need a CNC, a Laser cutter or a 3D printer
Do you have access to this type of equipment ??

Assembly is an easy task:
(http://i.imgur.com/JJrG8n1.png)
 >> Video << (https://www.youtube.com/watch?v=TduyjdRO1Dw&feature=youtu.be)


Should you need additional info, let me know


Title: Re: Rubik's cube Robot solver
Post by: bjim525 on Nov 23, 2014, 06:14 pm
I am in the progress of saving up the money for a 3d printer. Any ideas which one. The Arduino one looks good. Costs a lot though!!! :smiley-money:  :smiley-money: :smiley-money:
Title: Re: Rubik's cube Robot solver
Post by: kas on Nov 24, 2014, 08:04 am
Not too familiar with 3D printers  :smiley-roll:

Rubik's robot parts are CNC'd using a cheap chinese 30X40 router
Title: Re: Rubik's cube Robot solver
Post by: kas on Dec 07, 2014, 06:25 pm
Quote
I will now prepare a sketch with all possible moves:
F (Front),  B (Back),  U (Up),  D (Down),  L (Left),  R (Right),  plus the  " ' "  and  " 2 "  variants

For debugging purpose, moves will be entered through Arduino's serial monitor
Here it is:

Code: [Select]
#define VERSION       "Cube Mover V1.2  @kas2014\n"

// V1.2: refactored using Cube class
// V1.1: replaced Servo with VarSpeedServo library
// V1.0: initial release

#include <VarSpeedServo.h>
#include "cube.h"

// ---------- user adjustments -------------------
#define    DOWN_CLOSE          91 //92
#define    DOWN_OPEN          132
#define    DOWN_CW              6
#define    DOWN_MID            89
#define    DOWN_CCW           172

#define    BACK_CLOSE          84 //85
#define    BACK_OPEN          129
#define    BACK_CW              2
#define    BACK_MID            87
#define    BACK_CCW           171

#define    LOW_SPEED           50 //50
#define    HI_SPEED           100 //80
// -----------------------------------------------

#define    downPinchPin         9
#define    downRotPin          10
#define    backPinchPin         5
#define    backRotPin           6
#define    bipPin              11             // buzzer
#define    myRX                 2
#define    myTX                 3

#define    STX               0x02             // serial data frame delimiters
#define    ETX               0x03

Cube myCube(downPinchPin, downRotPin, backPinchPin, backRotPin);

char cmd[128];                                 // bytes received buffer

void setup() {
  Serial.begin(57600);
  Serial.println(VERSION);
  pinMode(bipPin, OUTPUT);    

  myCube.begin(HI_SPEED);                 // set HIGH servo's speed
  myCube.downSetLimits(DOWN_CLOSE, DOWN_OPEN, DOWN_CW,DOWN_MID, DOWN_CCW); // set limits for pinch and rotation servo's
  myCube.backSetLimits(BACK_CLOSE, BACK_OPEN, BACK_CW, BACK_MID, BACK_CCW);
  myCube.seize();
  bip(20, 2);                             // bip
}

void loop() {
  if(getSerialData())       parseData();
}

// ---------------------------

boolean getSerialData()  {
  if(Serial.available())  {                           // data received from smartphone
    delay(2);
    cmd[0] =  Serial.read();  
    if(cmd[0] == STX)  {
      int i=1;      
      while(Serial.available())  {
        delay(1);
        cmd[i] = Serial.read();
//      Serial.print(cmd[i]);
        if(cmd[i]>'u' || i>124)    {  bip(20, 5);    return false; }    // Communication error  XXX reinitialiser à zero <<<
        if((cmd[i]==ETX))               return true;     //
        i++;
      }
    }
  }
 return false;
}

boolean getSerialMonitor()  {  // Serial Monitor fsetting: Newline
  if(Serial.available())  {
    for(int i=0; i<124; i++)    cmd[i] = 0;
    int n = Serial.readBytesUntil('\n', cmd, 124);
//   Serial.print(cmd[0]); Serial.print(" ");
   cmd[n+1] = ETX;
   return true;
  }
 return false;
}

void parseData()    { // parseData(cmd)
  int i = 0;
  String progress = "";
  while (cmd[i] != ETX) {
//  Serial.print(cmd[i]); mySerial.print(" ");
    switch(cmd[i])  {

      // Move commands  ------------------------------------------------------------
      case 'R':                                                    //  'R' moves
        switch(cmd[i+1])  {
          case '2':
            Serial.print("R2 ");
            myCube.R2();
            break;
          case 39:
            Serial.print("R' ");
            myCube.Rp();
            break;
          default:
            Serial.print("R ");
            myCube.R();
            break;
        }
        break;
      case 'L':                                                    //  'L' moves
        switch(cmd[i+1])  {
          case '2':
            Serial.print("L2 ");
            myCube.L2();
            break;
          case 39:
            Serial.print("L' ");
            myCube.Lp();
            break;
          default:
            Serial.print("L ");
            myCube.L();
            break;
        }
        break;
      case 'U':                                                    //  'U' moves
        switch(cmd[i+1])  {
          case '2':
            Serial.print("U2 ");
            myCube.U2();
            break;
          case 39:
            Serial.print("U' ");
            myCube.Up();
            break;
          default:
            Serial.print("U ");
            myCube.U();
            break;
        }
        break;
      case 'D':       ** snip (9000 caracters limitation) **
      case 'F':
      case 'B':
       }
        break;

      // Scan commands  -----------------------------------------------------------
      case 'f':                                             // Scan Front side
        myCube.scanFront();
        Serial.println("OKf");
        break;
      case 'r':                                            // Scan Right side
        myCube.scanRight();
        Serial.println("OKr");
        break;
      case 'b':                                            // Scan Back side
        myCube.scanBack();
        Serial.println("OKb");
        break;
      case 'l':                                            // Scan Right side
        myCube.scanLeft();
        Serial.println("OKl");
        break;
      case 'u':                                            // Scan Up side
        myCube.scanUp();
        Serial.println("OKu");
        break;
      case 'd':                                            // Scan Down side
        myCube.scanDown();
        Serial.println("OKd");
        break;
      case 'g':                                           // back to Front side
        myCube.scanFront2();
        Serial.println("OKg");
        break;

      // Other commands  --------------------------------------------------------------
      case 'T':                                          // release gripper pressure
        myCube.seize();
        bip(40, 2);
        Serial.print("seize");
        break;
      case 'S':                                         // change move speed
        switch(cmd[i+1])  {
          case '2':
            myCube.setSpeed(HI_SPEED);
            Serial.print("High Speed");
            break;
          case '1':
            myCube.setSpeed(LOW_SPEED);
            Serial.print("Low Speed");
            break;
        }
        break;
      case 'V':                                         // bips
        switch(cmd[i+1])  {
          case '4':
            bip(80, 4);
            Serial.print("bip (4)");
            break;
          case '2':
            bip(80, 2);
            Serial.print("bip (2)");
            break;
          default:
            bip(80, 1);
            Serial.print("bip ");
            break;
        }
        break;

      default:
          break;
      }
      i++;
  }
  Serial.println();
  bip(20, 2);
}

void bip(int duration, int n)    {            // Bip piezo: duration in ms, n repeats
  for(int i=0; i<n; i++)  {  
     digitalWrite(bipPin, HIGH);        
     delay(duration);
     digitalWrite(bipPin, LOW);        
     delay(75);
  }
}


I also created a library to separate the "logic" of the program  from the low-level details
EDIT: see post #43 for complete code including cube.h

According to Singmaster notation,
myCube.L  generates a  <L>  move
myCube.L2  for  <L2> move
myCube.Lp  (L prime) for a  <L'> move


For demonstration purpose, the cube was first mixed according to < D B2 R2 U' F' L F2 R D2 R B2 R' >
In this video, I entered < R B2 R' D2 R' F2 L' F U R2 B2 D' > (inverse moves)  in the IDE Serial Monitor.

(http://i.imgur.com/7orYGJo.jpg)
>> Video << (https://www.youtube.com/watch?v=BlaSLV9qSCo&feature=youtu.be)

The cube is restored, as expected  ;)

I will now create a simple Python script (2 buttons) that will:
- Launch Cube Explorer
- move the cube, face by face, for color recognition by Cube Explorer
- request and obtain the solution from Cube Explorer
- transfer this solution to Arduino
Title: Re: Rubik's cube Robot solver
Post by: X-firm on Dec 07, 2014, 08:58 pm
Nice!

I have started to build a cube solver a couple of times but never finished any one. I will follow your project and maybe i will be inspired to build one too. After all you got me to build an balancing bot :)
Title: Re: Rubik's cube Robot solver
Post by: kas on Dec 09, 2014, 07:51 am
I feel now pretty confident to finish this project  ;)

Should I succeed, my long range plan is to remove the webcam and PC and use a single Android phone as both a camera and a computing device
This will then become a 100% autonomous machine
Title: Re: Rubik's cube Robot solver
Post by: kas on Dec 11, 2014, 07:47 pm
It's python's time folks     :)
Python is a nice language when it's comes to produce small utilities and middlewares
For the moment, I just implemented the "Arduino side"

(http://i.imgur.com/fRcd3N7.jpg)

this program accepts a string and transmit it to Arduino, through the serial port
in same way as Arduino Serial Monitor in Post #18

This is Rubik kasBot V1.13 (May 2017: change software versioning )             
Code: [Select]
## Rubik kasBot             @ kas 2014

## V1.13  changed windows position
## V1.12  removed delayB4scan
## V1.11  slow/fast cube moves
## V1.1   communication error management
## V1.0   initial release, serial communication with Arduino only

from tkinter import *
import serial, time
from serial import SerialException
import atexit
import subprocess

defaultPortNumber = '3'                     ##  default Serial port

root =Tk()
root.title('Rubik kasBot')
root.geometry('325x335+1000+100')    # window size + position

vSolve = StringVar()
comVar = IntVar()
speedVar = IntVar()
comSent = StringVar()
comIn = StringVar()
vErrror = StringVar()
vComPort = StringVar()
vComPort.set(defaultPortNumber)

comSent.set("")
comIn.set("")

def bSolve_CallB():
  arduino.write(b"x02" + str.encode(vSolve.get() + 'T') + b"x03")

def speed_CallB():
  if speedVar.get():
    arduino.write(b"x02 S2 x03")        ## slow moves
  else:
    arduino.write(b"x02 S1 x03")        ## fast moves
     
def com_CallB():
  if comVar.get():
    root.update()
    global arduino
    try:
      arduino = serial.Serial('COM' + vComPort.get(), 57600, timeout=15)
      time.sleep(1.25)                    ## give time to settle
      sComPort.config(state = DISABLED)
      print("COM  <ON>")
      comSent.set("COM  <ON>")
      EnableButtons(True)
      speedVar.set(True)
    except SerialException:
      EnableButtons(False)
      comVar.set(False)
      displayComError('COM' + vComPort.get() +" not available")
  else:
    speedVar.set(False)
    EnableButtons(False)
    arduino.close()
    sComPort.config(state = NORMAL)
    print("COM  <OFF>")
    comSent.set("COM  <OFF>")
    comIn.set("")

## utilities ------------------------------------
def displayComError(message):
  vErrror.set(message)
  root.update()
  print(message)
  time.sleep(2)
  vErrror.set("")
   
def EnableButtons(flag):
  if flag == True:
    aspect = NORMAL
  else:
    aspect = DISABLED
  bSolve.config(state=aspect)
  eSolve.config(state=aspect)
  checkSpeed.config(state=aspect)
 
def cleanup():  ## Exit Cube Explorer and close COM port
  if comVar.get():
    arduino.close()

atexit.register(cleanup)

## UI elements --------------------------
eSolve = Entry(textvariable = vSolve, width = 60, fg="Blue", bd = 2, font=('arial', 6))
eSolve.place(x=20, y=135, height=20, width=285)

bSolve = Button(padx=59, pady=0, bd=3, text="Solve cube ", fg="black", font=('arial', 16), command = bSolve_CallB)
bSolve.place(x=20, y=160, height=55, width=285)

checkSpeed = Checkbutton(text = "High speed", variable = speedVar, command = speed_CallB)
checkSpeed.place(x=20, y=255)

tError = Label(textvariable = vErrror, fg = "red", bd = 3, font=('arial', 8))
tError.place(x=160, y=260)

checkCom = Checkbutton(text = "COM", variable = comVar, command = com_CallB)
checkCom.place(x=20, y=287)

tComOut = Label(textvariable = comSent, bd = 3, font=('arial', 8))
tComOut.place(x=140, y=278)

tComIn = Label(textvariable = comIn, bd = 3, font=('arial', 8))
tComIn.place(x=140, y=297)

sComPort = Spinbox(from_=1, to=9, width = 1, textvariable=vComPort)
sComPort.place(x=80, y=289)

checkCom.invoke()
root.mainloop()

To run or modify this code, please download Python 3.4.2 (https://www.python.org/downloads/)
(available for Windows, Mac OS, Linux and others)

As for previous test, I shuffled the cube using < D B2 R2 U' F' L F2 R D2 R B2 R' > moves
and entered < R B2 R' D2 R' F2 L' F U R2 B2 D'> to solve it
Same result as above video, trust me on this one   ;)
Next steps:
- install a Webcam on the robot, to allow color recognition by Cube Explorer
- probably also install a LED lighting to overcome possible white balance variations




EDIT:     getting started (April 2017)   ---------------------------------------------------

install Python 3.xx
install tkinter (graphical UI)
install pyserial (Serial comm)

now... do your home work  ;)      (this thread is not a Python tutorial)
       ... and run this basic "hello World" test program:

Code: [Select]
## Rubik (Hello, World)             @ kas 2017

from tkinter import *
import serial, time
from serial import SerialException
import atexit
import subprocess

root =Tk()
root.title('Hello, World')
root.geometry('300x300+200+200')          ## window size + position

root.mainloop()


(https://s2.postimg.cc/fzlv5rzw9/Python_Hello_World.png)See the window ??  you are all set
Title: Re: Rubik's cube Robot solver
Post by: kas on Dec 20, 2014, 02:06 pm
The final bot, with led's and webcam:

(http://i.imgur.com/72XtOIn.jpg)


Now let's do the final Python coding to transmit color information to Cube Explorer, and obtain the magic formula to solve the cube  ;)


Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Dec 20, 2014, 04:45 pm
Hey! I am building the same project and wanted to know how u automated the scanning of the each 9 tiles of a face and the entire cube using this setup.

 
Title: Re: Rubik's cube Robot solver
Post by: kas on Dec 21, 2014, 09:28 am
Quote
Hey! I am building the same project and wanted to know how u automated the scanning of the each 9 tiles of a face and the entire cube using this setup.
Hi dd5665,
As mentioned, I use Cube Explorer (http://kociemba.org/cube.htm) (CE)

(http://i.imgur.com/s4Nep8T.png)

Cube explorer has a built in webserver
The robot has to move the cube and expose each face to the webcam, while sending IP queries to CE
Cube Explorer will insure facelets color recognition and will finally compute the solution

This is an excerpt from CE manual:
Quote
You can control the process of scanning the cube with the webcam interface by sending some
strings to the webserver.
Position the Back face of the cube in front of the webcam with your robot (as you would do it manually)
and send the string " http://127.0.0.1:8081/?scanB" to the webserver to scan the back face of the cube.
Then you position the Left face and send the string "http://127.0.0.1:8081/?scanL".
Proceed in this way, using the strings "?scanF", "?scanR", "?scanU" and "?scanD".
The webserver will respond with a "Done!" in all cases.

When the 6 faces have been scanned, you send the string "http://127.0.0.1:8081/?transfer".
If all facelets are ok, the scanned cube is transferred to the Main Window and the solving maneuver is computed.
The webserver will respond with a "Done!".

Finally, with the string " http://127.0.0.1:8081/?getLast" the webserver will respond with the last
computed solving maneuver in the Main Window of Cube Explorer.
Process this string with your robot to solve the cube.
I am busy coding this feature, using Python  :-\




Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Dec 25, 2014, 08:42 am
:-) Thanks! I have read the Cube explorer manual!

Your documentation is very informative. Can u give more insights onto how I can build the gripper using ply board. Do you have any drawings of all the parts needed to build the gripper. I do not know how to use Solid works or any such CAD softwares. ( Electronics student :-( ).

Thanx in advance!
Title: Re: Rubik's cube Robot solver
Post by: arduino5 on Dec 27, 2014, 06:29 pm
Hey Kas, amazing design man! I would love to get started also and maybe you can upload the paperscan of the wood grippers so i can print it and also make the grippers.
Looking forward to your reply!
Title: Re: Rubik's cube Robot solver
Post by: kas on Dec 28, 2014, 02:39 pm
Hi guys,

Too many relatives at home for the moment  :smiley-razz:
Will be back in a few days
Title: Re: Rubik's cube Robot solver
Post by: kas on Dec 29, 2014, 10:31 am
Quote
I do not know how to use Solid works or any such CAD softwares. ( Electronics student :-( )
This is a nice opportunity to get your hands dirty :smiley-wink:
You will definitely have to use these softs in your future jobs



Vectric Vcarve Pro (http://www.vectric.com/products/vcarve-pro.htm) cutting simulation:
(http://i.imgur.com/gVtZChY.jpg)




The assembly Video (https://www.youtube.com/watch?v=TduyjdRO1Dw&feature=youtu.be) (reply #15) has been created using Autodesk Inventor (http://www.autodesk.com/products/inventor/overview)
(http://i.imgur.com/JJrG8n1.png)




For dd5665, arduino5 and others, I attach to this post the gripper parts in pdf format
Not sure, you may have to login/register to see the file

Let me know if you need more info




Title: Re: Rubik's cube Robot solver
Post by: arduino5 on Dec 31, 2014, 02:55 am
Reviewed it, looks really great! What a nice job. When i get my servo's i will test it out. (Should take some more days/weeks)

Meanwhile i will test with cardboard :P

Timing is of the essence! TO THE BATCAVE!
Title: Re: Rubik's cube Robot solver
Post by: kas on Dec 31, 2014, 08:28 am
@arduino5
Quote
When i get my servo's i will test it out
Make sure that the rotation (wrist) servo can perform at least a full 180° move
Some servo's just can't  ::)

For this project I used 5mm (.2") plywood and 3mm (1/8") screws
How will you cut the parts ??


Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Jan 02, 2015, 02:35 pm
Hey kas!

Thanx for the layout! Its amazing! I havn't worked with servos before although I know the principles and theory related to it, I am really confused how you interfaced 4 servos (2 for each gripper) to the arduino. Which motor driver are you using? Is it a custom made driver or ready-made one? I am really confused!!!
Title: Re: Rubik's cube Robot solver
Post by: kas on Jan 03, 2015, 03:22 pm
Quote
I havn't worked with servos before although I know the principles and theory related to it
Great  8)  8)  8)

Quote
Which motor driver are you using? Is it a custom made driver or ready-made one? I am really confused!!!
:smiley-eek:  :smiley-eek:  :smiley-eek:
dd5665, I suggest you get really familiar with servo motors before tackling this project
No need for motor drivers, just one digital output (PWM) per Servo

Look for the sweep.ino sketch in the Aduino IDE Example (http://arduino.cc/en/Tutorial/sweep)
You may also look here (http://www.robotshop.com/blog/en/arduino-5-minute-tutorials-lesson-5-servo-motors-3636) and here (https://learn.adafruit.com/adafruit-arduino-lesson-14-servo-motors/overview)


Happy New Year to you and all the Community



Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Jan 03, 2015, 06:39 pm
:-)

Thanx kas!! I interfaced 2 servos today. It was a silly question indeed! :-P

I went to fabricate the grippers on plyboard today. Since I stay in a pretty backward area :-( ... there is only one place which has a CNC router. They told me that they can only fabricate the pieces on metal sheet or Acrilic sheet. Plus, they are charging Rs . 15000 per gripper for metal sheet and Rs. 4000 per gripper for acrillic sheet!!!!

Both of these options is way beyond my budget.

With no options to cut these parts without a CNC router...I purchased some cardboard and tried cutting the pieces manuallly by hand...
I'll let you know if it works. :-((
Title: Re: Rubik's cube Robot solver
Post by: kas on Jan 03, 2015, 09:22 pm
Quote
I purchased some cardboard and tried cutting the pieces manuallly by hand...
I guess it won't be an easy task   ::)
Let us know

Title: Re: Rubik's cube Robot solver
Post by: arduino5 on Jan 03, 2015, 10:02 pm
Cool. I tested the card-board version. Its awesome. Now i will make it from plywood when i get the time.

I do have one more request, the length of the bolts and screws, cause i have no idea which to purchase :o?
Title: Re: Rubik's cube Robot solver
Post by: kas on Jan 05, 2015, 12:55 pm
Quote
I tested the card-board version. Its awesome
Please let us have a photo of this card-board version


Quote
I do have one more request, the length of the bolts and screws,
I will prepare a list for the additional, non wooden, parts

Title: Re: Rubik's cube Robot solver
Post by: arduino5 on Jan 05, 2015, 06:20 pm
(http://s15.postimg.org/fo4sv0mvf/IMAG0645.jpg)

Just sandwiched the layers without servo. (Its fully working, except it cannot grip anything ofcourse. Just testing the mechanics. Its very well build i must mention (your design!))

I guess if you had this cut from Acrylic or maybe wood even, you could sell it as a low-budget kit.
Like, most grippers are way overpriced. This is a very good solution. Now i just need to find a good sheet. But i may make the wood version instead. Acrylic tends to be more expensive.
Title: Re: Rubik's cube Robot solver
Post by: arduino5 on Jan 05, 2015, 09:37 pm
I went to fabricate the grippers on plyboard today. Since I stay in a pretty backward area :-( ... there is only one place which has a CNC router. They told me that they can only fabricate the pieces on metal sheet or Acrilic sheet. Plus, they are charging Rs . 15000 per gripper for metal sheet and Rs. 4000 per gripper for acrillic sheet!!!!

Both of these options is way beyond my budget.

With no options to cut these parts without a CNC router...I purchased some cardboard and tried cutting the pieces manuallly by hand...
I'll let you know if it works. :-((
Cardboard: Use exacto knive + Patience. For holes: Cut a cross, then use a screwdriver the size of the hole, and force it through the cross-cut. This will open it up as if it was drilled. = Very easy todo.

Plywood: Use a figure-saw + drill holls. I plan todo that.

Acrylic. Sounds like it has to be lasercut. I wouldnt know how to cut shapes manualy? Streight pieces, sure, but all those corners and teeth? So for solid material maybe your best bet is with wood, like Kas has done.
Title: Re: Rubik's cube Robot solver
Post by: kas on Jan 05, 2015, 11:00 pm
Quote
Just sandwiched the layers without servo. (Its fully working, except it cannot grip anything ofcourse. Just testing the mechanics
Impressive  :o  :o
Care to show the gear parts ??
Title: Re: Rubik's cube Robot solver
Post by: kas on Jan 07, 2015, 06:03 pm
Quote
Your Robot solver is very nice
Thanks  ;)


Quote
I am doing same project and i really wonder how to connect Arduino to Cube Explorer .
Please detail me about this
As mentioned I use a middleware to connect Arduino to Cube Explorer

This Python script does the following tasks:
  1) Launch Cube Explorer
  2) ask Arduino to move the cube, face by face, for color recognition by Cube Explorer
  3) request and obtain the solution from Cube Explorer
  4) transfer this solution to Arduino

Points 2) and 3), please refer to response #24 for technical details
The code is still in the debugging stage

For point 4) see response #21
This code is 100% working



Title: Re: Rubik's cube Robot solver
Post by: kas on Jan 07, 2015, 06:32 pm
Part list for 5mm thickness material (plywood, acrylic, cardboard)

(http://i.imgur.com/vYWdVxd.jpg)

 - M3 screws 10, 16, 20 and 24mm
 - 3mm washers
 - M3 nuts
 - M3 Nylock nuts (http://hobbyking.com/hobbyking/store/__23717__Black_Anodised_Aluminum_M3_Nylock_Nuts_8pcs_.h

tml)
 - 14mm brass standoff spacers (http://www.ebay.com/itm/10x-Brass-Standoff-Spacer-M3-Female-x-M3-Female-

14mm-/250955120249?hash=item3a6e173e79)


For Imperial people, just use 1/8" hardware


Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Jan 26, 2015, 11:02 am
Hey kas! Any updates on the python code?
Title: Re: Rubik's cube Robot solver
Post by: kas on Jan 28, 2015, 10:30 am
Before building the robot solver, make sure you use the test bench as described in reply #6, together with the test code

Code: [Select]

#define    CLOSE                85                  // servo's limits
#define    OPEN                132
#define    CW                    0
#define    MID                  87
#define    CCW                 171


You need to carefully adjust those servo's limits to obtain clean moves as per attached video
Gripper should close tight enough to turn the cube and open enough not to touch the cube edges when rotating
Also grippers rotation should be adjusted to obtain exact O°, 90° and 180° moves

Nylock nuts should be very slightly tightened, to avoid any friction

Directly building the bot is the best recipe for preparing scrambled eggs  ;)

Please show us your work in progress
Photos/videos are welcome


The complete sketch, including cube.cpp and cube.h is attached to this message
Make sure to also download the VarSpeedServo library

I will post the final python code within a few days


EDIT
V1.3 is now available (Maker Faire 2017 release)    see Post #318



Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Feb 15, 2015, 09:21 am
Any update Kas??
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 16, 2015, 09:39 am
Quote
Any update Kas??
Hi dd5665, care to share your project, as built so far ??


This is RubikKasBot.py V1.3

Code: [Select]
## Rubik kasBot             @ kas 2014/2017

## This script will:
##  launch Cube Explorer
##  move the cube, face by face, for color recognition by Cube Explorer ([Scan colors] button)
##  request and obtain the solution from Cube Explorer
##  transfer this solution to Arduino ([Solve cube] button)

## V1.3    communication with Cube Explorer (Web server)
## V1.13  changed windows position
## V1.11  slow/fast cube moves
## V1.1    communication error management
## V1.0    initial release, serial communication with Arduino only

from tkinter import *
import urllib.request
import serial, time
from serial import SerialException
import atexit
import subprocess

##  Settings
## webcam setUp: white balance 6253°K (manual), Exposition: -6 (manual) >> -9

defaultPortNumber = '3'                     ##  default Serial port
cubeExplorerPath = 'C:\\Program Files\\Cube Explorer\\cube512htm.exe' ## Cube Explorer program path
cubeExplorer = 'http://127.0.0.1:8081/'     ## Cube Explorer web server address
webCamConnect = '?connect1'                 ##  connects to 2nd device in Cube Explorer device drop down
delayB4scan = 1                             ##  delay before scanning
....
....

** Please download attached file to get full code **
** Rename RubikKasBot_13posted.txt  >>  RubikKasBot_13posted.py **


Before running this code, please make sure that you can establish communication and drive your bot using V1.2 V1.13 code (see response #21)

Enjoy  ;)

Title: Re: Rubik's cube Robot solver
Post by: slowowl on Feb 19, 2015, 06:10 am
Hi Kas,

I just found this forum and I was thinking of doing something similar.
Did you put some thought about having Arduino computing the solution, instead of going on line and importing it ?
I'm quite familiar with some speed cubing algorithms.
In theory, from any state of the cube, you can get to the solution in less than 20 moves (God's number).
The Fridrich method that should be quite easy to program will average 60 moves.
The Petrus method that I think is more difficult to program will average probably 40 moves.
Granted, this won't be as fast as getting the solution on-line with cube solver, but the whole idea is to have Arduino do the whole thing, capture cube state, compute solution and  solve cube.
My take is an Arduino Due should be sufficient to do it. (enough RAM/ROM/IOs).

What do you think ?


Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 20, 2015, 08:59 am
Hi Slowowl

I am not too familiar with solving algorithms as such,
for this project the main challenge is the hardware (robot) construction.


Quote
My take is an Arduino Due should be sufficient to do it. (enough RAM/ROM/IOs)
The MCU should also accept video signal for color recognition, not sure Arduino Due would fill the bill  ::)
Raspberry Pi or even an Android phone would probably be better candidates for this task.

I would love to test a pure Arduino solving solution if you develop one ;)
 - input 54 facelets colors: 0, 4, 4, 5, 5, 5, 4, 4, 4, 5, 5, 4, 1, 1, 3, 5, 5, 3, 3, 1, 1, 1, 2, 2, 1, 2, 2, 5, 2, 1, 1, 4, 4, 1, 2, 2, 2, 3, 3, 0, 3, 3, 0, 4, 2, 3, 0, 0, 3, 0, 0, 5, 0, 0
 - output solution (Singmaster notation): FUFD'

BTW Cube Solver does not get on-line, solution is computed on local PC and sent to Arduino via USB

Let us know


Title: Re: Rubik's cube Robot solver
Post by: slowowl on Feb 20, 2015, 02:37 pm
Hi Kas,

For the Video, I've been playing with the OV7670+Fifo, it is quite easy to interface with a Due.
You can check my video at https://www.youtube.com/watch?v=zgiL_f0HxRc.

For the servo control, I got a servo board for 6 DOF robot arm, both off the shelf, it is controlled through UART.

I try to use a the robot arm to move the cube from 2 cube clamp that are at a 90 degree angle.
Each clamp can be rotated with a stepper motor, the DOF clamp holding the top layer at fixed position while the 2 bottom layers are rotating.

It turns out the DOF arm I had is not accurate enough, especially when moving the cube from 1 clamp to the other 1.

I think your method is simpler, I think I could reuse my servo board, but I will have to build your robot myself (which I'm not very good at. For me programming is easier).

I'm not too familiar with Rasberry Pi neither with interfacing with an Android phone.

I'm more an Arduino purist (everything Arduino). If Arduiino DUE is not sufficient, we can always go to Gallileo... ;)

I will look into building your robot controlled by Arduino, with video capture from Arduino and Arduino computing the (non-optimum) solution, probably using the Fridrich method (average 60 moves).

BTW which cube did you use ?

I think the standard size is 54mm.
But there are smaller ones.

Also Speed Cuber are using special cube that are more forgiving for face misalignment, meaning that if a face is not totally aligned, you can still rotate a perpendicular face without 'LOckiNG' the cube, and the cube realign itself.

For such cubes I would look into the 'DALIANG ZANCHI' or mini-ZANCHI (for smaller cube), you can get it on ebay, but also there is a good vendor in the US (www.lubix.com).

Title: Re: Rubik's cube Robot solver
Post by: slowowl on Feb 20, 2015, 02:52 pm
small correction US vendor for SPeed cubers is www.lubixcube.com (lubricated cube, forgive face misalignment).
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 21, 2015, 08:55 am
Quote
For the Video, I've been playing with the OV7670+Fifo, it is quite easy to interface with a Due.
You can check my video at https://www.youtube.com/watch?v=zgiL_f0HxRc.
Impressive  :o
Make sure that the OV7670 is smart enough to differenciate Orange and Red colors



Quote
BTW which cube did you use ?
I use a Dayan GuHong (57 mm)
not lubricated, very smooth, easy corner cutting (https://www.youtube.com/watch?v=hFhhyd0p_YY)
I ordered from Amazon, to get fast delivery, got it shipped from China (3 weeks  :smiley-evil: )

The DaYan ZhanChi is also very good, do not use the not so smooth genuine Rubik's Cube(tm)
The reference site in China for cubes: http://lightake.com/c/DaYan_001001005 (http://lightake.com/c/DaYan_001001005)

Title: Re: Rubik's cube Robot solver
Post by: rjplant on Mar 07, 2015, 08:07 pm

I am currently working on  a project...a rubik cube solver. I am building this using legos and arduino.
I am using 8 servos(4.8-6v) for the project. My idea is to use a 9v battery for the arduino and a seperate power supply for the servos and sensors i am going to use.I do not understand what type of power supply would be better to use to control 8 servos. A Ni-mh battery pack or power supply? I dont really understand...what do you suggest ?
Please help
Thank you
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 09, 2015, 10:14 am
Hi rjplant,

First let me describe my setup
For convenience, I use two Lithium phosphate (http://en.wikipedia.org/wiki/Lithium_iron_phosphate_battery) batteries (6.4V, 1500mA) to power both Arduino and servo's

(http://i.imgur.com/D0Pswmk.jpg)


LiFePO4 batteries have a very constant discharge voltage. Voltage stays close to 3.2V during discharge until the battery is exhausted.
Thoses batteries also have a high burst discharge rate (15C -> 22A)
I first used this battery chemistry for my GPS Logger (http://forum.arduino.cc/index.php?topic=199019) project


Connecting both Arduino and servo's to the same power supply is not strickly kasher, but it works flawlessly.
In this project there is four servo's, but during any move, only one servo is actually powered.

I also replaced battery holder wires with thicker ones to reduce voltage drop:
(http://i.imgur.com/hWammlJ.jpg)


Now, for your project with 8 servo's  :o , how many will spin at the same time ??
You may have to use a separate supply for the Arduino, to avoid possible CPU resets
Can you describe your setup and/or post a photo ??



Title: Re: Rubik's cube Robot solver
Post by: rjplant on Mar 09, 2015, 08:58 pm
Thank you for the reply kas.
I will use a separate power supply for the arduino. I am planning to use power supply for the servos. I have converted the power supply I have into a dc power supply(image 3).
4 motors(maximum) will be spinning at the same time
below are the images of my setup.
I have employed 4 claws(4 servos) and each claw has a servo which brings it backwards when the claw is finished turning the cube.
as 4 servos will be spinning at same time how much voltage does my power supply be able to supply?

thank you
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 10, 2015, 08:18 am
Quote
as 4 servos will be spinning at same time how much voltage does my power supply be able to supply?
:o  :o  :o   
Even with 10 servo's, 5 Volts will be enough, you just will need more amp's  ;)

Typical stall current for a standard servo is 1 Amp
So with 4 servo's spinning at the same time, you will be definitely safe with a 5Volt/5Amp power supply

Do not forget to connect Arduino's and servo's grounds

Also make sure that the Cube can't jam the system if misplaced
a servo may stall and fry it in a couple of seconds
You can detect servo stall by monitoring Amp's with a 0.5 ohm shunt resistor or a dedicated sensor

BTW, nice setup
Out of curiosity, how do you perform color recognition ??


Title: Re: Rubik's cube Robot solver
Post by: rjplant on Mar 10, 2015, 07:00 pm
My software friend is working on a mobile application for the color recognition part.
the output of the power supply i am using is +5@15A, +3.3V@15A, +12V@20A,...so the 5v connection would be enough right?
and i  read on the internet that its not possible to control 8 servos without using a servo shield, and its not safe to connect the power supply directly to the servos, is it true?


thank you
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 10, 2015, 10:02 pm
Quote
the output of the power supply i am using is +5@15A, +3.3V@15A, +12V@20A,...so the 5v connection would be enough right?
Right


Quote
i  read on the internet that its not possible to control 8 servos without using a servo shield, and its not safe to connect the power supply directly to the servos, is it true?
Please send me a link to these statements
The standard Servo library allows for up to 12 servo's
Each servo consumes one digital pin, no need for a servo shield

A servo shield (https://learn.adafruit.com/adafruit-16-channel-pwm-slash-servo-shield/overview) is useful to spare digital pins, as it is connected via I2C and requires only 2 pins
It also saves Arduino processing overhead.



Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Mar 11, 2015, 09:14 am
Hey kas! I am new to python. I am unable to execute the python code you provided. How do I install the tkinter, serial etc modules...can you give a step by step tutorial.

I'll be uploading my bot's pictures and videos in a few days.
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 11, 2015, 06:51 pm
Quote
Hey kas! I am new to python. I am unable to execute the python code you provided. How do I install the tkinter, serial etc modules...can you give a step by step tutorial.
What is your Operating System ??
What did you install ??   can you launch IDLE ide ??
Any error message ??
More info please

Title: Re: Rubik's cube Robot solver
Post by: rjplant on Mar 12, 2015, 07:41 pm
Hey kas,
I couldn't find the link. I spoke to my instructor at school and  he said the exact same thing you mentioned in ur previous post.
Thank you for the help
and again I need to connect a emergency stop button...When I press it... everything should stop....how am I supposed wire it? Should I wire it across the main power supply connection?
Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Mar 12, 2015, 08:24 pm
 :smiley-sad-blue:

my operating system is win7. i have installed python 3.4 IDLE. i get this error message:

Traceback (most recent call last):
  File "C:\Users\Dhiraj\Desktop\project\RubikKasBot_13.py", line 14, in <module>
    from tkinter import *
ImportError: No module named tkinter

i understand that the tkinter module is not installed but i cant install it!
also is this code in python v3 or v2?
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 12, 2015, 10:48 pm
Quote
Each servo consumes one digital pin, no need for a servo shield
Well...    connecting height servo's is not an easy task  :smiley-roll:
I suggest using a plain standard shield and add 8 female headers, a switch and a DC jack

(http://i.imgur.com/HqpWXKR.jpg)


Quote
and again I need to connect a emergency stop button...When I press it... everything should stop....how am I supposed wire it? Should I wire it across the main power supply connection?
The shield switch would immediately stop all servo moves



Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 13, 2015, 08:06 am
Quote
File "C:\Users\Dhiraj\Desktop\project\RubikKasBot_13.py", line 14, in <module>
    from tkinter import *
ImportError: No module named tkinter
tkinter IS already bundled with Python recent releases, no need for a separate download  :smiley-roll:


Quote
also is this code in python v3 or v2?
My code has been developped using IDLE 3.4.1

FWIW, the correct syntax is
Python 2.x:    from Tkinter import *
Python 3.x:    from tkinter import *

You probably don't have the right Python version/package, let me have a link to your downloaded file
Are you 16 or 32 bit ??
Can you run a simple code from the ide (w/o tkinter lib calls) ??

If really Python can't access tkinter, try this:
Go to Configuration > System > Advanced System Settings > Environment Variables
Under system variables create a new Variable called PYTHONPATH with values:
C:\Python34;C:\Python34\Lib;C:\Python34\DLLs;C:\Python34\Lib\tkinter
(assuming python34 is located at C:\ , as advised by most developpers)



Title: Re: Rubik's cube Robot solver
Post by: angus789 on Mar 14, 2015, 11:31 pm
Hello guys
i am trying to build a robotic arm using 5 servos. i am an amatuer at this stuff and trying to make it a hobby.I am trying to figure out how to make the connections...i have seen the previous posts in this thread and thought i should use a power supply to power the circuit, as i have one lying around. from what i know and the information i gathered from internet i have made the following connections
is this the correct way of connecting the circuit. do i have to use any other components on the circuit?
and one more thing when i connected the power supply with the following connections one of my servos failed to work properly. it was jittering while rotating. i thought the reason was improper power supply but the remaining servos are working perfectly fine
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 15, 2015, 09:07 am
Hi angus789

Your schematic is Modern Art, nice but a bit messy  ;) 

(http://i.imgur.com/hN3coon.jpg)

for more realistic result, you may try Fritzing (http://fritzing.org)
I suspect Servo 2, 3 and 4 supplies should be reversed
Also 4 X 1.5V is a bit low for the Arduino (4 NiMH's won't work), try using a 9V battery
Make sure you connected servo's and Arduino grounds, as per your drawing
You may also use the Arduino shield described in reply #63



Quote
...and one more thing when i connected the power supply with the following connections one of my servos failed to work properly. it was jittering while rotating
Try swapping two servo's, just to make sure the jittering servo is not deffective
Do you get problems only when several servo's are actuated ??
How many Amp can you get from your power supply ??
Servo's shouldn't be powered through PC board traces, use thick wires to avoid voltage drops

Title: Re: Rubik's cube Robot solver
Post by: angus789 on Mar 15, 2015, 09:22 pm
hi kas
thumbs up for fritzing
i have tried swapping the servos and seems the servo was faulty
the power supply i am using produces 5v~22A
i have connected the jumper wires i bought along with the arduino..i observed that they were melting...i guess they couldn't handle the high current
i am now using thick wires...seems like they are fine
i have attached a new drawing i made using fritzing ..please take a look at it
do u recommend adding any voltage regulators to the servos ?
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 16, 2015, 08:14 am
Quote
hi kas    thumbs up for fritzing
(http://i.imgur.com/LcoVmdq.jpg)
Congratulation, you now master a new tool  8)


Quote
i have attached a new drawing i made using fritzing ..please take a look at it
Nice and OK


Quote
do u recommend adding any voltage regulators to the servos ?
No, would't work
Most linear regulators request 6.5V input to produce 5V
Your (PC ??) power supply is probably regulated

Title: Re: Rubik's cube Robot solver
Post by: tecuser on Mar 17, 2015, 12:20 am
Excellent setup, kas.

I was so excited to start my Rubik's scrambler project but am instantly discouraged. Most of my projects fail as a result of me attempting to craft, from scratch, each component needed. This time around, I was immediately excited as I am willing to purchase x2 grippers that are strong enough to support/rotate a standard 3x3x3 cube. I've been unable to find any suitable options for sale, each gripper looks like the last and they all support (on average) 70mm or less (I figure the distance from any two corners on one face of my cube is roughly 88.9mm)

Have you come across any quality grippers for sale that may work? It's discouraging to be stuck at such an early stage of this simple project, but I cannot find suitable hardware.

The only gripper remotely close to adequate is: https://www.sparkfun.com/products/13174 - although it doesn't feel like the right fit.
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 17, 2015, 08:03 am
Quote
Excellent setup, kas
Thanks  8)


Quote
Have you come across any quality grippers for sale that may work? It's discouraging to be stuck at such an early stage of this simple project, but I cannot find suitable hardware
No, but it was fun to build my own
Do you have access to a CNC or a laser cutter ??   you can use the attached drawing at Post #28

If there is sufficient interest, I may consider to cut a batch of grippers and sell them for a minimal fee  ::)

Title: Re: Rubik's cube Robot solver
Post by: tecuser on Mar 18, 2015, 01:22 am
I don't, unfortunately. I'm much more of a software guy.

Is a shame that there aren't more options for hobbyists. Very generous to extend the offer to sell your own cuts, but I think I'll take this motivation and turn it into a new design (one I can actually accomplish :) ). Will try to keep you updated, although I'll likely do so in my own thread (as not to steal your thunder) and guide you towards it.
Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Mar 18, 2015, 06:10 pm
hey kas!

i am sorry for the late reply! the python code is working...it compiles...i am stuck with my project just because of the GRIPPERS. my grippers are made out of cardboard. Its not at all good. I really appreciate your idea of selling it for a nominal fee. ( consider the value it would be in Rupees :-/ )

P.S:
As you know I'm a student, i'd appreciate you charging as little as possible ( i will never forget this help!). My friend's friend owns a dremel tool but is not willing to share it, and he doesnot have the time to craft two grippers all by himself.

Here is the picture of my gripper.
Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Mar 18, 2015, 06:23 pm
better view
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 18, 2015, 10:43 pm
@tecuser
Quote
Very generous to extend the offer to sell your own cuts, but I think I'll take this motivation and turn it into a new design (one I can actually accomplish :) ). Will try to keep you updated
Please share your design when available. The critical point is definitely rigidity during rotation





@dd5665

(http://i.imgur.com/uWPGfoQ.jpg)
Manual CNC!!   impressive  :o

Quote
As you know I'm a student, i'd appreciate you charging as little as possible
Don't worry   ;)
Let me have your postal address via Private Message (clic on my avatar and "send PM")





Title: Re: Rubik's cube Robot solver
Post by: rjplant on Mar 22, 2015, 02:01 am
hi Kas
how are you?
need you help again
my circuitry is similar to angus789(but 8 servos)
the servos are  shaking when activated(not all of them but at least one of them each time i run the code). what could be the reason?
i am using standard servos and at least 5 servos will be running at one time. For this setup i am using 22 gauge wires. a standard servo consumes about 1amp ...maximum, right? for five servos do you think 22guage are good ?
when i connect the circuit this way is there a chance that if one of the servos demands more current and the rest get the same? because last time i was working on them two servos produced smoke and failed to work. they were not stalled.
Title: Re: Rubik's cube Robot solver
Post by: TomGeorge on Mar 22, 2015, 10:02 am
Hi,
Have you monitored the Voltage of the supply that powers the servos, see if it fluctuates.
Have you got the gnd leads all in a star to a common earth point, the same with the servo positive leads to the supply.
Daisy chaining common connections, is not a good idea, especially with gnd wiring as the currents flowing can produce noise.

Tom.... :)
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 22, 2015, 05:10 pm
Further to Tom's advices, try thicker gauge for the "general" supply area (more than one servo).
You may also add a 1000uF (1mF) capacitor to provide larger amounts of current during motor start
Please confirm your power supply specs (Volts, Amps)


Quote
when i connect the circuit this way is there a chance that if one of the servos demands more current and the rest get the same?
because last time i was working on them two servos produced smoke and failed to work
:o  No, no chance, refer to Ohm law
There is something wrong in your setup, please give more info and photos




Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 22, 2015, 05:48 pm
Quote
Don't worry   ;)
Let me have your postal address via Private Message (clic on my avatar and "send PM")
Shipped  :)
Let me know when you get it
I sent you one gripper only, as it fit in a standard A5 envelope (will go faster through custom)

You may damage the parts if you just tear them out of the board, carefully cut the tabs with a utility knife
Parts also request some sanding to get them smooth

You need screws and hardware as described in post #42

Finally, as soon as you can duplicate the test in post #6, I will cut and send you the other gripper
Take your time, go step by step, this is a modular project

(http://i.imgur.com/gVtZChY.jpg)

Enjoy  ;)


Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Mar 22, 2015, 07:21 pm
 :D  :D thanx a ton!!!!!

i can't tell u how happy i am...i'll tell u wen i receive it. thank u so much!!!!!!!!!!!!
Title: Re: Rubik's cube Robot solver
Post by: rjplant on Mar 22, 2015, 08:16 pm
hey Tom,
something like this?
Title: Re: Rubik's cube Robot solver
Post by: rjplant on Mar 22, 2015, 08:18 pm
Further to Tom's advices, try thicker gauge for the "general" supply area (more than one servo).
You may also add a 1000uF (1mF) capacitor to provide larger amounts of current during motor start
Please confirm your power supply specs (Volts, Amps)

 :o  No, no chance, refer to Ohm law
There is something wrong in your setup, please give more info and photos





hey kas

i am using a computer power supply.
am using 5v supply. its rated 5v~30A
Title: Re: Rubik's cube Robot solver
Post by: TomGeorge on Mar 22, 2015, 09:20 pm
Hi,
I would call that daisy chain, are you using protoboard as in that fritzy diagram?
Can you post a picture of  your project please.

Protoboard is not designed for the amount of current that 4 servos would need.

Tom..... :)
Title: Re: Rubik's cube Robot solver
Post by: rjplant on Mar 23, 2015, 12:21 am
yes, am using a protoboard.

what would you suggest me to use, if not the protoboard?

below are the images of my setup...8 servos in total.
I have employed 4 claws(4 servos) and each claw has a servo which brings it backwards when the claw is finished turning the cube.

at least 4motors will be spinning at the same time.
i am using a arduino mega r3. i will use a separate power supply for the arduino. It is rated 5v~30Amp. A power supply(removed from an old computer) will be used for the servos. As these servos require 4.8v to 6v to run i am using the 5v terminal from the power supply.

i am sorry these are the only pictures i have ,as of now.I will upload more clear and detailed pictures tomorrow.
Title: Re: Rubik's cube Robot solver
Post by: rjplant on Mar 24, 2015, 01:19 am
hey Tom , Kas
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 24, 2015, 08:06 am
Quote
what would you suggest me to use, if not the protoboard?
This is my suggested layout for 4+ servo's spinning at the same time

1 X  standard shield  (3 bucks shipped (http://www.ebay.com/itm/Prototyping-Prototype-Shield-ProtoShield-With-Mini-Breadboard-For-Arduino-/251726829985?pt=LH_DefaultDomain_0&hash=item3a9c1699a1))
3 X  8 pin headers
1 X  screw terminal
1 X  1000uF 15V electrolytic capacitor

To minimize voltage drop, I would solder 22 gauge bare wires along the "plus" and "minus" pcb traces

(http://i.imgur.com/qyQnYBw.png)
http://imgur.com/qyQnYBw (http://imgur.com/qyQnYBw)

Also make sure that connections from shield to servo's are as short as possible

Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Apr 01, 2015, 05:56 pm
Hey kas! I still havnt received the gripper! I guess I forgot to give my contact no. Do you have any tracking ID or anything so that I could track the shipment?
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 01, 2015, 08:47 pm
Relax
I sent the envelope on March 22nd by normal mail, not FedEx or DHL
Should arrive within 2 weeks according to Post office
If you don't receive it, I will send another one on April 15th

Just be patient  :smiley-razz:

Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Apr 09, 2015, 05:06 pm
Hey kas! Thank you so much! I received the gripper today! It was in perfect condition. I am really thankful to you for sending me that!

I'll assemble the parts in the coming days and test the code u have given on post #6. Can you send the other gripper soon? My project deadlines are coming this April end and since it took almost 20 days to reach here.  :smiley-confuse:

Thanx again!

Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Apr 09, 2015, 05:15 pm
:-)
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 11, 2015, 07:47 am
Quote
Halo kas!
You done an amazing job.I just got the parts for the robot and built a claw below first claw on a cub...
(http://i.imgur.com/f8zlNUd.jpg)

:smiley-eek:  :smiley-eek:  :smiley-eek:  :smiley-eek:


Superb implementation, thanks for sharing  :smiley-cool:   
How did you cut the parts??
please elaborate


Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 11, 2015, 07:58 am
Quote
Hey kas! Thank you so much! I received the gripper today! It was in perfect condition. I am really thankful to you for sending me that!

I'll assemble the parts in the coming days and test the code u have given on post #6. Can you send the other gripper soon? My project deadlines are coming this April end and since it took almost 20 days to reach here.  :smiley-confuse:

Thanx again!
Hi dd5665
Great to know you received the gripper  :)  :)
I will have access to the CNC early next week, parts should be sent wednesday at the latest
If you have any modification to your postal address (contact no), let me know via PM
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 14, 2015, 10:00 pm
Quote
Halo Kas1
i cut the parts with a laser cutting machine,i used plexiglass of 5mm,and for the base (some pictures below) i used 1,6 cm (width) steel pipe with quadratic profile from an old troler
Very smart setup   8)    Thanks for posting

(http://i.imgur.com/U4S7RKP.jpg)

Feel free to post a moving cube video



@dd5665
Second gripper shipped this morning   ;)


Title: Re: Rubik's cube Robot solver
Post by: Wykikamukow on Apr 20, 2015, 07:57 am
Hi Kas.

First off I'm really impressed. You've inspired me to have a go at making something similar.

Have you got a video of your 'bot completing a randomized cube? I'm trying to get my head around how you keep track of where each side is.

My understanding if you're looking at it from the side (similar to pic in last post) depending on where your camera is located the gripper on the left can rotate the Front side and the gripper on the right can rotate the Down side.

When solving the cube if you need to rotate the Up side the left gripper needs to turn the cube 180 degrees in two steps which will then allow the right gripper to rotate the Up side. After this move has finished do you then reverse the moves so the cube is back in it's original state? ie. left gripper is once again Front and right gripper is Down?

Sorry, hope all that made sense.

I'm doing it slightly different without an Arduino. I've got a SSC32 servo controller which I'll be controlling directly from a PC.

Title: Re: Rubik's cube Robot solver
Post by: garfield38 on Apr 20, 2015, 08:38 am
Hi

I have seen your rubiks solver at the casemate. Could someone print me the parts ?
Let me a message about the date and price.

Is there any wiki page for the part list ?

Thanks
Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Apr 20, 2015, 07:42 pm
Hey kas!

Thanx once again! I'll let you know once I receive it!
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 20, 2015, 09:00 pm
Hi Wykikamukow

Quote
First off I'm really impressed. You've inspired me to have a go at making something similar
thanks   8) 



Quote
My understanding if you're looking at it from the side (similar to pic in last post) depending on where your camera is located the gripper on the left can rotate the Front side and the gripper on the right can rotate the Down side.

When solving the cube if you need to rotate the Up side the left gripper needs to turn the cube 180 degrees in two steps which will then allow the right gripper to rotate the Up side. After this move has finished do you then reverse the moves so the cube is back in it's original state? ie. left gripper is once again Front and right gripper is Down?
Sorry, hope all that made sense.
It does  ;)


(http://i.imgur.com/72XtOIn.jpg)

The front cube face is facing the camera
According to Singmaster notation (http://forum.arduino.cc/index.php?topic=271827.msg1946292#msg1946292), the only "native" moves are
 - D (Down CW), D' (Down CCW) with the right gripper
 - B (Back CW) and B' (Back CCW) with the left gripper

For other moves, cube has first to be rotated

F (Front) move:   x2, B, x2
 - 2 X 90° rotation with the right gripper
 - B move with the left gripper
 - 2 X 90° rotation back with the right gripper

U (Up) move:   y2, D, y2
 - 2 X 90° rotation with the left gripper
 - D move with the right gripper
 - 2 X 90° rotation back with the left gripper



Quote
I'm doing it slightly different without an Arduino. I've got a SSC32 servo controller which I'll be controlling directly from a PC.
Keep us posted, good luck :)



Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 20, 2015, 10:46 pm
@garfield38
Quote
I have seen your rubiks solver at the casemate. Could someone print me the parts ?
I have contacted the Casemate FabLab, and requested they cut the parts for you
I will send you a PM as soon as I get a confirmation

Quote
Is there any wiki page for the part list ?
Will be added to Reply #1 (http://forum.arduino.cc/index.php?topic=271827.msg1915869#msg1915869) within a few days





@dd5665
Quote
Hey kas!
Thanx once again! I'll let you know once I receive it!
Let's hope this one will reach India faster than the previous one  ::)



Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 21, 2015, 11:35 am
Quote
@garfield38
Quote
I have seen your rubiks solver at the casemate. Could someone print me the parts ?
I have contacted the Casemate FabLab, and requested they cut the parts for you
I will send you a PM as soon as I get a confirmation
PM sent...


Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 22, 2015, 07:59 am
Quote
Quote
Is there any wiki page for the part list ?
Will be added to Reply #1 (http://forum.arduino.cc/index.php?topic=271827.msg1915869#msg1915869) within a few days
Done  ;)
Let me know if you need more détails


Title: Re: Rubik's cube Robot solver
Post by: garfield38 on Apr 23, 2015, 02:27 am
Thanks for the wiki. What is the size of the standard servo ? I have several types at home.

I have recover the name of the arduino board dedicated to manage servo with an integrated bluetooth modem:

(http://www.mibqyyo.com/articulos/wp-content/uploads/sites/4/2014/06/01.-Placa-controladora.png)

I have tested it with 8 servos 9g and it's work. May be for inrush current a capacitor can be added on the power line with a standard servo connectors.
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 23, 2015, 09:39 am
Quote
Thanks for the wiki. What is the size of the standard servo ?
Length 40mm, Width 20mm, Height 36 to 40mm


Quote
I have recover the name of the arduino board dedicated to manage servo with an integrated bluetooth modem
Nice card  8)
are the servo's connected to Vin or Vdd (5V) ??
let us have a link to it


Quote
May be for inrush current a capacitor can be added on the power line with a standard servo connectors
No real need for this project, as only one servo is actuated at the same time


Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Apr 25, 2015, 06:32 pm
Hey kas!

Can you explain the servo limits?


#define    OPEN                132
#define    CLOSE                132
#define    CW                    0
#define    MID                  87
#define    CCW                 171

which one does what?
Title: Re: Rubik's cube Robot solver
Post by: HermannSW on Apr 25, 2015, 08:18 pm
Perhaps more grippers would allow for more speed ...
Cubestormer 3 video (https://www.youtube.com/watch?v=X0pFZG7j5cE) 

Hermann.
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 25, 2015, 08:39 pm
3.25 seconds   :o   
This will be my next project  ;)

BTW, color scanning and recognition steps are not shown in this video

Thanks for sharing

Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 26, 2015, 07:36 am
Quote
Hey kas!
Can you explain the servo limits?

#define    OPEN                132
#define    CLOSE                132     <---  wrong value
#define    CW                    0
#define    MID                  87
#define    CCW                 171

which one does what?
Those settings are coded in CubeMover V1.2 (http://forum.arduino.cc/index.php?topic=271827.msg2063754#msg2063754) Arduino sketch

looking at picture shown at post #98
 - "DOWN" gripper (D move) is near the camera
 - "BACK" gripper (B move) is opposite to the camera

Each gripper has a Pinch (seizing servo) and a Wrist (rotation servo)
Pinch:
 - CLOSE defines minimum opening (57mm - 8mm),  should allow a firm cube grip during moves
 - OPEN defines maximum opening (57mm X 1.414 + 2mm),   should allow gripper rotation without touching the cube

Wrist:
 - CW defines max clockwise rotation (+90°)
 - MID defines zero position (0°)
 - CCW defines max counterclockwise rotation (-90°)
CW, MID and CCW should be fine tuned to obtain nice 90° moves, to avoid jamming

My current settings:
Code: [Select]

// ---------- user adjustments -------------------
#define    DOWN_CLOSE          91
#define    DOWN_OPEN          132
#define    DOWN_CW              6
#define    DOWN_MID            89
#define    DOWN_CCW           172

#define    BACK_CLOSE          84
#define    BACK_OPEN          129
#define    BACK_CW              2
#define    BACK_MID            87
#define    BACK_CCW           171

#define    LOW_SPEED           50
#define    HI_SPEED           100

You may notice that DOWN and BACK gripper settings are slightly different, as all servo's are not created equal ;)

The demo code (post #6) uses only one gripper and is very convenient for servo's tuning
Should you need additional info, please ask

Did you assemble the gripper??   any photo??


Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Apr 26, 2015, 03:08 pm
@kas

Thanks for the info!

I did assemble the gripper. Since I have my exams next month I was a bit busy and hence I didn't upload a photo.

Also, It took me 1 week of searching in all the local hardware stores but still I couldn't find M3 sized nuts and bolts. Later I had to search my collection of screws and got some and managed some from a friend.
I'll have to order nuts and bolts from the net for the second gripper! :-D

Anyway, you have been really very helpful kas!
Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Apr 26, 2015, 03:14 pm
photo
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 27, 2015, 05:20 pm
Servo pins where inverted in Gripper demo V1.2 (http://forum.arduino.cc/index.php?topic=271827.msg1944184#msg1944184)

Code: [Select]
   ...
  pinch_servo.attach(rot_pin); 
  rot_servo.attach(pinch_pin, 580, 2570);
  ...

is now 
  ...
  pinch_servo.attach(pinch_pin); 
  rot_servo.attach(rot_pin, 580, 2570);
  ...

Sorry  :-[


Title: Re: Rubik's cube Robot solver
Post by: lfljti on May 05, 2015, 10:46 pm
Hello, Kas!

I've been following this thread for a couple of weeks and just now I could finish to assemble my grippers and my base!
Really liked your design and just made a few adaptions, as you can see in the attached pictures! Hope you don't mind!

The problem is that I am not very familiar to Arduino, neither to Python! This is my first big project using Arduino, btw... So I was hoping you could help me work it out!

I can't even compile the CubeMover12 file! I downloaded and istalled the VarSpeedServo library properly (I think), but I keep getting this error message (among others):


cube.cpp: In member function 'void Cube::seize()':
cube.cpp:63:59: error: no matching function for call to 'VarSpeedServo::write(int, int&, bool)'
  _downPinch_servo.write(_downClose + SEIZE, _speed, false);


It says that  candidate expects 1 argument, 3 provided


Sorry if I am making a stupid mistake! Just am really new with this and very excited to finish the work! Hahaha!

Cheers!
Title: Re: Rubik's cube Robot solver
Post by: kas on May 06, 2015, 07:41 am
Quote
Really liked your design and just made a few adaptions, as you can see in the attached pictures! Hope you don't mind!
Let's share and improve  ;)
Your stand design for the camera is clever


Quote
can't even compile the CubeMover12 file! I downloaded and istalled the VarSpeedServo library properly (I think), but I keep getting this error message (among others):

cube.cpp: In member function 'void Cube::seize()':
cube.cpp:63:59: error: no matching function for call to 'VarSpeedServo::write(int, int&, bool)'
  _downPinch_servo.write(_downClose + SEIZE, _speed, false);
Your call to the write() function seems to include a pointer reference (int&)  :smiley-slim:  :smiley-slim:
 - please cut/paste ALL compiling errors
 - did you modify CubeMover12 by any means ??
 - let me have a link to the VarSpeedServo Library you downloaded

Title: Re: Rubik's cube Robot solver
Post by: lfljti on May 06, 2015, 01:00 pm
Your call to the write() function seems to include a pointer reference (int&)  :smiley-slim:  :smiley-slim:
 - please cut/paste ALL compiling errors
 - did you modify CubeMover12 by any means ??
 - let me have a link to the VarSpeedServo Library you downloaded


I have atached a .txt file to this message with all complining errors...

Did not modify anything in CubeMover 12!

And downloaded VarSpeedServo Library from this forum : http://forum.arduino.cc/index.php?topic=61586.0


Thanks for the fast reply!
And, please, tell me if you find out anything!

Regards!
Title: Re: Rubik's cube Robot solver
Post by: dd5665 on May 06, 2015, 03:19 pm
Hey kas!

Its almost 20 days and I still havn't received the other gripper. I'm really worried! I think the people at the customs didn't let it go through this time or maybe Indian posts lost the package! What do I do now!?
Title: Re: Rubik's cube Robot solver
Post by: kas on May 06, 2015, 06:31 pm
@lfljti
Quote
And downloaded VarSpeedServo Library from this forum : http://forum.arduino.cc/index.php?topic=61586.0
This version is NOT compatible with Arduino IDE V1.x
Go here (https://github.com/netlabtoolkit/VarSpeedServo) and press <Download ZIP>

Parts list (http://forum.arduino.cc/index.php?topic=271827.msg1915869#msg1915869) updated accordingly



@dd5665
Quote
Its almost 20 days and I still havn't received the other gripper
Relax  ;)     let's wait another week
Are you able to move the first gripper ??

Title: Re: Rubik's cube Robot solver
Post by: lfljti on May 06, 2015, 07:21 pm
Great, Kas!

It compiled, now!!
Thanks so much!!

Struggling to make the Python code run now! Hahaha!
Title: Re: Rubik's cube Robot solver
Post by: dd5665 on May 07, 2015, 12:03 am
@kas

yeah! first gripper is working perfectly! okay lets wait for one more week! :-/
Title: Re: Rubik's cube Robot solver
Post by: dd5665 on May 08, 2015, 02:14 pm
Hey kas!

I received the gripper today! Phew! Finally!

Now i'll assemble the parts and let you know. My exams are from 23rd this month. So, I'll be a bit busy :-(
Title: Re: Rubik's cube Robot solver
Post by: kas on May 08, 2015, 03:23 pm
Quote
It compiled, now!!
Thanks so much!!
Next step: Python 3.4 installation and configuration (with Idle IDE)
When you are done, please post a detailed "how to" for the community



Quote
I received the gripper today! Phew! Finally!
I told you to relax   ;)
Good luck for your exams

Title: Re: Rubik's cube Robot solver
Post by: dd5665 on May 23, 2015, 10:25 pm
Hey kas!

I was wondering what will be the best way to interface the servos such that there will be no jitter in the signals. You have used a custom shield for the servos, can you tell me if I can diy a shield for the 4 servos?

Title: Re: Rubik's cube Robot solver
Post by: kas on May 24, 2015, 08:56 am
Quote
I was wondering what will be the best way to interface the servos such that there will be no jitter in the signals
Can you describe the jitter you are experiencing (at start up / during operation)
How do you power the servo's (from the Arduino Vcc / separate supply)
Please elaborate


Quote
can you tell me if I can diy a shield for the 4 servos?
You can implement the design described in reply #85
As only one servo is running at the same time, you don't need any capacitor


Title: Re: Rubik's cube Robot solver
Post by: kas on May 26, 2015, 03:08 pm
This is my new (cleaner) custom shield

(http://i.imgur.com/LEOsbLP.jpg)

From left to right:
- 3uF 15V tantalum capacitor
- 1X  connector led lamp
- 4X  connectors servo's
- DC jack
- buzzer
- reset button


Title: Re: Rubik's cube Robot solver
Post by: dd5665 on May 29, 2015, 02:26 pm
this one looks great! can you share the schematic? Whats a tantalum capacitor used for? what is its advantage or difference from the conventional electrolytic one?
Title: Re: Rubik's cube Robot solver
Post by: kas on May 31, 2015, 10:24 pm
Quote
this one looks great! can you share the schematic?
No schematic available, these photos should help

(http://i.imgur.com/blIkoPB.jpg)

For convenience, left photo has been mirrored (flip horizontal)




Quote
Whats a tantalum capacitor used for? what is its advantage or difference from the conventional electrolytic one?
The capacitor removes noise
Tantalum electrolytic capacitors have more Farads per grams, you can use standard ones



Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Jun 14, 2015, 07:47 pm
hey kas!

my project is almost done....but the cube falls off. This happens since the grippers are slightly off centered....i mean the grippers hold the cube off-centered. Me and my project partners are not being able to figure out how to correct this. I am going to give a last try tomorrow by shifting the grippers closer to each other almost so as they touch each other. Will that work out?

P.S:

Project submission is on 16th :-(
Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Jun 14, 2015, 07:55 pm
This is my setup
look at the distance between the grippers
Title: Re: Rubik's cube Robot solver
Post by: kas on Jun 14, 2015, 09:42 pm
Hi dd5665

Your wrist servo's are not mounted symetric, this may have an impact on alignment
Also make sure that boards are perpendicular

I enclose a pdf for the two boards (also available in eps, dxf, ai)
Important: dimensions are OK for a 57mm Rubik's cube

Let me know if it helps

Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Jun 15, 2015, 06:27 pm
Hey kas!

Thanx a lot for that drawing. We aligned the grippers near-perfectly. Somehow.
Theres another problem now. We were using an indian clone called induinoX. I dont knw why but after scanning 4 sides of the cube. The message arduino not responding shows up in the console window.

I tried reducing the baud rate of serial communication in both cube mover.ino as well as in the python script to 9600 but it still doesnot work.

Title: Re: Rubik's cube Robot solver
Post by: kas on Jun 15, 2015, 07:14 pm
Probably not enough juice for the Arduino
try checking with a DVM

How do you power the board ??

Quote
I dont know why but after scanning 4 sides of the cube...
Seems that you get problems when the BACK wrist servo starts playing
My guess:
At some point, this servo may be blocked fully CW or CCW and sucks current
try moving the servo arm by one or two steps

Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Jun 15, 2015, 07:34 pm
No the grippers dont get stuck or anything.
When i press scan cube button. it scans the faces one by one but after scanning foursides, when its about to scan the up face. It gives the error.

I power the board using the PC USB
Title: Re: Rubik's cube Robot solver
Post by: kas on Jun 15, 2015, 07:53 pm
Quote
when its about to scan the up face. It gives the error
That's when the BACK wrist servo is energized
Try changing back wrist servo


Quote
I power the board using the PC USB
=500 mA  only :smiley-eek:       you get processor brownout
You need a 2 amps wall adapter

Google for brownout servo arduino


Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Jun 15, 2015, 08:08 pm
no i power the servo using a separate SMPS (one used in desktop pcs)
only arduino using the usb
Title: Re: Rubik's cube Robot solver
Post by: kas on Jun 15, 2015, 08:26 pm
Make sure Arduino and servo grounds are connected

possible bad servo
is your back wrist servo moving normally for scan #5 (top face) ??
try permuting servo
 
Do you get error message when running with servo's power OFF ??

Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Jun 15, 2015, 08:41 pm
Arduino and servo grounds are connected.
I tried the test button. this time the grippers move perfectly for all moves. I think the serial communication gets garbled messages?

can that happen? my baud rate is now 9600...should i try and decrease it?

also, what is the front 2 scan function? why should we scan the front face twice?
Title: Re: Rubik's cube Robot solver
Post by: kas on Jun 15, 2015, 09:07 pm
Quote
I think the serial communication gets garbled messages?
You may get noise, check for loose connections


Quote
can that happen?
On my bot, communication is rock solid


Quote
my baud rate is now 9600...should i try and decrease it?
No


Quote
what is the front 2 scan function? why should we scan the front face twice?
This function moves back cube to original position, no scan performed




Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Jun 15, 2015, 09:40 pm
do not compare ur robot with mine. Yours is like factory made. I wish i could intern with you for 2-3 years.  :smiley-confuse:
Title: Re: Rubik's cube Robot solver
Post by: kas on Jun 15, 2015, 09:49 pm
Quote
Yours is like factory made
CNC helps producing clean designs  ;)

Again, if you get errors when scanning Top face, Back wrist servo is the designated culprit (or connection to it)


Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Jun 15, 2015, 10:01 pm
my back pinch and rotate servos are faulty i know. I have to show my professors this way tomorrow. I'll replace the servos later on and check.

I'm studying your codes for tomorrow's presentation.

I have given your name on our thesis. :-)
Title: Re: Rubik's cube Robot solver
Post by: kas on Jun 15, 2015, 10:14 pm
Quote
I'm studying your codes for tomorrow's presentation
Good luck  ;D    let us know the outcome

Time to sleep now :smiley-sleep:


Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Jun 16, 2015, 08:25 pm
Everyone loved the robot!
I got a new arduino uno from a friend. I'll hook it up tomorrow and see if the arduino not responding problem is fixed.
Title: Re: Rubik's cube Robot solver
Post by: kas on Jun 16, 2015, 10:43 pm
Quote
Everyone loved the robot!
.      :)  :)  :)  :)

Title: Re: Rubik's cube Robot solver
Post by: dd5665 on Jun 18, 2015, 06:18 pm
Hey kas!

I have around a month's time to fix the robot completely to solve it. I will be leaving my college after a month. Today i showed the robot to our head of department and he was so impressed by it (he is a very hard-to-impress man). I want to gift our robot to our college's department. Can you help me diagnose the problem. I tried replacing the arduino with another one (this one is the official arduino uno) but the problem still persists.

Arduino not responding after 4th scan
Title: Re: Rubik's cube Robot solver
Post by: kas on Jun 19, 2015, 11:48 am
Quote
I have around a month's time to fix the robot completely to solve it. I will be leaving my college after a month
That plenty of time  ;)

Please answer ALL questions

Quote
I tried the test button. this time the grippers move perfectly for all moves
1) Please test again and confirm it actually works



Uninstall the cube

run "Scan colors"
2) Do you still have communication problems when the cube is removed (reduced servo's load)


If you still get the error message:
Disconnect all four servo's (remove plugs from shield) and run "Scan colors"
You should see debugging info in your Python shell

Code: [Select]
http://127.0.0.1:8081/?connect1
b'<HTML><BODY>\r\nDone!\r\n</BODY></HTML>\r\n'
b'OKb\r\n'
http://127.0.0.1:8081/?scanB
b'<HTML><BODY>\r\nDone!\r\n</BODY></HTML>\r\n'
b'OKl\r\n'
http://127.0.0.1:8081/?scanL
b'<HTML><BODY>\r\nDone!\r\n</BODY></HTML>\r\n'
b'OKf\r\n'
http://127.0.0.1:8081/?scanF
b'<HTML><BODY>\r\nDone!\r\n</BODY></HTML>\r\n'
b'OKr\r\n'
http://127.0.0.1:8081/?scanR
b'<HTML><BODY>\r\nDone!\r\n</BODY></HTML>\r\n'
b'OKu\r\n'
http://127.0.0.1:8081/?scanU
b'<HTML><BODY>\r\nDone!\r\n</BODY></HTML>\r\n'
b'OKd\r\n'
http://127.0.0.1:8081/?scanD
b'<HTML><BODY>\r\nDone!\r\n</BODY></HTML>\r\n'
b'OKg\r\n'
...........
3) Do you ??



Re-connect the two FRONT servo's only (camera side)
Run "Scan colors" again
4) Are the two servo's running OK ??
5) Do you see debug info as per above ??


Re-connect the BACK pinch servo (only BACK wrist servo is left disconnected)
Run "Scan colors" again
6) Are the three servo's running OK ??
7) Do you see debug info as per above ??

Let me have your answers

To be continued ...

Title: Re: Rubik's cube Robot solver
Post by: kas on Aug 04, 2015, 06:37 am
Quote
Hey Kas!

A few days ago I decided to make a cube solver robot. I really like your ideas and plans, so I have decided to make something similar. I am really enthusiastic now. I have experience in programming and I have done a couple of projects with Arduino.  I have seen your grippers and I think they are awesome.
The only problem is that I'm not able to make similar grippers because I don't have the appropriate equipment. I have found other grippers on the net, but they are very expensive. I'm a student and I'm on a low budget, that's why I can not afford to buy them.
I saw that you sent your authentic grippers to a member a few months ago. Could you send similar grippers to me? I would really appreciate it and of course I would pay for them. I would be really happy with your authentic grippers.

Thank you in advance.  :)
Hi bacsi1993,   in which part of the world do you live ??

Title: Re: Rubik's cube Robot solver
Post by: bacsi1993 on Aug 04, 2015, 01:14 pm
Hi bacsi1993,   in which part of the world do you live ??


Hey Kas!


I live in Hungary. It is a small country in the eastern part of Europe.
Title: Re: Rubik's cube Robot solver
Post by: kas on Aug 04, 2015, 08:05 pm
I live in Hungary. It is a small country in the eastern part of Europe.
OK,
I will cut and send you one gripper
As soon as you have it up and running as per post #6 (http://forum.arduino.cc/index.php?topic=271827.msg1944184#msg1944184), I will prepare and send you the second one
You need to go through this step for tuning and to really understand what you are doing

What about 4 euros /unit + 1.5 euros postage - PAYPAL
Shipping in an envelope, no insurance
If it is acceptable for you, let me have your address via PM
Title: Re: Rubik's cube Robot solver
Post by: bacsi1993 on Aug 04, 2015, 10:12 pm
OK,
I will cut and send you one gripper
As soon as you have it up and running as per post #6 (http://forum.arduino.cc/index.php?topic=271827.msg1944184#msg1944184), I will prepare and send you the second one
You need to go through this step for tuning and to really understand what you are doing

Thank you very much. :) As soon as i receive it I will definitely go through this step. Maybe I will have some questions. I can't tell you how happy i am. Thank you. :)

In your first post you mention that you use standard servos. I'm really curious what kind of servo do you use exactly. I want to use the most appropriate servo for this project. 
Title: Re: Rubik's cube Robot solver
Post by: Isaac96 on Aug 05, 2015, 04:35 pm
Any standard-size servo should work. Just make sure it is analog and 180 degrees, not continuous rotation.
Title: Re: Rubik's cube Robot solver
Post by: kas on Aug 05, 2015, 08:17 pm
Hi Isaac,
Nice to see you here  8)
Is your Android controlled (http://forum.arduino.cc/index.php?topic=173246.0) RC car up and running ??



@bacsi1993
Quote
In your first post you mention that you use standard servos. I'm really curious what kind of servo do you use exactly. I want to use the most appropriate servo for this project.
Just follow Isaac advices
Full 180° rotation is mandatory for wrist servo's only

My setup:
- Pinch servo's:  2X    AEROSTAR AS-559MG
- Wrist servo's:  2X    HITEC HS422


Title: Re: Rubik's cube Robot solver
Post by: Isaac96 on Aug 05, 2015, 11:10 pm
Oh yeah, sorry I never updated. It works really well. Thank you for designing your awesome app!
Title: Re: Rubik's cube Robot solver
Post by: kas on Aug 06, 2015, 07:51 am
Quote
Please let me know when you ship the gripper. I'm as excited as a little child. Thank you very much :)
Shipped !!!   ;)



You may damage the parts if you just tear them out of the board, carefully cut the tabs with a utility knife

(http://i.imgur.com/Si1wE4l.jpg) (http://imgur.com/Si1wE4l)

Parts also request some sanding to get them smooth

You need screws and hardware as described in post #42 (http://forum.arduino.cc/index.php?topic=271827.msg2032711#msg2032711)


Title: Re: Rubik's cube Robot solver
Post by: bacsi1993 on Aug 06, 2015, 03:30 pm
Thank you! :) What do you think about the delivery time? Maybe 2 weeks?
Title: Re: Rubik's cube Robot solver
Post by: bacsi1993 on Aug 06, 2015, 03:37 pm
- Pinch servo's:  2X    AEROSTAR AS-559MG
- Wrist servo's:  2X    HITEC HS422



I have just ordered 4X HITEC HS422. I  only have cheap chinese servos at home, I don't trust them. They aren't accurate enough. 
Title: Re: Rubik's cube Robot solver
Post by: kas on Aug 06, 2015, 04:42 pm
Thank you! :) What do you think about the delivery time? Maybe 2 weeks?
It's a letter, not a pack, should take less than a week  ::)
Title: Re: Rubik's cube Robot solver
Post by: bacsi1993 on Aug 18, 2015, 06:19 pm
It's a letter, not a pack, should take less than a week  ::)
I received the letter 5 days ago. It was in a perfect condition. Thank you very much. :) I was very busy during the last week that's why I didn't have enough time to assemble the gripper. I will show you my gripper as soon as I assemble it. 
Title: Re: Rubik's cube Robot solver
Post by: kas on Aug 18, 2015, 11:00 pm
That was rather fast

During assembly, do not fasten the screws to much
Joins should rotate freely

Title: Re: Rubik's cube Robot solver
Post by: bacsi1993 on Aug 23, 2015, 04:53 pm
Hey Kas!


The gripper works perfectly! :) I also tried your demo code.

Can you send me the second gripper? I really want to assemble the whole robot. :)

Thank you very much.

Title: Re: Rubik's cube Robot solver
Post by: kas on Aug 25, 2015, 06:26 pm
Hey Kas!

The gripper works perfectly! :) I also tried your demo code.
Can you send me the second gripper? I really want to assemble the whole robot. :)
Thank you very much.
I am currently on Holidays, somewhere in the Indian Ocean ...
Will be back early September
You have time to prepare the frame

Be patient  :smiley-razz: 

Title: Re: Rubik's cube Robot solver
Post by: bacsi1993 on Sep 03, 2015, 08:58 pm
I am currently on Holidays, somewhere in the Indian Ocean ...
Will be back early September
You have time to prepare the frame

Be patient  :smiley-razz: 


Okay, enjoy your holiday. :) The frame is under construction.
Title: Re: Rubik's cube Robot solver
Post by: kas on Sep 04, 2015, 08:43 pm
I just cut the 2nd gripper for you
Will ship it tomorrow  ;)
Title: Re: Rubik's cube Robot solver
Post by: bacsi1993 on Sep 06, 2015, 12:21 pm
I just cut the 2nd gripper for you
Will ship it tomorrow  ;)
Thank you! :)
Title: Re: Rubik's cube Robot solver
Post by: billcat on Sep 11, 2015, 02:23 am
Greeting kas!

Its been too long...hope you are well! :D

I just discovered your thread here today, very happy to see your continued involvement in fun projects and generosity towards the community.
My near teen son has been overly preoccupied with the CUBE for a good bit now, enough that even this old guy recently learned to solve it! ;)

I wonder if you would be able to offer the gripper files in .dxf, I may try and give it a go. I could probably work off the .pdf found earlier in the thread, but that would be a bit more involved.

Also, I would like to contact you regarding a proposition/project via email...you may have some interest as well.  Is your email unchanged from 1+ years past? hint: it relates Arduino, Android, python, CNC & Bluetooth(hard to deny you are the PERFECT candidate!)
Title: Re: Rubik's cube Robot solver
Post by: kas on Sep 13, 2015, 10:38 pm
Hi billcat,

Nice to see you here  :)

I designed the grippers using Vcarve Pro, native file extension is .crv
I had to convert to .ai (Illustrator) for a laser cutter machine
Can you use .crv or .ai files ??

I will look for other export options


Same email   ;)
Title: Re: Rubik's cube Robot solver
Post by: billcat on Sep 15, 2015, 02:01 am
 
Hi billcat,

Nice to see you here  :) Thanks :]


Can you use .crv or .ai files ?? I have been using Rhinoceros 4; it appears it will indeed support .ai but no mention of .crv, I can give .ai a shot.

Same email   ;)I will contact you via email sometime soon!
Cheers!
Title: Re: Rubik's cube Robot solver
Post by: kas on Sep 15, 2015, 07:34 am
Found the .dxf export option  ;)

Arduino Forum only accept doc, gif, jpg, mpg, pdf, png, txt, zip, c, h, cpp, ino, pde extentions
Please remove the txt extention after downloading the files

Title: Re: Rubik's cube Robot solver
Post by: bacsi1993 on Sep 21, 2015, 10:13 am
Hey Kas!

Finally, I assembled the robot. It is very impressive. I have some questions related to the power supply. I'm not an expert in batteries. Could you help me?

There is an online shop in Hungary, where I have found two batteries, but I'm very confused.



Li-Ion 3,7V 3800mAh (http://www.hestore.hu/prod_10034809.html)


Li-Ion 3,6V 1650mAh (http://www.hestore.hu/prod_10035092.html)
Title: Re: Rubik's cube Robot solver
Post by: billcat on Sep 22, 2015, 12:47 am
Found the .dxf export option  ;)
Greetings Kas, many thanks for your accommodation regarding the files, both .dxf and .ai imported well!

now if only to find some time for fun...

I'll be in touch before long. :)

Title: Re: Rubik's cube Robot solver
Post by: kas on Sep 23, 2015, 08:34 am
Hey Kas!

Finally, I assembled the robot. It is very impressive.
Cool   8)   let us have photos


Quote
I have some questions related to the power supply. I'm not an expert in batteries. Could you help me?

There is an online shop in Hungary, where I have found two batteries, but I'm very confused.
Google is your best friend   ;)
http://www.robotshop.com/blog/en/how-do-i-choose-a-battery-8-3585 (http://www.robotshop.com/blog/en/how-do-i-choose-a-battery-8-3585)
http://www.instructables.com/answers/Using-Arduino-and-8-servos-What-type-of-power-so/ (http://www.instructables.com/answers/Using-Arduino-and-8-servos-What-type-of-power-so/)

Servo's operate between 5 and 6 Volts
Arduino needs 7/12 Volts

Your possible choices:
Use two different supply sources (connect the grounds)
Use a 6 volt battery (2000 mAh min) and a DC/DC booster for the Arduino
Use two Li-Po battery (7.4V) and a DC/DC step down for the servo's
. . . . .

For my setup, I use two LiFePo4 and get a stable 6.6 volts
(http://i.imgur.com/EWF0z6h.jpg)
This is slightly out of spec for both servo's and Arduino
but it works flawlessly
I have an old Arduino diecemila and it may not work for other models

Title: Re: Rubik's cube Robot solver
Post by: bacsi1993 on Nov 18, 2015, 10:17 pm
Hey Kas!

I have been very busy lately. I have to study a lot, that's why I don't have enough time to develop my robot. Here is the latest version.


Title: Re: Rubik's cube Robot solver
Post by: woodygb on Nov 19, 2015, 05:38 pm
Hi Kas,

Quote
Servo's operate between 5 and 6 Volts
Most servo's should be fine @ 7.4v.

For a  DC DC step down I'd recommend a UBEC
e.g.
https://www.hobbyking.co.uk/hobbyking/store/__4319__TURNIGY_3A_UBEC_w_Noise_Reduction.html (https://www.hobbyking.co.uk/hobbyking/store/__4319__TURNIGY_3A_UBEC_w_Noise_Reduction.html)

Woody
Title: Re: Rubik's cube Robot solver
Post by: DuaneDegn on Nov 19, 2015, 06:39 pm
Most servo's should be fine @ 7.4v.
I strongly disagree.

I think a much more accurate statement is most servos are not fine at 7.4V.

If they don't go up in smoke (which I've seen) they often end up shaking. I don't know why they shake but I've seen several different models shake when I attempted 7.2V.

Here are links to a couple of my servo projects.

Hexapod (https://www.youtube.com/watch?v=f520FM9Z9is)

32 Servo Demo (https://www.youtube.com/watch?v=UfZL6YS05Ho)

Don't use more than 6V on a servo unless the specs for the servo make it clear high voltages are okay. I found even when the specs say higher voltages are okay, the servos don't always work well at higher voltages.
Title: Re: Rubik's cube Robot solver
Post by: kas on Nov 20, 2015, 11:29 am

Quote
I have been very busy lately. I have to study a lot, that's why I don't have enough time to develop my robot. Here is the latest version
Hi bacsi1993

(http://i.imgur.com/0ghqlYC.jpg)

I thought you gave up on this project
Let us have a video
Make sure you can move the cube safely before addressing the "resolution" side

I am now using my Android phone as camera




Quote
Most servo's should be fine @ 7.4v
@woodygb
I would say some servos are fine at 7.4V
which is not too far from DuaneDegn statement  ;)
I had short lifetime with 2 servo's

Quote
For a  DC DC step down I'd recommend a UBEC
e.g.
https://www.hobbyking.co.uk/hobbyking/store/__4319__TURNIGY_3A_UBEC_w_Noise_Reduction.html
Nice device, thanks for the link


Title: Re: Rubik's cube Robot solver
Post by: bacsi1993 on Dec 25, 2015, 02:49 pm
Hi bacsi1993

(http://i.imgur.com/0ghqlYC.jpg)

I thought you gave up on this project
Let us have a video

I never give up. I have a lot of exams in December and in January.  I have to concenrate on them. As soon as I finish them I will post a video. Unfortunately, I have problems with my robot, the cube often falls off. :( I have to develop the frame, it is not as good as yours. :(

On the other hand, I was thinking of a Cube solver robot with 4 grippers.

Something like this: https://www.youtube.com/watch?v=Q8BYKwbwZSM


Merry Christmas!

Alexander




 
Title: Re: Rubik's cube Robot solver
Post by: kas on Dec 25, 2015, 03:44 pm
I exhibited the Rubik's solver (together with a balancing Robot) at our local Maker Faire and generated a lot of interest  8)

Once you have more time, post a video with the cube falling off
We will analyze the reason for it, and suggest adequate tuning

When properly tuned, cube will  _never_ fall off

Good luck for your exams   ;)

Title: Re: Rubik's cube Robot solver
Post by: martin28 on Apr 29, 2016, 10:38 pm
Im building a project similar to this and i was wondering if you had the arduino coding for this??
Title: Re: Rubik's cube Robot solver
Post by: kas on May 04, 2016, 08:12 am
Im building a project similar to this and i was wondering if you had the arduino coding for this??
Hi martin28
Please refer to this post (http://forum.arduino.cc/index.php?topic=271827.msg2063754#msg2063754) and let us have more info on your project

Title: Re: Rubik's cube Robot solver
Post by: Alexeir7 on Sep 15, 2016, 08:49 pm
Hello Kas, I'm planning on building something like this.
Did you could make the color recognition with a webcam/android phone part?
Or I'm the one who missed something?
Title: Re: Rubik's cube Robot solver
Post by: kas on Sep 16, 2016, 01:35 pm
Hi Alexeir7
 
For the PC based robot (described in this thread), color acquisition is done within the PC, using a webcam
Color recognition is performed by Cube Explorer (http://kociemba.org/cube.htm)
Cube explorer also performs solving algorithm

My new robot is now fully autonomous
Color acquisition is performed via an Android phone
An home made Android App performs the following tasks:
 - color recognition
 - data transmission to a solving server (University, Montreal - Canada) via WiFi
 - get response from server
 - transmit moves to Arduino via Bluetooth

(https://s21.postimg.cc/e3h5j2shz/P1010370_LR.jpg)

If there is sufficient interest, I will describe the new Android based robot in this thread



Title: Re: Rubik's cube Robot solver
Post by: Alexeir7 on Sep 17, 2016, 01:27 am
Wow I thought this thread was actually dead.
I got lost at the server solving part  :(
Well I'm quite intered on your new robot.
Title: Re: Rubik's cube Robot solver
Post by: Isaac96 on Sep 18, 2016, 02:51 am
There is sufficient interest :)
Title: Re: Rubik's cube Robot solver
Post by: kas on Sep 18, 2016, 10:11 am
@Alexeir7 & Isaac96

The core of the project is indeed the mechanical part
Start building the demo bench as described in post#6 and let me know your progress

(http://i.imgur.com/WrbkEFr.png)

>> Video << (http://youtu.be/pPuBbTL4boQ)

This is definitely the most exciting Arduino project I ever built  8)


Title: Re: Rubik's cube Robot solver
Post by: eagerhearts on Oct 12, 2016, 12:31 pm
Hi Kas,

You mentioned that you use a android phone that recognize the colors.
I tried this one last year but I could not correctly recognize them. I tried comparing the RGB and comparing cmyk but that didn't work.

Did you use a library for this or in what way did you do the recognition?


I'm currently working for school on a arduino search and rescue robot but afterwards I'll start making such a Rubiks cube solver.

Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 12, 2016, 04:14 pm
Quote
You mentioned that you use a android phone that recognize the colors
The Android App is home baked


Quote
Did you use a library for this or in what way did you do the recognition?
No,
For each colored square, I average four pixels values:
Code: [Select]
private RGB averageSquare(byte[] data, int imageWidth, int top, int left, int size) {
Point p0 = new Point(left + size / 3, top + size / 3);
Point p1 = new Point(left + size / 3, top + 2 * size / 3);
Point p2 = new Point(left + 2 * size / 3, top + 2 * size / 3);
Point p3 = new Point(left + 2 * size / 3, top + size / 3);

RGB rgb0 = findPixelValue(data, imageWidth, p0);
RGB rgb1 = findPixelValue(data, imageWidth, p1);
RGB rgb2 = findPixelValue(data, imageWidth, p2);
RGB rgb3 = findPixelValue(data, imageWidth, p3);

int r, g, b;

r = rgb0.r + rgb1.r + rgb2.r + rgb3.r;
g = rgb0.g + rgb1.g + rgb2.g + rgb3.g;
b = rgb0.b + rgb1.b + rgb2.b + rgb3.b;

final RGB rgb = new RGB(r / 4, g / 4, b / 4);

return rgb;
}


Code: [Select]
private RGB findPixelValue(byte[] data, int imageWidth, Point p) {  // kas: YUV420/NV21
int n = p.y * imageWidth + p.x;
int offset = imageWidth * 480;  // imageWidth=800
int y = data[n] & 0xff;

if(p.y % 2 == 0) n = n-imageWidth;
if(p.x % 2 == 0) n = n-1;
n = n - p.y*imageWidth/2 + offset;
int u = data[n]   & 0xff;
int v = data[n+1] & 0xff;
       
  return conv_yuy2(y, u, v);
}


Color recognition is performed in guessColor() using least square Method
Code: [Select]
private Color guessColor(RGB rgb) {
int diff[] = new int[6];
int min = Integer.MAX_VALUE;
int minIdx = 0;

rgb = adjustColor(rgb);

Log.d(LOG_TAG, "Color: " + rgb);

for (int i = 0; i < 6; i++) {
Color color = Color.getColorById(i);

int diffr = Math.abs(color.red - rgb.r);
int diffg = Math.abs(color.green - rgb.g);
int diffb = Math.abs(color.blue - rgb.b);

diff[i] = diffr * diffr + diffg * diffg + diffb * diffb;

if (diff[i] < min) {
minIdx = i;
min = diff[i];
}
Log.d(LOG_TAG, "    Distance from " + color.name + ": " + diff[i]);
}

return Color.getColorById(minIdx);
}


Hope it helps ;)


Title: Re: Rubik's cube Robot solver
Post by: ecmaj61 on Oct 26, 2016, 08:26 am
hi kas!!

is it possible that your only using arduino? if your using android for scanning the cube?
Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 26, 2016, 03:07 pm
Hi ecmaj61

Welcome as a new member :)


The Android version works this way:

Smartphone   - take a picture from face #1 and perform color recognition for the 9 facelets
Smartphone   - send a Bluetooth command to Arduino to rotate cube to next face
Arduino           - rotate Cube to next face
Smartphone   - same for all 6 faces
Smartphone   - build and send via WiFi a query to a dedicated Rubik's solving server (Montréal, Canada)
Smartphone   - receive solution from server (Singmaster notation (http://en.wikipedia.org/wiki/Rubik%27s_Cube#Move_notation))
Smartphone   - send Bluetooth command to Arduino (Singmaster notation format)
Arduino            - move Cube according to command and put the cube in the right order

Typical query to server:
http://nova.polymtl.ca/~simark/solverB/query.php?b=WGGOOOGGG&l=OOGBBYOOY&f=YBBBRRBRR&r=ORBBGGBRR&u=YYRYYGRWW&d=OYYWWWWWW
 (http://nova.polymtl.ca/~simark/solverB/query.php?b=WGGOOOGGG&l=OOGBBYOOY&f=YBBBRRBRR&r=ORBBGGBRR&u=YYRYYGRWW&d=OYYWWWWWW)
Corresponding answer from server:     OK     F U F D'
Clic the query and see for yourself  ;)

You may also solve the cube locally on your own PC, using Cube Explorer (http://kociemba.org/cube.htm), this is a less portable solution



Title: Re: Rubik's cube Robot solver
Post by: eagerhearts on Oct 26, 2016, 04:00 pm
Hi ecmaj6,
If you want to make it even more independent you can include the cube explorer java library in the android app. Then it can find the best solution locally without using a wifi connection. So the only connection that is needed is between the arduino and the android phone.
Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 26, 2016, 04:16 pm
Quote
If you want to make it even more independent you can include the cube explorer java library in the android app
Hi eagerhearts

Interesting, please let me have a link to this library

Title: Re: Rubik's cube Robot solver
Post by: ecmaj61 on Oct 26, 2016, 06:34 pm

Welcome as a new member :)



[/quote]

thank you kas!!


So the only connection that is needed is between the arduino and the android phone.
what im gonna use Bluetooth module or wifi shield for connection??
Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 26, 2016, 08:38 pm
You need a standard HC-5 or HC-6 Bluetooth module (http://www.ebay.com/itm/HC-05-6-Pin-Wireless-Bluetooth-RF-Transceiver-Module-Serial-For-Arduino-D-/112033417867?hash=item1a15b64a8b:g:32oAAOSwOVpXaBXK)  (3 bucks shipped)
Don't buy a BT BLE board

You may also purchase a BT/Arduino combo board
I use this one (https://www.itead.cc/iteaduino-bt.html)
(http://i.imgur.com/DIFpAQg.png)



Title: Re: Rubik's cube Robot solver
Post by: ecmaj61 on Oct 27, 2016, 04:57 pm
hi kas what did you use in your (PC/webcam version) to become stand alone?
Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 27, 2016, 09:55 pm
Quote
hi kas what did you use in your (PC/webcam version) to become stand alone?
I use Cube Explorer (http://kociemba.org/cube.htm) for solving the cube



Title: Re: Rubik's cube Robot solver
Post by: eagerhearts on Nov 25, 2016, 08:02 pm
Hi eagerhearts

Interesting, please let me have a link to this library


Sorry for the late reply,
I use a adjustes version of the java library found at: http://kociemba.org/cube.htm (http://kociemba.org/cube.htm)
Which is adjusted like the way described at This (http://stackoverflow.com/questions/23598498/android-rubiks-cube-kociemba-optimal-solver-memory-shortage) website.

For your convenience I have included the library I use as a attachment to this post.


I hope you can use this!



For the gripper, which servo did you design it for? I use a MG90S servo and I'm still searching for a good gripper which I can 3d print for that one.


Title: Re: Rubik's cube Robot solver
Post by: eagerhearts on Nov 25, 2016, 08:10 pm

@kas

Also for the android app, did you use a rooted phone?

If i want to get the colors I have to make an Intent to the Camera app, which takes a picture, and then returns.
Then it calculates the colors of the 9 faces and this does it 6 times.

Do you know whether it is possible without going 6 times to the camera app and returning?
Title: Re: Rubik's cube Robot solver
Post by: kas on Nov 27, 2016, 12:23 pm
Quote
For your convenience I have included the library I use as a attachment to this post.
Thanks, I will give it a try, but I do like the external server techy approach


Quote
For the gripper, which servo did you design it for?
I use Hitec HS-422. Make sure to use servo's with full 180° rotation


Quote
Also for the android app, did you use a rooted phone?
No


Quote
Do you know whether it is possible without going 6 times to the camera app and returning?
The color recognition takes less then a minute for the total cube.
Most of this time is cube moves



(https://s14.postimg.cc/pmjbaqh1t/Rubik_s_color.jpg)
Title: Re: Rubik's cube Robot solver
Post by: Mrigank_Gupta on Dec 03, 2016, 03:04 pm
Which sensor are you using
Title: Re: Rubik's cube Robot solver
Post by: kas on Dec 04, 2016, 03:59 pm
Quote
Which sensor are you using
One sensor only:
the built-in camera from an Android phone, for colors recognition

 
Title: Re: Rubik's cube Robot solver
Post by: kas on Jan 02, 2017, 01:42 pm
Hey kas, I want to make your rubik's cube solver with an arduino, but I'd like to 3D print the parts. I don't have access to AI or AutoCAD to convert your drawing into a 3D model, and I was wondering if you would be kind enough to send me the files in obj or stl format of each piece that I will need to make with my 3D printer having a 10mm thickness. I would really appreciate it!

Thank you,
Jake
Sorry, 3D printing is still a universe I have to discover  ;)
Possibly someone may jump in and convert the files for 3D printing
I use Vcarve Pro and can supply .eps, .dxf, .ai .pdf or .crv files
All parts are really 2D, with constant 5mm thickness

BTW a legal AI CS2 version can (could ?) be downloaded on Adobe web site



Title: Re: Rubik's cube Robot solver
Post by: benbowman on Feb 16, 2017, 11:55 am
hey kas, I've converted the PDF file to CAD so anyone else wanting to print the claw like me,
I've uploaded the file to google sketchup's 3D workshop as "Rubik's cube claw".
I'll be uploading another CAD file soon that doesn't require glue to piece together some of the claw,
and hopefully will save some time.

thanks kas for the awesome ideas I'm exited to get mine working.
and here is just a preview of it, I pieced one together, and have the parts separate
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 17, 2017, 09:28 am
Nice job  8)  8)  8)

(https://s18.postimg.cc/ls8oby7nt/Capture.png)

Quote
I've uploaded the file to google sketchup's 3D workshop as "Rubik's cube claw".
Care to post a direct link to the claw ??

Thanks for your excellent feedback


The robot will be exhibited at Maker Faire Grenoble on March 18th/19th




Title: Re: Rubik's cube Robot solver
Post by: benbowman on Feb 17, 2017, 12:17 pm
here is the link to the original  (https://3dwarehouse.sketchup.com/model.html?id=c062dc9e-6c79-480b-ac92-535ff42be7bb)

and to the one that i had compacted  compacted  (https://3dwarehouse.sketchup.com/model.html?id=149cf021-ec68-486c-8035-e9aa8769095a)a little for 3D printing

i hope this helps  :)


Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 19, 2017, 12:39 pm
Thanks,

Please report on further progress

Title: Re: Rubik's cube Robot solver
Post by: alihan35 on Mar 01, 2017, 05:35 pm
here is the link to the original  (https://3dwarehouse.sketchup.com/model.html?id=c062dc9e-6c79-480b-ac92-535ff42be7bb)

and to the one that i had compacted  compacted  (https://3dwarehouse.sketchup.com/model.html?id=149cf021-ec68-486c-8035-e9aa8769095a)a little for 3D printing

i hope this helps  :)



Can you e-mail the holders' dwg files
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 01, 2017, 05:53 pm
Can you e-mail the holders' dwg files
Hi alihan35,

Are you looking for the "grippers" files or the "stand" files ??


Title: Re: Rubik's cube Robot solver
Post by: alihan35 on Mar 01, 2017, 06:04 pm
grippers files
Title: Re: Rubik's cube Robot solver
Post by: InsydeTech21 on Mar 01, 2017, 09:05 pm
Hello Kas,

Im a student and want to do this project. Could you please send me with a zip file of all the python and arduino files you used?

I want to do the project offline on my Mac.

Thanks.
Title: Re: Rubik's cube Robot solver
Post by: InsydeTech21 on Mar 01, 2017, 09:17 pm
Also,
Hello Kas,

Im a student and want to do this project. Could you please send me with a zip file of all the python and arduino files you used?

I want to do the project offline on my Mac.

Thanks.
Also, Could you add some brief instructions as I got confused after reading every post.
I am very confident about this as you are a good member of the community, you have helped many people with this project since 2014!
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 01, 2017, 09:46 pm
@alihan35

As mentioned in post #193, I can supply .eps, .dxf, .ai .pdf or .crv files
You may contact benbowman for possible other file formats

Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 01, 2017, 10:04 pm
Quote
I am very confident about this as you are a good member of the community, you have helped many people with this project since 2014!
Thanks, for the kind words, but flattery will bring you nowhere   ;)  ;)

Please refer to post #1 (2nd message)
I tried to gather all information, including parts list and software
Should you have any additional questions, just let me know

Enjoy this project  :)

Title: Re: Rubik's cube Robot solver
Post by: alihan35 on Mar 01, 2017, 11:30 pm
@alihan35

As mentioned in post #193, I can supply .eps, .dxf, .ai .pdf or .crv files
You may contact benbowman for possible other file formats


Hi can you send me to use dxf file?
Title: Re: Rubik's cube Robot solver
Post by: ard_newbie on Mar 02, 2017, 10:50 am

Just for the fun, a robot powered by a 3rd party Arduino board breaks all the rubik cube records with 0.677 s   :o

See this video from Infineon :

https://www.rs-online.com/designspark/bringing-multicore-to-the-arduino-world-with-shieldbuddy-tc275 (https://www.rs-online.com/designspark/bringing-multicore-to-the-arduino-world-with-shieldbuddy-tc275)



Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 02, 2017, 12:26 pm
@ard_newbie
Impressive  :o


Following  InsydeTech21  request, I have updated Post#1 (http://forum.arduino.cc/index.php?topic=271827.msg1915869#msg1915869) with additional information

(https://s21.postimg.cc/e3h5j2shz/P1010370_LR.jpg)

Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 02, 2017, 12:46 pm
@alihan35

Quote
Hi can you send me to use dxf file?
Here it is, remove the .txt extension and let me know if you can open it


Title: Re: Rubik's cube Robot solver
Post by: InsydeTech21 on Mar 02, 2017, 09:16 pm
@ard_newbie
Impressive  :o


Following  InsydeTech21  request, I have updated Post#1 (http://forum.arduino.cc/index.php?topic=271827.msg1915869#msg1915869) with additional information

(https://s21.postimg.org/e3h5j2shz/P1010370_LR.jpg)


Thanks A Ton! I will keep you updated on my progress as I have ordered a new 3D printer that will arrive next week. I hope to 3D print the claws using the google sketchup files I found.
Title: Re: Rubik's cube Robot solver
Post by: alihan35 on Mar 02, 2017, 10:35 pm
@alihan35

Here it is, remove the .txt extension and let me know if you can open it
I will share what I do on the forum.


thanks for everything . I can do it for files opened. next step with arduino software .

I will share what I do on the forum
Title: Re: Rubik's cube Robot solver
Post by: WitherKun on Mar 04, 2017, 02:39 pm
Hey, Kas. I was really impressed by your project. So i decided to make something similar, but using a smartphone. Could you please send me a link for the android app?
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 05, 2017, 08:01 am
Quote
Hey, Kas. I was really impressed by your project. So i decided to make something similar, but using a smartphone.
Could you please send me a link for the android app?
Just leave me your email via PM
The Android version is, in my opinion, the way to go

Two important advices:
- have the hardware (stand + grippers) build & tuned before messing with software
- understand Bluetooth connection using  Joystick BT Commander (http://forum.arduino.cc/index.php?topic=173246.0)  (another free App)

Smartphone / Arduino connection is performed using a HC-05 or HC-06 board (3 bucks shipped)
(http://i.imgur.com/jzHoND9.jpg)

You can also use a very convenient Arduino/HC-05 combo
(http://i.imgur.com/4HPW4Rc.jpg)

Again, full details here (http://forum.arduino.cc/index.php?topic=173246.0)

Title: Re: Rubik's cube Robot solver
Post by: InsydeTech21 on Mar 05, 2017, 08:55 pm
One question, When you mount the bottom servos that turn the rubix cube, what is the default angle?
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 05, 2017, 10:11 pm
One question, When you mount the bottom servos that turn the rubix cube, what is the default angle?
For the wrist (rotation) servo,default angle is 0°, servo will rotate 90° CW and 90° CCW
For the pinch servo, default angle is also 0°, but not critical as rotation is only 60 CW

Reminder:
Quote
Make sure that the rotation (wrist) servo can perform at least a full 180° move
Some servo's just can't  ::)
Title: Re: Rubik's cube Robot solver
Post by: alihan35 on Mar 06, 2017, 10:40 pm
Hey Kas.
There seems to be a setback. It looks dull. Do you have a problem?

(http://i.hizliresim.com/Ja46yo.jpg)
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 07, 2017, 07:57 am
Looks promising   :)

Nuts should be very sightly tied, to avoid too much friction (untied 1/2 turn)
I suggest you use Nylock nuts and washers
(https://s12.postimg.cc/716pkxxj1/nut.jpg)


Next important step is described in post #6
Make sure to use a smooth rotating cube (Dayan or equivalent)
Please post a video for this step


Title: Re: Rubik's cube Robot solver
Post by: alihan35 on Mar 10, 2017, 03:56 pm
hey Kas ! . I'm opening arduino code . but ı dont understand " bip ".  what is the " bip " pin ?
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 10, 2017, 08:25 pm
hey Kas ! . I'm opening arduino code . but ı dont understand " bip ".  what is the " bip " pin ?
The Bip pin is connected to an active buzzer for signaling various events (end of scan, errors ...)

(http://i.imgur.com/LEOsbLP.jpg)

Please refer to post #118 for a full custom shield description

Title: Re: Rubik's cube Robot solver
Post by: demirell95 on Mar 20, 2017, 09:10 pm
Hello KAS
First of all, thank you for this excellent topic.
I started this project.
I print the holders with a 3d printer (thanks to the friend who shared the design)

Pictures:
http://i.resimyukle.xyz/3bOU1.jpg
http://i.resimyukle.xyz/PcUdR.jpg
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 20, 2017, 09:48 pm
Hello KAS
First of all, thank you for this excellent topic.
I started this project.
I print the holders with a 3d printer (thanks to the friend who shared the design)

Pictures:
(http://i.resimyukle.xyz/3bOU1.jpg)

(http://i.resimyukle.xyz/PcUdR.jpg)
Hi demirell95
Nice job   8)  8)
Thanks for your feedback, keep us aware of your progress

Remainder: do not overlook the first test, as described in post #6   ;)



Title: Re: Rubik's cube Robot solver
Post by: demirell95 on Mar 20, 2017, 10:03 pm
Hi demirell95
Nice job   8)  8)
Thanks for your feedback, keep us aware of your progress

Remainder: do not overlook the first test, as described in post #6   ;)




First of all I am sorry for my English, I don't know english :D (GOOGLE TRASNLATE)

Of course I will go step-by-step, #1, #2, #3 ...... I will try to give feedback in all stages.
Title: Re: Rubik's cube Robot solver
Post by: benbowman on Mar 28, 2017, 12:54 pm
Hey Kas!
I've almost finished my hardware, just need a camera holster and i can get the program running.

here is what my design looks like (all 3D printed),
I'm getting exited and may have some questions about your code to come :)
I'll share again ones I've fixed the errors in my prints and have the cam holder working.
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 29, 2017, 08:12 am
Hi benbowman

Superb implementation  :smiley-eek-blue:  :smiley-eek-blue:  :smiley-eek-blue:

(https://s9.postimg.cc/saed62zrz/claw.jpg)


See my comments (post #216) for nuts


Quote
I'm getting exited and may have some questions about your code to come :)
Which road are you taking, Python or Android ??


I exhibited my robot last week at Maker Faire Grenoble and generated a LOT of interest  8)





Title: Re: Rubik's cube Robot solver
Post by: demirell95 on Mar 31, 2017, 12:53 am
Hi benbowman

Superb implementation  :smiley-eek-blue:  :smiley-eek-blue:  :smiley-eek-blue:

(https://s9.postimg.org/saed62zrz/claw.jpg)
Hi Kas,
Are not the grippers too close together?
Does it create a problem?
Hi benbowman,
Can you share 3D design stl files(lower case)
Title: Re: Rubik's cube Robot solver
Post by: benbowman on Mar 31, 2017, 10:45 am
Which road are you taking, Python or Android ??

thanks Kas    :smiley-sweat:

ill be taking the python path with my raspberry pie and arduino.

hey demirell95, yes the claws are too close together, I didn't take in to consideration the droop the servo shaft is having under the weight of the claw so ill be fixing the print by putting a chip at the base of the servo holding the claw.
and as for the CAD files i will upload that when i am sure that it works :) as last time i rushed a little.
Title: Re: Rubik's cube Robot solver
Post by: kas on Mar 31, 2017, 02:50 pm
Quote
I didn't take in to consideration the droop the servo shaft is having under the weight of the claw
To help rigidity, you may use servo's with dual ball bearings and metal gears
I like this one
(https://s17.postimg.cc/d89jbrs9b/MG995-1_B.jpg)


FWIW, this is a close up showing the relative position of the claws
(https://s9.postimg.cc/tkftkxzdb/P1020830_copy.jpg)

Also keep in mind that, depending on construction material, you may add a bike rubber tyre ring around the claw to increase friction. This will add an extra millimeter at the lower part of the claw



Title: Re: Rubik's cube Robot solver
Post by: benbowman on Apr 02, 2017, 10:51 am
hey Kas,

thanks for the idea I'll order 2 of those servos in after my school holidays thanks.
as for the bike tyre i was thinking of using stick on foam strips, thought that'd do the job nicely.
Title: Re: Rubik's cube Robot solver
Post by: demirell95 on Apr 02, 2017, 10:58 am

I finished mounting the grippers and made the first test.
It was very successful.
(http://i.resimyukle.xyz/9N1IU.jpg)

Now I will make the frame(case).I have not seen cad yada stl files in the forum.

I saw some designs on youtube.
(http://i.resimyukle.xyz/5PKBN.png)

(http://i.resimyukle.xyz/aBKAS.png)

Can you share those with the same or similar frame(case) design? (Stl or cad..)

Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 02, 2017, 10:04 pm
@demirell95

I can supply frame drawing with .eps, .dxf, .ai .pdf or .crv format
Let me know

This drawing allows precise grippers relative positioning



Title: Re: Rubik's cube Robot solver
Post by: demirell95 on Apr 03, 2017, 02:25 am
@demirell95

I can supply frame drawing with .eps, .dxf, .ai .pdf or .crv format
Let me know

Yes KAS now I need a frame design to combine all the pieces. (dxf veya ai veya eps)

I saw the file you shared(support v2).But I need exactly the frame design.
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 03, 2017, 09:35 am
Quote
I saw the file you shared(support v2).But I need exactly the frame design.
Not sure to understand, please elaborate   ::)
Title: Re: Rubik's cube Robot solver
Post by: demirell95 on Apr 03, 2017, 11:01 am
#post123 there is such an answer.
I enclose a pdf for the two boards (also available in eps, dxf, ai)

Let me know if it helps

You added two boards design as Pdf in # post123.(name: SupportV2.pdf)

Do you load dxf or ai or eps file instead of pdf in these panes. (Do you share the dxf or ai or eps files of these 2 panels?)

My english is over
Title: Re: Rubik's cube Robot solver
Post by: demirell95 on Apr 03, 2017, 11:07 am
I can supply frame drawing with .eps, .dxf, .ai .pdf or .crv format
Let me know

Yes I want dxf or ai or eps formats.
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 03, 2017, 11:55 am
Drawing for the wrist servo's backplanes, dxf and pdf format
Please drop the .txt extension

Title: Re: Rubik's cube Robot solver
Post by: demirell95 on Apr 03, 2017, 12:15 pm
Drawing for the wrist servo's backplanes, dxf and pdf format
Please drop the .txt extension


Thank you so much kas..
Title: Re: Rubik's cube Robot solver
Post by: Shin-Danny on Apr 06, 2017, 06:55 am
Hello,
I just created an account for this project. Have to say that this is the best(?) project so far for rubik solver that I have read.I came here after I had the idea of making a rubik solver, and yet I had came across other alike projects.
I haven't read through all the post, so can you recap to some of my concerns:
   How long did it take you to finish the project?
   Some big Rubik solver use 6 motors to maximize the time solving. Why dont you do that?
Thank you, your work is very inspirational!
-Shin-
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 06, 2017, 06:45 pm
Hi Shin,

Thanks for the kind words  8)

Quote
How long did it take you to finish the project?
Took several months, most of the time was finalizing the grippers design


Quote
Some big Rubik solver use 6 motors to maximize the time solving. Why dont you do that?
I like the K.I.S.S concept  ;)


Title: Re: Rubik's cube Robot solver
Post by: Shin-Danny on Apr 07, 2017, 09:09 pm
Hey Kas,

Do you mind sharing your reasons on picking servo motors? Some other projects use stepper motor, and I think it also makes more sense as we should be able to spin layer more than 1 cycle, and dont actually need the angle feedback.
And also can you provide on what speed and torque that your rubik requires?

-Shin-
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 08, 2017, 07:59 am
Shin, both servo's or stepper's can be used successfully to build a Rubik's solver
I am here to share, not to advocate  ;)

Servo's are really easy to drive with an Arduino
Just one digital pin, no additional motor driver, easy control

The Bot I am describing did run for a full day out of 2 X 18650 batteries at Maker Faire,
forget it with steppers

And, yes, cube solving itself can be made in one second with 6 stepper motors:
(https://s17.postimg.cc/l6koctc33/Rubik_servo.png)
  >> Video << (https://www.youtube.com/watch?v=laPVTrzGDpA)

This project requires special/modified cube for holding and moving
Color recognition is performed manually and takes... more than 1 second



Quote
And also can you provide on what speed and torque that your rubik requires?
No idea  ::)

What ever the road you choose, enjoy your project  ;)


Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 10, 2017, 08:40 pm
@benbowman
Quote
thanks for the idea I'll order 2 of those servos in after my school holidays thanks.
EDIT: Beware of clones, some are REALLY bad copies  :smiley-evil:
EDIT2: Please make sure they can make a full 180° rotation

Title: Re: Rubik's cube Robot solver
Post by: demirell95 on Apr 15, 2017, 01:41 am
I made my robot :)

(http://i.resimyukle.xyz/5RS3A.jpg)
(http://i.resimyukle.xyz/cxIaA.jpg)

I applied #post6 and worked correctly.

In the current stage I'm going to apply Post 13. But I don't know how to do this.

Do you have a code? (Code in the video: Video (https://www.youtube.com/watch?v=1QmT9pcLVms&feature=youtu.be)
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 15, 2017, 12:13 pm
Congrat, the hardware part of your project is nearly completed   8)


Quote
In the current stage I'm going to apply Post 13. But I don't know how to do this.
Do you have a code?
Please extract the CubeMover_hard_coded_demo folder to your Arduino sketch folder
Do not forget to enter your own values in the 'user servo's adjustments' aera
You may also have to tune '#define SEIZE 8" in cube.cpp

Let us have a video

EDIT: Using Windows 10, you may have to change extension file to .rar


Title: Re: Rubik's cube Robot solver
Post by: demirell95 on Apr 23, 2017, 12:53 am
I finished the design and code.
" < R B2 R' D2 R' F2 L' F U R2 B2 D'> " <= I am writing this code. He's doing exactly the opposite of the video moves.For example, the video is doing the exact opposite motion(video D move on my machine D')
He works without a cube.

Video: https://streamable.com/5fswc

Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 23, 2017, 04:59 pm
Quote
video D move on my machine D'
Something is inverted, not important for the moment

Please, clear mark and identify servo's (Down and Back)
The "Down" servo performs the native  Singmaster "D"
The "Back" servo performs the native  Singmaster "B"
Can you make a new video with only < D B > commands


The most important is to have it move the cube without jamming
On the video, you should tighten left servo's grip by adjusting DOWN_CLOSE (or BACK_CLOSE ??) value
and/or select another no grip material
The "close" position of the pinch should be about 'cube size' minus 5 mm, for a good grip

Again, take time to adjust parameters before going any further ;)




Title: Re: Rubik's cube Robot solver
Post by: demirell95 on Apr 23, 2017, 05:54 pm
Can you make a new video with only < D B > commands

video: https://streamable.com/w5hw4

There is no problem when I test the grippers one by one. But they both have problems when they work at the same time


Send the last state of the code and the last state of the python code.
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 23, 2017, 06:14 pm
Servo's should NEVER move at the same time, please post your actual Arduino sketch
Suspect this is a library issue

In the serial monitor, just enter DB, no need for <DB> but both will work

Title: Re: Rubik's cube Robot solver
Post by: demirell95 on Apr 23, 2017, 09:05 pm
please post your actual Arduino sketch Suspect this is a library issue.

I downloaded the file "CubeMover12.zip" in #post43.

I did not make any changes.
I just changed the "DOWN_CLOSE          89  
                         DOWN_OPEN          159
                         DOWN_CW              0
                         DOWN_MID            78
                         DOWN_CCW           180
                         BACK_CLOSE          92
                         BACK_OPEN          159
                         BACK_CW              0
                         BACK_MID            79
                         BACK_CCW           180 "    settings...

(http://i.resimyukle.xyz/1LyPM.jpg)


Could you send an Arduino connection diagram or schematic?
You have a code that you have finished everything completely.
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 23, 2017, 10:00 pm
Quote
I downloaded the file "CubeMover12.zip" in #post43.
Please use the sketch I posted for you in post #242

Moves D  B  B'  D'  are hard coded, no needs for the Serial Monitor
You can change moves within the sketch

// -- Demo  --
  myCube.D();
  myCube.B();
  myCube.Bp();
  myCube.Dp();
  myCube.seize();       // release cube




Title: Re: Rubik's cube Robot solver
Post by: demirell95 on Apr 23, 2017, 11:10 pm
Please use the sketch I posted for you in post #242

Moves D  B  B'  D'  are hard coded, no needs for the Serial Monitor
You can change moves within the sketch

// -- Demo  --
  myCube.D();
  myCube.B();
  myCube.Bp();
  myCube.Dp();
  myCube.seize();       // release cube

I used the codes in post 242. But nothing changed.

I did everything right. But why the moves are exactly the opposite.

Video: https://streamable.com/mudxs
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 24, 2017, 07:45 am
Invert DOWN_CW / DOWN_CCW and BACK_CW / BACK_CCW

From:
Code: [Select]
// ---------- user servo's adjustments -----------
#define    DOWN_CLOSE         107
#define    DOWN_OPEN          159
#define    DOWN_CW              9
#define    DOWN_MID            89
#define    DOWN_CCW           172

#define    BACK_CLOSE         111
#define    BACK_OPEN          163
#define    BACK_CW              2
#define    BACK_MID            87
#define    BACK_CCW           171


To:
Code: [Select]
// ---------- user servo's adjustments -----------
#define    DOWN_CLOSE         107
#define    DOWN_OPEN          159
#define    DOWN_CCW             9  <<
#define    DOWN_MID            89
#define    DOWN_CW            172  <<

#define    BACK_CLOSE         111
#define    BACK_OPEN          163
#define    BACK_CCW             2  <<
#define    BACK_MID            87
#define    BACK_CW            171  <<


Use your own settings and tune them to get perfect  grip  and  rotation


Title: Re: Rubik's cube Robot solver
Post by: demirell95 on Apr 25, 2017, 02:15 pm
Thanks kas..
He is now doing the moves correctly.



I have only one problem. :(

#define    myRX                 2   What are these pins? What does this do? Do I have to connect?
#define    myTX                 3   


Without the cube, it does all the moves correctly. But when you put a cube, the servors are broken. (I'm powering just from USB. I did not plug in extra batteries. I didn't tie off the extra battery.)


Is it true that you give both USB and battery power?

Video https://streamable.com/5fswc (Problem at the end of the video)



The PYTHON code is not working. (OS= Windows 10) (Can you take a video and help?)
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 25, 2017, 08:51 pm
Quote
Thanks kas..
He is now doing the moves correctly.
OK



Quote
I have only one problem. :(

#define    myRX                 2   What are these pins? What does this do? Do I have to connect?
#define    myTX                 3   
No, those lines should be removed (was a SoftSerial connection)
You are going too fast   ;)
Please stick to CubeMover_hard_coded_demo.ino until you get acceptable moves



Quote
Without the cube, it does all the moves correctly. But when you put a cube, the servors are broken. (I'm powering just from USB. I did not plug in extra batteries. I didn't tie off the extra battery.)
Power supply should be separated, never power a servo from USB
This a wiring example:
(https://s27.postimg.cc/c2sjwr9lf/servo_Power_Supply.jpg)
Don't forget to connect grounds



Quote
The PYTHON code is not working. (OS= Windows 10)
Do you have Python 3.4 or higher installed and running ??
Did you install pyserial to access you PC serial communication port ??
Are you using code from Post #21 ??



Title: Re: Rubik's cube Robot solver
Post by: demirell95 on Apr 25, 2017, 10:18 pm
You are going too fast   ;)
I do it for project homework. (Last day tomorrow):D


MY CONNECTION :S

(http://i.resimyukle.xyz/46TyH.jpg)


LAST CONNECTİON
(http://i.resimyukle.xyz/25JO7.jpg)

How do I log in without using USB?
Is the problem solved this way? (Are the connection correct?)
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 25, 2017, 11:04 pm
Quote
How do I log in without using USB?
Well... connect your USB cable   ;)
You may then remove the 9V battery if you wish



Title: Re: Rubik's cube Robot solver
Post by: demirell95 on Apr 25, 2017, 11:17 pm
(http://i.resimyukle.xyz/25JO7.jpg)


Well. I do this in this way. :D

I use two 18650 LiFePO4 batteries 3V 1000mA+3V 1000mA =(6V, 2000mA)
Title: Re: Rubik's cube Robot solver
Post by: demirell95 on Apr 26, 2017, 03:51 am
Finally happened.
VERY VERY Thanks KAS :D :D

Video: https://streamable.com/o8vze


The next step is python.
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 26, 2017, 07:33 am
Quote
Finally happened.
VERY VERY Thanks KAS :D :D
Video: https://streamable.com/o8vze.
Amazing  :)


Quote
The next step is python
You first need to fine tune your moves to avoid further frustrations   ;)
Please clearly identify your DOWN and BACK servo with a label (post #244)
It will be much easier for you and me.

On the video, the servo on the left (DOWN ??  BACK ??) is not rotating enough in the ClockWise (CW) direction.
Please slighty adjust DOWN_CW (or BACK_CW ??)
You can also create a slight overshoot:
in the 'cube.cpp' tab, look for Cube::downArmCW() and Cube::backArmCW() and adjust overshoot values
With your configuration values should probably be slightly positive

For rotation fine tuning, move only one servo:
Code: [Select]
void setup() {

   .....................

  // -- Demo  --
  myCube.D();
  delay(2000);

  myCube.D();
  delay(2000);

  myCube.D();
  delay(2000);

  myCube.D();
  delay(2000);

  myCube.seize();       // release cube
}

void loop() {}          // Empty Loop




(http://i.resimyukle.xyz/25JO7.jpg)


Well. I do this in this way. :D

I use two 18650 LiFePO4 batteries 3V 1000mA+3V 1000mA =(6V, 2000mA)
Good choice, I use the same 18650 LiFePO4 batteries  ;)
BTW, by combining (serial) two 3V 1000mA, you get 6V 1000mA, not 2000mA

You may remove the 9V battery if connected to USB


Title: Re: Rubik's cube Robot solver
Post by: demirell95 on Apr 27, 2017, 12:46 am
I did what they said. Now he's making the moves more beautiful. :D (Thanks KAS)

I shot a video about the Pyton problem.

Video: https://streamable.com/qycbz
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 27, 2017, 08:00 am
Please follow the track    ;)
Rather than using the full blown Python code, use the short version as per post #21
This program accepts a string and transmit it to Arduino, through the serial port
in same way as Arduino Serial Monitor in Post #18

You will be able to validate both your Python setup and Serial communication

Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 27, 2017, 12:39 pm
For information, I just added this text to post #21

Quote
EDIT:     getting started (April 2017)   ---------------------------------------------------

install Python 3.xx
install tkinter (graphical UI)
install pyserial (Serial comm)

now... do your home work  ;)      (this thread is not a Python tutorial)
        ... and run this basic "hello World" test program:

Code: [Select]
## Rubik (Hello, World)             @ kas 2017

from tkinter import *
import serial, time
from serial import SerialException
import atexit
import subprocess

root =Tk()
root.title('Hello, World')
root.geometry('300x300+200+200')          ## window size + position

root.mainloop()


(https://s2.postimg.org/fzlv5rzw9/Python_Hello_World.png)See the window ??  you are all set
Title: Re: Rubik's cube Robot solver
Post by: benbowman on May 05, 2017, 05:57 am
hey kas!!

my cube solver is going nicely so far, just like i said though i do have some problemes with the code  :smiley-confuse:. do you know where i would be able to find your "cube.h" library for the arduino code?
and what is the "delayB4scan" in your python code?

ill have some pics soon just a hastle to upload them  :)
 thanks kas
Title: Re: Rubik's cube Robot solver
Post by: kas on May 05, 2017, 07:22 am
Quote
do you know where i would be able to find your "cube.h" library for the arduino code?
Which code are you trying to run ??
cube.h should be included in the zip file


Title: Re: Rubik's cube Robot solver
Post by: demirell95 on May 05, 2017, 10:47 pm
install Python 3.xx : I did
install tkinter (graphical UI) : I did
install pyserial (Serial comm) : I did

Video: https://streamable.com/ay83b

Hello World Video: https://streamable.com/18nqx

## Rubik kasBot v1.2 Video: https://streamable.com/73sxn

## Rubik kasBot v1.3 Video: https://streamable.com/ntemh
Title: Re: Rubik's cube Robot solver
Post by: kas on May 06, 2017, 09:05 pm
You should work with the Python graphic ide (IDLE ), not with the command line tool
Please reload Rubik kasBot V1.2A   V1.13 (post #21)
Save the file as Rubik_kasBot_V12A.pyw  Rubik_kasBot_V13.pyw
Right click on the file and choose "Edit with Idle"

(https://s14.postimg.cc/6xezk0epd/python_idle.png)

FWIW idle is located at \Python34\Lib\idlelib
Please, get familiar with Python through additional readings

Title: Re: Rubik's cube Robot solver
Post by: demirell95 on May 07, 2017, 12:06 pm



[/quote]
You should work with the Python graphic ide (IDLE ), not with the command line tool
I did it like you said.But he gave me this error again. I think I'm uploading incorrectly (pyserial)

(http://i.resimyukle.xyz/x3C8K.png)

I followed the steps in the video: https://www.youtube.com/watch?v=zedZmYIpGKM

Would you describe it with video :(
Title: Re: Rubik's cube Robot solver
Post by: demirell95 on May 07, 2017, 01:48 pm
I finally did it :D :D Thanks KAS
(http://i.resimyukle.xyz/J8NQP.png)

End move post#45 RubikKasBot.py V1.3

I don't understand if it works.
Video: https://streamable.com/4ua8p


Title: Re: Rubik's cube Robot solver
Post by: kas on May 07, 2017, 04:59 pm
Congrat, you made it   8)

Let's check communication

connect Arduino to PC
load Rubik_kasBot_V1.13
select COM port
enter D B R U U' R' B' D'

Cube should move (D B R U) and go back to initial colors position (U' R' B' D')


Please post a video (put Front & Back labels on grippers)


Title: Re: Rubik's cube Robot solver
Post by: Ricardol on May 08, 2017, 09:43 am
This is really cool:) I'm happy I found this thread
Title: Re: Rubik's cube Robot solver
Post by: benbowman on May 09, 2017, 01:27 pm
hey kas,

i couldnt open the zip file correctly so i had to use ziprar, so i do now have the cube.h library :).
i was running the 1.2 python code, but i recently had more errors that i previously fixed so it'll be a bit before i have a question (hopefully)
Title: Re: Rubik's cube Robot solver
Post by: alihan35 on May 09, 2017, 10:03 pm
install Python 3.xx : I did
install tkinter (graphical UI) : I did
install pyserial (Serial comm) : I did

Video: https://streamable.com/ay83b

Hello World Video: https://streamable.com/18nqx

## Rubik kasBot v1.2 Video: https://streamable.com/73sxn

## Rubik kasBot v1.3 Video: https://streamable.com/ntemh
müsaitsen sana birkaç soru sormak istiyorum kardeş
Title: Re: Rubik's cube Robot solver
Post by: demirell95 on May 10, 2017, 03:21 am
müsaitsen sana birkaç soru sormak istiyorum kardeş
Tabiki elimden geldigince yardımcı olurum..
Title: Re: Rubik's cube Robot solver
Post by: alihan35 on May 10, 2017, 12:37 pm
Tabiki elimden geldigince yardımcı olurum..
kardeş özelden numaranı verebilir misin şimdi burda anlatmak sağlıksız olur eğer sana da uyarsa
Title: Re: Rubik's cube Robot solver
Post by: kas on May 10, 2017, 06:05 pm
Quote
hey kas,

i couldnt open the zip file correctly so i had to use ziprar, so i do now have the cube.h library :).
i was running the 1.2 python code, but i recently had more errors that i previously fixed so it'll be a bit before i have a question (hopefully)
Hi benbowman, any video ?? 

Title: Re: Rubik's cube Robot solver
Post by: alihan35 on May 11, 2017, 04:31 pm
Hey Kas How many degrees of tightening and turning of servo motors?
Title: Re: Rubik's cube Robot solver
Post by: alihan35 on May 11, 2017, 06:47 pm

Also can you show here what movements are doing in the clamp down commands like "downclose, downopen"?

  _downClose = 0;
  _downOpen = 180;
  _downCW = 0;
  _downCCW = 180;
  _downMid = 90;
  _backClose = 0;
  _backOpen = 180;
  _backCW = 0;
  _backCCW = 180;
  _backMid = 90;
  _speed = speed;
Title: Re: Rubik's cube Robot solver
Post by: kas on May 11, 2017, 07:12 pm
Sorry alihan35, I can't understand your questions
I suggest you discuss directly with demirell95
Title: Re: Rubik's cube Robot solver
Post by: demirell95 on May 11, 2017, 09:38 pm
Sorry alihan35, I can't understand your questions
I suggest you discuss directly with demirell95

I learned with your help,kas. I'm trying to help you.(alihan35)

Özelden numaramı yazdım ordan benimle irtibata geçebilirsin..
Title: Re: Rubik's cube Robot solver
Post by: demirell95 on May 14, 2017, 03:34 pm
Do you take a video using Python code and camera
I wonder how you solved what I scanned without making any moves.
Would you take a video KAS
Title: Re: Rubik's cube Robot solver
Post by: kas on May 14, 2017, 05:08 pm
Quote
Do you take a video using Python code and camera
Sorry, I moved to the Android version a long time ago
I even don't own a webcam anymore

Please respond to my post #267 for checking both Serial communication and Cube moves

Title: Re: Rubik's cube Robot solver
Post by: demirell95 on May 14, 2017, 05:37 pm
Sorry, I moved to the Android version a long time ago
I even don't own a webcam anymore

Please respond to my post #267 for checking both Serial communication and Cube moves


Will you share the android version. Video, code etc.

My exam started, so I can not take a video. :(  
(But, I tested it. It works.)
Title: Re: Rubik's cube Robot solver
Post by: benbowman on May 15, 2017, 06:16 am
hey kass,
sorry its late, i'm not sure that video would be helpful, but i thing my pythons fixed but i incly=uded an image of the arduino error message, if you could help
thanks
Title: Re: Rubik's cube Robot solver
Post by: kas on May 15, 2017, 07:07 am
hey kass,
sorry its late, i'm not sure that video would be helpful, but i thing my pythons fixed but i incly=uded an image of the arduino error message, if you could help
thanks
::)  ::)  you are missing the bip() function
This convenient utility function drives an active buzzer, as shown below

(http://i.imgur.com/LEOsbLP.jpg)

which code version are you using ??



Quote
My exam started, so I can not take a video. :( 
(But, I tested it. It works.)
@demirell95
No rush, post it when you have time
Good luck for your exams

Title: Re: Rubik's cube Robot solver
Post by: benbowman on May 15, 2017, 01:29 pm
hey kas

is it a stupid question to ask how i get the bip() function?
and im using the 1.2 arduino code
Title: Re: Rubik's cube Robot solver
Post by: kas on May 15, 2017, 01:48 pm
Quote
is it a stupid question to ask how i get the bip() function?
:o  :o   should be included
There is possibly several V1.2 versions around, please specify Post number


Title: Re: Rubik's cube Robot solver
Post by: benbowman on May 16, 2017, 04:47 am
the arduino code off post #18
Title: Re: Rubik's cube Robot solver
Post by: kas on May 16, 2017, 09:04 am
The bip() function is included in this code, your Copy/Paste was not accurate enough   ;)
The complete code including cube.h is located at Post #43

Title: Re: Rubik's cube Robot solver
Post by: benbowman on May 16, 2017, 01:37 pm
thanks kas!!
the codes compiled correctly, ill set my solver tomorrow and hopfully video its first 'solve', ill also upload my frame files soon  :)

thanks so much kas
Title: Re: Rubik's cube Robot solver
Post by: demirell95 on May 16, 2017, 07:38 pm
Everything is right
But it gives such an error
I dont understand ?
(http://i.resimyukle.xyz/7bQC8.png)
Title: Re: Rubik's cube Robot solver
Post by: lampel on May 16, 2017, 08:31 pm
Hello all ,
i have a few question before buying the servos :
1. do you need different servos for the pinch / Wrist servo ?, can i buy the same 4 servos ?
2. on post #226 kas said that he liked Towerpro MG995 servo but if i look at the DataSheet :
    "This servo can rotate approximately 120 degrees (60 in each direction)" ,
    on other posts you say make sure servo can do a full 180° so i am confused
3.maybe a dumb question but i want to make sure : when you say pick a servo that can do a full 180° ,
   do you mean 90° in each direction??
4. i cannot find the suggested HITEC HS422 servo to buy , do you have another suggestion
   for a full 180 degree motor ? a full 180° servo i find seems to be very low Torque , whats the minimum Torque
   for cube rotation ? i dont think ANY 180° servo is good (see the cheap arduino starter kit servo SG90)



Thanks lampel
Title: Re: Rubik's cube Robot solver
Post by: kas on May 16, 2017, 10:40 pm
Quote
Everything is right
But it gives such an error
I dont understand ?
Communication with Arduino is not established

Please respond to my post #267
We need to validate both serial communication and cube moves


Title: Re: Rubik's cube Robot solver
Post by: kas on May 17, 2017, 08:01 am
Hi lampel

1 - No, Yes
2 - My 995's are modified for continuous rotation, can't check this important feature for wrist servo's
3 - Yes (no dumb question  ;) )
4 - HITEC HS422 (https://www.sparkfun.com/products/11884) seems to be widely available
     Torque won't be an issue provided you choose a quality Cube (see post #1)

Title: Re: Rubik's cube Robot solver
Post by: lampel on May 17, 2017, 08:17 pm
Thank you kas!

2. Mybe off topic but how do you modify 995's  for continuous rotation? ,
    can you modify any servo  for continuous rotation? ,
    so why buy a full 180° servo if i can modify a servo ,
    are there any disadvantages for this modification?

Thanks lampel
Title: Re: Rubik's cube Robot solver
Post by: kas on May 17, 2017, 09:05 pm
Continuous rotation servo's are used as DC motors with integrated drivers
 - myServo.write(0) is full backward
 - myServo.write(90) is zero RPM
 - myServo.write(180) is full forward

They can't be used for this project
I currently use them for a BB8 bot, sorry for the confusion
Most servo's can be modified for continuous rotation, search on YouTube for directions

You really need a full 180° servo for the wrist, the Hitec HS-422 is one of those
You can probably find it on e-bay for less than 10 bucks shipped



Title: Re: Rubik's cube Robot solver
Post by: sirnikop on May 17, 2017, 09:34 pm
Hi kas,
I can't use a 3D printer or a laser cut machine to create grippers... Is it possible to make them handmade? Or is there another solution?
And what does it mean that the robot is semi autonomous?
Thank you
Title: Re: Rubik's cube Robot solver
Post by: kas on May 17, 2017, 10:26 pm
Hi kas,
I can't use a 3D printer or a laser cut machine to create grippers... Is it possible to make them handmade? Or is there another solution?
Hi sirnikop
You can't have them handmade, you will spend a lot of time and, at the end, it won't work
Why don't you find a Fab Lab near you, and have them CNC'ed, printed or laser cut ??
Otherwise come back to me, we will find a solution   ;)


Quote
And what does it mean that the robot is semi autonomous?
The webcam version is 'semi autonomous' and need to be connected to a PC
The Android version is 'self contained', very convenient for exhibiting at Maker Faire

Title: Re: Rubik's cube Robot solver
Post by: sirnikop on May 17, 2017, 10:32 pm
Thank you for your reply.
I could try to order it on the net, if it doesn't cost too much... Which size it should be? A5?
Title: Re: Rubik's cube Robot solver
Post by: sirnikop on May 17, 2017, 10:46 pm
Ok, I've found a FabLab in my city, problem solved  :) .
Which file do I need to create it?
Title: Re: Rubik's cube Robot solver
Post by: kas on May 19, 2017, 01:49 pm
@sirnikop
I sent you a PM

Title: Grippers kits available
Post by: kas on May 21, 2017, 08:25 am
I have two Laser cut grippers sets available for a low price
Should you be interested, just send me a PM


(http://i.imgur.com/gVtZChY.jpg)

(http://i.imgur.com/JJrG8n1.png)


Title: Re: Rubik's cube Robot solver
Post by: lampel on May 22, 2017, 08:40 pm
hello all ,
where can i find kas android program ?
thanks lampel
Title: Re: Rubik's cube Robot solver
Post by: kas on May 22, 2017, 09:44 pm
 ::)  ::)  ::)

@lampel
Did you receive my email message ??

Title: Re: Rubik's cube Robot solver
Post by: lampel on May 22, 2017, 10:24 pm
Hi KAS ,
no i havent :(

i sent you a PM a few days ago ,
didn't got response so i was thinking you're not available to answer

Title: Re: Rubik's cube Robot solver
Post by: kas on May 22, 2017, 10:27 pm
Please confirm your email address via PM

Title: Re: Rubik's cube Robot solver
Post by: kas on May 23, 2017, 07:50 am
Check your mail   ;)
please confirm

Title: Re: Rubik's cube Robot solver
Post by: lampel on May 23, 2017, 09:24 am
hi Kas ,
still noting..  (i checked the spam folder aswell )
can you PM me your email mybe i will direct send you an email ,
mybe gmail is blocking JAR files
Title: Re: Rubik's cube Robot solver
Post by: kas on May 24, 2017, 06:56 am
Quote
Thank you! ,
Got it
Finally   ;D
Enjoy

Title: Re: Rubik's cube Robot solver
Post by: lampel on May 28, 2017, 07:46 am
Hello kas ,
So i installed your android program ,
I maneged to connect it to the HC 05 module but  when i press scan i am getting "setting not supported by camera" error message , do you know this problem ?
Title: Re: Rubik's cube Robot solver
Post by: kas on May 28, 2017, 08:24 am
Quote
when i press scan i am getting "setting not supported by camera" error message , do you know this problem ?
Android code:
Code: [Select]
    parameters.setPreviewFormat(ImageFormat.NV21);
    parameters.setPreviewSize(864, 480);
    parameters.setExposureCompensation(RubikMainActivity.exposureCompensation);
    parameters.setWhiteBalance (RubikMainActivity.WBCompensation);
    parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_MACRO);
    try {
      camera.setParameters(parameters);
         } catch (Exception e) {
      Toast.makeText(getContext(), "setting not supported by camera", Toast.LENGTH_LONG).show();
         }


Your specific IP camera doesn't accept one of those settings  ::)

Go to Option
   set Exposure compensation to zero
   set White Balance to 'auto'
and test again

Let me have your camera model, together with a link to technical specifications

Title: Re: Rubik's cube Robot solver
Post by: lampel on May 28, 2017, 12:04 pm
Hi KAS ,
I tried that and still the same...
Its a samsung note 5 ,
Her is a link to the phone spesification

http://m.gsmarena.com/samsung_galaxy_note5-7431.php
Title: Re: Rubik's cube Robot solver
Post by: kas on May 28, 2017, 08:28 pm
I will recompile App with modified code:
Code: [Select]
    parameters.setPreviewFormat(ImageFormat.NV21);
    parameters.setExposureCompensation(RubikMainActivity.exposureCompensation);
    parameters.setWhiteBalance (RubikMainActivity.WBCompensation);
    parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_MACRO);
    try {
      camera.setParameters(parameters);
    } catch (Exception e) {
      Toast.makeText(getContext(), "setting not supported by camera", Toast.LENGTH_LONG).show();
    }

    parameters.setPreviewSize(864, 480);
    try {
      camera.setParameters(parameters);
    } catch (Exception e) {
      Toast.makeText(getContext(), "Preview 864X480 not supported by camera", Toast.LENGTH_LONG).show();
    }


I bet the unsupported feature is the 864X480 display; please confirm

Stay tuned


Title: Re: Rubik's cube Robot solver
Post by: kas on May 28, 2017, 09:14 pm
Check your mail   ;)
Title: Re: Rubik's cube Robot solver
Post by: kas on May 29, 2017, 06:35 am
Quote
Hi KAS ,
so i installed the debug version ,
i get : "PreviewSize(864,480) not supported"
Makes sense
I will compile the updated version within a week

Title: Re: Rubik's cube Robot solver
Post by: lampel on May 29, 2017, 08:25 pm
Hi kas ,
Your new version fixed the problem !!!
Thank you what a great guy,
do you have a paypal account can I buy you a coffee???
Title: Re: Rubik's cube Robot solver
Post by: kas on May 29, 2017, 08:35 pm
Quote
Your new version fixed the problem !!!
Glad it works  :D
I built the App using my Motorola Moto G, I really need that type of feedback to polish the code
and make it fully usable for other brands with different screen sizes


Quote
do you have a paypal account can I buy you a coffee???
I don't drink coffee   ;)
Thanks for this kind offer anycase

Title: Re: Rubik's cube Robot solver
Post by: lampel on May 30, 2017, 02:23 pm
hi Kas ,
a quick question  ,
in your android app what is the cube scan order ? (F THEN R THEN B Etc...)
do i need to set the cube orientation in a particular color order? (put red color in front ,blue color to the left,green color to the right etc...)
Thanks
Title: Re: Rubik's cube Robot solver
Post by: kas on May 30, 2017, 10:42 pm
Quote
a quick question  ,
in your android app what is the cube scan order ? (F THEN R THEN B Etc...)
(https://s9.postimg.cc/was5080rz/Rubik.png)
Yellow > Red > White > Orange > Blue > Green    then back to Yellow
Colors are only for showing scan moves order
Pay special attention to Top & Bottom faces orientation



Quote
do i need to set the cube orientation in a particular color order? (put red color in front ,blue color to the left,green color to the right etc...)
Doesn't matter

Title: Re: Rubik's cube Robot solver
Post by: lampel on May 31, 2017, 11:00 pm
Thank you kas ! ,

The complete sketch, including cube.cpp and cube.h posted on #43
seems to be corrupted..
can i find it anywhere else?
 
Title: Version V1.3
Post by: kas on Jun 01, 2017, 07:30 am
This is V1.3 (Maker Faire 2017 release)
Make sure to also download the VarSpeedServo Library

adjust DEBUG_SERIAL according to project type:
 true      for Python mode or Serial Monitor testing
 false     for Bluetooth Android mode

Enjoy   ;)



** Please rename file extension to .rar **
Title: Re: Rubik's cube Robot solver
Post by: figital666 on Jun 08, 2017, 12:50 am
i just went through all 22 pages of this project and i wanted to say thanks kas!

your project is totally inspiring.  i just got a new arduino kit for my 10 year old son and your cube project is something we're definitely going to work towards.

i might even try to build a 2x2x2 cube solving robot, as i have never seen one of those before!!
i think the programming for it would even be easier than one for a 3x3x3.  it uses the same sort
of standards as your project; basic singmaster notation, and has only corner pieces.

thanks again for the great project and inspiration.

derek...
Title: Re: Rubik's cube Robot solver
Post by: kas on Jun 09, 2017, 06:43 am
Quote
thanks again for the great project and inspiration
Hi Derek, thanks for the nice comments   8)

Again, before making any atempt so solve the cube, please make sure that:
 - the frame geometry is correct
 - rotations are _exactly_ 90° by tuning  XXX_CW and  XXX_CCW parameters
 - griping strenght is adequate, with no slippage (XXX_CLOSE)

Bot should pass the two tests described in post #6 and post #13

Good luck for your project, feel free to report progress


Title: Re: Rubik's cube Robot solver
Post by: WitherKun on Jun 09, 2017, 12:35 pm
Hey Kas. I'm trying to build a similar robot. The only problem i have now is that my servo's do not turn exactly a 90°. They turn like 90° in one direction and 75-80° in another. I'm using a digital Tower Pro MG995. I've seen that you are using Hitec HS-422 which are analog and should be more precise (from their description). Is there any difference between analog and digital. Are HS-422 precise enough? Will they give me a complete 90° turn?
Title: Re: Rubik's cube Robot solver
Post by: kas on Jun 09, 2017, 09:43 pm
Hi WitherKun

Not sure you are facing an accuracy problem   ::)

I suspect that your servo's are not covering the full 180° range
Apparently the MG995 can be used as a 'pinch' servo, but is not adequate as 'wrist'
Any 180° servo will be suitable as 'wrist', Hitec HS-422 fits the bill


Title: Re: Rubik's cube Robot solver
Post by: WitherKun on Jun 12, 2017, 11:25 am
Hey Kas. I have the same problem of demirell95 in post #288 and i already checked post #267. How can i solve that error ?
Title: Re: Rubik's cube Robot solver
Post by: kas on Jun 12, 2017, 05:58 pm
@ClankingFeather
Did you receive my email message ??


@WitherKun
Really need more info   ::)
Please post the video as per post #267


Title: Re: Rubik's cube Robot solver
Post by: WitherKun on Jun 13, 2017, 12:39 pm
@ClankingFeather
Did you receive my email message ??


@WitherKun
Really need more info   ::)
Please post the video as per post #267



(http://i.imgur.com/Gx9bac4.png)

First it was giving me this type of error. And i resolve it by adding an arduino.flushInput() string like that. Which i think is some kind of interrupt.

(http://i.imgur.com/pShx9ym.png)

It works perfectly fine and scan all the cube, except the D-face. Even though i've added the same flush.input string.
Title: Re: Rubik's cube Robot solver
Post by: kas on Jun 14, 2017, 08:09 am
Quote
And i resolve it by adding an arduino.flushInput() string like that. Which i think is some kind of interrupt.
"flushInput()"  flushes Serial input buffer and discards its contents
This python function is renamed "reset_input_buffer()" in Python V3.x

which Python version are you using ??
which RubikKasBot (python) version ??
which CubeMover (arduino) version ??


Quote
It works perfectly fine and scan all the cube, except the D-face. Even though i've added the same flush.input string
You mean you can scan all faces except the last one ??   :o



Title: Re: Rubik's cube Robot solver
Post by: WitherKun on Jun 14, 2017, 10:51 am
"flushInput()"  flushes Serial input buffer and discards its contents
This python function is renamed "reset_input_buffer()" in Python V3.x

which Python version are you using ??
which RubikKasBot (python) version ??
which CubeMover (arduino) version ??

You mean you can scan all faces except the last one ??   :o




I'm using CubeMover_13, RubikKasBot V1.3 and Python 3.4.2.

Yes. By adding a flushInput it start scanning, but now it stops on U-face instead. And i did't change nothing from yesterday. And if i change all flushInput with reset_input_buffer it's says that it was not defined, so does inputflush. So it's a little bit confusing how it works
Title: Re: Rubik's cube Robot solver
Post by: kas on Jun 14, 2017, 06:02 pm
Please stick to the original RubikKasBot V1.3 code

Within CubeMover_13 Arduino sketch, make sure DEBUG_SERIAL is set to false

(https://s3.postimg.cc/hzg3aa8pv/kasbot.png)

"Test" button does scan one face only per press
first press = face #1 (no move)
second press = face #2
...

Let me know how it works

Should it fail, please post both CubeMover and RubikKasBot


Title: Re: Rubik's cube Robot solver
Post by: WitherKun on Jun 15, 2017, 12:03 pm
Please stick to the original RubikKasBot V1.3 code

Within CubeMover_13 Arduino sketch, make sure DEBUG_SERIAL is set to false

(https://s3.postimg.org/hzg3aa8pv/kasbot.png)

"Test" button does scan one face only per press
first press = face #1 (no move)
second press = face #2
...

Let me know how it works

Should it fail, please post both CubeMover and RubikKasBot



I downloaded original CubeMover and now the scanning part works fine. Must have been some variable changed without noticing it. Thanks for the help.  :D  ;)
Title: Re: Rubik's cube Robot solver
Post by: lampel on Jun 23, 2017, 09:52 pm
Hello all ,
does anyone has the frame (stand) stl files for 3d printing ??
i 3d printed the claws from the previous posts and it works good ,
i saw kas support v2 dxf file but it seems not suitable for 3d printing ,
thanks
Title: Re: Rubik's cube Robot solver
Post by: kas on Jul 05, 2017, 03:31 pm
Quote
does anyone has the frame (stand) stl files for 3d printing ??
Did you find a solution ??

Title: Re: Rubik's cube Robot solver
Post by: benbowman on Jul 28, 2017, 11:07 am
hey kas!!
long time no contact, i gave up on my project for a little bit there but decided my school might disapprove. might have some simple coding questions to come like if i could get away with completing the project with out a buzzer.

as for you lampel, I did just upload my base for my cube solver, however the camera holder thing i made was a rushed job so might need to glue, drill or someting to make it work. here's the link to my base https://3dwarehouse.sketchup.com/model/cf7d9f09-c40f-469f-a40b-c59e31414775/Rubiks-cube-solver-base (https://3dwarehouse.sketchup.com/model/cf7d9f09-c40f-469f-a40b-c59e31414775/Rubiks-cube-solver-base) 
Title: Re: Rubik's cube Robot solver
Post by: benbowman on Jul 30, 2017, 04:06 am
hey kas,
for your code for "Cube Mover hard coded Demo  @kas2017\n" I'm having some troble as when i set the limits for closing the griper it works at the start and finish. however throughought the execution the gripers don't close enough, i can try provide video.
thanks
Title: Re: Rubik's cube Robot solver
Post by: kas on Jul 30, 2017, 07:27 am
Hi benbowman

Quote
might have some simple coding questions to come like if i could get away with completing the project with out a buzzer
A buzzer is really useful (and cheap). If you don't have it for the moment, just comment the content of the bip() function:

Code: [Select]

void bip(int duration, int n)    {            // Bip piezo: duration in ms, n repeats
 // for(int i=0; i<n; i++)  { 
 //    digitalWrite(bipPin, HIGH);       
 //    delay(duration);
 //    digitalWrite(bipPin, LOW);         
 //    delay(75);
 // }
}



Quote
I'm having some troble as when i set the limits for closing the griper it works at the start and finish. however throughought the execution the gripers don't close enough, i can try provide video.
A video will definitely help    ;)


Title: Re: Rubik's cube Robot solver
Post by: benbowman on Jul 31, 2017, 08:41 am
hey kas,
thanks for that i'll see if i can get a buzzer, but i should be able to run the code soon then.

here's a video of the cube, as you can see the gripper on the left is lose and the one on the right seems fine, these are what my limits are set to, i thought it might be because of the my limits being the oposite to yours (close is higher than open, yours is the opposite)

   DOWN_CLOSE          76
   DOWN_OPEN           35

   BACK_CLOSE          79
   BACK_OPEN           35



https://www.youtube.com/channel/UC7o9_8HEwzxFIk4ifCsnYtQ (https://www.youtube.com/channel/UC7o9_8HEwzxFIk4ifCsnYtQ)
Title: Re: Rubik's cube Robot solver
Post by: kas on Jul 31, 2017, 09:28 am
@ benbowman

Video link is missing  :-\
please edit your post

Title: Re: Rubik's cube Robot solver
Post by: benbowman on Aug 02, 2017, 12:08 am
hey kas,
any ideas?
Title: Re: Rubik's cube Robot solver
Post by: kas on Aug 02, 2017, 02:30 pm
First make sure that your can manually increase claw closure
You may have reached the mechanical end stop of your left servo
Just unscrew, lift the driving arm and rotate it


Quote
i thought it might be because of the my limits being the oposite to yours (close is higher than open, yours is the opposite)
That's a possibility
Remove cube,
adjust DOWN/BACK_CLOSE/OPEN parameters one at a time and see the effect for yourself
For a good grip, without cube inserted, claw should close about 2mm more than the actual cube edge size and open 1 to 2mm more than cube diagonal



Title: Re: Rubik's cube Robot solver
Post by: benbowman on Aug 03, 2017, 12:07 pm
hey kas,
thanks, I'd already been playing with my limits, so I've decided to change servo and to add different cushioning thats more gripy as one of my gripers is able to grip the cube while the other obviously can't. I've also been drawing up to 2.5 amps during the uses, does what does yours draw?
thanks
Title: Re: Rubik's cube Robot solver
Post by: kas on Aug 03, 2017, 05:37 pm
Quote
...and to add different cushioning thats more gripy
I use rubber bands cut out of a bike inner tube, dipped in acetone to remove any greasy residues.


Quote
I've also been drawing up to 2.5 amps during the uses, does what does yours draw?
I tested my servo's last year and had no values over 1500mA   YMMV


Quote
and to add different cushioning thats more gripy as one of my gripers is able to grip the cube while the other obviously can't.
Strange  ::)  this call for additional investigation
Did you try inverting Right/Left servo connectors ??  did it transfer problem to the right servo ??


Title: Re: Rubik's cube Robot solver
Post by: benbowman on Aug 07, 2017, 01:00 pm
I'll give the idea of the bike tubing out,

that's strange do you know what the stall current of your servos are? but its no real pro blame I've just
increased my power supply

i changed the connections to the servos and they back gripper still doesn't hold the cube I'm a little lost about because the down claw holds the cube beautifully, but i did find that by prints aren't quite aligned so
i will need to upload a different frame for those that would like to use it.   

Title: Re: Rubik's cube Robot solver
Post by: kas on Aug 07, 2017, 04:39 pm
Quote
i changed the connections to the servos and they back gripper still doesn't hold the cube I'm a little lost about because the down claw holds the cube beautifully
With cube removed, can you manually close the back gripper ??
How is the requested applied force compared to the down gripper ??


Title: Re: Rubik's cube Robot solver
Post by: benbowman on Aug 10, 2017, 07:14 am
hey kas,
ive managed to solve the problem with the gripping, the claws werent aligned properly and i changed the foam that i was using on the claws.
however, i am now having some dificulties with the python, here's an image (http://imgur.com/DbtLmLx)
any chance you know whats going on there, i changed the path that you set and it still didn't work.
Title: Re: Rubik's cube Robot solver
Post by: kas on Aug 13, 2017, 05:21 pm
Offending code:
----------------------------------------------------------------------------------------
try:
  p=subprocess.Popen([cubeExplorerPath])        ## Cube Explorer launching
except:
  vSolve.set("** Cube Explorer not found **")
----------------------------------------------------------------------------------------

The most probable reason for the raised exception is a wrong/malformed path to cube512htm.exe

 - can you launch cube512htm.exe manually ??
 - what is your absolute path to cube512htm.exe on your computer ??
 - are you Windows or Mac ??
 - please copy paste the "cubeExplorerPath = ...." line from your actual python code



Title: Re: Rubik's cube Robot solver
Post by: benbowman on Aug 15, 2017, 05:32 am
hey kas,
the code you've refere to i couldn't find.
----------------------------------------------------------------
  try:
    f = urllib.request.urlopen(cubeExplorer + command)
    print(cubeExplorer + command)
    page = str(f.read())
  except:
    vSolve.set("No response from Cube Explorer")
----------------------------------------------------------------
that's what I've got...

-yes, i can launch cube512htm.exe and it runs perfectly
-"C:\Users\ben\Documents\school\systems\cube exporer\cube512htm.exe" is this what you need?
-I'm using windows
-"cubeExplorerPath = 'C:\\Program Files\\Cube Explorer\\cube512htm.exe' ## Cube Explorer program path"
Title: Re: Rubik's cube Robot solver
Post by: kas on Aug 15, 2017, 10:12 am
Quote
the code you've refere to i couldn't find.
----------------------------------------------------------------
  try:
    f = urllib.request.urlopen(cubeExplorer + command)
    print(cubeExplorer + command)
    page = str(f.read())
  except:
    vSolve.set("No response from Cube Explorer")
----------------------------------------------------------------
that's what I've got...
This is not the right code snippet, I am refering to line #354




Quote
>> - what is your absolute path to cube512htm.exe on your computer ??
           "C:\Users\ben\Documents\school\systems\cube exporer\cube512htm.exe" is this what you need?

>> - please copy paste the "cubeExplorerPath = ...." line from your actual python code
          "cubeExplorerPath = 'C:\\Program Files\\Cube Explorer\\cube512htm.exe' ## Cube Explorer program path"
Based on your information, your actual python code should read (line #26):
 cubeExplorerPath = C:\\Users\\ben\\Documents\\school\\systems\\cube exporer\\cube512htm.exe




Title: Re: Rubik's cube Robot solver
Post by: benbowman on Aug 15, 2017, 01:36 pm
thanks heeps kas!!
that fixed it, i thought tried that but i thought it might be a local path or something.
I'll try it out with my hardware tomorrow
Title: Re: Rubik's cube Robot solver
Post by: kas on Aug 16, 2017, 10:05 am
Quote
that fixed it
great :D


Quote
i thought tried that but i thought it might be a local path or something.
Please read the code thoroughly and try to understand most of it, no need to recreate it  ;)



BTW you should be more confortable with Idle compared command line tool
here it is ...\Python36\Lib\idlelib\idle.bat



Title: Re: Rubik's cube Robot solver
Post by: benbowman on Aug 17, 2017, 03:56 am
yeah I'm just trying to get to know python a bit better.

now that ive tested the code with the hardware but when i try to "scan colors" the text says " no response from cube explorer" and same when i try reset but not test. but the program opens cube explorer, any ideas
Title: Re: Rubik's cube Robot solver
Post by: kas on Aug 17, 2017, 08:06 am
Quote
now that ive tested the code with the hardware but when i try to "scan colors" the text says " no response from cube explorer" and same when i try reset but not test. but the program opens cube explorer, any ideas
Yes   ;)

Please enable WebServer in Cube Explorer
(https://s11.postimg.cc/vcvt6aq9v/Cube_Explorer.png)


FWIW, I enclose the relevant documentation, please read


Title: Re: Rubik's cube Robot solver
Post by: benbowman on Aug 31, 2017, 06:42 am
hey kas, that fixed the error.

however the cube i am using and that you seem to be using are arranged that same, however you'll notice in the photo that my scan shows that the left it doesn't appear to be the same as the red and orange have switched sides or visa versa. i think this is because the claw scans in the wrong direction? as the scan asks to be in the order back then left then front etc. but it scans the wrong side second? would that effect it?s 
Title: Re: Rubik's cube Robot solver
Post by: kas on Aug 31, 2017, 08:04 am
@benbowman

Please post a full video showing robot and computer screen

Title: Re: Rubik's cube Robot solver
Post by: Joshwin on Aug 31, 2017, 09:24 am
Could you give me the link for the android application kas ? Thanks
Title: Re: Rubik's cube Robot solver
Post by: Joshwin on Aug 31, 2017, 09:37 am
Could you give me the link for the android app?
Title: Re: Rubik's cube Robot solver
Post by: kas on Aug 31, 2017, 10:52 am
Quote
Could you give me the link for the android app?
To get this free App, send me your email address via PM

Title: Re: Rubik's cube Robot solver
Post by: kas on Aug 31, 2017, 10:56 am
❝Could you give me the link for the android app?
To get this free App, send me your email address via PM
Check your mail  ;)



Title: Re: Rubik's cube Robot solver
Post by: benbowman on Aug 31, 2017, 11:37 am
here's a video kas
https://www.youtube.com/watch?v=7RkVfVERU-o&feature=youtu.be (https://www.youtube.com/watch?v=7RkVfVERU-o&feature=youtu.be)
Title: Re: Rubik's cube Robot solver
Post by: kas on Sep 02, 2017, 07:55 am
Quote
Great!Could you give me the link for the android App? Thanks
xxxxx@gmail.com
@kmimax
Check your mail

Title: Re: Rubik's cube Robot solver
Post by: kas on Sep 02, 2017, 12:26 pm
benbowman,

Make sure your hardware is 100% tuned before fiddling with color recognition
You will save a lot of frustration  ;)

Your grippers are possibly too far apart

(https://s26.postimg.cc/xohbvgxp5/P1030168.jpg)
Cube should really sit on the base of the claw

Try inserting four washers between each servo and frame and see for yourself

You may also increase gripper closing by 1mm, by adjusting
  #define  BACK_CLOSE     and  #define  DOWN_CLOSE

What Arduino sketch version are you using ??



Quote
i think this is because the claw scans in the wrong direction?
To change rotation direction, invert values for both servo's

  #define    DOWN_CW                 9   --->  172
  #define    DOWN_CCW           172   --->      9

  #define    BACK_CW                  2    --->  171
  #define    BACK_CCW             171    --->     2
(use your own parameters)


Title: Re: Rubik's cube Robot solver
Post by: benbowman on Sep 03, 2017, 09:50 am
hey kas,
i'll tinker with the hardware with what you suggested, it is quite frustrating.

and i was thinking that my ccw and cw tuning might have been wrong. from which perspective it to be seen as clockwise or counter clock wise? (looking at the servo knob or from the back of the servo?
thanks so much kas!
Title: Re: Rubik's cube Robot solver
Post by: kas on Sep 03, 2017, 12:14 pm
Quote
and i was thinking that my ccw and cw tuning might have been wrong. from which perspective it to be seen as clockwise or counter clock wise? (looking at the servo knob or from the back of the servo?
From the back of the servo

Out of curiosity, where are you based ?

Title: Re: Rubik's cube Robot solver
Post by: kas on Sep 03, 2017, 03:20 pm
Quote
i'll tinker with the hardware with what you suggested, it is quite frustrating
From the video, seems you are missing the reseat() function
Please confirm your  CubeMover  sketch version



Title: Re: Rubik's cube Robot solver
Post by: benbowman on Sep 04, 2017, 06:05 am
hey kas,
im using cube mover 1.2 is that too early?
and i'm based in Melbourne Australia.
Title: Re: Rubik's cube Robot solver
Post by: kas on Sep 04, 2017, 09:50 pm
Please use the most recent release
V1.3 introduced the reseat() function that briefly opens/closes grippers between two moves
and helps reseating the cube on the base of the claw (post #359)

Also look at Cube::downArmCW() & Cube::backArmCW()
I added a small rotation overshoot to ensure that moves are really square
Please adjust to taste

How do you power servo's & microcontroller ??

When ready, please post a new video
 - robot only
 - from one side
 - with faster moves


Title: Re: Rubik's cube Robot solver
Post by: kmimax on Sep 06, 2017, 11:06 pm
have a try,begin!
Title: Re: Rubik's cube Robot solver
Post by: kas on Sep 07, 2017, 07:47 am
Hi kmimax, welcome


(https://s26.postimg.cc/bzogryy09/IMG_8489.jpg)

Nice  8)
Don't forget the bracket for the camera


Title: Re: Rubik's cube Robot solver
Post by: kmimax on Sep 07, 2017, 12:15 pm
If I use my smartphone's LED light,OK?
Title: Re: Rubik's cube Robot solver
Post by: kas on Sep 15, 2017, 08:17 am
If I use my smartphone's LED light,OK?
Bright idea  ;)

Led's provide constant intensity and constant color temperature lighting to the cube
they reduce fluctating ambient lighting effects
The smartphone led is probably too weak for the job

Try it and let us know


Title: Re: Rubik's cube Robot solver
Post by: kas on Sep 23, 2017, 11:32 am
Hello, Kas.
I want to make a last years project about your Rubik's cube solver. Do you think it's possible to complete this project without any electronic knowledge?

If you think so, could you please send me all the links, files, instructions,... to complete your project?
Yours sincerely,
Souli

PS: My final degree depends on your reply ;) (sorry for my bad English i'm from Belgium)
Hi Souli,

This Rubik's solver is a major project

Electronic knowledge as such is not mandatory
The major point is mastering the Arduino ecosystem
Of course, precision crafting is of the essence   ;)

All instructions and files are included in post #1 (http://forum.arduino.cc/index.php?topic=271827.msg1915869#msg1915869)

Good luck for your project


Title: Re: Rubik's cube Robot solver
Post by: Souli on Sep 23, 2017, 08:14 pm
Thank you man! ;)
Title: Re: Rubik's cube Robot solver
Post by: mrgakoy96 on Sep 28, 2017, 02:08 pm
Hello, I am a study in Industrial University of Vietnam. Currently, I'm working on the robot solve rubik project and are having a lot of trouble connecting the software to each other. You can guide yourself to solve this part is not. Thank you very much.
Title: Re: Rubik's cube Robot solver
Post by: kas on Sep 28, 2017, 09:14 pm
Hello, I am a study in Industrial University of Vietnam. Currently, I'm working on the robot solve rubik project and are having a lot of trouble connecting the software to each other. You can guide yourself to solve this part is not. Thank you very much.
Well   ::)
I can help you for the project integration

I won't teach you Python, C++ and Arduino IDE
There are lots of smarter tutorials on the Web for these specific points

Efficient communication (English) may also be an issue  ;)


Title: Re: Rubik's cube Robot solver
Post by: mrgakoy96 on Sep 29, 2017, 05:08 am
Thank you, if I use the camera to determine the color, how the data will be processed.
Title: Re: Rubik's cube Robot solver
Post by: kas on Sep 29, 2017, 07:39 am
Your Rubik's cube Robot solver is very interesting. Could you give me the link for the android app?
Check your mail   ;)



Quote
I have one more question. Cube Explorer is no longer available on the site. Page  http://kociemba.org/cube.htm does not exist. Do you have this program for PC or is there any other option for (PC / webcam version)
Regards
Cube Explorer is still on-line (http://kociemba.org/cube.htm), just clic 'Download'




Title: Re: Rubik's cube Robot solver
Post by: kas on Sep 29, 2017, 03:35 pm
Just found a cool implementation on Instructables (https://www.instructables.com/id/Cool-Cube-Solver-Robot-With-Arduino/)

(https://s26.postimg.cc/u2xmj023t/alt_Rubik_s.jpg)


Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 02, 2017, 07:42 am
Thank you, if I use the camera to determine the color, how the data will be processed.
mrgakoy96
To help you, it will be easier if you explain what exactly you are trying to achieve
Did you already build your rubik's robot ??
Please let's have a photo


Title: Re: Rubik's cube Robot solver
Post by: mrgakoy96 on Oct 05, 2017, 05:57 pm
sorry kas, today i can answer you. My project is still in theory, I want to do the project with an android phone, can you share me detailed documentation: drawing, software and how to connect, ... thank you!
Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 06, 2017, 07:44 am
OK mrgakoy96, welcome

As already told, all info and drawings are included in this thread
Start building your bot, share your progress and get support from the community
Good luck  ;)


Title: Re: Rubik's cube Robot solver
Post by: Krishxyz on Oct 14, 2017, 08:31 am
Hi kas,   
Can u plz tell which arduino u used
Can u plz give the wiring of servos and arduino

If possible plz send the Android app
Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 14, 2017, 02:48 pm
Quote
Can u plz tell which arduino u used
Arduino Uno + HC-05 or HC-06 bluetooth board
I personally use this (https://forum.arduino.cc/index.php?topic=173246.msg2552714#msg2552714) combo board


Quote
Can u plz give the wiring of servos and arduino
- back pinch servo to pin 5
 - back wrist servo to pin  6
 - down pinch servo to pin 9
 - down wrist servo to pin 10

for additional inspiration, look here  (http://forum.arduino.cc/index.php?topic=271827.msg2154535#msg2154535), here (http://forum.arduino.cc/index.php?topic=271827.msg2137172#msg2137172), here (http://forum.arduino.cc/index.php?topic=271827.msg2248638#msg2248638) and here (http://forum.arduino.cc/index.php?topic=271827.msg2256555#msg2256555)


Title: Re: Rubik's cube Robot solver
Post by: Krishxyz on Oct 14, 2017, 03:49 pm
Hi kas, is it fine if I don't use the Bluetooth board for the web cam version
Title: Re: Rubik's cube Robot solver
Post by: Krishxyz on Oct 14, 2017, 07:26 pm
thx kas

is there varspeedservo for 32 bit windows
can u plz give cube mover13 with a .rar extension instead of .txt
 
Title: Re: Rubik's cube Robot solver
Post by: Krishxyz on Oct 14, 2017, 07:57 pm
hi kas ,
can u plz try to send me the grippers as i am a 9th grader and dont have acess to cnc , 3d printer etc
in 2 months i have sumbit a autonomous robot for a exam so i am building this, plz tell me the cost or if plz can i hav it free
Title: Re: Rubik's cube Robot solver
Post by: Krishxyz on Oct 15, 2017, 08:29 am
hi kas
 can i hav the link to pyserial and tkinter
and will i need to change the code or can i just copy paste it

Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 15, 2017, 10:01 am
Quote
Hi kas, is it fine if I don't use the Bluetooth board for the web cam version
Right, no Bluetooth required for the web cam version
You can easily switch to Android version later on



Quote
is there varspeedservo for 32 bit windows
::)   Within Windows, I suspect the complete Arduino environment is 32 bit



Quote
can u plz give cube mover13 with a .rar extension instead of .txt
This forum does not accept .rar attachments, just download and rename to .rar



Quote
can u plz try to send me the grippers
Sorry, no more grippers available
Where are you based ??   I am confident you will find many CNC's, 3D printers or laser cutters around
Ask your friends and/or look for FabLabs



Quote
can i have the link to pyserial and tkinter
and will i need to change the code or can i just copy paste it
Please do your home work for Python installation, Google is your best friend  ;)
https://pypi.python.org/pypi/pyserial (https://pypi.python.org/pypi/pyserial)
https://pypi.python.org/pypi/tkinter.help (https://pypi.python.org/pypi/tkinter.help)



Title: Re: Rubik's cube Robot solver
Post by: Krishxyz on Oct 15, 2017, 02:26 pm
Thx kas
Title: Re: Rubik's cube Robot solver
Post by: Krishxyz on Oct 15, 2017, 03:14 pm
will i need to change the code or can i just copy paste it
Title: Re: Rubik's cube Robot solver
Post by: Krishxyz on Oct 15, 2017, 03:21 pm
Have a look at this nice and easy project

https://makerzone.mathworks.com/resources/arduino/rubiks-cube-solver/

Video

https://m.youtube.com/watch?v=-FvypJ8-Wms
Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 15, 2017, 04:24 pm
Nice  :)
 
Enter "rubik robot" on YouTube and you will see a lot of interesting projects
I personally like this one (http://jacoburge.co.uk/rubix-cube-solving-robot) for the very original color recognition method


Title: Re: Rubik's cube Robot solver
Post by: Krishxyz on Oct 15, 2017, 04:44 pm
will i need to change the code or can i just copy paste it
Plz reply
Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 15, 2017, 05:22 pm
will i need to change the code or can i just copy paste it
You just have to adjust servo's limit values

Code: [Select]
// ---------- user adjustments -------------------
#define    DOWN_CLOSE         107
#define    DOWN_OPEN          159
#define    DOWN_CW              9
#define    DOWN_MID            89
#define    DOWN_CCW           172

#define    BACK_CLOSE         111
#define    BACK_OPEN          163
#define    BACK_CW              2
#define    BACK_MID            87
#define    BACK_CCW           171



Title: Re: Rubik's cube Robot solver
Post by: Krishxyz on Oct 16, 2017, 04:41 am
Kas ,
Can I plz have the wiring of  the servo , Arduino , the shelid and the battery

I am very confused
Title: Re: Rubik's cube Robot solver
Post by: Krishxyz on Oct 16, 2017, 07:46 am
Will I need to use arduino ide
Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 16, 2017, 08:15 am
Will I need to use arduino ide 
:o  :o  :o

Krishxyz, this is an advanced project, both for hardware and software
Please get familiar with the Arduino environment before tackling this one

Sorry, I can't help you for that  :-\


Title: Re: Rubik's cube Robot solver
Post by: Krishxyz on Oct 16, 2017, 09:23 am
what does cube mover 13 does
Title: Re: Rubik's cube Robot solver
Post by: Krishxyz on Oct 16, 2017, 09:32 am
basically i am supposed to type all the code in pyton



1 st time i am interlinking 2-3 softwares
sorry for so many questions but it is really important for me as this is a school project


if i need to type the code on arduino serial monitor or somewhere else plz let me know
Title: Re: Rubik's cube Robot solver
Post by: Krishxyz on Oct 16, 2017, 09:46 am
Will I need to use arduino ide

silly question indeed :)  :)  :)  :D  :D  ;D
Title: Re: Rubik's cube Robot solver
Post by: Krishxyz on Oct 16, 2017, 11:07 am
hi kas,

 i live in india ,
it is very hard to find fablabs , 3d printer or cnc
plz can u arrange for the grippers and plz giv me the lowest price u can give :D
Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 16, 2017, 04:32 pm
Quote
what does cube mover 13 does
...
basically i am supposed to type all the code in pyton
...
1 st time i am interlinking 2-3 softwares
Cube mover 1.3 is an Arduino sketch, not a Python code

Krishxyz, please accept the fact that you are not  yet  ready to tackle such a project, both on the soft & hard side
Look for an easier bot to build

Again, sorry for that



Title: Re: Rubik's cube Robot solver
Post by: Krishxyz on Oct 16, 2017, 05:28 pm
Thanks for the advise ,,

If it is so hard I will try the Android version which looks much easier than the python version so can u plz send me the app
Title: Re: Rubik's cube Robot solver
Post by: Krishxyz on Oct 16, 2017, 05:38 pm
Sorry was I lied to u , I am a 7th grader only

:-X :-X
Title: Re: Rubik's cube Robot solver
Post by: Krishxyz on Oct 17, 2017, 09:24 am
Hi kas ,,

I asked my teacher about the code , he explained me everything and a am supposed to submit the project by November end plz cooperate with me

Plz try to send the grippers I beg you please 
If I don't submit the project in time I may fail




Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 17, 2017, 09:38 am
Sorry Krishxyz, please refer to my last comment
Title: Re: Rubik's cube Robot solver
Post by: Krishxyz on Oct 17, 2017, 11:45 am
kas whatever u say

i am going to try my best to make this project
i will try going to a acralic sheet cutter or somewhere else
if i suceed i will post images
i hav made more complex projects than this before
the project whoose mechanics are very tough


thx again
Title: Re: Rubik's cube Robot solver
Post by: Ghost_StarLord on Oct 27, 2017, 09:29 am
Hey man, this project is amazing and its good to see that you are helping the ones trying to make even after such a long time. I am very new to CNC cutting and wanted to know how to proceed to cut the grippers out? What should i do with the PDF file that you have provided.
Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 27, 2017, 11:37 am
Hi Ghost_StarLord

Quote
Hey man, this project is amazing and its good to see that you are helping the ones trying to make even after such a long time
Thanks for the kind words



Quote
I am very new to CNC cutting and wanted to know how to proceed to cut the grippers out? What should i do with the PDF file that you have provided
Welcome to the CNC world   ;)
I can possibly post the G-code file
Let me know which softwares you are using for parts design & CNC control




Title: Re: Rubik's cube Robot solver
Post by: JosePK on Oct 27, 2017, 12:27 pm
Hi, first of all, thank you for your great contribution. I'm following your instructions to make a rubik's cube solver robot with an Android mobile. What application do you use to take the photos? Thank you.  :)
Title: Re: Rubik's cube Robot solver
Post by: Ghost_StarLord on Oct 27, 2017, 01:40 pm
Welcome to the CNC world   ;)
I can possibly post the G-code file
Let me know which softwares you are using for parts design & CNC control





Hey thanks for the quick reply. I am learning to use AutoCAD and solidworks. It would be of great help if you can send the G-code.
Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 27, 2017, 02:50 pm
Quote
It would be of great help if you can send the G-code.
(http://i.imgur.com/gVtZChY.jpg)

The attached G-Code was processed for Mach3 controller
See if it works and let me know



Title: Re: Rubik's cube Robot solver
Post by: kas on Oct 27, 2017, 02:53 pm
Quote
Hi, first of all, thank you for your great contribution. I'm following your instructions to make a rubik's cube solver robot with an Android mobile. What application do you use to take the photos? Thank you.
This free application is available on request
Please post a photo of your project and let me have you email address via PM

Title: Re: Rubik's cube Robot solver
Post by: mrgakoy96 on Nov 08, 2017, 08:45 am
sorry, help me!!! cube explorer can not identified scan color orange.
https://drive.google.com/file/d/185wSxw3m2UAHU0wIqW7h0gI2vE2mUjtY/view?usp=sharing
Title: Re: Rubik's cube Robot solver
Post by: kas on Nov 08, 2017, 09:56 am
sorry, help me!!! cube explorer can not identified scan color orange.(https://drive.google.com/drive/u/0/my-drive)
The attached photo is not available, please repost

Title: Re: Rubik's cube Robot solver
Post by: kas on Nov 11, 2017, 11:13 am
Color recognition is a whole universe

discriminating between red and orange is not trivial
You need a constant lighting (both intensity and color temperature)

Please read & follow instructions in the "The Webcam Tabbed Sheet" paragraph
Also adjust webcam white balance and exposure

This is a one time only tuning


Title: Re: Rubik's cube Robot solver
Post by: Souli on Nov 17, 2017, 02:11 pm
I am still working on my design  :)
Title: Re: Rubik's cube Robot solver
Post by: kas on Nov 18, 2017, 07:46 am
So far so good   :)

Thanks for sharing


Title: Re: Rubik's cube Robot solver
Post by: ParaPedro on Nov 25, 2017, 06:02 pm
Hi Kas
Here's my interpretation of your design.

One thing I've discovered while testing and tuning with CubeMoverHardCoded is when I made my grippers, I made a left (Back) and right (Down) version of them. I orientated the servo's so all the wiring from the pinch servo's would lead out the back of the frame.
The problem I found when testing is that the SEIZE command would make one gripper grab the cube tight, while the other would release and drop the cube.
I found that by editing the cube.cpp file and changed the (_downClose + SEIZE......)  command to be (_downClose - SEIZE... ) it appears to have fixed it.
Will this cause problems further down the track as I progress.
Maybe a trick for other beginners to be aware of.
So far, so good.
Title: Re: Rubik's cube Robot solver
Post by: kas on Nov 25, 2017, 08:07 pm
(https://s33.postimg.cc/m15mxbilr/My_Cube1.jpg)

Nice setup, classic style   :)

 - On the picture, the left gripper seems a bit high compared to the right one
 - You placed the "wrist" servo's vertically, please make sure that grippers can still rotate as expected

It is good practice to have the BT card antenna slightly outside the mother PC board
for this project with short distance broadcast, it won't matter

My grippers are ambidextrous with wirings on both side of the frame
You will encounter additional problems that will be easily fixed in the code

Post a video when ready


Title: Re: Rubik's cube Robot solver
Post by: sandy_undefined on Dec 13, 2017, 04:52 am
hlo its just amazing project!!! can u tell me the software part fully described means what kind of software to use and how to link between smatphone and other i don't get it!!
Title: Re: Rubik's cube Robot solver
Post by: kas on Dec 13, 2017, 08:14 am
hlo its just amazing project!!! can u tell me the software part fully described means what kind of software to use and how to link between smatphone and other i don't get it!!
The Android version (http://forum.arduino.cc/index.php?topic=271827.msg1915869#msg1915869) needs two pieces of software
- One Android App, let's call it MASTER
- one Arduino sketch  CubeMover V1.3 (http://forum.arduino.cc/index.php?topic=271827.msg3283775#msg3283775), let's call it SLAVE

SLAVE is only in charge of moving cube according to MASTER's orders
MASTER and SLAVE communicate via BlueTooth

Workflow is as follow:

 - MASTER performs color recognition for the 6 faces and requests SLAVE to move cube accordingly
 - MASTER builds and send a query to a dedicated online Rubik's solving server (Montréal, Canada)
 - MASTER receives solution from server and sends commands to Arduino (Singmaster notation format)
 - SLAVE moves cube according to commands and put the cube in the right order

Easy isn't it  ;)


Title: Re: Rubik's cube Robot solver
Post by: sandy_undefined on Dec 15, 2017, 06:17 pm
The Android version (http://forum.arduino.cc/index.php?topic=271827.msg1915869#msg1915869) needs two pieces of software
- One Android App, let's call it MASTER
- one Arduino sketch  CubeMover V1.3 (http://forum.arduino.cc/index.php?topic=271827.msg3283775#msg3283775), let's call it SLAVE

SLAVE is only in charge of moving cube according to MASTER's orders
MASTER and SLAVE communicate via BlueTooth

Workflow is as follow:

 - MASTER performs color recognition for the 6 faces and requests SLAVE to move cube accordingly
 - MASTER builds and send a query to a dedicated online Rubik's solving server (Montréal, Canada)
 - MASTER receives solution from server and sends commands to Arduino (Singmaster notation format)
 - SLAVE moves cube according to commands and put the cube in the right order

Easy isn't it  ;)

i like the way u explain its easy thanks a lot!!
nd i need 1more help  can u tell me how setup the sofware part!!! inncluding all software nd all that!!
Title: Re: Rubik's cube Robot solver
Post by: kas on Dec 15, 2017, 06:51 pm
Quote
i need 1more help  can u tell me how setup the software part!!! including all software nd all that!!
Please (re)read this thread, you will find all that
I have a feeling you are not (yet) ready for this type of project   ::)


Title: Re: Rubik's cube Robot solver
Post by: sandy_undefined on Dec 15, 2017, 08:53 pm
The final claw should grip the cube (55mm) and open sufficiently (55 X 1.414, thanks pythagoras  ;)  ) to allow cube rotation

where is the use of pythagoras???
can u explain it plz!
Title: Re: Rubik's cube Robot solver
Post by: kas on Dec 16, 2017, 10:11 am
Quote
The final claw should grip the cube (55mm) and open sufficiently (55 X 1.414, thanks pythagoras  ;)  ) to allow cube rotation

where is the use of pythagoras???
can u explain it plz!
I was refering to Pythagorean theorem (https://en.wikipedia.org/wiki/Pythagorean_theorem)
Claw should open a bit more than cube Diagonal:        D² = 55² + 55²     --->     D =  55 X 1.414


Title: Re: Rubik's cube Robot solver
Post by: ahappykid on Feb 02, 2018, 06:04 pm
Hi kas, i'm doing a rubik cube solver for my final school project.
I'm trying to do the android version, so can you please tell me where i can find the app ?

i know this is kind of an old project but i would really appreciate if you helped me.
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 03, 2018, 09:12 pm
Hi kas, i'm doing a rubik cube solver for my final school project.
I'm trying to do the android version, so can you please tell me where i can find the app ?

i know this is kind of an old project but i would really appreciate if you helped me.
The project is still alive   :)
Please post a photo of your bot and let me have your email via PM


Title: Re: Rubik's cube Robot solver
Post by: ahappykid on Feb 06, 2018, 05:12 pm
I dont have nothing build yet, but i am looking for a place to 3d print my robot, But i would like to have everything ready.

Also can you tell me if i can test the code without the arduino board ?

(sorry i'm a newbie)
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 07, 2018, 07:23 am
OK, no rush, come back when your bot is ready to move
It is difficult to test a micro controller code without uploading it the card  ;)


Title: Thingiverse
Post by: kas on Feb 09, 2018, 07:55 am
I got some inquiries to have the 3D design published on  thingiverse (https://www.thingiverse.com/)
If there is sufficient interest, I will upload the complete project for you

Let me know


Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 11, 2018, 10:20 pm
Hi Kas,
I am looking for a new project and your rubics cube solver would suit me just fine.
I have only scanned through the thread but can only find one reference to a drawing for the gripper parts
#162.
I have tried all sorts of ways to bring the .dxf up for printing and can only get it to show on irfanview (a program for showing pictures).
When I try to print it all I get is the top corner of the page as if irfanview doesn't understand the whole picture.
I don't have anything that will show the .ai file.
Is this the only copy of the gripper parts list or is there some other version I can download.
Thanks.
I have a 3d printer and would be very interested in parts on thingiverse even if only the parts with the cog.
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 12, 2018, 08:44 am
Hi matelot
This project does combine several skills during implementation   (not for noobs) ;)

I am currently optimising grippers design for 3D printing
Should you be interested, please let me have your email via PM
I will send you the stl's, and based on your comments/suggestions I will publish the gripper design on Thingiverse

Let me know


Title: 3D printed gripper
Post by: kas on Feb 13, 2018, 03:00 pm
@ matelot,

Check your mail   ;)

This is the new 3D printed gripper V2
simpler to build, only M3 screws and some filament
no more washers, servo's horns and standoffs are now embedded in the relevant PLA parts
This instance is fitted with a mini top plate, to expose the internal mecanism

(https://s13.postimg.cc/l68zyqqc7/Gripper_V2.jpg)


This gripper was printed @40mm/s with 30% infill, no support needed

Let me have your comments


Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 13, 2018, 04:41 pm
Hi Kas,
one of the grippers is printing as we speak.
I have had right fun with the python. I have never used python before so a learning curve is so steep it is blocking out the light.
I have managed, after two days to get the hello world box but I had to do it without the lines

import serial, time
from serial import SerialException
import atexit
import subprocess

the cmd says no module named 'serial'   ?

I have been trying to find out why on various forums but without much help. can you understand why?
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 13, 2018, 04:52 pm
Quote
the cmd says no module named 'serial'   ?
I have been trying to find out why on various forums but without much help. can you understand why?
Did you download and install the pySerial (https://pythonhosted.org/pyserial/) package ??   ::)


Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 13, 2018, 05:40 pm
I have downloaded the package but I have a feeling it is not in the right directory.
I have the python in
c:\.....python\python36-32
and the pyserial in
c:\.....python\python36-32\pyserial-master\pyserial-master
Can I just move some files to get it right and if so which ones?
Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 13, 2018, 05:47 pm
I am trying all sorts of things to get it to work.
I am changing directories in the command prompt and moving various files around but just keep getting nowhere.
I am now at the point with setup.py in the python directory and failing to load cos it can't find _init_py.  _init_py is in the seriel directory back in pyserial_master. I don't want to keep moving files around like this, there has to be a way round this I can't see everone having to do what I am doing?

The cog printed and looks quite good.


Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 13, 2018, 06:56 pm
Quote
I have never used python before so a learning curve is so steep it is blocking out the light.
Matelot, we are on the same boat   ;)
I first fiddled with Python, 3 year ago for this specific project and have not used it later on  ::)

I tend to remember that pySerial had a built in installer
Also make sure not to mix 16/32 bit versions for Python/pySerial

My "serial" files are here: C:\Python36\Lib\site-packages\serial
I have no "pyserial-master" folder on my (Windows) machine
Suspect that pySerial is not _installed_




Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 13, 2018, 11:57 pm
Just whilst I am looking at other things I will comment that the py-serial folder pyserial-master was produced by the auto loader? :(
Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 14, 2018, 01:47 am
I have now tried lots of things with the python.
I can get the hello world box by removing all references to the pyserial but still can't get it to run with it in.

I have printed the cog twice and the middle plate that it sits on.
If you still have the files (I don't know what you used to make the STL's but I would use *.FCstd's in freeCAD, would it be possible to alter the hole on one of the cogs to take the servo? Like the bottom plate.
Perhaps moving the cog teeth round a bit so you have a male and a female might help as well. Just a thought.
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 14, 2018, 10:24 am
Quote
I don't know what you used to make the STL's
I work using Fusion 360 (https://www.autodesk.com/products/fusion-360/overview) from Autodesk, a great/free piece of software



Quote
would it be possible to alter the hole on one of the cogs to take the servo? Like the bottom plate.
Perhaps moving the cog teeth round a bit so you have a male and a female might help as well. Just a thought
I don't get the point, please elaborate, a quick sketch might help

This is the Fusion 360 final assembly, including the wrist servo:
(https://s17.postimg.cc/7z9lfzklr/Gripper_Fusion.jpg)

the embedded horns are designed for Futaba 25 teeth spline geometry (Futaba/TowerPro/Orion/Savox/ProTekAce/Bluebird...)
I will release specific designs for Hitech servo's family (24T) if required


Quote
I have now tried lots of things with the python.
I can get the hello world box by removing all references to the pySerial but still can't get it to run with it in.
OK, let me know:
 - Operating System
 - 16/32 bit
 - Python version installed (link)
 - Python root folder (C:\  ??)
 - Did you add Python to $PATH ??
 - pySerial version installed (link)
 - pySerial installation procedure you used (pip install ??)
 - where is serialutil.py actual folder location in your setup?
 - are you using "iddle" IDE environment?



Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 14, 2018, 06:17 pm
For an easier assembly, I just uploaded a short exploded view video on YouTube

(https://s17.postimg.cc/garkc3dv3/exploded_gripper.png)
Video (https://youtu.be/6oEKLfjW-V4)

Enjoy


Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 15, 2018, 12:47 am
OK, let me know:
- Operating System
- 16/32 bit
- Python version installed (link)
- Python root folder (C:\  ??)
- Did you add Python to $PATH ??
- pySerial version installed (link)
- pySerial installation procedure you used (pip install ??)
- where is serialutil.py actual folder location in your setup?
- are you using "iddle" IDE environment?

Operating system
Windows 7

64 bit

Version installed
Look at list of files at bottom of  https://www.python.org/downloads/release/python-364/
Windows x86-64 executable installer.

Root folder
C;|users\bob\python36  (the installer produced the directory python36)

Did I add $path
When I loaded python I ticked the PATH box.

Pyserial; version
https://pypi.python.org/pypi/pyserial      Halfway down the page is a grey headed box  'File'
I loaded the top one    pyserial-3.4py2.py3-none-any.whl (md5)    it loaded from there.

Where is serialutil.py
Not in my files?  I can't find serialutil.py

I take it I don't have pyserial in my computer?

Am I using 'iddle'
? I am using the CMD box to send instructions to python. Your initial test prog works, without the pyserial bits in.

In the second link above, further down the page Is the file       'programming language::python::3.6'   is this the one I need to load as I am using python 3.6.4?


Quote
I don't get the point, please elaborate, a quick sketch might help
Would the servo that is connected to the cog be better with one of these?
Quote
the embedded horns are designed for Futaba 25 teeth spline geometry (Futaba/TowerPro/Orion/Savox/ProTekAce/Bluebird...)
I will print the bottom plate and let you know if this is the one, I think so.

Quote
I don't get the point, please elaborate, a quick sketch might help
I am wondering if because both sets of teeth are the same, one arm would be further forward than the other? I will see when I print enough parts.
Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 15, 2018, 01:17 am
Sorry Kas I have just noticed there is a gear(cog) with a horn plate on it
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 15, 2018, 08:12 am
Quote
Sorry Kas I have just noticed there is a gear(cog) with a horn plate on it
So all is well   :)  :)
Depending on your specific servo's, we may have to adapt spline design in  gear_horn25T_L.stl  and  rear_ plate_horn25T.stl




Quote
I have the python in c:\.....python\python36-32
seems to be a 32bit install   ::)  
I just installed "Windows x86-64 executable installer" for testing and get a "c:\.....python\python36" folder
please confirm your windows 7 is 64bit and you downloaded "Windows x86-64 executable installer"


- where is your site-packages folder located ?
- where is your serialwin32.py file located ?
- where is your pip.exe file located ?


Open a cmd prompt and type "pip freeze" without quotes and let me know the outcome




Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 15, 2018, 12:18 pm
seems to be a 32bit install   ::)  
I just installed "Windows x86-64 executable installer" for testing and get a "c:\.....python\python36" folder
please confirm your windows 7 is 64bit and you downloaded "Windows x86-64 executable installer"
I have added an attachment with a screen shot of the python file it shows 64 bit..

Quote
- where is your site-packages folder located ?
If I do  'python -m site' in CMD I get the second screen shot.
The reference to the ones at appdata\roaming look to be a copy of python27 that is far from complete. I wonder if a previous unload of the program failed to wipe these?


Quote
- where is your serialwin32.py file located ?
I have a copy of a program called CURA (for 3d printing) and it looks as if the only serialwin32.py I have is in the directories of that as if that loaded them in with it?

Quote
- where is your pip.exe file located ?
I have three copies of pip.exe. one is in the Python36 directory.

Quote
Open a cmd prompt and type "pip freeze" without quotes and let me know the outcome
the first time I did it my AVG virus eater checked it for malware and then it just waited a second and went back to the CMD prompt. Each time now it just waits a second then goes back to the CMD prompt and waits for another instruction.
Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 15, 2018, 12:59 pm
I have just printed the gear horn T25. The hole for the servo is about 1mm diameter smaller than the cog on my futaba FP S28 servo? The diameter of the spline is 6mm. The hole is 5mm.
For reference the middle plate is exactly 7cm wide. and the servo top fails to go into the hole in the lower plate. I am still looking but it looks as if my printer is printing everything slightly too small?
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 15, 2018, 01:19 pm
OK, let's re install the complete package (I just did it to make sure)

 - disable AVG anti virus
- delete C:\Users\bob\AppData\Local\Programs\Python folder
- download and install Windows x86-64 executable installer (with path option)
- check your Python install is located at C:\Users\bob\AppData\Local\Programs\Python\Python36
 - open a CMD prompt
- type C:\Users\bob\AppData\Local\Programs\Python\Python36\Scripts\pip install pyserial

Should display: Successfully installed pyserial-3.4

You should then be all set





Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 15, 2018, 02:55 pm
I have no idea what I was doing wrong?
I have deleted all references to python, other than the ones in other programs such as CURA and Inkscape that look as if they were loaded as part of those programs.
I did a full reinstall of Windows x86-64 executable installer (with path option) as you said.
I then remade the test.py file from your #22 below and just as a test I opened a CMD prompt and from c'\Users\bob I typed   python test.py (I have shown it on the attached screen shot) the hello world box opened. It looks as if that has done it.   Well done to you.

I will start another thread with my problems with the printed parts.
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 15, 2018, 03:04 pm
 ;D
Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 15, 2018, 03:07 pm
Do you have a 3d printer? are you printing the parts?
If I screw the lower plate and middle plate together than try to fit the servo under them, into the square hole. The servo doesn't quite fit in the hole. The spline doesn't extend into the round hole of the middle plate but the gear horn doesn't drop down beyond the bottom of the middle plate so the spline and the horn don't quite reach each other, apart from the fact that the spline is too big for the horn hole. If the grommets are removed from the holes in the servo then if the holes were right up to the middle plate the spline should just reach the horn and work?
I have two different servos FPS 128 AND FPS 28. I am trying to find more just to check.
I am amazed to see the pillared holes in both the plates are threaded at one end :o
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 15, 2018, 03:54 pm
Quote
Do you have a 3d printer? are you printing the parts?
Yes and yes, please see picture on post #431

Does this sketch help ?
(https://s10.postimg.cc/605cx4c21/gears_detail.png)



Also have a look at the gripper 3D view (http://a360.co/2C0PnbG)


Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 15, 2018, 04:57 pm
(https://uniim1.shutterfly.com/ng/services/mediarender/THISLIFE/007075481778/media/73740394411/small/1518707878/enhance)
There is a small protrusion on either side of the servo.
If I file away the short sides the servo fits up to the plate but the spline is still not long enough to reach the gear horn? No problem I can just file away the pillars on the lower plate until it does fit.

I have drilled the horn out to 5.5mm and the spline goes on now with a bit of force.
I will continue to print the rest of the parts.
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 15, 2018, 05:22 pm
Quote
There is a small protrusion on either side of the servo.
I did remove them using an utility knife


Quote
I have drilled the horn out to 5.5mm and the spline goes on now with a bit of force.
Let me have a link to your servo's


Quote
No problem I can just file away the pillars on the lower plate until it does fit.
Don't do that  :smiley-eek-blue:
You won't be able to insert the lower rods




Successful test using the test jig as per post #6
(https://s10.postimg.cc/6tvqusegp/bench_test.png)
video (https://youtu.be/eWGjJFvjOPs)



Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 15, 2018, 06:05 pm
Quote
Let me have a link to your servo's
Also let me have the distance between the upper part of the servo's gear and the upper face of the lower middle plate
(+- 0.1mm)

(https://s10.postimg.cc/orl2c8v9l/coupe.jpg)



I use TowerPro MG946R (https://www.ebay.com/itm/1-x-MG946R-MG946-13KG-Torque-Metal-Servo-For-Helicopter-Car-Upgraded-MG945-New/232096152402?epid=2120971845&hash=item360a023b52:g:qXcAAOSwuD9Z3J1E) with metal gears  ($4.36 shipped), they fit nicely


Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 15, 2018, 06:46 pm
sorry...

... and the upper face of the middle plate
Title: Re: Rubik's cube Robot solver
Post by: vinceherman on Feb 15, 2018, 07:47 pm
I got some inquiries to have the 3D design published on  thingiverse (https://www.thingiverse.com/)
If there is sufficient interest, I will upload the complete project for you

Let me know
Please do push it up to Thingiverse.
I have many different servos.  I do have a bunch of Futaba 3003's and a bunch of Spektrum digitals from my hexapod experiments.


Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 15, 2018, 08:21 pm
Hi vinceherman, I am pleased to see others are interested in this as well as me. I feel I am taking a bit of a liberty with Kas and very pleased he is willing to help.

I don't have anything accurate enough to measure the spline height but I have friends who do. It looks to be about 4mm from the top and 7mm from the bottom of the spline but I have contacted a friend who, hopefully, I will be seeing tomorrow evening and get him to produce an engineers depth gauge.
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 15, 2018, 08:29 pm
@vinceherman
Thanks for your feedback


@matelot
Please indicate your servo's model


Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 15, 2018, 08:44 pm
they are a very old ripmax futaba FP-28 and FP-128. I have two of each. I might look at purchasing something newer if this keeps going lol.

I have been trying to find some info about it but without much luck, all I have so far is

According to https://www.futabarc.com/servos/discontinued-servos.html
S128 and s28 are both 1.50 x 0.75 x 1.56 inches  that is 38.1 x 19.05 x 39.642  mm that is just the body.
https://www.rcgroups.com/forums/showpost.php?p=13441675&postcount=2
has this about 10 lines down
Futaba Output Spline Diameter is Ø5.96 except S3114 which is only 4mm.

I will keep looking.

Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 15, 2018, 09:01 pm
Quote
they are a very old ripmax futaba FP-28 and FP-128
They are probably 25T
It should work, try again, push hard
I made it a tight fit   ;)

Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 15, 2018, 09:25 pm
I have drilled the hole out to 5.5mm and I was still worried as I pushed it on that the gear was going to break.
It pushes on now and locks in position but is too far from the spline when in the plates.
Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 15, 2018, 09:29 pm
I have one of the rods that goes onto the spline (what do you call them?) and the hole in it is 6.25 mm.
It's not easy to count but I think there are 25 teeth.
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 16, 2018, 10:41 am
@vinceherman
When/if you are ready for printing the parts, let me have your email via PM


@matelot
Quote
I feel I am taking a bit of a liberty with Kas and very pleased he is willing to help.
I am not too busy this week
Son and grand daughter are coming next week, I will have very limited availability   ;)

I sent you four spline designs (24/25 teeth) with slightly enlarged shapes
Please let me know which one works best for you


Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 16, 2018, 01:29 pm
Quote
My printer is sitting idle
check your mail   ;)

Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 17, 2018, 02:03 am
Yes, thank you Kas the 25T_110D is fine.
The spline is 3.8mm below the level of the middle plate and is 4mm long.
Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 19, 2018, 04:45 pm
you have a zip file CubeMover_hard_coded_demo.zip in thread #243.
For some reason when I download it and try to open it I am told it is an invalid file?


I have found a file at #19 I will copy it and try it.
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 19, 2018, 04:59 pm
I just open it using WinRar V3.91
Try again, you may also try renaming to .rar

Let me know


Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 19, 2018, 06:31 pm
That got it. I loaded the file from #19 and I think it was the one for your smart phone which I don't have.
When I run the sketch into four servos on the table it jumps both grippers between each sequence?
look at this. (https://vimeo.com/256449050)
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 19, 2018, 06:53 pm
You are on the right track   ;)


CubeMover_hard_coded_demo:
Code: [Select]
void setup() {
  myCube.begin(LOW_SPEED);                    // low servo's speed
  myCube.downSetLimits(DOWN_CLOSE, DOWN_OPEN, DOWN_CW,DOWN_MID, DOWN_CCW); // set limits for pinch and rotation servo's
  myCube.backSetLimits(BACK_CLOSE, BACK_OPEN, BACK_CW, BACK_MID, BACK_CCW);

  // -- Demo  --
  myCube.D();
  myCube.B();
  myCube.Bp();
  myCube.Dp();
  myCube.seize();       // release cube
}


As shown in the setup() function, this demo code moves the cube according to Singmaster notation:
 - D
 - B
 - B'
 - D'




Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 19, 2018, 09:11 pm
Yes that is part of the code I had in and it works ok, apart from the little jumps between each section.

I have now been trying to get the CubeMover13_posted sketch to work and allow me to input moves.

When I upload it and open the monitor nothing happens when I enter anything like R or R2.

I have opened the Rubik_kasbot programme in python and got the box with the solve cube button and the small box to enter instructions.

I had to go into the programme and alter the spinbox to

sComPort = Spinbox(from_=1, to=30, width = 2, textvariable=vComPort)

because the port I am using is 25.
When I set it to 25 and put a tick in the box one of the servos jumps so it looks as if I am connected but anything I put in the long box just stays there and doesn't clear when I press "solve cube" though the "solve cube" box "sinks in".

I think I have everything loaded, there are three tabs in the arduino IDE including cube.cpp and cube.h.
I am now at a loss.
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 19, 2018, 10:01 pm
Quote
Yes that is part of the code I had in and it works ok, apart from the little jumps between each section
This is normal procedure, see the reseat() function


Quote
I have now been trying to get the CubeMover13_posted sketch to work and allow me to input moves.
When I upload it and open the monitor nothing happens when I enter anything like R or R2.
To enter Serial Monitor mode in CubeMover13_posted, just change
 boolean    DEBUG_SERIAL =     false;
to
 boolean    DEBUG_SERIAL =     true;


Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 19, 2018, 10:25 pm
I sent you the modified horn related parts (left gripper + back plate)

Based on our discussion, I will upload the gripper files set to Thingiverse
and positively specify TowerPro MG946R (https://www.ebay.com/itm/1-x-MG946R-MG946-13KG-Torque-Metal-Servo-For-Helicopter-Car-Upgraded-MG945-New/232096152402?epid=2120971845&hash=item360a023b52:g:qXcAAOSwuD9Z3J1E) servo's with metal gears

Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 20, 2018, 02:29 am
thank you, they are both perfect.
Title: Gripper design on Thingiverse
Post by: kas on Feb 20, 2018, 11:30 am
The grippers 3D printed version is now officially released on Thingiverse
 (https://www.thingiverse.com/thing:2800244)

This is the Fusion 360 final assembly, including the wrist servo:
(https://s17.postimg.cc/7z9lfzklr/Gripper_Fusion.jpg)


the embedded horns are designed for Futaba 25 teeth spline geometry (Futaba/TowerPro/Orion/Savox/ProTekAce/Bluebird...)
I will release the two specific parts for Hitech servo's family (24T) if required



To avoid any frustration, I strongly advise to tune servo's move on a dedicated bench
using Gripper_demo_V1.2 (http://forum.arduino.cc/index.php?topic=271827.msg1944184#msg1944184)
(https://s10.postimg.cc/6tvqusegp/bench_test.png)
video (https://youtu.be/eWGjJFvjOPs)



Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 20, 2018, 05:54 pm
Well done. I bet lots of people use it even just for the gripper.

 I have spent most of today making the frame and trying to get the initial_test_for_servos working for me.
I have altered it so I can press a key and just have it do one instruction, "open gripper, close gripper, ccw. mid etc. This allows me to set up the limits to get it 90 degrees at a time.
I have spent ages altering the CW and CCW variables without much success till I noticed they are not doing anything :(
further down the page in the setup section is the line

rot_servo.attach(rot_pin, 380, 2570);

this is now (rot_pin, 70, 2000) and my servo does almost 0 degrees, 90 degrees,180 degrees.
Can you remember what the relationship is?

Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 20, 2018, 06:28 pm
Quote
I have spent ages altering the CW and CCW variables without much success till I noticed they are not doing anything :(
They really do, within limits to be set via the .attach() function


Quote
this is now (rot_pin, 70, 2000) and my servo does almost 0 degrees, 90 degrees,180 degrees.
Can you remember what the relationship is?
70 & 2000 are min and max PWM pulse width, relationship with rotation angle varies with servo's brand


Please have a look at functions declaration within "VarSpeedServo.h"


Title: Re: Rubik's cube Robot solver
Post by: vinceherman on Feb 20, 2018, 07:14 pm
I suspect that your servo does not support all the way down to 70.
You might have said in an earlier post, what servo are you using?
Did you arrive at that 70 value by trial and error?  Did you see a difference when writing 0 to the servo with a larger min value, say 80 or 100?

Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 20, 2018, 10:18 pm
I have taken the min back up to 200 without much difference, above that it starts to fail to reach the 90 degrees. I have put cw to 0, mid to 90 and ccw to 180.

I can fine tune them when I get a frame made.

The servo is a ripmax futaba FP-S28 which gives some indication of my age lol.

I must be honest and say I don't fully understand the Varspeedservo .h instructions and would not be able to build a running program from the start using them.
I can see the uint8_t attach(int pin, int min, int max); you mention but wouldn't quite know how to use it.
I have just entered numbers into the rot_pin line and watched the result.
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 21, 2018, 08:28 am
Quote
I have taken the min back up to 200 without much difference, above that it starts to fail to reach the 90 degrees. I have put cw to 0, mid to 90 and ccw to 180.
To perform a clean/square 90° rotation at high speed, depending on your cube's brand, you will have to create a small overshoot (0 to 1°) by decreasing  xx_CW  and/or increasing  xx_CCW  values.
You will end up in troubles if you already have xx_CW = 0 and xx_CCW = 180
Servo's should actually rotate a bit more than 180° and I am not convinced the FP-S28 can do the trick.

Again, I strongly advise to buid a test bench as described at post #473
Gripper_demo_V12.ino will rotate the cube at different speeds and allow to fine tune the overshoot.

While building the frame, you may also decide to order new servo's  ;)


Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 21, 2018, 10:28 pm
I had to smile at your smiley comment.
Quote
While building the frame, you may also decide to order new servo's  ;)
You don't know me all that well.  :)
If I can get away without buying it.....well.

I actually bought a new cube from china, mine is very difficult to turn and this new 'speed' cube turns even when quite far from straight so I will hope that will help.

I am waiting for the correct size bolts to turn up, I have the base and sides of a frame and I will build a testing frame as you suggest but I want to properly clamp it before I do any final tests.
The screws are due either tomorrow or Friday, we will see..
Title: Re: Rubik's cube Robot solver
Post by: vinceherman on Feb 21, 2018, 11:09 pm
That brings up a question - how many and what size/length bolts to order?
And I suppose, where did you order from?


Title: Re: Rubik's cube Robot solver
Post by: matelot on Feb 21, 2018, 11:42 pm
I looked in a few places and found Amazon as good as any.
I have only got them for the grippers.

There are 8 x  25mm bolts needed
here (https://www.amazon.co.uk/gp/product/B00A06AF3G/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1)

12 nuts
here (https://www.amazon.co.uk/gp/product/B00A6E8MEQ/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1)

4 x 20 mm bolts
here (https://www.amazon.co.uk/gp/product/B00A06CGHY/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1)

the holes through all three plates need about 35mm bolts so I am going to use threaded bar and a nut on each end which I already possess.

They are due Friday so let me get them and let you know how good they are.
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 26, 2018, 07:28 am
Hi Terry, welcome   :)

Quote
The hardware is working now and can solve the cube with linking to a pc windows. Now I would like to link my cube solver to a smartphone. Could you please send me the cube App
Sure, let us have a photo/video first


Quote
Should you agree, please send to my email :  lxxxxxxxxd@gmail.com
For your own peace of mind, never expose your email on a public forum  :o
I suggest you edit your last message and remove this info






Title: Re: Rubik's cube Robot solver
Post by: lufamseed on Feb 26, 2018, 12:37 pm
Hi Kas,

Please see the Vedic that I post on YouTube.
https://youtu.be/mFFIHKBIPKU

Terry.
Title: Re: Rubik's cube Robot solver
Post by: lufamseed on Feb 26, 2018, 12:43 pm
Dear Kas,

Thanks for the reminding, if you are interested in my other projects, please search YouTube with keyword : lufamseed

Thanks and regards,
Terry
Title: Re: Rubik's cube Robot solver
Post by: lufamseed on Feb 26, 2018, 12:54 pm
Recently I wrote a program in Arduino trying to solve the cube, it works, but the size of program has became to big to fit in Arduino Uno, I have to move my program to nodemcu for bigger memory. At the end it works, but the outcome of the steps are too much. Sometimes it takes 1200 steps to solve the cube. It is because my robot can move only 90 degrees and this is why I would like to link my robot to your App because your app can come out with far less steps than mine.

Regards,
Terry.
Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 26, 2018, 07:55 pm
Hi Kas,

Please see the Vedic that I post on YouTube.
https://youtu.be/mFFIHKBIPKU

Terry.
(https://s18.postimg.cc/yhqrkisvt/Rubik_2.png)

:o interesting design



Check your mail   ;)

Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 26, 2018, 08:14 pm
Quote
this is why I would like to link my robot to your App because your app can come out with far less steps than mine
The Android version does not solve the cube as such, please refer to post #419 for a complete workflow description


Title: Re: Rubik's cube Robot solver
Post by: lufamseed on Feb 27, 2018, 07:18 am
Dear Kas,

Is there any requirement for the cube scan sequency by cube center cell color and cube orientation during scaning? Please advise. Thanks!

Regards,
Title: Re: Rubik's cube Robot solver
Post by: lufamseed on Feb 27, 2018, 09:26 am
Dear Kas,

Thanks for the scan app. I have downloaded and installed it. After trial run of the program, I can only scan face #1, the screen will flash out right after I took the shoot. I can not continue scanning the face#2 and so on. Is it normal? Please advise. (The version that you send for me is V1.2).

Regards,
Terry.

Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 27, 2018, 10:10 am
Dear Kas,

Is there any requirement for the cube scan sequency by cube center cell color and cube orientation during scaning? Please advise. Thanks!
For cube scan, the App sends the following sequence: "b", "l", "f", "r", "u", "d", "g"
and expects the Arduino to send feedback:

Code: [Select]
     // Scan commands  -----------------------------------------------------------
      case 'f':                                             // Scan Front side
        myCube.scanFront();
        Serial.println("OKf");
        break;
      case 'r':                                            // Scan Right side
        myCube.scanRight();
        Serial.println("OKr");
        break;
      case 'b':                                            // Scan Back side
        myCube.scanBack();
        Serial.println("OKb");
        break;
      case 'l':                                            // Scan Right side
        myCube.scanLeft();
        Serial.println("OKl");
        break;
      case 'u':                                            // Scan Up side
        myCube.scanUp();
        Serial.println("OKu");
        break;
      case 'd':                                            // Scan Down side
        myCube.scanDown();
        Serial.println("OKd");
        break;
      case 'g':                                           // back to Front side
        myCube.scanFront2();
        Serial.println("OKg");
        break;



Title: Re: Rubik's cube Robot solver
Post by: kas on Feb 27, 2018, 10:19 am
Dear Kas,

Thanks for the scan app. I have downloaded and installed it. After trial run of the program, I can only scan face #1, the screen will flash out right after I took the shoot. I can not continue scanning the face#2 and so on. Is it normal? Please advise. (The version that you send for me is V1.2).
Please perform the following test

- switch off Bluetooth device
- start App
- wait for "BT not connected" message
- press "SCAN" button
- press "SHOOT" button

The App takes 1 shot for each face (Face #1, Face #2, ......Face #6)

Let me know how it works

Title: help for servo control "Power base shield"
Post by: mrgakoy96 on Mar 21, 2018, 03:21 pm
Can you help me about the module for servo control "Power base shield"
Title: Re: help for servo control "Power base shield"
Post by: kas on Mar 22, 2018, 07:18 am
Quote
Can you help me about the module for servo control "Power base shield"
For the servo's shield, please look here (http://forum.arduino.cc/index.php?topic=271827.msg2248638#msg2248638), here (http://forum.arduino.cc/index.php?topic=271827.msg2141758#msg2141758), here (http://forum.arduino.cc/index.php?topic=271827.msg2256555#msg2256555) and here (http://forum.arduino.cc/index.php?topic=271827.msg2137172#msg2137172) (only 4 servo's required).

Those type of shields are also available on eBay (https://www.ebay.com/itm/Arduino-UNO-MEGA-Duemilanove-Sensor-Shield-V5-Digital-Analog-Module-Servo-Motor/172841373895?epid=1250875142&hash=item283e2610c7:g:89sAAOSwFWVZo5KZ)  (1.45 bucks shipped)

(https://s31.postimg.cc/jxbwh9cy3/shield.png)


Title: Re: Re: Rubik's cube Robot solver
Post by: mrgakoy96 on Mar 22, 2018, 02:29 pm
thank kas, how do i use servo GM995 and Arduino UNO MEGA?
Title: Re: Re: Rubik's cube Robot solver
Post by: vinceherman on Mar 22, 2018, 03:01 pm
Did you mean MG995?
If so, you want to know how to use a servo with an arduino, right?
There are a few tutorials on this subject.  I would start with the sweep tutorial (https://www.arduino.cc/en/Tutorial/Sweep).
Title: Re: Re: Rubik's cube Robot solver
Post by: mrgakoy96 on Mar 25, 2018, 10:30 am
https://drive.google.com/file/d/1jXDSnzsR3cJ8e_JWXc5A8-lpxNteCQQs/view?usp=sharing
Can you help me???...please
https://drive.google.com/file/d/1DZHLu3d8-0mTw44PKYOn_S3Ci5r22Nvn/view?usp=sharing
"COM3 not available"
Title: Re: Re: Rubik's cube Robot solver
Post by: kas on Mar 26, 2018, 07:37 am
@mrgakoy96

(https://s9.postimg.cc/4go2j5nen/code.png)

This code is not mine, you are at the wrong place
Please contact the relevant developper

Title: Re: Re: Rubik's cube Robot solver
Post by: mrgakoy96 on Mar 26, 2018, 08:45 am
Sorry Kas, I use your code and the servo GM995 does not run.


https://drive.google.com/file/d/137FaMrJ-PvboB8TGbQg1yNk7pMZ3YReV/view?usp=sharing
https://drive.google.com/file/d/1Z0Nid7F99jF2NM2aG4tlDoobPTnL2dnp/view?usp=sharing
https://drive.google.com/file/d/1fQhY2IXhVoV0uvRWt-LwecH8XNyMd9zG/view?usp=sharing
Title: Re: Re: Rubik's cube Robot solver
Post by: kas on Mar 26, 2018, 09:16 am
Sorry Kas, I use your code and the servo GM995 does not run.
Please refer to vinceherman comments


Title: Re: Re: Rubik's cube Robot solver
Post by: mrgakoy96 on Mar 26, 2018, 11:40 am
Thank Kas, I will try to find out more...
Title: Re: help for servo control "Power base shield"
Post by: TomGeorge on Mar 30, 2018, 11:52 am
Hi,
@mrgakoy96 please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html (http://forum.arduino.cc/index.php/topic,148850.0.html) then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

How have you got the servo connected?
Can you post a picture of  your project so we can see your component layout?

Can you please tell us your electronics, programming, Arduino, hardware experience?

Thanks.. Tom.. :)
Title: Re: Rubik's cube Robot solver
Post by: mrgakoy96 on Apr 03, 2018, 01:47 pm
Dear, Kas and Tom.
This is component layout of me, and programming. I use Arduino UNO R3, I entered through Arduino's serial monitor but no any feedback from serial monitor and servo. Code is CubeMover13_posted and done uploading.
Code is CubeMover_hard_coded_demo: Run Good.
Please help me!!!
Title: Re: Rubik's cube Robot solver
Post by: TomGeorge on Apr 03, 2018, 02:51 pm
Hi,
Have you got the negative/gnd of the servo powersupply connected to the gnd of the UNO?

I can see it in your picture...

Tom..... :)
Title: Re: Rubik's cube Robot solver
Post by: mrgakoy96 on Apr 03, 2018, 03:24 pm
Yes, I did gnd of the servo powersupply connected to the gnd of the UNO but still as before...I was wrong???Help me!!
Title: Re: Rubik's cube Robot solver
Post by: TomGeorge on Apr 03, 2018, 03:39 pm
Hi,
Yes, I did gnd of the servo powersupply connected to the gnd of the UNO but still as before...I was wrong???Help me!!
Well its not shown on the picture.
Have you got any of the servos to work?
Have you just connected one servo and written some code for it?
Do you have a DMM, what is the servo power supply?
Tom.... :)
Title: Re: Rubik's cube Robot solver
Post by: mrgakoy96 on Apr 03, 2018, 03:51 pm
Dear, Tom!
I have a 5v power supply, all running, when I test a simple code it runs normally, and the code CubeMover_hard_coded_demo provided by kas also runs very well but when running Code is CubeMover13_posted code is not.
If you have video tutorial, I thank you very much...
Title: Re: Rubik's cube Robot solver
Post by: TomGeorge on Apr 03, 2018, 03:57 pm
Hi,
I can't help you any further, sorry, I am not familiar with the Rubics Cube code.

I only ended up here through some magical forum transformation,  I was originally in a thread on 

"help for servo control "power base shield"

:o :o :o :o
Title: Re: Rubik's cube Robot solver
Post by: mrgakoy96 on Apr 03, 2018, 04:01 pm
Thank Tom very much
Title: Re: Rubik's cube Robot solver
Post by: Slick36 on Apr 09, 2018, 08:40 pm
I have the LinkSprite cube solver kit (a blatant and shameless copy of the project here).

The servos included in the kit were junk so I replaced them with servos from DFRobot.  Big improvement!

My problem is the cube gets 'pushed' around after a dozen or so moves and then it gets hung up in the opposite claw.  Eventually two layers are grabbed at the same time, then chaos ensues. 

Any body have any clues to solve this problem?
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 10, 2018, 07:29 am
This mess can be generated by several factors
 - bad claws relative position
 - inaccurate 90° rotation
 - insufficient claw/cube grip

Please post a video showing a typical hung up

Title: Re: Rubik's cube Robot solver
Post by: Slick36 on Apr 11, 2018, 01:32 am
https://youtu.be/103ojO48itM (https://youtu.be/103ojO48itM)

Thanks!
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 11, 2018, 07:46 am
Your claws are too low
(https://s17.postimg.cc/h6g8s3x27/rubik_1.png)
Move each wrist servo holder plate 2/3mm upward


The key moment is at 0:10
(for slow motion, set YouTube video speed to X .25)
(https://s17.postimg.cc/f35tjyrz3/rubik_2.png)

At this very moment, is the cube seated on the base of the claws??
(https://s26.postimg.cc/xohbvgxp5/P1030168.jpg)
Title: Re: Rubik's cube Robot solver
Post by: Slick36 on Apr 11, 2018, 04:42 pm

I will shim the holder plates with washers and report the results here.
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 28, 2018, 10:47 am
Quote
Hi Kas,

can you please send me the android app you used to solve the cube through the web based server?

I'm am now planning on how I'm going to make the cube solver but i want to have all my software ready before i buy the parts for cost reasons.
i originally thought of making a color sensor rotate on a servo reading each square individually but it would take alot of time to finish and since i already have an android phone.. it wasn't cost effective.

Thanks!
Hi Snipz
Please let me have your email address via PM

Title: Re: Rubik's cube Robot solver
Post by: Snipz on Apr 28, 2018, 11:37 am
here's my email

9sniper6@gmail.com

thank you!
Title: Re: Rubik's cube Robot solver
Post by: kas on Apr 28, 2018, 12:46 pm
here's my email
xxxx@gmail.com

thank you!
I said via PM    ;)
Do yourself a favor, edit your message and remove your personal info

EDIT: check your mail

Title: Re: Rubik's cube Robot solver
Post by: joashsamual on May 14, 2018, 06:47 pm
Found the .dxf export option  ;)

Arduino Forum only accept doc, gif, jpg, mpg, pdf, png, txt, zip, c, h, cpp, ino, pde extentions
Please remove the txt extention after downloading the files

how do i open those files and with what program?
Title: Re: Rubik's cube Robot solver
Post by: kas on May 14, 2018, 07:20 pm
Hi joashsamual

How do you plan to build the gripper, CNC or 3D printing ??
Let me know


Title: Re: Rubik's cube Robot solver
Post by: Souli on May 15, 2018, 09:16 am
Hello Kass!

I just finished the hadrware part of my project (for school) , the only thing I still need to work on is the

final version of the software, altough I have no idea how I should start making this....

And I need to handle it in 3 weeks for school  :o  :smiley-confuse:


Can you write me in a short message or mail how I should begin making this? (I already read the entire forum and didn't find anything useful)

Thanks in advance!
S

Title: Re: Rubik's cube Robot solver
Post by: vffgaston on May 15, 2018, 09:29 am
Hello Kass!

I just finished the hadrware part of my project (for school) , the only thing I still need to work on is the

final version of the software, altough I have no idea how I should start making this....

And I need to handle it in 3 weeks for school  :o  :smiley-confuse:


Can you write me in a short message or mail how I should begin making this? (I already read the entire forum and didn't find anything useful)

Thanks in advance!
S
Hi,

Guess you need, as first step, knowing the "algorithm" to solve the cube; try looking for a book on it.
Another concern is to "read" the actual cube situation to know where to start: perhaps by using those colour recognition LED's ...

(Three weeks looks quite constrained ...)

Regards
Title: Re: Rubik's cube Robot solver
Post by: Souli on May 15, 2018, 09:41 am
Hi,

Guess you need, as first step, knowing the "algorithm" to solve the cube; try looking for a book on it.
Another concern is to "read" the actual cube situation to know where to start: perhaps by using those colour recognition LED's ...

(Three weeks looks quite constrained ...)

Regards
Hi,

First of all I want to thank you for your answer!
I actually want to make it myself easy,  I would like to enter the colors of the Rubik's cube manually on the computer (with cube explorer) and let the servo's do the rest of the work. See you what I mean?

Sorry for my bad English I am from Belgium
Title: Re: Rubik's cube Robot solver
Post by: kas on May 15, 2018, 09:53 am
Quote
I already read the entire forum and didn't find anything useful
:o  :o  :o
If you didn't find anything useful, then I am afraid I can't help you anymore
Please have a second read


@vffgaston
There is two bot versions (webcam and Android)
The algorithm to solve the cube is done by  Cube Explorer (http://kociemba.org/cube.htm) for the webcam version
for the Android version, resolution is performed on line using a dedicated web server located in Montreal, Canada (post #1)


Title: Re: Rubik's cube Robot solver
Post by: vffgaston on May 15, 2018, 09:54 am
See you what I mean?
Hi,
Perfectly (your english, I think, is more than acceptable; any case, I'm spaniard).
I was thinking on advicing you to do so (entering the cube "state" by hand, then concentrating on the problem of solving it: good idea).
Last week I watched a video on a robot solving the cube: if you have the movement problem solved (I mean, you have written and tested the routines to turn the whole cube so that it is in the position you want and to rotate the end "stage" -I dont know how to refer to the 9 small cubes that are in one top of the cube-, your problem is just the logic to solve the cube -the data inside the program to keep track of the cube state has to be a little tricky, but nothing unsolvable).
I told you to look for a book ... Have you googled for that?. Sure you can find miriads of WEBs ...
Regards
Title: Re: Rubik's cube Robot solver
Post by: Souli on May 15, 2018, 10:03 am
:o  :o  :o
If you didn't find anything useful, then I am afraid I can't help you anymore
Please have a second read


@vffgaston
There is two bot versions (webcam and Android)
The algorithm to solve the cube is done by  Cube Explorer (http://kociemba.org/cube.htm) for the webcam version
for the Android version, resolution is performed on line using a dedicated web server located in Montreal, Canada (post #1)



No no that's not what I mean, I have no experience in programming... So I was verry confused when I saw all those programms on the forum
Title: Re: Rubik's cube Robot solver
Post by: vffgaston on May 15, 2018, 10:03 am
@vffgaston
There is two bot versions (webcam and Android)
The algorithm to solve the cube is done by  Cube Explorer (http://kociemba.org/cube.htm) for the webcam version
for the Android version, resolution is performed on line using a dedicated web server located in Montreal, Canada (post #1)

Sure. I have seen that there is an "official" WEB
https://eu.rubiks.com/blog/how-to-solve-the-rubiks-cube (https://eu.rubiks.com/blog/how-to-solve-the-rubiks-cube)
I'm not sure of the (suppossed) scope of the OP project:
If it is about robotics, it looks that he has almost solved the issue; any case I don't think that it is acceptable to -just- solve the cube by issuing orders via, say, serial monitor (I'm not joking; if the project is just about robotics he has had to build the robot and program all the movements .I wouldn't know how to do it ...).
If the program encompasses the logic, he has to implement it ...
Regards
Title: Re: Rubik's cube Robot solver
Post by: Souli on May 15, 2018, 10:12 am
Hi,
Perfectly (your english, I think, is more than acceptable; any case, I'm spaniard).
I was thinking on advicing you to do so (entering the cube "state" by hand, then concentrating on the problem of solving it: good idea).
Last week I watched a video on a robot solving the cube: if you have the movement problem solved (I mean, you have written and tested the routines to turn the whole cube so that it is in the position you want and to rotate the end "stage" -I dont know how to refer to the 9 small cubes that are in one top of the cube-, your problem is just the logic to solve the cube -the data inside the program to keep track of the cube state has to be a little tricky, but nothing unsolvable).
I told you to look for a book ... Have you googled for that?. Sure you can find miriads of WEBs ...
Regards

I'm going to look up on the interenet. If  I got some news I will let you know as soon as possible. thank you very much!
Title: Re: Rubik's cube Robot solver
Post by: Souli on May 15, 2018, 10:26 am
some pics of my school project... Hope I can finish it in 3 weeks  :smiley-confuse:  :smiley-roll-sweat:
thank you Kass btw for being  present on the forum!
Title: Re: Rubik's cube Robot solver
Post by: kas on May 15, 2018, 10:48 am
Quote
I'm not sure of the (supposed) scope of the OP project
I am the OP
For both projects (webcam, Android) the scope is to
 - scan cube
 - perform color recognition
 - get the solution
 - move the cube and solve it


@Souli
All photos are now back, should be easier to read
Have a special look at post #21 (http://forum.arduino.cc/index.php?topic=271827.msg1997757#msg1997757)
I agree with vffgaston, three weeks is very short



Title: Re: Rubik's cube Robot solver
Post by: kas on May 15, 2018, 12:06 pm
Quote
Hi, I have read forum during those last 2 hours.
I think I will not be ready on time with my project.

I am very confused because I see all kinds of programs in the forum and I don't really know what they are for..
I have no experience in programming...
So I was very confused when I saw all those programs on the forum  :smiley-confuse:
I don't think you are ready for the complete project, especially for the Python part
I suggest to have a look at this basic Chinese clone version (http://linksprite.com/wiki/index.php5?title=Cube_Solver_Robot_with_Arduino)

Title: Re: Rubik's cube Robot solver
Post by: vffgaston on May 15, 2018, 03:20 pm
I am the OP
Excuse me, in fact I am here a newcomer ... :smiley-confuse:

Just one question (it is pure curiosity): is it possible to program a "blind" solution once you've got the actual state (I mean, the robot does not see how the cube evolves as it moves it)?

Thanks.

Regards.

(Your knowledge on the subject is really overwelming; encycolpedic)
Title: Re: Rubik's cube Robot solver
Post by: kas on May 15, 2018, 10:20 pm
Quote
Excuse me, in fact I am here a newcomer ... :smiley-confuse:
no problems   ;)



Quote
is it possible to program a "blind" solution once you've got the actual state (I mean, the robot does not see how the cube evolves as it moves it)?
This is a "blind" solution
Once color recognition is performed, webcam (or smartphone camera) is not used anymore for cube solving


Title: Re: Rubik's cube Robot solver
Post by: vffgaston on May 16, 2018, 10:02 am
This is a "blind" solution
Once color recognition is performed, webcam (or smartphone camera) is not used anymore for cube solving
.
Hi,
Thanks.
Such a case, the guy that intends to enter the cube initial state "by hand" is in the right way ...
I mean, if he has the routines to manipulate the cube tested, then everything he has to do is to program the algorithm, isn't it?.
Regards.
Title: Re: Rubik's cube Robot solver
Post by: Johan_Ha on May 16, 2018, 11:41 am
36 pages of posts!This is post #533! Any videos somewhere? I only saw one in the beginning, where the robot was a bit clumsy.
Title: Re: Rubik's cube Robot solver
Post by: ahappykid on May 16, 2018, 12:15 pm
hi kas, i already have all the parts 3d printed and i have all the servos and the bluetooth arduino board, i only need the android app so if you can send me the app i would be grateful.

And i am having a problem compiling and uploading to the board the CubeMover13_posted code, i get the exit status 1 error, i have done some research and i tried every solution i found but nothing worked.

thanks.
Title: Re: Rubik's cube Robot solver
Post by: kas on May 16, 2018, 02:02 pm
Quote
hi kas, i already have all the parts 3d printed and i have all the servos and the bluetooth arduino board, i only need the android app so if you can send me the app i would be grateful.
Hi ahappykid, let me have your email via PM


Quote
And i am having a problem compiling and uploading to the board the CubeMover13_posted code, i get the exit status 1 error
Which board are you using ??
Let me have more info re this 'exit status 1 error'




@Johan_Ha
Quote
36 pages of posts!This is post #533! Any videos somewhere?
Carefully read the 36 pages, you should find some!

Title: Re: Rubik's cube Robot solver
Post by: kas on May 16, 2018, 02:11 pm
Quote
Hi,
Thanks.
Such a case, the guy that intends to enter the cube initial state "by hand" is in the right way ...
I mean, if he has the routines to manipulate the cube tested, then everything he has to do is to program the algorithm, isn't it?.
Yes, user just enter the solution using Singmaster notation,  Arduino will 'blindly' solve the cube
He does not need to program the solving algorithm, it's built in Cube Explorer


Title: Re: Rubik's cube Robot solver
Post by: vffgaston on May 16, 2018, 08:27 pm
Yes, user just enter the solution using Singmaster notation,  Arduino will 'blindly' solve the cube
He does not need to program the solving algorithm, it's built in Cube Explorer



I have had a look to the Singmaster code ...
Curiosity again: How Singmaster notation is translated to C++?

Regards
Title: Re: Rubik's cube Robot solver
Post by: kas on May 16, 2018, 09:07 pm
Quote
Curiosity again: How Singmaster notation is translated to C++?
That's the all purpose of CubeMover V1.3 (http://forum.arduino.cc/index.php?topic=271827.msg3283775#msg3283775) sketch    ;)
Have a look at it


Title: Re: Rubik's cube Robot solver
Post by: ahappykid on May 21, 2018, 04:42 pm
Which board are you using ??
Let me have more info re this 'exit status 1 error'
i am using the iteaduino bt, because of the bluetooth capability
Title: Re: Rubik's cube Robot solver
Post by: kas on May 21, 2018, 04:49 pm
Let me have more info re this 'exit status 1 error'
Post the entire error message. 
There is more information in the message that points to the type and location of the error

I sent you the App by email
Title: Re: Rubik's cube Robot solver
Post by: kas on May 21, 2018, 05:27 pm
Quote
I sent you the App by email
My message was returned with error code 550 (no such user)
Please confirm your email address via PM


Title: Re: Rubik's cube Robot solver
Post by: Souli on May 22, 2018, 11:12 pm
Hello Kass!

I want to use a power based shield for my project to power the four servos... Which one do you advice

me?

Can I use this one?

https://www.amazon.com/gp/product/B01HNK6TQS/ref=ox_sc_act_title_1?smid=A2TOL213PF2CAG&psc=1

looking forward to hearing from you
Title: Re: Rubik's cube Robot solver
Post by: kas on May 23, 2018, 06:51 am
Hello Kas!
I want to use a power based shield for my project to power the four servos... Which one do you advice me?
looking forward to hearing from you
I made my own shield
(http://i.imgur.com/LEOsbLP.jpg)



Quote
Can I use this one?
https://www.amazon.com/gp/product/B01HNK6TQS/ref=ox_sc_act_title_1?smid=A2TOL213PF2CAG&psc=1
You can use this one although there are cheaper alternatives (http://forum.arduino.cc/index.php?topic=271827.msg3658417#msg3658417)


Title: Re: Rubik's cube Robot solver
Post by: ahappykid on May 23, 2018, 10:34 am
Arduino: 1.8.4 (Windows 7), Placa:"Arduino BT, ATmega328P"

F:\PAP\software\CubeMover13_posted\CubeMover13_posted.ino:3:28: fatal error: VarSpeedServo.h: No such file or directory

 #include <VarSpeedServo.h>

                            ^

compilation terminated.

exit status 1
Erro ao compilar para a placa Arduino BT.
Biblioteca inválida encontrada em C:\Program Files\Arduino\libraries\LiquidCrystal_I2C: C:\Program Files\Arduino\libraries\LiquidCrystal_I2C
Biblioteca inválida encontrada em C:\Program Files\Arduino\libraries\LiquidCrystal_I2C: C:\Program Files\Arduino\libraries\LiquidCrystal_I2C





here is the error message, i am sorry but some things are in portuguese.
Title: Re: Rubik's cube Robot solver
Post by: kas on May 23, 2018, 12:19 pm
F:\PAP\software\CubeMover13_posted\CubeMover13_posted.ino:3:28: fatal error: VarSpeedServo.h: No such file or directory
 #include <VarSpeedServo.h>
                            ^
You need to install the VarSpeedServo (https://github.com/netlabtoolkit/VarSpeedServo) library in your /Arduino/library folder


Title: Re: Rubik's cube Robot solver
Post by: ahappykid on Jun 04, 2018, 06:59 pm
hi kas, with your help and with the help of everyone here i was able to build the structure and upload the code to the iteaduino board.

but i still have questions about how to power the servo motors so if you could show me how to connect the servos to the board it would be great.

thanks.
Title: Re: Rubik's cube Robot solver
Post by: kas on Jun 05, 2018, 07:40 am
Quote
i still have questions about how to power the servo motors so if you could show me how to connect the servos to the board it would be great.
thanks.
(http://i.imgur.com/LcoVmdq.jpg)


Adapt for four servo's only
I use two LiFePO4 batteries  (6.8V)  for powering both Arduino and servo's
The safe way is to use separate power supplies (9V + 5/6V) to avoid browning out
Don't forget common grounds


EDIT: this drawing is for connection description only
Please don't use a solderless breadboard, wires should be soldered

Title: Re: Rubik's cube Robot solver
Post by: Johan_Ha on Jun 05, 2018, 09:38 am
How many amps can go through the positive rail in a solderless breadboard? Should the power current carrying wires of the servos be soldered directly to the power source instead of through the breadboard?
Title: Re: Rubik's cube Robot solver
Post by: kas on Jun 05, 2018, 09:54 am
How many amps can go through the positive rail in a solderless breadboard? Should the power current carrying wires of the servos be soldered directly to the power source instead of through the breadboard?
Sure, solderless breadboard shouldn't be used
I edited my post accordingly

Title: Re: Rubik's cube Robot solver
Post by: ahappykid on Jun 19, 2018, 10:37 am
hi kas, i am having some problems with the code, when i power the servos they start moving on their own.

maybe i am connecting the servos to the wrong pins, can you please explain me a little of the code ?
Title: Re: Rubik's cube Robot solver
Post by: kas on Jun 19, 2018, 02:37 pm
Quote
the servos they start moving on their own.
Please be more specific
Post connection diagram and a video showing those moves

 
Title: Re: Rubik's cube Robot solver
Post by: ahappykid on Jun 20, 2018, 11:42 pm
i follow exactily the image you sent me, but the moment i power the iteaduino and the servos they move and lock in place, i bet i am connecting the servos to the wrong pin on the iteaduino.

and i also am having a problem with the app, if i connect the app with the iteaduino when i try to scan the app crashes.

i hope you can help me because i am almost out of time for my school project.
Title: Re: Rubik's cube Robot solver
Post by: kas on Jun 21, 2018, 08:03 am
Quote
i follow exactily the image you sent me, but the moment i power the iteaduino and the servos they move and lock in place, i bet i am connecting the servos to the wrong pin on the iteaduino.
According to CubeMover13_posted
"down" gripper:
#define    downPinchPin         9
#define    downRotPin          10

"back" gripper
#define    backPinchPin         5
#define    backRotPin            6



Quote
and i also am having a problem with the app, if i connect the app with the iteaduino when i try to scan the app crashes
According to CubeMover13_posted
// -------------------------------------------------------------------------------------//
//boolean    DEBUG_SERIAL =       true;          // Python mode or Serial Monitor testing      //
boolean    DEBUG_SERIAL =         false;           // Android mode                                                   //
// -------------------------------------------------------------------------------------//

Please set DEBUG_SERIAL to false
ahappykid, I am not convinced you fully understand what you are trying to achieve  ::)
You should probably go for an easier project




Title: Re: Rubik's cube Robot solver
Post by: mach1 on Jul 02, 2018, 12:31 pm
Hi Kas

I have just recently found this project and I have decided to give it a go. I will retire soon and my plan is to start this in the autumn after the clocks turn at the end of October, so that I can get it ready for Christmas. It can be my Christmas present to myself. Meanwhile I will set about collecting the bits and pieces needed ready for the start date.

Being as you have been very helpful to people on this forum I was wondering if you would be kind enough to sell me a pair of grippers ready for my project. 

If you are happy to do so I would prefer clear plexiglass, acrylic or perspex as a first choice, then as a second choice plywood.

I would be happy to pay the going rate for these items if you are prepared to produce them for me.

I have made a few projects with the Arduino in the past so I should be able to pick it up again with not too much difficulty, at least I hope so. The last think I did some time ago was a device to replace a timer switch to switch on a security/welcoming light which automatically changed the on time according to the time of year using an algorithm based on the equation of time, rather than an LDR. I have no experience of servos, but I have thought of learning to use them for some time and this seems like a good excuse to start with.

Many thanks mach1
Title: Re: Rubik's cube Robot solver
Post by: kas on Jul 02, 2018, 02:05 pm
Hi mach1

Once retired, you will soon enter a very busy time, trust me on this one   ;)

I don't own a CNC machine anymore
This project is a nice opportunity for you get into the 3d printing Universe
Files are on Thingiverse
 (https://www.thingiverse.com/thing:2800244)
A good printer can now be had for less than $200


My advice: get familiar with servo motors first and spend time on the test bench before building the final prototype

(https://s10.postimg.cc/6tvqusegp/bench_test.png)
video (https://youtu.be/eWGjJFvjOPs)



Title: Re: Rubik's cube Robot solver
Post by: mach1 on Jul 02, 2018, 02:19 pm
Thanks, will do.
Title: Re: Rubik's cube Robot solver
Post by: mach1 on Jul 27, 2018, 10:54 pm
Hi Kas

I am slowly assembling what is needed for this project. What do you think about this as a power supply:

https://www.ebay.co.uk/itm/Waterproof-18650-Battery-Pack-8-4V-Case-House-Cover-for-Bike-Light-Lamp-UK-stock/282920287390?hash=item41df5cfc9e%3Am%3Am5OE9_yJ4FOGiJXL5Qt36zw&var=582770477611&_pgn=2&_sacat=7294&_nkw=bike+light+battery+pack&_from=R40&rt=nc

8.4 V to power the Arduino, 5 V to power the servos.


By the way I am heading for the Android route. Any chance that I can have the app now in readiness?

Thanks.

Title: Re: Rubik's cube Robot solver
Post by: kas on Jul 28, 2018, 06:57 am
Hi Mach1
This device with 6 X 18650 batteries will be OK, but is pretty much overkill for the job
Same with two batteries only will be 100% acceptable

I power my own bot with 2 X LiFePO4 batteries
6.6V is slightly out of spec for both Arduino and servo's, but it works pretty well


Title: End of technical support
Post by: kas on Jul 28, 2018, 10:30 am
End of technical support


I have been supporting this project for nearly four years, this was an exciting experience
I have since moved to other projects and it's now time for me to retire

All possible questions have been answered in this thread, just read it  ;)
The Android App is here (https://www.dropbox.com/s/pj2jw52ypws5gzt/RubikCubeV120.apk?dl=0)
Feel free to use this thread on a peer to peer basis to share your experience
Please no more PM's

Thanks again for your interest and good luck for your projects


Title: Re: Rubik's cube Robot solver
Post by: nielyay on Aug 28, 2018, 05:53 am
Quote
together with my assistant
looks like you have good assistant.
Title: Re: Rubik's cube Robot solver
Post by: moko999com on Dec 30, 2018, 12:34 pm
I made one use PC version^_^
https://youtu.be/O8mV_Y_DHa0
Kas, thank you so much.
Title: Re: Rubik's cube Robot solver
Post by: kas on Dec 30, 2018, 06:36 pm
Nice implementation
Thanks for sharing   ;)

Title: Re: Rubik's cube Robot solver
Post by: SergSolo on May 16, 2019, 11:47 pm
I made a robot for the Rubik's Cube.
On Python works.
ON THE ANDROID no
I read both forums completely.
The problem in the phone and arduino connection.
The phone passes the test -  AndroTest_V20_POSTED_DEBUG,AndroTest_V20_POSTED- OK.
BUT - CubeMover13_posted NO, Will help?

https://forum.arduino.cc/index.php?topic=271827.0
https://forum.arduino.cc/index.php?topic=173246.0
Title: Re: Rubik's cube Robot solver
Post by: DrVoHo on Sep 01, 2019, 09:03 am
Based on this long and fruitful discussion I decided to make my own robot. It is running stand-alone without any external Computer or smart-phone. I'm using a Raspberry pi - therefore most SW discussion cannot be applied.

Teaser:
https://www.youtube.com/watch?v=Xv4a6-XM1M4&t=39s

Please find the construction on Thingiverse:
https://www.thingiverse.com/thing:3826740

SW is on Github:
https://github.com/DrVoHo/Rubik_solver


Title: Re: Rubik's cube Robot solver
Post by: Sembot on Oct 09, 2019, 10:22 am
Hai Kas,

Fantastic project, in a week I saw YOUR project on the internet and was sold, I immediately started building with my Prusa i3 printer
I want to build the smartfpone version as you can see, I have already installed the app and arduino code
Now adjust and try, I hope it works

Thanks for sharing it with us

Title: Re: Rubik's cube Robot solver
Post by: Sembot on Oct 09, 2019, 10:51 am
Here are the foto's

Title: Re: Rubik's cube Robot solver
Post by: Sembot on Oct 10, 2019, 06:46 pm
Because nobody reacts,i think this project is closed
A test setup with discarded 3D printer parts
I think my standard servos are too weak
A fantastic project and well explained
Title: Re: Rubik's cube Robot solver
Post by: DrVoHo on Oct 11, 2019, 05:29 pm
I cannot comment to your smart phone SW. But if you are interested in an Raspberry pi implementation you can use HW and SW as described above.
Title: Re: Rubik's cube Robot solver
Post by: SergSolo on Oct 17, 2019, 10:34 pm
Because nobody reacts,i think this project is closed
A test setup with discarded 3D printer parts
I think my standard servos are too weak
A fantastic project and well explained
Does your Android app work well? Make a video. My projec  https://drive.google.com/open?id=1EF3Kzz5-JrnfIpN-sHqgFmOifzmdUdcj
Title: Re: Rubik's cube Robot solver
Post by: SergSolo on Oct 17, 2019, 10:47 pm
Hai Kas,

Fantastic project, in a week I saw YOUR project on the internet and was sold, I immediately started building with my Prusa i3 printer
I want to build the smartfpone version as you can see, I have already installed the app and arduino code
Now adjust and try, I hope it works

Thanks for sharing it with us


I can help you. Make a video of how the android application works. Does the phone determine color correctly?

The color application is not correct for me, but how do you.
https://drive.google.com/file/d/11Pvfe3X2jaX2NBtjGqbSkaQZVyBUYFlk/view?usp=sharing