Second aduino arm

This is the

second arm i built

bigger base servo

better claw

more repeatable and less wobble

https://www.youtube.com/watch?v=LxtpB_15iQQ

video of it working

picks up object

drops it at top of slide

repicks object

20160229_193424.jpg

https://www.youtube.com/watch?v=LxtpB_15iQQ

code for the above arm


//                      26/02/2016
//                        mk VI
//  This one is for the large wooden arm with 5 servos
//            base shoulder elbow wrist claw
//         pick up object from POINT A on table
//     and deposit it at the top of the slide POINT B



#include <Servo.h>
Servo myservob;       // base
Servo myservos;       // shoulder
Servo myservoe;       // elbow
Servo myservow;       // wrist
Servo myservoc;       // claw

int del = 600;        // preset delay

void setup()
{
  Serial.begin(9600);

  // set servo pins
  myservoc.attach(6);  // claw 0-180
  myservow.attach(7);  // wrist
  myservoe.attach(10); // elbow
  myservos.attach(8);  // shoulder
  myservob.attach(9);  // base


  // start routine
  myservoc.write(0);    // close claw
  delay(del);           //
  myservoc.write(180);  // open
  delay(del);           //
  myservoc.write(0);    // close
  delay(del);           //
  myservow.write(0);    // wave wrist
  delay(del);           //
  myservow.write(180);  //
  delay(del);           //
  myservow.write(125);  // middle
  delay(del);           //
  myservoe.write(75);   // wave elbow
  delay(del);           //
  myservoe.write(135);  //
  delay(del);           //
  myservos.write(45);   // wave shoulder
  delay(del);           //
  myservos.write(70);   //
  delay(del);           //
  myservob.write(5);    // turn left / right
  delay(del);           //
  myservob.write(175);  //
  delay(del);
  delay(del);           // pause at end of start routine
  delay(del);delay(del);// pause at end of start routine
}




void loop() {
 
  myservob.write(110);   // turn to point A
  delay(del);            //
  myservos.write(60);    // shoulder lean forward
  delay(del);            //
  myservoe.write(50);    // elbow down
  delay(del);            //
  myservow.write(135);   // wrist down
  delay(del);            //
  myservoc.write(180);   // open claw
  delay(del);            //
  myservow.write(180);   // grab routine
  delay(del);            //
  myservos.write(80);   //
  delay(del);            //
  myservos.write(107);   //
  delay(del);            //
  myservoc.write(0);     // close claw
  delay(del);            //
  myservos.write(70);    // lift up
  delay(del);            //
  myservow.write(180);   //
  delay(del);            //
  myservow.write(180);   //
  delay(del); 
  delay(del);delay(del); // wait to stabalize load


  myservos.write(20);     // lean back to avoid obstical
  delay(del);
      myservoe.write(100);
  delay(del);
  myservob.write(180);    // turn to point B (slide)
  delay(del);
  myservow.write(140);    // position and drop object at top of slide
  delay(del);
  myservos.write(70);
  delay(del);
  myservoe.write(90);
  delay(del);
  myservow.write(160);
  delay(del);
  myservoc.write(180);      // drop object
  delay(del);
 myservos.write(20);    // shoulder lean forward
  delay(del);
 
  delay((del*4));           // Long wait at end of routine

}                           // end of sequence return to begining

wobble reduction

Pretty neat.  If you add a gyro/accelerometer to the end of the arm you might be able to reduce wobbling with closed-loop feedback control.

wobble

i think using millis instead of delay would help too

but fundermentally only one lolly stick to support the claw was a mistake

it needs like a bearing and another lolly stick on the other side

and maybe another bearing on the base to support it.

20160301_104947.jpg

20160301_105416.jpg

i have been working on an electro magnet claw version with a half decent turntable made out of marbles

but its no where near 'ready' yet