Introduction: UCL - Embedded - Robotarm

We are 3 students from University College Lillebaelt, second semester in Automation engineering, who chose to make a project in Arduino, and we have made a case/study of the project.

The initial idea was to make a robot arm, which could be remotely controlled via Bluetooth, and still be used by a person who had no programming knowledge. Therefore, ease of use was made a priority.

Made by: Samm0120, Sila3913, Tobi3084

Step 1: The Project

The robot arm has two programs, which both can be selected in the app. The app’s function is to make the robot arm easier to use, as the user can wirelessly communicate with the robot via Bluetooth.

The first program is automatic, as the robot arm is programmed to carry items from point A to point B on a wooden panel. The robot arm will first go to a waiting position over point A. After that the robot arm will pick up the item at point A, once the first photoelectric sensor gives the signal, that an item is in place. After that the robot arm will carry the item to point B, where it will drop off the item, once the second photoelectric sensor gives the signal, that the space is clear. The sensors are placed as a safety measure, to protect both the items and the robot itself. Once the item is dropped off, the robot arm will return to its waiting position over point A, where it will wait for another item.

The second program is a manual program, where the user can control the robot via buttons in the android app.

Step 2: Component List

3d print:

· EBAmk2_001_base.STL

· EBAmk2_002_mainarm.STL

· EBAmk2_003_varm.STL

· EBAmk2_004_link135.STL

· EBAmk2_005_link135angled.STL

· EBAmk2_006_horarm_.STL

· EBAmk2_007_trialink.STL

· EBAmk2_008_link147_new.STL

· EBAmk2_009_trialinkfront.STL

· EBAmk2_010_gearservo_22DENTI.STL

· EBAmk2_011_gearmast_full.STL

· EBAmk2_012_mainbase.STL

· EBAmk2__013_lower_base.STL

· EBAmk2_014_claw_base_own.stl

· EBAmk2_015_claw_finger_dx.STL

· EBAmk2_016_claw_gear_drive.STL

· EBAmk2_017_claw_finger_sx.STL

· EBAmk2_018_claw_gear_driven.STL

· New_drive_cover.stl

Not printed:

· 1x Arduino Mega2560

· 1x Bluetooth module HC-05

· 2x Photoelectric sensors

· 3x Servomotor Futuba S3003

· 1x Microservo SG90

· 1x Smartphone with android

· 1x Breadboard

· 6x Male to male wires

· 7x Male to female wires

· 1x M6 selflocking nut

· 1x M6x25 screw

· 2x M3 selflocking nuts

· 2x M3 x 20 screws

· 1x M3 x 10 hex recessed head screw

· 9x M4 selflocking nuts

· 1x M4 x 40 screw

· 1x M4 x 30 screw

· 5x M4 x 20 screw

· 1x M4 x 60mm threaded rod

· 1x M4 x 32mm threaded rod

· 25x dia 6 mm ball spheres

· 1x 606zz bearing

· 4m washers as needed

Step 3: 3D Printing

We made use of some predesigned parts for the robot, but we did make alterations to the design. We redesigned the claw and the claw base to better suit our needs, as we are picking up items below the robot, and would like it to be able to move up/down in a vertical fashion, and easily be able to pick up items, without aligning itself in a horizontal position.

In the printing and design process we made use of Autodesk Fusion 360 and a Ultimaker 3D printer.

The filenames are in step 2.

We have uploaded our custom parts here.

Credit for parts: theGHIZmo.

Link to his instructable: https://www.instructables.com/id/EEZYbotARM-Mk2-3...

Step 4: Setup

After printing the specific parts, we started assembly of the robot, with help from the guides provided by theGHIZmo in his EEZYbotArm Mk2 instructable. When we had completed the assembly of the robot, we tested the basic functions. After the test had been completed successfully, and we had checked that all parts were the right size, we decided to cut out a base, made out of wood, to make sure the robot could remain in a stable position during operation. The wooden base also helped us position the items for retrieval and delivery.

The wood base has the following measurements: 40x50 cm

There are small comments in some of the pictures.

Link to theGHIZmo's instructable: https://www.instructables.com/id/EEZYbotARM-Mk2-3...

Please notice the assembly guide is in his Step 3.

Step 5: Fritzing

We made use of Fritzing, a free program that makes electronic diagrams accessible for all. The color of the wires is used to indicate the following:

· The yellow wire is used for sending and receiving signals.

· The red wire is power.

· The black wire is ground.

We used this program to provide us with an overview of our connections, components and power supply.

Step 6: I/O List - Sequence Diagram

Here is our I/O list, which show what component we have wired to the different pins, and the sequence diagram, which shows what steps the robot goes through while running in the Automatic program.

Step 7: The Code

Comments explaining the code can be found in the following section:

unsigned long current;
unsigned long previous1; const int interval1 = 3000; //timer used with (millis)

void setup() { // put your setup code here, to run once: Servo1.attach(servoPin1); Servo2.attach(servoPin2); Servo3.attach(servoPin3); Servo4.attach(servoPin4);

pinMode (sensor1, INPUT); //declaring pinmodes for sensor 1 & 2 pinMode (sensor2, INPUT);

Serial.begin(9600); //start the serial monitor Serial.setTimeout(10000000);

}

