(RB-13K111)AS-6DOF white Aluminium alloy manipulator of Arduino

From ALSRobot-Wki
Jump to: navigation, search
13K11101.png

Contents

Product overview

This AS-6DOF aluminium robotic arm is the newest products of Harbin Alseon Robotics Technology Co., Ltd.The robotic arm (including electric control part) is automated mechanical device that is most extensive applied in the robot technology areas currently. you can see it in industrial manufacturing, medical treatment, entertainment services, the teaching application, military and space exploration areas. Although everybody often see it in movies or TV, and want to have one belong to oneself .But the high price and pertinence make our buyers away. Now you don't have to worry about that question, AS - 6D0F aluminum robotic arm suite that can realize your robot dream. The AS - 6DOF robotic arm use Arduino UNO R3 controller as control systems, joints can move in the prescribed scope, control software by operating upper computer, download control command signal to arduino controller, so as to realize the precisely work in the space, the performance feedback image can be seen by mounting camera on robot arm, if installed to the mobile platform, also can finish visual work replace workers in harmful environment, revise control instruction at current time ,accurately complete tasks, it is really a set of cost-effective and easy-to-use robot platform.

Main Controller Technical Parameters

  1. Main Controller:Carduino UNO R3
  2. Microcontroller:ATmega328
  3. Flash RAM:32 KB (ATmega328, 0.5 KB of it is used for Bootloader)
  4. Operating Voltage:5V
  5. Input voltage:External power supply not required when USB connected or Input of 7V~12V DC
  6. Output voltage:5V DC Output, 3.3V DC Output and External power supply input
  7. Clock frequency:16 MHz
  8. Input voltage:7-12V(recommended)
  9. Input voltage:6-20V(limited)
  10. Supports USB Interface Protocol and power supply(External power supply not required)
  11. Supports ISP download
  12. Digital I/O interface:14(6 PWM Output port)
  13. Simulation input interface:6
  14. DC Current:40mA(I/O Pin)
  15. DC Current:50mA(3.3V Pin)
  16. EEPROM:1 KB (ATmega328)
  17. SRAM:2 KB (ATmega328)
  18. Size:75x55x15mm

Packing List

  • 1 x AS-6DOF Aluminium Robotic Arm
  • 1 x CarDuino UNO R3
  • 1 x USB Cable A-B for Arduino
  • 1 x Sensor Shield v5.0 for Arduino
  • 1 x I2C/TWI LCD2004 Module
  • 4 x 3Pin Jumper Wire
  • 1 x DC Barrel Jack Adapter - Male
  • 4 x Big Button (Red)
  • 1 x AC Cable
  • 1 x Wall Adapter Power Supply (12VDC 1.5A /5VDC 8A)

Wiring Installation

Step 1:Install CarDuino Uno controller and sensor Shield, upload sample program for Carduino UNO
Step 2:Connect Digital Push Button module to Sensor
Connect the four button modules to analog port A0.A1.A2.A3 of sensors shield v5.0. When the button A0 is pressed, servo turns from top to bottom, A1 pressed, servo turns from bottom to top. When A2 is pressed, servo rotate clockwise, as to A3 rotates counterclockwise.。
Step 3:Connect RB-150MG and Sensor Shield
Connect the servos from chassis to gripper successively to the 6 digital port D4(Chassis Servo),D5.D6.D7.D8.D9(Gripper servo) to the sensor shield.

Sensor connection rendering

Step 4 IIC LCD2004 display and Sensor shield Connection
Connect the IIC LCD2004 display to IIC port of sensor shield v5.0
Step 5 Arduino Sensor Shield v5.0 external power supply
Use the switching power supply(Sensor Shield is powered by the 5V one and CarDuino Uno Controller is powered by the 12V one), Connect the red one to VCC, the black one to GND(Attention to distinguish the positive and negative pole),take down the jumper cap of sensor Shield v5.0, choose external power supply for the digital port, other expansion ports remain internal power supply.
Step 6 Power CarDuino Uno
Power CarDuino Uno(Program downloaded already),as the schematic diagram 11,press the reset button of sensor shieldv5.0, reboot CarDuino Uno Controller, now the IIC LCD2004 display will post up the preseted textual information.

Overall effect diagram after installation

Sample Code

Before uploading the compiled program, it is necessarily to download the library files that program needed.Arduino robotic arm library files Download

#include <Servo.h>      //调用一些库文件
#include <TimedAction.h>
#include <SimpleTimer.h> 
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
                                //定义舵机位置名称,并编号。
const int base =      0;         
const int shoulder =   1;          
const int elbow =     2;        
const int wristflex =   3;        
const int wristrot =    4;          
const int gripper =    5;         

const int stdDelay =   20;         //舵机运动延时(单位ms)
const int maxServos =  6;         //舵机的数量
const int centerPos =  90;        //舵机中位位置

unsigned long key_millis = 0;      
unsigned long button_millis = 0;
int keyDelay = 100;              //定义延时时间
int buttonDelay = 50;           //定义按键延时
int thisServo = base;           //定义起始电机

