csit.selu.educsit.selu.edu/~csit/seniorprojects/seniorprojects2018/... · web viewthe rotating...

31
1 TECHNICAL PROJECT FINAL REPORT FOR ET 494 SENIOR DESIGN II Industrializing the Robotic Arm Southeastern Louisiana University Department of Computer Sciences and Industrial Technology BY: Michael Hernandez, Peter DiMarco, Jordan Martin ET 494 SENIOR DESIGN II-INTERIM REPORT Spring 2018 Instructor: Dr. Cris Koutsougeras Advisor: Dr. Mohammad Saadeh

Upload: others

Post on 18-May-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

1

TECHNICAL PROJECT FINAL REPORT FOR ET 494 SENIOR DESIGN II

Industrializing the Robotic Arm

Southeastern Louisiana University

Department of Computer Sciences and Industrial Technology

BY: Michael Hernandez, Peter DiMarco, Jordan Martin

ET 494 SENIOR DESIGN II-INTERIM REPORT

Spring 2018

Instructor: Dr. Cris Koutsougeras

Advisor: Dr. Mohammad Saadeh

Page 2: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

2

ABSTRACT:

This project is a continuation of our previous senior project under the supervision of Dr.

Saadeh and Dr. Koutsougeras. The goal of this project is to operate a simple pick and place

system using a programmable logic controller with the assistance of a microcontroller. This

process is achieved through servo motors controlling the motion of robotic arms that objects and

move them along a path. Our project will mimic a simple pick and place system that can show

how a typical manufacturing system operates.

Page 3: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

3

INTRODUCTION:

In almost every manufacturing process in an industry, the typical workforce includes

robotics. The most common type is the articulated robotic arm which includes rotation at the

joints and is usually arranged in a chain to reach into difficult places. Robots are essential for

smooth and efficient operation in a specific process. They are mostly controlled by PLC which

allow for ladder logic programming or microcontrollers that can be programmed for certain

tasks. A microcontroller is a small computer on a single integrated circuit that can provide

control to a robotic arm or any other manufacturing equipment with appropriate coding. Some

examples of applications that use microcontrollers are: instrumentation, high-precision assembly,

sensing, order picking, and many more. For this project, we will include a PLC component that

will control the entire process for the system and an Arduino component that will separately

control the motions for each function of the project.

Page 4: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

4

SETUP:

The design of the project exhibits a typical industrial pick and place manufacturing

system. Mainly, it is desired to have all functions running at the same time using a single code

that can scale the movements for all components in the system to work simultaneously (Figure

1).

Figure 1- Process Flow Chart

It begins by placing a block on the second conveyor belt and the belt will move it towards

the second robotic arm. That arm will move from its home position to the first position at the tray

Page 5: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

5

and pick up the block from the tray. It will move to the second position by the first conveyor belt

and then place the block on it and return to its home position. The block will move along the

first conveyor belt, land on the rotating platform and rotate towards the first robotic arm. The

first robotic arm will be at its home position awaiting an instruction to move to the block on the

rotating platform. It will then receive a signal to move to the first position where the block is on

the rotating platform. It will pick the block and move to the second position where the second

conveyor belt will be positioned. It will place the block on the second conveyor belt and the belt

will move towards the second robotic arm. This series of events will mimic a simple pick and

place system that is seen in a manufacturing plant, but a scaled down version that will run on a

single microcontroller and PLC for triggering each movement (Figure 2).

Figure 2- Process Flow Design

Page 6: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

6

MATERIALS:

The project includes two robotic arms, two conveyor belts, and a rotating platform, all

programmed by a C/C++ code written in the open source Arduino IDE and a simple ladder logic

program written in the ClickPLC software. A previous introduction to the project included a

ClickPLC and for functions to run smoothly, we decided to bring back the ClickPLC. The PLC

will be used to control the Arduino’s actions based on where objects are in the system. The PLC

will receive a sensor signal telling where and object is and will transmit that signal to the

Arduino telling it what to move next based on the PLC ladder logic code. The robotic arms will

work in conjunction with two conveyor belts and a rotating platform to move objects from one

belt to another, mimicking a simple pick and place manufacturing system. This process will

ultimately run on the Arduino with the PLC controlling what happens next based on the process

flow chart (Figure 1). The robotic arms (Figure 3 and 4) are constructed using aluminum C-

channels, pattern brackets, servo gearboxes, and linear actuators that are controlled using the

Arduino PWM output pins.

Page 7: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

7

Figure 3- Robotic Arm 1

Page 8: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

8

Figure 4- Robotic Arm 2

The servos (Figure 5) used to control the robotic arms are the Hitec HS785-HB. These

servos offer high torque for stability when moving, and they provide continuous rotation which

allows us to have freedom of movement for each arm.

Page 9: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

9

Figure 5- Hitec HS785-HB Servo

The rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an