void loop() { // put your main code here, to run repeatedly: current = millis(); //use the function millis instead of delay mode = Serial.read(); //function to read the incoming integers from the app

servobase = constrain(servobase, 0, 180); //we use the "constrain" function to make sure the servos dont move to position, that it physically cant. servowrist = constrain(servowrist, 122, 175); servoelbow = constrain(servoelbow, 5, 55); servogrip = constrain(servogrip, 15, 70);

Servo1.write(servobase); //the "write" function sends the position to the servo, from the variables Servo2.write(servoelbow); Servo3.write(servowrist); Servo4.write(servogrip);

int sensor1Value = digitalRead(sensor1); //read the status of sensor 1 & 2, (TRUE/FALSE) int sensor2Value = digitalRead(sensor2);

switch (mode) { //switch-case function for manuel drive & start auto case 1: //auto function active switch (stepp) { //switch-case function for autodrive case 0: //step 0, in auto drive. Serial.println("100"); //print value to app servobase = 0; //setting values to the servos servowrist = 160; servoelbow = 20; servogrip = 70; if (current - previous1 >= interval1) { //using the function millis as a timer, to wait for the servos to go in position before the next step stepp = 1; //set the varible "stepp" to 1, to go to next case previous1 = current; } break; case 1: //step 1, in auto drive Serial.println("101"); //print value to app if (sensor1Value == LOW) { //waiting for sensor 1, to detect an object stepp = 2; delay(1000); } break; case 2: //step 2, in auto drive Serial.println("102"); //print value to app servoelbow = 90; //setting values to the servos servowrist = 110; if (current - previous1 >= interval1) { stepp = 3; previous1 = current; } break; case 3: //step 3, in auto drive Serial.println("103"); //print value to app delay(1000); servogrip = 15; //setting values to the servo if (current - previous1 >= interval1) { stepp = 4; previous1 = current; } break; case 4: //step 4, in auto drive Serial.println("104"); //print value to app servobase = 140; //setting values to the servos servowrist = 160; servoelbow = 20; servoelbow - 3;

if (current - previous1 >= interval1) { stepp = 5; previous1 = current; } break; case 5: //step 5, in auto drive Serial.println("105"); //print value to app if (sensor2Value == HIGH) { //waiting for sensor 2, to detect that there isn't an object stepp = 6; delay(1000); } break; case 6: //step 6, in auto drive Serial.println("106"); //print value to app servoelbow = 90; //setting values to the servos servowrist = 110; if (current - previous1 >= interval1) { stepp = 7; previous1 = current; } break; case 7: //step 7, in auto drive Serial.println("107"); //print value to app delay(1000); servogrip = 70; //setting values to the servo if (current - previous1 >= interval1) { stepp = 8; previous1 = current; } break; case 8: //step 8, in auto drive Serial.println("108"); //print value to app servoelbow = 20; //setting values to the servos servowrist = 160; if (current - previous1 >= interval1) { stepp = 9; previous1 = current; } break; case 9: //step 9, in auto drive Serial.println("109"); //print value to app servobase = 0; //setting values to the servo if (current - previous1 >= interval1) { stepp = 0; previous1 = current; } break; } break; case 2: stepp = 0; //case 2: manuel function active Serial.println("100"); delay(50); Serial.println("100"); delay(50); Serial.println("100"); break; case 10: servoelbow = servoelbow + 2; //manuel drive, move elbow down break; case 12: servoelbow = servoelbow - 2; //manuel drive, move elbow up break; case 15: servowrist = servowrist + 2; //manuel drive, move wrist up break; case 17: servowrist = servowrist - 2; //manuel drive, move wrist down break; case 22: servobase = servobase + 2; //manuel drive, move base right break; case 20: servobase = servobase - 2; //manuel drive, move base left break; case 26: servogrip = 15; //manuel close gripper break; case 25: servogrip = 70; //manuel open gripper break; } }

Step 8: The App

Here we’ll show the app code from MIT App Inventor, and a small description of the app code. This app serves as the control panel for the robot, and the option to choose between the manual and the automatic program.

Click on the photos for a more detailed description of the code.

Step 9: Video of the Robot Arm in Action

Here we'll show the robot arm in action, as it picks up a couple of items and places them, when the space is clear. We will also run the robot in manual mode.

Step 10: Evaluation

What went well?

We used our time effectively, and all group members participated from the start.

Good chemistry and workflow in the group.

A good foundation for the code was made from the start, so we didn't need to make major adjustments later in the process.

What didn’t go so well?

Small problems with the 3d printing, due to lack of calibration.

The communication between the Arduino and the app, created several difficult problems, due to the amount of data that was sent in the start.

Any features we would have liked to implement if given more time?

Higher efficiency in the automatic sequence.

More smooth movements from the robot arm.

A sensor to see if an item was picked up succesfully or if an item was dropped.

That it could remember which step it was in, if the automatic sequence was stopped/paused.

Final comments.

Overall, we are satisfied with the result, with the amount of time we were given.