3rd Arm Accessorised!

20160503_152023.jpg

3rd arm

Thanks for posting. Looks like you are enjoying this project.

3rd arm

Thanks ,it is becoming a real time and money pit but still fun all the same.

   i have a bit of a problem though

   i have to include a rather annoying offset variable to make the arm return to the same point each time

   the off set is different for the pickup points A  and  B

   although the program does work i am mistified why i need to include this offset in the first place ?

   ill include the code below but i am guessing the root of the problem must lie in a wobbly lollypop stick

   but i havent found it yet

  this is the video of the code below working https://youtu.be/WclASes1hY8

 


//
//  This one is for the THIRD wooden arm with 5 servos
//            base shoulder elbow wrist claw
//                side pick
//                       mar 2016
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#include <Servo.h>
#define I2C_ADDR    0x27 // <<----- Add your address here.  Find it from I2C Scanner
#define BACKLIGHT_PIN 3  // these are lcd pins
#define En_pin        2
#define Rw_pin        1
#define Rs_pin        0
#define D4_pin        4
#define D5_pin        5
#define D6_pin        6
#define D7_pin        7
LiquidCrystal_I2C  lcd(I2C_ADDR, En_pin, Rw_pin, Rs_pin, D4_pin, D5_pin, D6_pin, D7_pin);

Servo myservob;             // base
Servo myservos;             // shoulder
Servo myservoe;             // elbow
Servo myservow;             // wrist
Servo myservoc;             // claw

int ledState = HIGH;
unsigned long previousMillis = 0;
int del = 600;              // preset delay between moves
const int ledPin = 13;

void setup() {
  Serial.begin(112500);
  lcd.begin( 16, 2 );
  lcd.setBacklightPin(BACKLIGHT_PIN, POSITIVE);
  lcd.setBacklight(HIGH);// Switch on the backlight
  lcd.clear();
  lcd.home (); // go home

  pinMode (ledPin , OUTPUT);// odd or even light

  myservos.attach(6);       // shoulder 30 - 150
  //     not pin (7)
  myservoe.attach(8);       // elbow     0 - 180
  myservob.attach(9);       // base      0 - 180
  myservow.attach(10);      // wrist     0 - 180
  myservoc.attach(11);      // claw      70 - 180 open

  lcd.setCursor ( 0, 0); lcd.print(“Third Arm side pick Test”); Serial.println(“Third Arm side pick Test”); delay(del2); // wait a bit



  lcd.clear(); lcd.setCursor( 0, 0); lcd.print(“open close claw”); Serial.println(“open close claw”);
  myservoc.write(70); delay(del); myservoc.write(0); delay(del); myservoc.write(70);

/
 
  lcd.clear(); lcd.setCursor ( 0, 1); lcd.print(“start up routine”); Serial.println(“start up routine”); delay(del);
  lcd.clear(); lcd.setCursor ( 0, 0); lcd.print(“base to pointA-B”); Serial.println(“Turn base to point A-B”);
  myservob.write(0);   delay(del); myservob.write(180); delay(del); myservob.write(90); delay(del);
  lcd.setCursor ( 0, 1); lcd.print(“wave shoulder”); Serial.println(“wave shoulder”);
  myservos.write(70);   delay(del); myservos.write(120);  delay(del); myservos.write(90); delay(del);
  lcd.clear(); lcd.setCursor ( 0, 0); lcd.print(“wave elbow”); Serial.println(" wave elbow");
  myservoe.write(50);   delay(del); myservoe.write(120); delay(del); myservoe.write(60); delay(del);
  lcd.setCursor( 0, 1); lcd.print(“wave wrist”); Serial.println(“wave wrist”);
  myservow.write(180); delay(del); myservow.write(0); delay(del); myservow.write(90);
  lcd.clear(); lcd.setCursor( 0, 0); lcd.print(“open close claw”); Serial.println(“open close claw”);
  myservoc.write(180); delay(del); myservoc.write(0); delay(del); myservoc.write(100);
  delay(del * 3);
/
 
}