on-board encoder that will send and receive position signals to the system controller.

Figure 6- Rotating Platform Figure 7- DC Motor

Page 10: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

10

The conveyor belts used in the project were adopted from previous projects and are

controlled using stepper motors. Stepper motors are DC motors that achieve accurate motions

based on a sequence of coordinated and minute step motions. Prior knowledge of the number of

steps needed to obtain a full rotation is important to achieve precise positioning and speed

control of the motor. The first conveyor belt (Figure 8) is powered by a NEMA 17 stepper motor

with a built-in gearbox (Figure 9).

Figure 8- Conveyor Belt 1

Figure 9- NEMA 17 Stepper Motor

This stepper motor will drive the conveyor belt at a low speed but high torque which can

allow for heavier objects to be transported on the belt if needed. The second conveyor belt

Gearbox

Page 11: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

11

(Figure 10) was adopted from a previous senior design project and uses a larger and more

powerful stepper motor.

Figure 10- Conveyor Belt 2

The NEMA 34 stepper motor (Figure 11) is used for this conveyor belt and offers a

generous amount of torque and can be adjusted for motor current and steps per revolution. These

adjustments can make the motor operate in a smoother motion while still offering enough power

which is beneficial for our project as we will most likely not use the full power of this stepper

motor.

Page 12: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

12

Figure 11- NEMA 34 Stepper Motor

Stepper motors need plenty of power to operate. A microcontroller that will be used to

program a stepper motor needs to use a shield to protect itself from back electromotive force.

The stepper driver is a messenger that receives a signal from the Arduino and drives the stepper

based on the pulse signal that is received. The driver also protects the low voltage Arduino from

back electromotive force coming from the stepper motor that can cause critical damage to the

Arduino. A wiring schematic (Figure 12 and 13) shows how we wired each servo for the two

robotic arms.

Page 13: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

13

Figure 12- Robotic Arm Wiring

Figure 13- Robotic Arm Schematic

DELIVERABLES:

Date Objective Who

Jan.-Mar.

90%

Re-code the Arduino to

control the two arms

Michael, Jordan, Peter

Mar.-Apr.

40%

Introduce the stepper motor

and platform to the code

Michael, Peter

Apr.-May

30%

Combine the arms, conveyor

belt, and platform to one code

Michael, Jordan, Peter

Page 14: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

14

REMAINING TIMELINE:

Date Objective

Late AprilFinalize robotic arm and conveyor belts on

Arduino

April - May 10Implement ClickPLC with Arduino code to

control parallel actions

COST:

The cost for this semester will be at minimum because most of the materials are

accounted for and already purchased. Changes in the design forced a new problem with the

microcontroller and how it will handle every PWM signal. The previous microcontroller used

was an Arduino UNO which had a total of thirteen digital pins, six of those pins are assigned a

PWM output. The project uses a total of eight servo motors and would not be able to run on the

UNO because of the lack of pins needed. The next viable option would be purchasing a

microcontroller with more PWM output, and the Arduino Mega was a clear winner for the

project. The Mega has more flash memory allowing it to store more code and it has nine more

digital PWM output pins which cover the need for this design. The new implementation used for

the project will include a ClickPLC to provide parallel control and synchronization of events.

These tasks are not readily available if we only use the Arduino. The ClickPLC used will include

a power supply, CPU, and voltage output module. The ClickPLC was used in a previous project

and will not include any other expenses for the project.

Page 15: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

15

PROGRESS AND ISSUES:

This project was initially only going to run on the Arduino MEGA because the ClickPLC

would not be able to fully control the robotic arms. The servos need precise signals and timing to

move to certain locations and the ClickPLC would not be able to provide these signals. It was

decided to introduce the ClickPLC again to the project, but only for semi controlling the actions.

The ClickPLC communicates to the Arduino where the objects are and when to move the robotic

arms and conveyor belts. This process works by connecting an output signal from the PLC to an

input on the Arduino. The ladder logic for testing the signals is shown below (Figure 14).

Figure 14- PLC Ladder Logic

The PLC will receive a signal from sensors (Figure 15 and Figure 16) connected to

conveyor belt 2. Those sensors will trigger outputs (Y101 and Y102) that are connected to the

Arduino that will tell the conveyor belt which direction to travel.

Page 16: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

16

Figure 15- Right Belt 2 Sensor Figure 16- Left Belt 2 Sensor

When the second conveyor belt reaches the right position, it will trigger the sensor in the PLC

ladder logic to tell the Arduino to stop the belt. After a small delay, the Arduino will tell the first

robotic arm to move to the set position by the second conveyor belt to pick up the block. The

sensors allow the Arduino to know where the second conveyor belt is and which robotic arm to

move. The process will utilize the PLC only to control sensors that tell when the Arduino can

activate certain functions. These specific functions that move the conveyor belts and robotic

arms are programmed on the Arduino, allowing us to have a microcontroller for precise

