DIY 6-Axis Servos Control Palletizing Robot Arm Model for Arduino UNO MEGA2560

From SainSmart Wiki
Revision as of 02:54, 30 August 2016 by Admin (Talk | contribs)

Jump to: navigation, search
SainSmart DIY 6-Axis Servos Control Palletizing Robot Arm

Introduction

SainSmart DIY 6-Axis Servos Control Palletizing Robot Arm Model for Arduino UNO MEGA2560

  • Simulate real palletizing robot arm structure
  • PVC material, CNC processing
  • Adopts MG996 55g metal gear servo 4pcs
  • Active joint bearing connection

Preparations

  • Arduino UNO board x1
  • SainSmart sensor shield x1
  • DC Power supply x1
  • USB cable x1
  • Connect wire x2
  • SainSmart DIY 6-Axis Servos Control Palletizing Robot Arm x1


DIY6A4.png


Detail Step to Getting Start

Step1.Give number to each servo and Mark the cable

Servo Number 1-6
CableNumber 1-6


Step2.Upload the test code to Arduino UNO


DIY6A1.png


Choose the .ino file and open it by Arduino IDE

DIY6A2.png


Choose"Arduino UNO" "COM UNO" on Arduino IDE

DIY6A3.png


Click verify then Click upload Make sure upload the test code successful Step 3.Connect the 6-Axis Robot Arm to Arduino UNO

  myservoA.attach(3);  //  Control waist (A) port number is   3    
  myservoB.attach(5);  //  Control lorearm(B)port number is 5    
  myservoC.attach(6);  //  Control  Forearm(C)port number is 6
  myservoD.attach(9);  // Control Forearm rotation (D) port number is 9
  myservoE.attach(10); // Control wrist(E)port number is 10 wrist
  myservoF.attach(11); // Control wrist rotation (F) port number is 9
 

Define 1-6 servo to Arduino digital PIN3、PIN5、PIN6、PIN9、PIN10、PIN11

The Robot Arm need a External DC-5V Power Supply

DIY6A7.png


  • DONT USE THE Adruino POWER PINS!

OPERATION

The Robot Arm have three work mode!

  • Automatic operation
  • Computer serial port control
  • Standstill
String mycommand="";    /// Serial capture   #auto: automatic operation  #com: computer serial port control  #stop: standstill
static int mycomflag=2; // #auto:2 automatic operation  , #com: 1  computer serial port control    #stop:0  standstill 
 

you can change work mode by write the different number to mycomflag

void setup() 
{ 
  pinMode(13,INPUT);
  pinMode(12,INPUT);  
  Serial.begin(9600);
  myshow=0;
  mycomflag=1;         // the  ARM default  state: 2 automatic operation
  myservoA.attach(3);  //  Control waist (A) port number is   3    
  myservoB.attach(5);  //  Control lorearm(B)port number is 5    
  myservoC.attach(6);  //  Control  Forearm(C)port number is 6
  myservoD.attach(9);  // Control Forearm rotation (D) port number is 9
  myservoE.attach(10); // Control wrist(E)port number is 10 wrist
  myservoF.attach(11); // Control wrist rotation (F) port number is 9
  

RESOURCE