void loop() {

  digitalWrite(ledPin, ledState++);

int A = 20;                 // set points A and B
int B = 60;
               int offset = 5; // A offset
              int offset2= 9; // B offset


  // side pick routine
  lcd.clear(); lcd.setCursor ( 0, 0); lcd.print(“Side pick”); lcd.setCursor ( 0, 1); lcd.print(“routine”); Serial.println(“Begin side pickup”);
  delay(del * 3);



  //stand up
  myservow.write(90); myservoe.write(90); myservos.write(90);



  lcd.clear(); lcd.setCursor ( 0, 0); lcd.print(“turn to point A”); lcd.setCursor ( 0, 1); lcd.print(“and grab object”); Serial.println(“turn to point A and grab objec”);
  myservob.write(A+(offset-3)); delay(del);
  //A and pick
  myservow.write(160); myservoe.write(150); myservos.write(50); delay(del); myservoc.write(180); delay(del); myservos.write(20); delay(del); myservow.write(150); delay(del); myservow.write(140); myservoc.write(70); delay(del);



  //stand up
  myservow.write(90); myservoe.write(70); myservos.write(90);



  //B and drop
  lcd.clear(); lcd.setCursor ( 0, 0); lcd.print(“turn to point B”); lcd.setCursor ( 0, 1); lcd.print(“and drop object”); Serial.println(“turn to point B and drop objec”);
  delay(del); myservob.write(B); delay(del);

  myservow.write(160); myservoe.write(150); myservos.write(50); delay(del); myservos.write(20); delay(del); myservow.write(150); delay(del); myservoc.write(180); delay(del); myservow.write(180); delay(del);



  //stand up
  myservow.write(90); myservoe.write(70); myservos.write(90);



  //sleep
  lcd.clear(); lcd.setCursor ( 0, 0); lcd.print(“rest”); lcd.setCursor ( 0, 1); lcd.print(“for a second”); Serial.println(“rest for a second”); delay(del);
  myservob.write(180); myservos.write(160); myservoe.write(180); myservow.write(70); myservoc.write(70); myservow.write(40); delay(del);



  //stand up
  myservow.write(90); myservoe.write(70); myservos.write(90);


 
  lcd.clear(); lcd.setCursor ( 0, 0); lcd.print(“turn to point B”); lcd.setCursor ( 0, 1); lcd.print(“and grab object”); Serial.println(“turn to point B and grab objec”);
  delay(del); myservob.write(B-offset2); delay(del);
 
 myservow.write(160); myservoe.write(150); myservos.write(50); delay(del); myservoc.write(180); delay(del); myservos.write(20); delay(del); myservow.write(150); delay(del); myservow.write(140); myservoc.write(70); delay(del);




  //stand up
  myservow.write(90); myservoe.write(70); myservos.write(90);



  lcd.clear(); lcd.setCursor ( 0, 0); lcd.print(“turn to point A”); lcd.setCursor ( 0, 1); lcd.print(“and drop object”); Serial.println(“turn to point A and drop objec”);
  delay(del); myservob.write(A+offset); delay(del);

  myservow.write(160); myservoe.write(150); myservos.write(50); delay(del); myservos.write(20); delay(del); myservow.write(150); delay(del); myservoc.write(180); delay(del); myservow.write(180); delay(del);


  //stand up
  myservow.write(90); myservoe.write(70); myservos.write(90);



  lcd.clear(); lcd.setCursor ( 0, 0); lcd.print(“goto sleep”); lcd.setCursor ( 0, 1); lcd.print(“goodbye”); Serial.println(“goto sleep goodbye”); delay(del);
  myservob.write(180); myservos.write(160); myservoe.write(180); myservow.write(70); myservoc.write(70); myservow.write(40); delay(del);



  // **************** pretty handy press any key to continue …
  lcd.clear(); lcd.setCursor ( 0, 0); lcd.print(“await key press”); Serial.println(F("\nPress any key / ENTER to continue"));
  while (Serial.available() && Serial.read()); // empty buffer
  while (!Serial.available());                 // wait for data
  while (Serial.available() && Serial.read()); // empty buffer again
  lcd.clear(); lcd.setCursor ( 0, 0); lcd.print("
** key presed "); Serial.println("  key pressed  ***");
  delay (500);
  Serial.println(“main routine starting”);

}  // end of sequence return to begining

 

Nice Project!

Nice project, but starting to worry you might soon max out the torque of the 9g servos (each segment looks quite long). If you use cardboard rather than popsicle sticks, using mostly bents, and made the design files open, I’m sure new users to the community would love to try it themselves.

3rd arm servos

So does that mean if i shortened the elbow to wrist length that would improve the chances of the 9g servo ?

 

3rd Arm

as for using card board i think it would wobble all over the place

there were no designs for other people to try out my version

of an arm it just sort of evolved,

thats why its called ‘3rd arm’

(i already blogged v1 and v2 for anyone needing a giggle)

 

 

Shorter Lengths

Yes, the shorter the arm segments, the more it can lift.

**yes you were right about the length of arm segments **

2016-05-26_20_50_16.jpg

yes you were right about the length of arm segments effecting the 9g servos torque

its taken me a while but rather than shortening the arm segment from wrist to elbow

i swapped out the servo for a bigger one and that has fixed my wobble problem!!!

it also meant i had to re write the software because the geometry had still changed.

 

heres upgraded arm https://www.youtube.com/watch?v=MENPeGsuTkg

 

this was the arm before upgrade https://www.youtube.com/watch?v=2ODjrPf0MHo