typedef struct{              //数组框架结构
  byte neutral;             //中位角度
  byte minPos;             //最小角度
  byte maxPos;            //最大角度
  byte delaySpeed;         //延时时间
  byte curPos;            //舵机当前角度
} ServoPos;              //结构体名称

ServoPos servosPos[] = {    //对舵机限位
  { 90, 180, 10, stdDelay, 0 }, //中位90,最小角度180,最大角度10,范围0~180度。
  { 90, 180, 10, stdDelay, 0 },
  { 90, 180, 60, stdDelay, 0 },
  { 90, 170, 50, stdDelay, 0 },
  { 90, 180, 10, 10, 0 },
  { 90, 125, 55, 5, 0 }
};

byte serv = 90;
int counter = 0;
int curServo = 0;
int sMove[] = {0, 90, 0};
int sAttach[] = {0, 0};

LiquidCrystal_I2C lcd(0x27,20,4);     //0x27  D7~D0端口开关设置0x表示十六进制27转换成16进制数是00100111  1代表开,0代表关, 20列,4行,行号从零算起,第一行行号0,第二行行号1.
Servo servos[maxServos];
int destServoPos[maxServos];
int currentServoPos[maxServos];

TimedAction servoMove[maxServos] = TimedAction(100, doServoFunc);   // 延时,延时时间为声明时间。
SimpleTimer timer;            // For movement tests
TimedAction keys = TimedAction(10, keypadFunc);

void setup() {                            //设置
  delay(200);
  Wire.begin();
  lcd.init();                             //LCD初始化             
  lcd.backlight();                 //LCD背光灯打开
  delay(500);
  lcd.on();                     // LCD开机
  setupDisplay();               //调用子程序,设置显示内容门,后面有定义。

  for(int i=0; i<maxServos; i++) {          
    servos[i].write(servosPos[i].neutral);
    servosPos[i].curPos = servosPos[i].neutral;
    servos[i].attach(i+4);
    destServoPos[i] = centerPos;
    currentServoPos[i] = centerPos;
    servoMove[i].disable();
  }
  //timer.setInterval(5000, servoTestFunc);      
}

void loop() {
  for(int x=0; x<maxServos; x++) {
    curServo = x;
    servoMove[x].check();
  }
  //timer.run();            
  keys.check();
  navSwitchFunc();
}

void servoTestFunc() {
  if(counter % 2) {
    Move(thisServo, servosPos[thisServo].minPos, servosPos[thisServo].delaySpeed);
  }
  else
    Move(thisServo, servosPos[thisServo].maxPos, servosPos[thisServo].delaySpeed);
  counter++;
}

void writeServo() {
  int servoNum = sMove[0];
  if(servoNum >=0 && servoNum <= maxServos) {
    destServoPos[servoNum] = sMove[1];
    servoMove[servoNum].enable();
    servoMove[servoNum].setInterval(sMove[2]);
  }
}

void setServoAttach() {
  int servo = 1;    // sAttach[0]
  int mode = 2;     // sAttach[1]
  if(servo >= 0 && servo <= maxServos) {
    if (mode == 1)
      servos[servo].attach(servo+4);
    else
      servos[servo].detach();
  }
}

void doServoFunc() {
  int x = curServo;      
  if(destServoPos[x] == currentServoPos[x])
    servoMove[x].disable();       
  if(destServoPos[x] > currentServoPos[x])
    currentServoPos[x]++;
  else
    currentServoPos[x]--;
  
  servosPos[x].curPos = constrain(currentServoPos[x], servosPos[x].maxPos, servosPos[x].minPos);
  currentServoPos[x] = servosPos[x].curPos;
  servos[x].write(currentServoPos[x]);
  jointPos(x, currentServoPos[x]);
}

void Move(int servoNum, int servoPosition, int delayTime) {  //舵机驱动指令
  sMove[0] = servoNum;             //所驱动舵机号
  sMove[1] = servoPosition;          //舵机的目标位置
  sMove[2] = delayTime;            //每个舵机运动的延迟时长
  writeServo();
}

void Attach(int servoNum, int servoMode) {
  sAttach[0] = servoNum;
  sAttach[1] = servoMode;
}

void navSwitchFunc() {                //键盘检测子程序
    if (millis() > button_millis + buttonDelay) {
    button_millis = millis();
    if(digitalRead(A0) == LOW) {      // 当A0引脚低电平
      thisServo--;                   //电机号自加1
      thisServo = constrain(thisServo, 0, 5); //电机控制范围
      jointPos(thisServo, servosPos[thisServo].curPos);
      delay(200);                 //延时200毫秒
    }
    if(digitalRead(A1)== LOW) {      //当A1引脚低电平
      thisServo++;                 //电机号自加1
      thisServo = constrain(thisServo, 0, 5); //电机控制范围
      jointPos(thisServo, servosPos[thisServo].curPos);
      delay(200);                 //延时200毫秒
    }
    if(digitalRead(A2) == LOW) {      //当A2引脚低电平
      byte t = thisServo;
      servosPos[t].curPos--;       //电机角度自减1
      servosPos[t].curPos = constrain(servosPos[t].curPos, servosPos[t].maxPos, servosPos[t].minPos);
      jointPos(t, servosPos[t].curPos);
    }
    if(digitalRead(A3) == LOW) {     //当A3引脚低电平
      byte t = thisServo;
      servosPos[t].curPos++;         //电机角度自减1
      servosPos[t].curPos = constrain(servosPos[t].curPos, servosPos[t].maxPos, servosPos[t].minPos);
      jointPos(t, servosPos[t].curPos);
    }
  }
}