applications and still being able to include an industrial control process with a programmable

logic controller.

Page 17: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

17

RAW CODE:

#include <Servo.h>#include <Stepper.h>Servo servo1;Servo servo2;Servo servo3;Servo servo4;

int pb1=0;int pb2=0;int new_servoArray1;int new_servoArray2;int new_servoArray3;int new_servoArray4;int val1;int val2;int val3;int val4;int check1=0;int last1=0;int last2=0;int check2=0;int last3=0;int last4=0;int i=0;int j=0;int inc;int inc2;int flag=0;int flag2=0;int dir = 1; // 1 for ascending, -1 for descendingint del = 1;//int dir2 = 1; // 1 for ascending, -1 for descendingint del2 = 1;int enablePin=8;int directionPin=9;int pulsePin=10;int PBPIN1 = 22;int PBPIN2 = 24;

int servoArray1[][10]={{178,178,178,178,178,178,178,178,178,178}, {178,178,180,182,184,184,186,188,188,190},

Page 18: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

18

{190,183,176,169,162,155,148,141,138,135}, {135,140,145,150,155,160,165,170,175,178}};int servoArray2[][10]={{180,180,180,180,180,180,180,180,180,180}, {180,171,162,153,144,135,126,117,109,105}, {105,124,143,162,181,200,219,238,257,263}, {263,253,243,233,223,212,202,195,187,180}};int servoArray3[][10]={{180,180,180,180,180,180,180,180,180,180}, {180,169,158,147,146,135,124,113,102,95}, {95,110,125,140,155,165,180,195,210,215}, {215,211,207,203,199,195,191,187,183,180}};int servoArray4[][10]={{180,180,180,180,180,180,180,180,180,180}, {180,198,216,234,252,270,288,306,318,325}, {325,303,279,255,231,207,183,159,135,130}, {130,136,142,148,154,160,166,172,178,180}};

void setup() {

Serial.begin(9600);servo1.attach(3);servo2.attach(5);servo3.attach(10);servo4.attach(11);servo1.write(servoArray1[1][1]);servo2.write(servoArray2[1][1]);servo3.write(servoArray3[1][1]);servo4.write(servoArray4[1][1]);pinMode (pulsePin, OUTPUT);pinMode (directionPin, OUTPUT);pinMode (enablePin, OUTPUT);}

void loop() {

ARM1TRAJECTORY();ARM2TRAJECTORY();

}

void ARM1TRAJECTORY(){pb1=digitalRead(PBPIN1); // push button read from pin 22

if((pb1==1||check1==1)&& flag==0){delay(20);}

Page 19: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

19

pb1=digitalRead(PBPIN1); if((pb1==1||check1==1)&& flag==0){ check1=pb1; }

if(check1==1){ //delay(50); i=i+del; flag = 1; }

//delay(500);

if (i>=0 && i<=3 && flag==1){for(inc=0;inc<10;inc++){new_servoArray1 = servoArray1[i][inc];new_servoArray2 = servoArray2[i][inc];val1 = map(new_servoArray1,0,360,600,1755);val2 = map(new_servoArray2,0,360,600,1740);servo1.write(val1);servo2.write(val2);Serial.println("servo1: ");Serial.println(new_servoArray1);Serial.println("servo2: ");Serial.println(new_servoArray2);delay(50);

}

if (i==3){del = -2*dir;}else if (i==1){del = dir;}

flag = 0;check1 = 0;

}Serial.println("i = ");Serial.println(i);Serial.println("inc = ");Serial.println(inc);}

Page 20: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

20

void ARM2TRAJECTORY(){pb2 = digitalRead(PBPIN2); // push button read from pin 24

if((pb2==1||check2==1)&& flag2==0){delay(20);}

pb2 = digitalRead(PBPIN2); if((pb2==1||check2==1)&& flag2==0){ check2=pb2; } if(check2==1){ //delay(50); j=j+del2; flag2 = 1; }

if (j>=0 && j<=3 && flag==1){for(inc2=0;inc2<10;inc2++){new_servoArray3 = servoArray3[j][inc2];new_servoArray4 = servoArray4[j][inc2];val3 = map(new_servoArray3,0,360,600,1755);val4 = map(new_servoArray4,0,360,600,1740);servo3.write(val3);servo4.write(val4);Serial.println("servo3: ");Serial.println(new_servoArray3);Serial.println("servo4: ");Serial.println(new_servoArray4);delay(50);

}

if (j==3){del2 = -2*dir;}else if (j==1){del2 = dir;}

flag2 = 0;check2 = 0;

}Serial.println("j = ");Serial.println(j);

Page 21: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

21

Serial.println("inc2 = ");Serial.println(inc2);}

Page 22: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/... · Web viewThe rotating platform (Figure 6) utilizes a basic DC servo motor (Figure 7) including an on-board

22