void keypadFunc() {
  byte keypad = lcd.keypad();
  lcd.command(0);                
  if (keypad !=0) {
    if (millis() > key_millis + keyDelay) {
      keypress(keypad);
      key_millis = millis();
    }
  }
}

void keypress (byte keypad) {  //读取按键按下情况。       
  byte t;
  lcd.setCursor(15, 1);
  switch(keypad) {
    case 1: 
      lcd.print("1");
      t = base;
      servosPos[t].curPos--;
      break;
    case 2:
      lcd.print("2");
      t = shoulder;
      servosPos[t].curPos--;
      break;
    case 3:
      lcd.print("3");
      t = elbow;
      servosPos[t].curPos--;
      break;
    case 5:
      lcd.print("4");
      t = base;
      servosPos[t].curPos++;
      break;
    case 6:
      lcd.print("5");
      t = shoulder;
      servosPos[t].curPos++;
      break;
    case 7:
      lcd.print("6");
      t = elbow;
      servosPos[t].curPos++;
      break;
    case 9:
      lcd.print("7");
      t = wristflex;
      servosPos[t].curPos--;
      break;
    case 10:
      lcd.print("8");
      t = wristrot;
      servosPos[t].curPos--;
      break;
    case 11:
      lcd.print("9");
      t = gripper;
      servosPos[t].curPos--;
      break;
    case 13:
      lcd.print("*");
      t = wristflex;
      servosPos[t].curPos++;
      break;
    case 14:
      lcd.print("0");
      t = wristrot;
      servosPos[t].curPos++;
      break;
    case 15:
      lcd.print("#");
      t = gripper;
      servosPos[t].curPos++;
      break;   
  }
  servosPos[t].curPos = constrain(servosPos[t].curPos, servosPos[t].maxPos, servosPos[t].minPos);
  jointPos(t, servosPos[t].curPos);
}

void jointPos(byte t, byte pos) {    //定义两个byte类型的变量,t,pose.
  lcd.setCursor(6, 1);//电机所在位置名称
  switch(t) {
    case base:               // 1, 4
      lcd.print("bse");    //LCD显示bse
      break;
    case shoulder:           // 2, 5     
      lcd.print("shl");   //LCD显示shl
      break;
    case elbow:              // 3, 6
      lcd.print("elb");    //LCD显示elb
      break;
    case wristflex:          // 7, * 
      lcd.print("wfx");   //LCD显示wfx
      break;
    case wristrot:           // 8, 0    
      lcd.print("wrt");   //LCD显示wrt
      break;
    case gripper:            // 9, #
      lcd.print("grp");    //LCD显示grp
      break;
  }
  
  lcd.setCursor(2, 3);// 设置显示位置第4行,3列就是说前面空2格。
  lcd.print(" you are welcome  ");
  lcd.setCursor(6, 2);//pose后面显示的角度位置。
  lcd.print(pos, DEC); //当按键按下后显示角度值。
  servos[t].write(pos);
}

void setupDisplay() {    //子程序定义,LCD显示内容,开机立即显示。
  lcd.clear();          //LCD清屏
  lcd.blink_off();       //LCD光标闪烁关
  lcd.home();         //
  lcd.setCursor(1, 1);  //设置显示位置第2行,2列就是说前面空1格。
  lcd.print("key: ");   //显示内容 “key”
  lcd.setCursor(4, 0);   //设置显示位置第一行,5列就是说前面空4格。
  lcd.print("alsrobotbase      ");//显示内容”alsrobotbase”
  lcd.setCursor(1, 2);         // 设置显示位置
  lcd.print("Pos: ");           //显示内容”Pos”
}

Electronic control part instruction

6 DoF Robot Arm mechanical part installation instruction
Digital Push Button usage instruction
IIC 2004 LCD display usage instruction
Sensor Shield V5.0 usage instruction
Arduino UNO Getting Started Tutorial
Arduino UNO driver installation
Arduino UNO Programming Reference Guide

Products related to recommend

Erweima.png

Purchase link

AS-6DOF Robotic Arm--within Arduino Control System

Related recommended products

RB-897DMG Waterproof Servo Motor

Related documents

AS-6DOF Robotic Arm Positioning grab
6DOF Robotic Arm amateur assessment(1)
6DOF Robotic Arm amateur assessment(2)
Alsrobot Technical Forum

Personal tools
Namespaces

Variants
Actions
Navigation
Tools