Scara Arm - Report

Download as pdf or txt
Download as pdf or txt
You are on page 1of 145

The Capstone Team Project

MECT/MENG 411

Name of Project: Design and Development of a Smart Factory

Group Name: TEAM MECHANIZERS

Group Members:
17700450 ZEYAD SHEHATA
17700557 HISHAM AFASH
17700158 AL AMIR SHAHEEN
16700725 HABIB UR REHMAN
17700358 AHMED ABDEL RAOUF

Supervisor: Assoc. Prof. Dr. Qassim Zeeshan


Semester: Spring 2020-2021
Submission Date: 07th of June 2021

Eastern Mediterranean University


Department of Mechanical Engineering

Department of Mechanical

Engineering
ABSTRACT

Nowadays, Development of technology is necessary because it relates to human needs and

both are rapidly increasing. The goal is to make life easier every day. As for industries,

the development of Industry 4.0 introduced a brand-new way of organizing the means of

production, and that introduced a new era of technology use in industrial sectors.

One of the most important applicants of Industry 4.0 is the smart factory model. A Smart

Factory is a concept for indicating the ultimate goal of digitization in manufacturing. A

smart factory model applies the means of the 4th industry through different aspects

including new technologies such as cloud computing. It combines the physical production

process with digital technology.

Our smart factory model mainly consists of a robotic arm and two conveyor belts. All

assembled and manufactured using 3D printing and different workshop processes. In order

for our project to meet the objectives, cost, performance, availability, and environment

will be all taken into consideration. It basically combines mechatronics with mechanical

skills to introduce a modern mimic of how smart factories can be represented. With the

use of sensors and Arduino board which will make the process flexible and efficient we

will be able to detect the process of the factory and sense any error that might occur.

Applying all these aspects the results expected is to have a full-modern smart factory that

applies the visions of the 4th industry.

i
Table of Contents

ABSTRACT ........................................................................................................................i

List of Figures .................................................................................................................... v

List Of Tables ....................................................................................................................vi

LIST OF SYMBOLS and ABBREVIATIONS ................................................................. 1

CHAPTER 1 - INTRODUCTION ..................................................................................... 2

1.1 Detailed definition of the project ............................................................................. 2

1.2 Significance of the project ....................................................................................... 4

1.3 Detailed project objectives ....................................................................................... 5

1.3.1 Design for safety ................................................................................................... 5

1.3.2 Design for cost ...................................................................................................... 5

1.3.3 Design for assembly .............................................................................................. 6

1.3.4 Design for environment......................................................................................... 6

1.3.5 Design for performance......................................................................................... 6

1.4 Detailed project constraints ...................................................................................... 7

1.5 Report Organization ................................................................................................. 8

CHAPTER 2 - LITERATURE REVIEW ........................................................................ 10

2.1. Background Information ....................................................................................... 10

2.2. Concurrent Solutions............................................................................................. 11

2.2.1. Deloitte Smart Factory ....................................................................................... 11

2.2.2 Toyota Smart Manufacturing and Connectivity .................................................. 13

2.2.3 ABB’s Smart Factory .......................................................................................... 14

2.3 Comparisons Of The Concurrent Solutions ........................................................... 15

2.4 Engineering Standards Of The Concurrent Solutions ............................................ 16

ii
2.4.1 ISO 10303 ........................................................................................................... 16

2.4.2 IEC 62832 ........................................................................................................... 17

2.4.3 DIS 22400 ........................................................................................................... 17

2.4.4 IEEE P1872.1 ...................................................................................................... 18

CHAPTER 3 -DESIGN and ANALYSIS ........................................................................ 19

3.1 Proposed/Selected Design ...................................................................................... 19

3.1.1 Mechanical Components ................................................................................. 20

3.1.2 Electrical Components .................................................................................... 21

3.1.3 Circuit Diagrams Design ................................................................................. 23

3.1.4 Controlling System ......................................................................................... 26

3.1.5 Operation Mechanism ..................................................................................... 27

3.2 Engineering Standards ........................................................................................... 28

3.3 Design Calculations ............................................................................................... 29

3.3.1 Robot Arm Torque Calculations ..................................................................... 29

3.3.2 A4988 Motor Current Tuning ......................................................................... 31

3.3.3 Robotic Arm Forward Kinematics Calculation............................................... 33

3.4 Cost Analysis ......................................................................................................... 36

CHAPTER 4 – MANUFACTURING PLAN .................................................................. 44

4.1 Manufacturing Process Selection ........................................................................... 44

4.2. Detailed Manufacturing Process ........................................................................... 48

CHAPTER 5 - PRODUCT TESTING PLAN ................................................................ 49

5.2 Verification Plan Of The Applied Engineering Standards ..................................... 51

CHAPTER 6 - RESULTS AND DISCUSSIONS ........................................................... 53

6.2. The Engineering Standards ................................................................................... 54

6.3. The Constraints ..................................................................................................... 55

iii
CHAPTER 7 - CONCLUSION AND FUTURE WORKS .............................................. 56

7.1 Conclusion ............................................................................................................. 56

7.2 Future Works .......................................................................................................... 56

REFERENCES................................................................................................................. 58

APPENDIX A: Electronic Media .................................................................................... 62

APPENDIX B: Constraints .............................................................................................. 63

APPENDIX C: Standards ................................................................................................ 64

APPENDIX D : Project Plan ........................................................................................... 66

APPENDIX E : Engineering Drawings ........................................................................... 69

APPENDIX F: CODES ................................................................................................. 126

APPENDIX G: SPECIFCATION SHEETS .................................................................. 135

iv
List of Figures

Figure 1 Outline of Smart Factory ..................................................................................... 2

Figure 2 Deloitte smart factory digital journey. ............................................................... 13

Figure 3 Toyota smart production factory ....................................................................... 14

Figure 4 Digital twin in ABB's smart factory .................................................................. 15

Figure 5 Conceptual layers of the Digital Factory Framework........................................ 17

Figure 6 Selected Design ................................................................................................. 20

Figure 7 Breakdown structure. ......................................................................................... 20

Figure 8 : Circuit diagram of the scara robotic arm ......................................................... 23

Figure 9: Circuit diagram for the conveyor belt system .................................................. 24

Figure 10: Explanation of the units and measurements used to calculate the torque ...... 30

Figure 11 adjusting the voltage passing to the A4988 stepper driver. ............................. 32

Figure 12 Top View ......................................................................................................... 33

Figure 13 Side View ........................................................................................................ 34

Figure 15 Creality 3D CR-10 S5 3D Printer .................................................................... 45

Figure 16 the RoboDK simulation that was used to do the testing. ................................. 50

Figure 17 Poster of the project. ........................................................................................ 62

Figure 18 Gantt chart. ...................................................................................................... 68

v
List of Tables

Table 1 : Comparison of Concurrent Solutions ............................................................... 15

Table 2: The Mechanical Components ............................................................................ 20

Table 3 : The Electrical Components ............................................................................... 21

Table 4 : Torque calculations for the robotic arm . .......................................................... 30

Table 5 DH Parameters Table .......................................................................................... 35

Table 6 Capital investment .............................................................................................. 36

Table 7 Cost analysis ....................................................................................................... 36

Table 8 Manufacturing process selection ......................................................................... 47

Table 9 flexibility test reults ............................................................................................ 54

Table 10 Logbook ............................................................................................................ 66

Table 11 Servo motor specification sheet ...................................................................... 135

Table 12 PLA Spec. Sheet ............................................................................................. 136

Table 13 Printing Spec. Sheet ........................................................................................ 136

Table 14 Arduino Spec. Sheet ........................................................................................ 136

Table 15 NEMA 17 Stepper motor spec. sheet. ............................................................. 137

Table 16 12V-100RPM DC Gear Motor Spec. Sheet .................................................... 138

vi
LIST OF SYMBOLS and ABBREVIATIONS

3D: Three-Dimensional.

PLA: Polylactic-acid

Θi: Theta angle of X-axis.

di: Distance between Z-axis to another.

αi: Alpha angle of Z-axis.

a: distance between X-axis and another.

ii
CHAPTER 1 - INTRODUCTION

1.1 Detailed definition of the project

The smart factory is defined as a factory where physical production processes and

operations are combined with digital technology, smart computing, and big data to create

a more opportunistic system for companies that focus on manufacturing and supply chain

management. The smart factory is an aspect of Industry 4.0, a new phase in the Industrial

Revolution that focuses heavily on real-time data, embedded sensors, connectivity,

automation, and machine learning.[1]

Figure 1 Outline of Smart Factory

2
Extensive use of IoT sensors and devices connects machines and enables visibility into

their condition as well as into factory processes, creating an industrial internet of things

(IoT) [2]. Increasingly sophisticated analytics and applications based on AI and machine

learning handle many of the routine tasks, freeing up people to focus on handling

exceptions and making higher-level decisions. Robots are expected to populate smart

factories for routine work, working alongside people. Smart factories rely on smart

manufacturing, which connects the plant to other entities in the digital supply network,

enabling more effective supply chain management. They also rely on digital

manufacturing, which uses a Digital twin to connect a product digitally at all stages in its

lifecycle. [3]

Given that one of the most fundamental characteristics of a smart factory is its

connectedness, sensors are critical to linking devices, machines, and systems to provide

data needed to make real-time decisions. In a similar way that smart home devices

accomplish routine actions like dimming lights at a certain time or triggering alerts when

something is amiss, the ideal smart factory runs itself on a much larger scale, self-

correcting where appropriate and alerting for human intervention where needed. In

addition, the extensive amount of data provides real-time insight to supply chain

stakeholders, both inside the factory and to the business and partners. In this way, agility

can increase exponentially, and issues can be addressed proactively. Already, IoT

technologies have helped to monitor industrial operations, provide supply chain

visibility, and predict equipment downtime.

3
1.2 Significance of the project

The smart factory model acts for a breakthrough from more traditional automation to a

completely associated and workable system. Making a smart factory is not easy, it needs

a high level of accuracy and engineering skills from different majors so it can serve the

fourth revolution of industry successfully. However, this project seeks to achieve the

basics of Industry 4.0 through different mechanical and mechatronics processes.

This model of smart factory can be used perfectly as a mimic to represent how factories

in the modern era should work. The project perfectly applies mechatronics skills by having

a modern robotic arm that takes the product from a process to another and it is essential

to have since the adoption of robots in industries worldwide is on the high rise. The robotic

arm provides working with high quality and accuracy in less time.

Smart factory model should provide high engineering skills. With two conveyor belts

aside to the robotic arm this model serves classic mechanical work with high efficiency

and modern perspective. All the parts of the model are associated through a conveyor belt

and controlled by a programmable Arduino that will make the process flexible and

efficient.

4
1.3 Detailed project objectives

The main objective of the project is to design and manufacture a smart factory model

which can evaluate the idea of a smart factory that contains a robotic arm using Arduino.

Detailed project objectives are illustrated below.

1.3.1 Design for safety

The factory model is being implemented for several reasons, first of which is that it can

ease the process of sorting and moving heavy materials. Usually this is carried using

manpower, which can cause lifetime injuries if done repeatedly daily. Add to that the

factory model helps work to be done in extreme organization and precision as by

identifying each object by its color and moved automatically it will know where the

material should be headed to.

1.3.2 Design for cost


Design for cost is the conscious use of engineering processing technology to reduce the

design cost. This is achieved using suitable low-cost materials and manufacturing

processes. For example, the part of the robotic arm platform was manufactured using a 3D

printing system and then assembled using mechanical fasteners. As for the other parts of

the model they are all manufactured by wood material which is not as expensive as metals.

As for the rods and threaded rods they were made of stainless-steel and lead respectively.

5
1.3.3 Design for assembly

The main assembly of the robotic arm was involved two sub-assemblies which is the arm

and the conveyor system. The 3D construction of the robotic arm is done by using

Solidworks. The arm assembly was done using screws and nuts, while the conveyor

system was done by wood-carving and joinery then followed by screws and nuts.

1.3.4 Design for environment

The material used in the smart factory are used to be environmentally friendly. Polylactic

acid (PLA) is used for the robotic arm, this material is known to consist of renewable raw

materials. Wood material is chosen to design the conveyor belts, this type of material was

chosen since it is known to require less energy in manufacturing processes other than

materials which makes it environmentally friendly.

1.3.5 Design for performance

Design for performance is one of the main project objectives which is achieved by making

a factory model that with connectedness and sensors, can take input data and perform real-

time decision leading to a factory that can run itself and self-correcting and giving alerts

for human intervention when needed.

6
1.4 Detailed project constraints

Cost: The manufacturing and assembly cost of the model parts doesn’t exceed the

available budget as most of the parts are 3D printed using Polylactic Acid (PLA).

Availability: The model is designed using materials and components available in the

international market.

Reliability: System uses Arduino board which allows devices to communicate and interact

with each other through a programmable code and data exchange of devices. Thus,

stochastic events, errors and failures can be minimized, thus wastes, total costs and lead

times can be reduced. [4]

Efficiency: the system has high resource utilization, due to self-organizing, self-

regulating, and self-adapting operation. So sustainable production can be provided in the

long term due to more efficient resource utilization.

Maintainability: This system is of a predictive maintenance type which means that all

things are connected via an Arduino board and they are able to communicate and alert

each other and if an error or failure is detected the system stops, the machines and parts

are set to repair quickly.

Economic: The smart factory design will add up to the economy by enabling factories to

produce more while lowering costs and industries may almost double their operating profit

in the long run.

7
1.5 Report Organization

The following report consists of seven chapters in total, each chapter is divided into

different subsections. The first chapter is Introduction, which entails five sections which

are, Detailed Definition of Smart Factory, Significance of The Smart Factory Model,

Detailed Project Objectives which been divided into five sections, detailed project

constraints and finally Report Organization which explains the structure of the report.

The second chapter, Literature Review explains the smart factory model and the

advantages of it, the other sections consist of the concurrent solutions, the comparisons of

these concurrent solutions and finally the engineering standard used.

The third chapter, Design and Analysis consists of the proposed or selected design, which

states the various reasons of choosing the specified material and design. The other sections

include the engineering standards used, design calculations and last of all the cost analysis

(BOM).

The fourth chapter is Manufacturing Plan. It has two sections which are Manufacturing

Processes Selection where all the types of manufacturing processes are mentioned. The

other section is the Detailed Manufacturing Processes which gives full detailed

information about the manufacturing process of the project.

The fifth chapter is Product Testing Plan. It entails the verification plan of the objectives

of the project as well as the Verification plan of the applied engineering standards.

8
The sixth chapter is Results and Discussions, this chapter discusses the overall procedure

and the final results, and it discusses the standards that were used in this project and the

constraints the team faced meanwhile working on it.

The seventh chapter is Conclusion, this chapter sums up the whole procedure briefly and

illustrates the future works of the model and how it can be implemented in a better

operation.

9
CHAPTER 2 - LITERATURE REVIEW

2.1. Background Information

The term ' smart factory ' is recent to the science world, however, the concept has been

talked about in various different forms for the couple of years. Many tech companies in

recent times, have been creating smart factories for some of the world's leading

manufactures in different industries such as automotive and discrete industries for more

than a decade now.

At first, smart factories were originally designed to specifically help vehicle assembly and

manufacturing to tackle the challenges of managing ever increasing level of complexity

in assembly lines brought by huge changes and demand in customization. The

development in smart industries sector delivered real- time operational awareness and data

insights that enabled smart and effective decisions for optimal process execution,

eliminating the cost and burden of manual processes. This reduced the risk of errors and

rework which lead to increase in productivity and savings which ensured the manufactures

about safe future of smart factories.

Around 4 percent of the world’s cars are now built in a factory installed with Ubisense’s

Smart Factory but while automotive manufacturers have been the early adopters of

location-driven Smart Factory solutions, other sectors such as agricultural and military

have seen an increase in demand from manufactures. [5]

10
2.2. Concurrent Solutions

The smart factory is characterized as a factory where digital technology, smart computing

and big data combine physical production processes and operations to create a more

opportunistic system for companies that concentrate on manufacturing and supply chain

management. Industry 4.0, a new stage in the Industrial Revolution that focuses heavily

on real-time data, embedded sensors, networking, automation, and machine learning, is

an aspect of the smart factory.

The smart factory brings the fourth industrial revolution to bear by driving more intelligent

manufacturing. Some ways this can play out include:

 Using machine learning to automatically analyze data collected on equipment by

sensors and monitoring devices and find opportunities for gains in performance.

From there, the program will adjust the parameters that machines use to run,

automatically enforcing process changes.

 Using robotics solutions to deal with routine activities that previously needed

human interaction at a deeper level.

2.2.1. Deloitte Smart Factory

Deloitte Smart Factory is a pre-configured suite of cloud-based IoT software designed to

accelerate smart applications for manufacturing transitions for businesses with

manufacturing activities. Driven by AWS IoT, Deloitte developed and created a suite of

cloud software and integrated services to bring smart factory capabilities to industrial

companies. Smart Factory Fabric suite of services helps businesses boost their operating

11
efficiency and reduce costs by increasing visibility, improving production, improving

quality, and minimizing unplanned downtime associated with running a smart factory. [6]

The Smart Factory Fabric solution, built on Amazon web services (AWS), connects the

physical and digital world, leveraging a powerful technology stack:

 At the plant level, the solution can read and offer two-way communication with a

multitude of edge devices, reducing latency and getting information real-time.

 The pertinent information can be ported to the cloud layer, allowing for rich data

analysis, modeling, and cognitive processes to create insights.

 A set of applications have been designed to proactively interact with the data

insights, offering alerts, ability to transact, and most importantly, a rich user

experience.

Once integrated with your IT landscape and combined with AWS methodology, the cloud-

enabled smart manufacturing technology can activate and transform the factory to adjust

manufacturing behaviors and achieve the anticipated ROI. [7]

Deloitte's Smart Factory model offers a global design, versatile enough to handle

numerous installations as shown in Figure (2). When completely scaled, it will provide

indicators for various aspects of the company and an integrated view of the operations

required to uncover opportunities for change and make decisions across the sector. [8]

12
Figure 2 Deloitte smart factory digital journey.

2.2.2 Toyota Smart Manufacturing and Connectivity

As a leading material handling manufacturer, Toyota has proven its dominance in the field

time and time again. With more than 130,000 trucks connected on a global scale, they

were the earliest and most confident adopters of these Industry 4.0 solutions and promise

further innovation as time and technologies progress. [9]

Preventative maintenance is the ultimate goal for Toyota when it comes to connectivity,

and equipping their smart trucks with digital solutions serve as a major step towards that

goal. To begin receiving direct insights and data from their trucks, customers need only

activate an account; Toyota encourages companies to embrace these offerings by showing

how simple and painless it is. The simpler things are for everyone involved, the easier it

is for Toyota to build value-adding and long-term relationships with its customers. [10]

13
To further add value to its customers, Toyota uses the same smart trucks within its own

operations. This allows them to learn from their own needs and apply their first-hand

experience when supporting customers. Toyota strives to always be learning and

developing, sharing best practice across as many industries as possible and serving as an

inspiration for other companies considering the implementation of Industry 4.0 solutions.

[11]

Figure 3 Toyota smart production factory

2.2.3 ABB’s Smart Factory

ABB’s factory of the future at the Hanover Messe features industry-leading digital twin

technology, which makes it possible to amend and optimize manufacturing without

interrupting the production process. [12] As welding automotive parts has become more

complex in recent years, designing production around the optimal robotics path is critical

to boost weld quality and productivity. The Dassault System solution will integrate a

digital twin that complements ABB’s Robot Studio software to simulate the application

and illustrate how it can augment production by outlining the best possible robot path.

14
A key feature of the factory of the future is the sensor, which collects and feeds

information about the production process into the industrial internet. ABB has developed

a compact ABB Ability™ Smart Sensor that can be easily attached to the frame of a low-

voltage induction motor, mounted bearings and pumps to measure key parameters, such

as vibration and temperature. Using on-board algorithms, based on ABB’s decades of

expertise in electric motors, the ABB Ability™ Smart Sensor gathers information about

the equipment’s condition and sends the data via a wireless Bluetooth connection to a

secure server, from which it can be accessed through a Smartphone or tablet.

Figure 4 Digital twin in ABB's smart factory

2.3 Comparisons of the Concurrent Solutions

Table 1 : Comparison of Concurrent Solutions

Deloitte smart factory Toyota smart ABB's smart factory


manufacturing
and
productivity

Software Cloud-based and IoT Smart Smart sensor relays


software application

Connectivity Amazon web services Smart trucks Bluetooth and internet

Smart Cloud computing Tracking and Smart sensors


parts/materials tracing

15
Based on concurrent solutions mentioned above in Table 1, comparisons are made to

choose the one most suitable for our project. Our smart factory model design uses the

sensors to identify different colored products which can also prove to be beneficial while

differentiating between working and defective products, similar to the features found in

the ABB's smart factory which uses smart sensors in the process of manufacturing. Also,

to use the sensor's ability to the fullest, on-board algorithms are used to gather information

about the equipment’s condition and send the data to the server for better maintenance and

production.

2.4 Engineering Standards of the Concurrent Solutions

Standards are present in every industry. They are used to have a uniform design, methods,

processes, etc. across the world. Each industry has certain standard they follow and adhere

there product according to it.

2.4.1 ISO 10303

ISO 10303, commonly known as STEP, is an international standard designed to exchange

product data between CAD systems with a neutral data structure. The purpose of this

international standard is to provide a framework capable of representing product data

during the life cycle of a product, independent of any specific method. The design of this

definition makes it appropriate not only for neutral file exchange, but also as a basis for

the implementation and sharing of product databases and archiving. [13]

16
2.4.2 IEC 62832

A standard for digital representation and identification of assets in the factory. Today each

department inside the enterprise describes its products and production systems according

to its own data management schemes, often using different terms and structures, with no

seamless information exchange can be found between all the actors involved in the

product and production system lifecycle due to this lack of interoperability in the

information systems. This standard aims to establish guidelines for communicating the

descriptions of the objects and the exchange of information among different systems in

the organization. [14]

Figure 5 Conceptual layers of the Digital Factory Framework.

2.4.3 DIS 22400

DIS 22400 specifies key performance measures (KPIs) used in the management of

manufacturing operations. DIS 22400-2:2014 defines the number of KPIs chosen for

current practice. The KPIs are presented using their formula and corresponding

17
components, their time behavior, their unit/dimension and other characteristics. DIS

22400-2:2014 also specifies the user category to which the KPIs are used and the

development methodology to which they relate. Some of the measures defined include the

following:

 Raw materials inventory, Consumables inventory), Finished goods inventory,

Work in process inventory, Consumed material.

 Order quantity, Scrap quantity, Good quantity, Rework quantity, Produced

quantity

 Equipment production capacity, Worker efficiency, Throughput Rate, Utilization

efficiency, Overall equipment effectiveness, Availability, Effectiveness, Quality

Ratio, Technical efficiency, First pass yield, Scrap ratio, Rework ratio

 Process capability index, Inventory turns, Finished goods ratio

 Mean Operating time between failures, Time to failure, Corrective maintenance

time. [15]

2.4.4 IEEE P1872.1

This standard describes an ontology that allows the representation, reasoning and

communication of task information in the field of robotics and automation. This ontology

includes main terms as well as their descriptions, attributes, types, structures, properties,

shortcomings and relationships. It will address the way in which hierarchical planners

represent the information of the task, which will allow them to interact better between the

levels of the ontology hierarchy. [16]

18
CHAPTER 3 -DESIGN and ANALYSIS

3.1 Proposed/Selected Design

The selected model design shown in Figure (6) consists of a Scara-robotic arm which is

printed using 3D-printer using Polylactic Acid (PLA) material which is eco-friendliest

option for 3D-printers operation. This Arduino controlled smart factory model consists of

a part of a factory where a 4-Degrees of freedom with 5-Axial directions robotic arm is

used to sort out products. IR infrared sensors and color sensors are used to run the sorting

process, detect errors and malfunction. The design and assembling of each part are going

to be listed in the following sections.

Figure 6 The selected design for the model.

19
Figure 7 Selected Design

Figure 7 Breakdown structure.

3.1.1 Mechanical Components

Each model should have mechanical and electrical parts, both of mechanical and electrical

parts depends on each other to do the required task. As we see here in Table 2 is a table

that shows the mechanical components of the project and the benefit of it.

Table 2: The Mechanical Components

Mechanical Components Usage


Scara robotic arm The application of this robotic arm is pick and
place for objects for the drilling and stamping
production line.
Conveyor belt The conveyor belt is used for transporting the
material from one place to another without the
human interference.
Storages This storage acts as a temporary store for
processed parts before they are transported
along the production line.

20
3.1.2 Electrical Components

Electrical components to all intense and purposes are the most important tools that should

be available in the project, because the project cannot operate without them. All the

information, program codes, and user command are installed and being saved in the

Arduino which can operate and take control over the model to do the required tasks and

detect errors without the human interference.

Here is a table that shows all the electrical components involved in this project and the

use of them. To get better understanding while reviewing the upcoming information.

Table 3 : The Electrical Components

Electrical Components Usage

DC 12V 100 rpm gear This motor is used to rotate the wheel of the Convey belt and
Motor provide them with motion.

17HS1910 Stepper Motor A stepper motor used to provide the Scara robot with motion along
the axis.

MG996R servo motor A servo motor which is used to control the Scara gripper motion.

Arduino UNO R3 board The Arduino is used to control the motors and sensors circuit by
which the model works by getting date from the inputs, running a
code full of statements and condition and based of different
conditions sends a signal to the outputs of the circuit.

IR infrared sensor These sensors are used to detect infrared radiation in its
surrounding environment. It's used to detect objects.

21
A4988 stepper driver The A4988 is a micro stepping driver used for controlling bipolar
stepper motor.

Arduino CNC shield CNC shield is plugged onto the Arduino and on top of it is the
A4988n drivers and is used as a driver expansion board.

L298n motor driver L298n motor driver is used for driving DC and stepper motor.

Limit switches Limit switches are used to detect the presence or absence of an
objects and used to limit the travel of an object.

Color sensor Photoelectric sensor which emits light from a transmitter, and then
detects the light reflected back from the detection object with a
receiver.

The stepper, servo and DC gear motor play a big rule in this project, they convert the

electrical power from the battery source to a mechanical power which provides motion to

the conveyer belt, robotic arm. The Arduino UNO R3 acts as a control unit of the model

where all the controlling information are installed and saved. While one Arduino board

contains all the programming commands to be executed by the robotic arm and the second

Arduino control the conveyor system. Both Arduino then share information and work

together via serial communication. Finally, sensors are used to detect errors in the

production line.

22
3.1.3 Circuit Diagrams Design

A circuit is a closed loop that electrons can travel in. A source of electricity such as a

battery, which provides energy in the circuit. Unless the circuit is complete, that is, making

a full circle back to the electrical source. No electrons will move. Circuits are so important;

they can define how the project could work and operate and it acts like a map which shows

how everything must be connected to run the project successfully. In this project there are

many electrical components needs to be connected between each other.

Figure 8 Circuit diagram of the scara robotic arm

23
As shown Figure (8), the Scara-robotic arm circuit consists of 4 NEMA 17 stepper motor

and 1 servo for the control of the joints and end effector respectively. For the controlling

of the stepper motor, each stepper motor was controlled using an A4988 motor driver

connected to the top of a CNC shield paired with an Arduino UNO board which is the

brain of the Scara-robotic arm. Limit switches were connected to each axis of the robotic

arm to limit the travel motion of each joint and to define the home position. Finally, a 12V

and 4amps power supply was used to power the circuit and jumper cables were placed on

each enable pins for each axis to enable the motors.

Figure 9: Circuit diagram for the conveyor belt system


As illustrated in Figure (9), the conveyor belt system consists of DC gear motor and 2 IR

infrared sensors. The gear motor used is a 12v and 100 rpm gear motor and it is connected

to a L298N motor driver which is responsible for the enable/disable, direction of rotation

24
and rotation speed of the motor by communicating with the Arduino UNO board and based

on the values or status of the color and IR sensors connected to the Arduino signals are

sent to L298N motor driver for the controlling of the motor.

Figure 10 Color sensor simple connection.


As shown in figure (10), the TCS230 color sensor connection consist of S0, S1, S2, S3,

OUT, GND and VCC while VCC and GND are connected to 5v and ground respectively.

While S0, S1 are for setting frequency and S2, S3 are for reading the color value and

finally the OUT pin gives the output to the Arduino in the form of square waves. To start

with, frequency was set to 20% for detecting color values. And after testing the color and

taking reading from the sensor for coding purpose the color Green required the photodiode

values to be (30<R<85 & 25<G<80) while for blue values where required to be (35<B<95

& 75<G<150) which was the condition used in coding to differentiate between colors.

25
Finally this color sensor was connected via serial communication between 2 Arduino

UNO R3 controlling the robotic arm and conveyor system respectively to give data to both

of them for color sorting purposes.

3.1.4 Controlling System

Control system is one of the most important components in the whole project. Any

electrical or mechanical machine have a method to be controlled by. Either manual or

automatic. In this project the controller circuit plays a very big rule because it receives the

data from the sensors and pass it to the other components making it possible to control the

system using Arduino with Java script programing without user interference.

In this project, the smart factory model is controlled via an Arduino connected to a

computer for the programming purpose. Using Java script programming language, we are

able to control the sensors that is responsible to detect any movement in the production

line so that is can send signals which is then translated by the program and enables it to

control the status of the motors which control the conveyor belts so that machines on the

production line can proceed with their functions continuously without any human

interference.

The Arduino UNO R3 is programmed in a way that allows all the electrical components

to connect between each other. In other words, the controller is the place where all the

electrical cables are joined to control all the components in the project. The control

program is designed in a method to avoid any error or problems might face the operation

process.

26
This is possible with an Arduino because it continuously monitors the state of the input

devices and make the decisions based upon the commands stated in a program to control

the state of the output devices. This operation takes place by energizing the output pins of

the DC gear motor when sensors conditions are met while in the robotic arm case stepper

motors energize for a specific number of steps by which the desired position can be

reached and finally in the case of the servo motor when condition is met, it rotates by a

given angle.

3.1.5 Operation Mechanism

The smart factory can be viewed as a closed loop system, by which a sequence of machine

movements is controlled by an Arduino. The smart factory model consists of two conveyor

belts and a robotic arm placed in the middle for product sorting purpose. The work piece

is heading toward the robotic arm from the first conveyor belt, the moment it reaches the

robotic arm, the IR infrared sensor and the color sensor detect the work piece, and the

conveyor belt stops so that the arm pick and place operation can take place. Depending on

the color of the work piece it proceeds to either the storage or the next conveyor belt via

the robotic arm. If the object color is blue, the robotic arm will transport the work piece

to the storage. Otherwise, if the work piece is green. The robotic arm transports the work

piece to the next conveyor belt.

27
3.2 Engineering Standards

Standards for the design are as follows:

 ISO 20140-5 Automation systems and integration -- Evaluating energy efficiency


and other factors of manufacturing systems that influence the environment.

 ISO 13849 Safety of machinery -- Safety-related parts of control systems.

 ISO 8373:2012 -- Robots and robotic devices. [18]

 ISO 9283:1998 Manipulating industrial robots -- Performance criteria and related


test methods.

 IEC 61131 Programmable controllers -- Programming languages.

 ISO/TS 15066:2016 Robots and robotic devices -- Collaborative robots.

 IEC 62443 Industrial communication networks -- Network and system security -


Terminology, concepts, and models

 IEC 62061 Functional safety of electrical, electronic, and programmable


electronic control systems. [19]

28
3.3 Design Calculations

In this section, mathematical methods are used to obtain the operating analysis and

calculations for the project. Calculations are to be carried out for determining the

following:

1. Robot arm torque calculations.

2. Physical measurement properties of the robotic arm.

3. Robotic arm forward kinematics calculations.

3.3.1 Robot Arm Torque Calculations

The robot torque arm calculations is intended to help choosing the right motor for each

joint of the used robotic arm. The torque (T) required at each joint is calculated as a worst-

case scenario (lifting weight at 90 degrees). The units used for calculations is in SI units

(cm, kg).

L: length from pivot to pivot.

M: link mass.

A: Stepper or servo motor mass.

T: Torque Calculated

29
Figure 11: Explanation of the units and measurements used to calculate the torque

Table 4 : Torque calculations for the robotic arm .


L : [ CM ] M : [ KG ] A : [ KG ] T : [KG CM]

L1: 21.50 1.2 0.245 23.176

L2: 46.80 1.1 0.245 32.986

L3: 32.70 0.9 0.245 28.081

L4: 18.60 0.9 0.230 24.388

30
As shown in Table (4), these are the torque calculations for each joint of the robotic arm

which are three joints. Calculating torque for the robotic arm is important to know. Torque

is used to measure the maximum performance level of the arm and to know which and

what type of motors to choose during the manufacturing process of the project. While the

process torque is little higher than the maximum torque that the motor can generate, gears

are added in each links to increase the torque produced by the motor. The arm is in the

safe site and could operate perfectly with less amount of error. But if the process torque

exceeds the maximum amount of torque generated by the motor, failure will occur to the

system.

3.3.2 A4988 Motor Current Tuning

The A4988 stepper driver will interrupt the current to the stepper motor, it is an important

thing to set up the current when using these drivers as the motor current limit especially

when you’re using a higher input voltage than what the motor is rated for. Using a higher

voltage generally enables you to get more torque and a faster step speed, but limiting the

amount of current flowing through the motor coils so the coil does not get damaged.

The adjustment was done by calculating the current reaching to the 2 models of the stepper

motor used and then adjusting the reference voltage on the driver.

Current limit = Vref * 2

My stepper = 1.6 A

1.6 = Vref * 2

31
Vref = 1.6/2

Vref = 0.8V

Therefore, adjusting the voltage reaching the A4988 stepper driver connected to the 42mm

stepper motor model to 0.8 as shown in the Figure 13. [20]

Figure 12 Adjusting the voltage passing to the A4988 stepper driver.


While for the 28mm stepper motor model adjusting the voltage reaching the A4988
stepper driver to 0.6 V as stated in the calculations below.

Current limit = Vref * 2


My stepper = 1.2 A
1.6 = Vref * 2
Vref = 1.6/2
Vref = 0.6 V

32
3.3.3 Robotic Arm Forward Kinematics Calculation

In this section, the forward kinematics of the robotic arm is going to be explained. Forward

kinematics refers to the use of the kinematic equation of a robot to compute the position

of the end-effectors from a specified value for the joint parameters.

Figure 13 Top view


TOP view gives us:

 θ3: rotational angle of link 1, can be any value between 0° and 180°.

 L3: horizontail length of link 1.

 L4: horizontal length of link 2.

 Θ4: rotational angle of link 1, can be any value between 0° and 360°.

SIDE view gives us:

 Θ1, θ2 and θ3: The first, second and third angles, determine the angle of each arm
from the home position.

33
 .L1, L2: The length of the arms.

 .d1: The distance between the base of the robot and the top end of the robot.

 d2: the distance from fourth joint and the end effector

Figure 14 Side View

34
Table 5 DH Parameters Table
# θi di ai αi

1 θ1 d1 0 0

2 θ3 0 L1 0

3 θ4 0 L2-L3 0

4 0 d2 0 0

𝑐𝑜𝑠𝜃1 −𝑠𝑖𝑛𝜃2 0 0 𝑐𝑜𝑠𝜃3 −𝑠𝑖𝑛𝜃3 0 𝐿1𝑐𝑜𝑠𝜃3


sin 𝜃1 𝑐𝑜𝑠𝜃1 0 0 sin 𝜃3 𝑐𝑜𝑠𝜃3 0 𝐿1𝑠𝑖𝑛𝜃3
𝐴1 = [ ] 𝐴2 = [ ]
0 0 1 𝑑1 0 0 1 0
0 0 0 1 0 0 0 1

𝑐𝑜𝑠𝜃4 −𝑠𝑖𝑛𝜃4 0 (𝐿2 − 𝐿3)𝑐𝑜𝑠𝜃4 1 0 0 0


𝐴3 = [sin 𝜃4 𝑐𝑜𝑠𝜃4 0 (𝐿2 − 𝐿3)𝑠𝑖𝑛𝜃4 ] 𝐴4 = [0 1 0 0
]
0 0 1 0 0 0 1 𝑑2
0 0 0 1 0 0 0 1

T1 = A1*A2*A3*A4

35
3.4 Cost Analysis

Table 6 Capital investment

Quantity Unit price Total

Screw drivers set 1 $3.27 $3.27

Multimeter 1 $9.53 $9.53

Soldiering gun 1 $8.17 $8.17

Table 7 Cost analysis

ITEM QUANTITY NAME SOURCE COST PICTURE

1 2 King Lan Electric Amazon.com 20.2$/


Motor 12V DC
Geared Motor High Location:Washington,United Piece
Torque Gear States
Reducer Motor –
125RPM
Tel: 1-888-280-4331

Email:ecr-
[email protected]

2 1 MG996R servo Amazon.com 9.53$/


motor Piece
Location: Washington, United
States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

36
3* 8 A4988 Stepper Banggood LLPC 2.72$/
Motor Driver
Location: China Piece

Tel:+00852-35903678

Email:[email protected]
m

4 4 Arduino UNO R3 eBay inc 10.89$/


Piece
Location: USA - California

Tel:1-866-540-3229

Email:[email protected]
om

5 1 TCS3200 Color Banggood LLPC 8.17$/


Sensor Color
Recognition Location: China Piece

Tel:+00852-35903678

Email:[email protected]
m

6* 2 Arduino CNC Amazon.com 5.45$/


shield v3
Location: Washington, United Piece
States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

37
7 4 Nema17 Stepper Amazon.com 14.97$/
Motor 42mm 1.68A Piece
Location: Washington, United
States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

8* 2 L298n motor driver Amazon.com 5.00$/

Location: Washington, United Piece


States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

9* 2 12V 4amp power Amazon.com 9.80$/


supply
Location: Washington, United Piece
States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

10 10 Micro limit Amazon.com 0.85$/


switches
Location: Washington, United Piece
States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

38
11 6 Geekcreit® IR Amazon.com 2.72$/
Infrared Obstacle
Avoidance Sensor Location: Washington, United Piece
States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

12 12 Radial ball bearing Amazon.com 1.40$/


8x22x7mm
Location: Washington, United Piece
States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

13 4 Linear bearings Amazon.com 5.44$/


10mm
Location: Washington, United Piece
States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

14 2 Thrust ball bearing Amazon.com 5.44$/


40x60x13mm
Location: Washington, United Piece
States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

39
15 4 Thrust ball bearing Amazon.com 5.00$/
35x52x12mm
Location: Washington, United Piece
States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

16 1 Lead screw – 8mm Amazon.com 10.89$/


400mm Piece
Location: Washington, United
States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

17 4 Smooth rod shaft – Amazon.com 7.00$/


10mm 400mm
Location: Washington, United Piece
States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

18 1 Stepper motor Amazon.com 5.44$/


coupler 5mm to
8mm Location: Washington,United Piece
States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

40
19 5 GT2 Idler Pulley 20 Amazon.com 2.60$
Teeth Aluminum
5mm Bore 6mm Location:Washington,United /Piece
Width Timing Belt States
Pulley Wheel

Tel: 1-888-280-4331

Email:ecr-
[email protected]

18 1 Hybrid Ceramic Amazon.com 5.44$/


Bearing 35*47*7
mm Location:Washington,United Piece
States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

19 2 Hybrid Ceramic Amazon.com 5.44$/


Bearing 30*45*7
mm Location:Washington,United Piece
States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

20 2 GT2 Closed Loop Amazon.com 3.90$


Timing Belt Rubber
6mm 400 mm Location:Washington,United /Piece
Synchronous Belt States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

41
21 2 GT2 Closed Loop Amazon.com 3.80$
Timing Belt Rubber
6mm 300 mm Location:Washington,United /Piece
Synchronous Belt States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

22 1 GT2 Closed Loop Amazon.com 2.18$/


Timing Belt Rubber
6mm 200 mm Location:Washington,United Piece
Synchronous Belt States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

23* 1 Various lengths M3, Amazon.com 20.00$/


M4 and M5 bolts Piece
and nuts Location:Washington,United
States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

24* 2 Mounted bracket for Amazon.com 5.45$/


motor
Location:Washington,United Piece
States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

42
25 2 Motor coupler 4mm Amazon.com 4.90$/

Location:Washington,United Piece
States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

26 1 Leather sheet Amazon.com 10.89$/


100*70cm Piece
Location:Washington,United
States

Tel: 1-888-280-4331

Email:ecr-
[email protected]

Total price 460.88$

(*); Not included in the drawings.

43
CHAPTER 4 – MANUFACTURING PLAN

4.1 Manufacturing Process Selection

The project collaborative Smart Factory Model was mainly produced with the aid of 3D

printing machine and other simple assembly processes. 3D printing is a method of

manufacturing known as ‘Additive manufacturing’, since instead of removing material to

create a part the process, it adds material in successive patterns to create the desired shape.

The uses of 3D printing in the model are:

 The links of the robotic arm.

 Couplers and gears for each joint of the robotic arm.

 The attached gripper of the robotic arm.

 Coupler connection for the conveyor belts.

CAD programs such as Solidworks, and coding language like G-Coding were used to slice

the 3D part into layers, each layer has a thickness of 1mm with a filling of 30%, then it

will be traced onto the build plate by the printer and once the pattern is completed the

build plate is lowered and the next layer is added on top of the previous one.

44
Typical manufacturing techniques are known as ‘Subtractive Manufacturing’ because it

is a process by which 3D objects are constructed by successively cutting material away

from a solid block of material. Milling and cutting are also subtractive manufacturing

techniques. Subtractive Manufacturing process creates a lot of waste since; the material

that is cut off generally cannot be used for anything else and is simply sent out as scrap.

3D Printing eliminates such waste since the material is placed in the location that it is

needed only, the rest will be left out as empty space.

Figure 15 Creality 3D CR-10 S5 3D Printer

The machine used was Creality 3D CR-10 S5 3D Printer. Such printer was selected due

to many features in it, it features large printing size, filament detector which avoids any

printing interrupts, and double motor screw which increases the printing accuracy. The

Creality CR-10 S5 is a 3D-printer manufactured by Lux watts shown in Figure (15). [21]

The machine uses the material various materials such as PLA, ABS, PETG, and PVA and

has a maximum resolution of 0.1mm. The printer uses the fused deposition modeling

(FDM) single extruder, and a Bowden drive.

45
The printing is controlled via the program Simplify3D, which prepares the parts for

production after it has been exported from Solid Work as STL File, and then converted

into G-Code. This can be done by using the default settings or by editing the parameters

to achieve a desired result. Through the program used we may edit the resolution which

directly effects our product quality which is as well proportional to time consumption.

This will be done for the production of the robotic arm parts and will be assembled using

screws as this allows dismantling if a small part of the arm gets damaged. By 3D printing,

the design objectives can be met.

The tensile strength of the given materials is:

 PLA: 37 MPa
 ABS: 27 MPa
 PETG: 35.7 MPa
 PVA: 10 MPa
 The melting point of the given materials is:
 PLA: 180º - 220º C
 ABS: 105º C
 PETG: 160º C
 PVA: 200º C
The water absorption of the given materials after 24 hours is:

 PLA: 23%
 ABS: 30%
 PETG: slight
 PVA: very high

46
The cost of the given materials is:

 PLA: 0.63 $/Kg


 ABS: 0.65 $/Kg
 PETG: 0.56 $/Kg
 PVA: 0.37 $/Kg
Table 8 Manufacturing process selection

10 → highest Polylactic Acid Acrylonitrile Polyethylene Poly(vinyl alcohol)


1 → lowest (PLA) Butadiene Styrene terephthalate (PVA)
(ABS) glycol-modified
(PETG)
Strength 10 6 8 2
Cost 5 6 7 9
Heat resistance 9 3 6 7
Water resistance 6 5 9 2
Reliability 8 7 8 6
Safety 9 6 7 4
SUM 47 33 45 30

Other than 3D printing, other processes were carried out to manufacture other parts of the

model such as the conveyor built. Such parts were done by wood-crafting process

assembled using screws, bearings, and tools in the department workshop.

47
4.2. Detailed Manufacturing Process

As some of the parts were bought such as bearings, rods, and screws while most of the

work was 3D printed and handmade such as conveyor belts and the small storage also

bearings will be added to the rollers to perform a smoother movement to the conveyor

belts.

As for the robotic arm, the shoulder is put above the base and secured together using bolts

and nuts. A turning movement was achieved by adding the gears and attaching them to

the motor using belts and couplers. To achieve a smooth movement bearings were placed

in between each joint. Smooth and threaded rods were manufactured using milling and

turning machine. All linking related to the robotic arm is done by M3, M4, M5, and M8

bolts. By drilling holes and links to the gripper allows its wires and cables to be connected

to the motor box and the Arduino board. As for the Z-axis stainless-steel rods were used

in order to assure the stability of the arm and to smooth the movement along the Z-axis

direction. Stainless-steel rods were manufactured using turning machine in a workshop

followed by a grinding machine to achieve a better surface finishing and make the surface

of the rods smooth enough while moving along with the bearings.

48
CHAPTER 5 - PRODUCT TESTING PLAN

This chapter aims to discuss whether the objectives of this project were on point.

Moreover, a method of testing will be followed for the objectives to be met will be

developed. Lastly, this chapter aims to verify whether applied standards came to

expectations throughout this project.

5.1 Verification Plan of the Objectives of the Project

Several tests will be conducted to validate the compatibility of the model to the objectives

of the design and ensure that the requirements and user expectations are met. The user has

then to decide whether the model can perform a particular task, whether enough

information exists to program this factory model.

 The main objective of the smart factory model is to be able to receive an item and

be able to carry out the instructions needed by itself and be self-learning. This will

be tested by inserting items to the smart factory model. After that we will be able

to conserve the movement of the conveyer belts leading to the color sensor

followed by an IR sensor right before reaching the robotic arm. This is where half

of the real test is. As we will be testing if the sensor can detect faulty objects or

not. After that the process would be testing the robotic arm as we will conduct if

it can carry the object easily and freely around to move it from one conveyer belt

to the other or to the faulty storage depending on the information given by the

49
color sensor on either if the object is faulty and will go to faulty storage or the

pickup storage and sent to delivery.

 As for another testing method for the robotic arm, simulation using ROBODK is

done. The objective of this simulation was to theoretically test if the robotic arm

and color sensor will be able to function as wanted. In this simulation a source is

added to add items at random with objects being either faulty or good based on

what could happen the test would see if the color sensor will give the robotic arm

the correct instructions to place the objects in the correct conveyer depending on

their condition. In the simulation shown in Figure (18) the conveyers are used as

processors as with the sensor they would allow to give the same output/ doing the

same task.

Figure 16 the RoboDK simulation that was used to do the testing.

50
5.2 Verification Plan of the Applied Engineering Standards

To verify the testing standards for the smart factory, these specific standards were

followed:

ISO 20140-5

Automation systems and integration -- Evaluating energy efficiency and other factors of
manufacturing systems that influence the environment. [18] This standard was included
so that the model can run on low power supply with a good efficiency.

ISO 13849

Safety of machinery -- Safety-related parts of control systems. The model has no human
interaction during the process of working, with the material used (PLA) to assure the
safety and to avoid any type of pollution. No critical speed was used in the robotic arm
and conveyor belts.

ISO 8373:2012

This standard defines the terms used in relation with robots and robotic devices operating
in both industrial and non-industrial environments. [18] This standard is followed by the
concept of our project as it is reprogrammable and it could have multi-purposes and good
work under complete autonomy, which was proven in the model testing.

51
ISO 9283:1998

It is intended to facilitate understanding between users and manufacturers of robots and


robot systems. As our model has the ability to repeat processes in multi-directional pose
and distance accuracy (robotic arm movement). The model has exchangeability of moving
the object from one conveyor belt to the other.

ISO/TS 15066:2016

It specifies safety requirements for collaborative industrial robot systems and the work
environment and supplements the requirements and guidance on collaborative industrial
robot operation given in ISO 10218-1 and ISO 10218-2. [18] The model can process on a
workshop desk performing with less safety precautions needed doing human-like actions.

IEC 62443

The standard sets forth security capabilities that enable a component to mitigate threats
for a given security level without the assistance of compensating countermeasures. [19]
In Arduino coding the robotic arm is given limits to its speed and directional movements
to its respective joints, as well as for the conveyor belts are given discrete average speed
which cannot cause any damage.

IEC 62061

This standard describes the implementation of safety-related electrical control


systems on machinery and examines the overall lifecycle from the concept phase through
to decommissioning. Arduino board is put in a box in order to prevent any climate change
that can damage/affect the Arduino board. As for the robotic arm cables they are connected
from the inside, disconnecting any external communication which extends its life
expectancy.

52
CHAPTER 6 - RESULTS AND DISCUSSIONS

6.1. The Results

Starting with the assembly procedure the 3D printed parts were printed successfully except

for some holes in the Z-axis were not as accurate as required which caused some noise

while moving the arm along the Z-axis. However, sand paper was used in order to increase

the holes diameter therefore, the noise was reduced. Other than that bearings, gears, and

belts in each joint were connected perfectly resulting an efficient motion. As for the

conveyor belts, the couplers required two trials since the first trial resulted an error in the

diameters which caused a break in the coupler. However, the second trial the design was

changed which gave the coupler a strong withstand torque created by the motor.

The initial plan was to use PLC however, due to limited financial budget PLC was

replaced with an Arduino which was more complicated but cheaper cost-wise. Working

with Arduino was difficult in the beginning since the first supplier gave a faulty piece of

Arduino, however after changing the supplier and connecting the Arduino to the motor

controller the procedure went smoothly.

As for the testing method two tests were conducted. Firstly a test was done through

simulation software RoboDK. Using the exact robot and degrees of freedom we were able

to simulate the movement of the robotic arm when moving a blue or green object from

and to conveyor belts and storage. Arm movement simulation code was written in Matlab

53
and the objects that were tested in the simulation had the same size, weight, and properties

all in all relative to the real life tested objects.

Second test was to check the flexibility of the whole model together, to do that a timer

was set before the object was placed on the conveyor belt to calculate the timing in seconds

needed for the blue object to reach the storage and the green to be transported and reach

end of the other conveyor belt. Results are as shown in Table (9).

Table 9 flexibility test reults

# Of trials Object’s color Time in seconds (s)

Trial #1 Green 30

Blue 22

Trial #2 Green 26

Blue 18

6.2. The Engineering Standards

As mentioned in the previous sections, NFPA 70E was followed throughout the project to

ensure safety while working with electricity and mechanical equipment. Also, isolated

gloves and safety goggles were used to satisfy this standard to maximum level. In addition

to that, ISO 8373:2012 standard, which defines the manufacturing of a robotic arm was

used which completely satisfied the requirements of the standard.

54
6.3. The Constraints

Throughout the project, several constraints were faced:

 Economic: Due to limited financial budget, different parts of the project were

compromised in order to be in the budget range.

 Availability: Due to the on-going pandemic, many parts of the project were hard

to find locally. While delivery from aboard faced many huddles due to delay in

shipments.

 Politics: Majority of parts of the project were purchased online. However, due to

political complications about location of the country, issues were faced during the

purchasing which increased the delivery cost since, orders went through customs

regulations at Turkey as well.

 Safety : All safety standards and precautions were taken very seriously during the

project especially while using mechanical workshop equipment’s (i.e. drilling,

welding machines)

 Environmental: To ensure safe and clean environment, all waste produced during

the project was carefully collected and processed as advised.

55
CHAPTER 7 - CONCLUSION AND FUTURE WORKS

7.1 Conclusion

In the current industrial age, smart manufacturing systems have played an important and

evolving role in the implementation of smart manufacturing technology. The main aim of

smart manufacturing technology is to improve the operational efficiency, productivity and

has great impact in the global economy. The main objectives of this project was to show

reliability and robustness of the system to withstand rough industrial conditions, less error,

higher quality and increased speed in production level with taking safety factor in

consideration. The objectives was achieved successfully while implementing a smart

factory model consisting of a robotic-arm performing a pick-and-place operation through

two conveyor belts using a color sorting system.

Additionally, it can be mentioned that the Arduino used in our model is the brain of the

control system as it connects the input-output systems together. Arduino is an echo system

which allows for rapid development and gives us complete control as the software of

the Arduino is well-suited with our operation system.

7.2 Future Works

The Arduino and robotic arm used in this model can be modified and updated to the newer

versions. It can also be mentioned that the current model contains conveyor belts made

out of wood, the material can be changed to metal to achieve more stability and reliability.

56
In addition, instead of using only one robotic arm in the model, multiple robotic arms can

be used to pick and place the objects which can be helpful in speeding the process and

also to, expand the project to even more automated system with further more complexity.

It can also be mentioned that the current Arduino used is an Arduino UNO R3 board which

can be replaced with Arduino MEGA that can be used instead of 2 Arduino systems in the

project that will add more digital and analog pins which allows us to run the system fully

on one Arduino board.

As for the robotic arm some improvements can be implemented, the length of joint 2 and

joint 3 links can be shortened since the current length causes a high percentage of shear

stress. Smaller motors can be used in order to reduce the weight of the arm, therefore, the

moment of the arm will be reduced.

57
REFERENCES

[1] Admin. (2019, May 9). What is a Smart Factory and its Role in Manufacturing?

Retrieved from https://abas-erp.com/en/news/smart-factory-

manufacturing#:%7E:text=The%20smart%20factory%20is%20defined,manufact

uring%20and%20supply%20chain%20management

[2] Admin (n.d). Smart Manufacturing And Smart Industry in Context.

Retrieved from https://www.i-scoop.eu/industry-4-0/manufacturing-industry/

[3] Margaret Rouse. (2019, April). Smart Factory. Techtarget. Retrieved from

https://searcherp.techtarget.com/definition/smart-factory

[4] Fei Tao. (2019). Digital twin and big data. Science direct. Retrieved from

https://www.sciencedirect.com/topics/engineering/smart-manufacturing

[5] Nell Walker. (2017). Past present and future of smart factories. Manufacturing

Global. Retrieved from https://www.manufacturingglobal.com/technology/past-

present-and-future-smart-factories

[6] AWS. (2020, July). Deloitte Smart Factory Fabric Solution. Aws Amazon.

Retrieved from https://aws.amazon.com/iot/solutions/DeloitteSFF/

58
[7] Channy Yun. (2020, December 15). Transform your Business with AWS IoT (1:42).

Amazon Web Services, Inc. Retrieved from

https://aws.amazon.com/iot/?nc=sn&loc=1https://orca.cf.ac.uk/125573/1/Yuqian

%20-%20Conference%20-

%20Standards%20for%20Smart%20Manufacturing%20-%20A%20review.pdf

[8] Harald Prof. (n.d). The Deloitte Smart Factory experience.

Retrieved from https://www2.deloitte.com/global/en/pages/energy-and-

resources/articles/deloitte-smart-factories.html

[9] The Leadership Network®. (2020, July 28). How Toyota Helps Customers Turn

Information into Insights. Retrieved from

https://theleadershipnetwork.com/article/connectivity-at-toyota

[10] Toyota production system. (2016). Toyota Forklifts. Retrieved from https://toyota-

forklifts.eu/about-toyota/toyota-production-system/

[11] Toyota Production System. (2017). Global Toyota. Retrieved from

https://global.toyota/en/company/vision-and-philosophy/production-system/

[12] Group article. (2019, April 01). Smart production meets digital twin in ABB’s

factory of the future. Retrieved from

https://new.abb.com/news/detail/18462/smart-production-meets-digital-twin-in-

abbs-factory-of-the-future

59
[13] Leiva, C. (2020, November 02). For Smart Manufacturing – Integration Standards

are a must... IBASEt. Retrieved from https://www.ibaset.com/blog/smart-

manufacturing-integration-standards-opc-ua-step-oagis-isa95/

[14] Admin. (2015, June 21). Conceptual layers of the Digital Factory Framework.

[Illustration]. Retrieved from https://www.ibaset.com/smart-manufacturing-

integration-standards-opc-ua-step-oagis-isa95/

[15] IEEE. (2017, April 01). Towards Industry 4.0: Gap Analysis between Current

Automotive MES and Industry Standards Using Model-Based Requirement

Engineering - IEEE Conference Publication. Ieeexplore. Retrieved from

https://ieeexplore.ieee.org/abstract/document/7958432?casa_token=m17RsAMC

qZMAAAAA:I2oMJV95dQ9DVEdGz7owrgMHqoJEca6M4XB5MCVkevQrZu

87UDVRBC0zRkzLabjuBGg4mLi014M

[16] IEEE SA Search. (n.d.). Standards IEEE. Retrieved from

https://standards.ieee.org/search-results.html?q=smart%20factory

[17] Dejan. (2020, October 02). How To Build Your Own Arduino Based Robot.

Retrieved from https://howtomechatronics.com/projects/scara-robot-how-to-

build-your-own-arduino-based-robot/

[18] ISO Engineering standards. (n.d). Retrieved from

https://www.iso.org/search.html?q=design%20iso&hPP=10&idx=all_en&p=0&h

FR%5Bcategory%5D%5B0%5D=standard

60
[19] IEC (n.d). Retrieved from

https://www.iec.ch/global/search?keyword=IEC%2061131#gsc.tab=0&gsc.q=IE

C%2061131

[20] Admin. (2021). Control Stepper Motor with A4988 Driver Module & Arduino.

Retrieved from https://lastminuteengineers.com/a4988-stepper-motor-driver-

arduino-tutorial/

[21] Admin (n.d) Creality 3D CR-10 S5 3D Retrieved from

https://creality3d.shop/?gclid=Cj0KCQjwweyFBhDvARIsAA67M70xVLlTMBDDswT

ZXmYPsNbE-2wTRuv3RjUaQ68-cTJnbvPrPMkTFRYaAgB0EALw_wcB

[22] ISO/ASTM 52921:2013. (2018, July 10). Retrieved from

https://www.iso.org/standard/62794.html

[23] ISO/ASTM 52915:2013. (2016, February 12). Retrieved from

https://www.iso.org/standard/6194-4.html

[24] ISO/TS 15066:2016. (2016, February 04). Retrieved from

https://www.iso.org/standard/629-96.html

[25] ISO 8373:2012. (2017, June 27). Retrieved from

https://www.iso.org/standard/55890.html?-browse=tc

61
APPENDIX A: Electronic Media

Figure 17 Poster of the project.

62
APPENDIX B: Constraints

Economic Constraints: The aim is to balance cost budget, time and quality during the

design and production of the project. The design is limited by the funding, since the

project is carried out by the students’, the available funds are truly short and this in return

limits the choice of materials and process selection.

Manufacturability: The manufacturing process greatly limits this design, as the only

manufacturing processes available are those in the workshop of mechanical engineering

department of the university, which creates limited processes only. Some belts were

difficult to find in local/international shops since it required a very specific size. Add on

that, the process of 3D printing took a large amount of time which was time consuming

and some 3D printed parts lacked of accuracy.

Assembly: Some of the wires were difficult to manage which made the process more

complex. The size of the screws made the process difficult to assemble since some parts

of the 3D printing were unreachable.

63
APPENDIX C: Standards

ISO/ASTM 52921:2013 includes terms, definitions, nomenclature, and acronyms

associated with coordinate systems and testing methodologies for additive manufacturing

(AM) technologies in an effort to standardize terminology used by AM users, producers,

researchers, educators, press/media, and others, particularly when reporting results from

testing of parts made on AM systems. Terms included cover definitions for

machines/systems and their coordinate systems plus the location and orientation of parts.

[22]

ISO/ASTM 52915:2013 describes a framework for an interchange format to address the

current and future needs of additive manufacturing technology. For the last three decades,

the STL file format has been the industry standard for transferring information between

design programs and additive manufacturing equipment. An STL file contains information

only about a surface mesh and has no provisions for representing color, texture, material,

substructure, and other properties of the fabricated target object. As additive

manufacturing technology is quickly evolving from producing primarily single-material,

homogenous shapes to producing multi material geometries in full color with functionally

graded materials and microstructures, there is a growing need for a standard interchange

file format that can support these features. [23]

64
ISO/TS 15066:2016 specifies safety requirements for collaborative industrial robot

systems and the work environment, and supplements the requirements and guidance on

collaborative industrial robot operation given in ISO 10218-1 and ISO 10218-2. [24] It

does not apply to non- industrial robots, although the safety principles presented can be

useful to other areas of robotics

ISO 8373:2012 defines terms used in relation with robots and robotic devices operating

in both industrial and non-industrial environments. [25]

ISO128 – International Technical Drawing Standards

ISO14001 – Environment Management System

IEC61969 – Mechanical Structures for electrical electronic equipment. This standard

determines to operate the system of the hydraulic press within safe procedure and

techniques used to prevent any damage to machinery and surrounding of the operator. [18]

ISO 286-1 This standard is used for tolerance grades used in the drawings.

65
APPENDIX D: Project Plan

Table 10 Logbook

Day/Month/Year Description of the work


05/10/20 Started with research for t h e project individually.

10/10/20 Meeting with supervisor to discuss about the selected


design.

11/10/20 Team meeting to discuss the report and divide the work.

19/11/20 Revision of the proposed design.

01/12/20 Review of chapter 1 and chapter 2. Started work on the


initial design.

02/12/20 Meeting with the team members. Chapter 3 finished.

10/12/20 Discussion on parts of the project available in the market.


Chapter 4 and 5 started.

14/12/20 Worked on appendixes, table of contents, etc.

16/12/20 Team meeting to discuss the progress and improvements.

22/12/20 Review of the design and calculations.

29/12/20 Improvised chapter 4 and chapter 5.

66
02/01/21 Corrections of report and checked for plagiarism

04/01/21 Finalizing the report and submission.

10/02/21 Capstone 1 report reviewed and discussion over the design.

20/02/21 Components of the project checked online and 3d printing


started.

04/03/21 Panel assembly started.

12/03/21 Mechanical work on the conveyors.

20/03/21 Wiring work started.

01/04/21 Wiring work finished and damaged parts 3d printed again.

10/04/21 Testing of robotic arm.

21/04/21 Testing of sensors and conveyor belts.

02/05/21 Testing of complete system and discussion.

12/05/21 Debugging the problems found in the system.

15/05/21 Discussion on chapter 6 and 7 of the report.

22/05/21 Changes and addition in report.

30/05/21 Final review meeting on the report and discussion on the


presentation.

31/05/21 Finalizing the report.

67
10/13/2020 10/16/2020 10/22/2020 10/29/2020 11/8/2020 11/11/2020 11/20/2020 12/13/2020 12/20/2020 12/26/2020 12/30/2020 1/6/2021 1/10/2021 1/13/2021

PLAN PLAN END Graph Graph PERCENT


Tasks PLAN START
DURATION START duration COMPLETE PERIODS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60

SMART FACTORY MODEL


5/10/2020 246 7/6/2021

Literature review 4 100%


1
Research about the project and assigning tasks 4 100%
10/10/2020 12/10/2020 5
Discussion over the proposed design. 4 100%
22/10/2020 5 26/10/2020 9
Discussion about pros and cons of concurrent solution
20/10/2020 21/10/2020
4 100%

Design and Analysis 4 100%


10/2/2020 8 11/7/2020 13
Defining the design and components needed 4 100%
11/8/2020 40 11/10/2020 17
Research about components needed for 3D printing 4 100%
11/11/2020 5 11/11/2020 21
Research and discussion on available parts in market
10/12/2020 4 5/1/2021
100%

Parts selection and update on design


20/02/2021 1/3/2021
4 100%

Mechanical work on conveyors and wiring setup 4 100%


12/3/2021 10 1/4/2021 25
Panel assembly 4 100%
4/3/2021 5 06/04/202 29
3D printing of damaged parts and overall assembly 4 100%
20/02/2021 5 12/5/2021 33
Manufacturing 4 100%

Assembly and trails of the system 4 100%


05/052021 3 12/29/2021 37
Electrical wiring of the project 4 100%
20/03/2021 6 1/5/2021 41
Work on the simulations
8/5/2021 20/05/2021
4 100%

Testing the components of the system 4 100%


2/5/2021 3 20/5/2021 45
PRODUCT TESTING PLAN 100%

Testing the robotic arm 4 100%


10/4/2021 3 1/6/2021 53
Testing of the conveyor belts and sensors 100%
21/04/2021 12/5/2021
Testing o f complete system and discussion 100%
2/5/2021 12/5/2021

Figure 18 Gantt chart.

68
APPENDIX E: ENGINEERING DRAWINGS

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
APPENDIX F: CODES

The following code is for the Scara robotic-arm:


#include <AccelStepper.h>

#include <Servo.h>

#define limitSwitchZ 11
#define limitSwitchY 10
#define limitSwitchX 9
#define limitSwitchA A3

AccelStepper stepperX (1, 2, 5);


AccelStepper stepperY(1, 3, 6);
AccelStepper stepperZ(1, 4, 7);
AccelStepper stepperA(1, 12, 13);

Servo gripperServo;

long initial_homingX=1;
long initial_homingY=1;
long initial_homingZ=1;
long initial_homingA=1;
int pooos=0;

void setup() {
Serial.begin(9600);
pinMode(A1,INPUT);
pinMode(A2,INPUT);
pinMode(limitSwitchX, INPUT_PULLUP);
pinMode(limitSwitchY, INPUT_PULLUP);
pinMode(limitSwitchZ, INPUT_PULLUP);
pinMode(limitSwitchA, INPUT_PULLUP);

stepperX.setMaxSpeed(500);
stepperX.setAcceleration(250);
stepperY.setMaxSpeed(1200);
stepperY.setAcceleration(500);
stepperZ.setMaxSpeed(500);
stepperZ.setAcceleration(250);
stepperA.setMaxSpeed(1500);

126
stepperA.setAcceleration(500);
gripperServo.attach(A0);

gripperServo.write(40);

delay(1000);
homing();
}

void loop() {
while(digitalRead(A2)== 0){
delay(1000);

while(digitalRead(A2)== 0){
movement2();
}
}
while(digitalRead(A1)== 0){
movement1();
}

}
void homing(){
//homing stepperA
Serial.print("stepperA is homing...");
while (digitalRead(limitSwitchA) != 1) {
stepperA.moveTo(initial_homingA);
initial_homingA++;
stepperA.run();
delay(0.5);
}
stepperA.setCurrentPosition(0);
stepperA.setMaxSpeed(1500);
stepperA.setAcceleration(500);
initial_homingA=-1;

while (digitalRead(limitSwitchA)== 1) {
stepperA.moveTo(initial_homingA);
stepperA.run();
initial_homingA--;
delay(0.5);
}
stepperA.setCurrentPosition(0);
Serial.print("homing stepperA completed");
stepperA.setMaxSpeed(1500);
stepperA.setAcceleration(500);

127
//homing stepperZ
Serial.print("stepperZ is homing...");

stepperZ.setCurrentPosition(0);

//homing stepperY
Serial.print("stepperY is homing...");
while (digitalRead(limitSwitchY)!= 1) {
stepperY.moveTo(initial_homingY);
initial_homingY++;
stepperY.run();
delay(0.5);
}
stepperY.setCurrentPosition(0);
stepperY.setMaxSpeed(500);
stepperY.setAcceleration(500);
initial_homingY=-1;

while (digitalRead(limitSwitchY)==1) {
stepperY.moveTo(initial_homingY);
stepperY.run();
initial_homingY--;
delay(0.5);
}
stepperY.setCurrentPosition(0);
Serial.print("homing stepperY completed");
stepperY.setMaxSpeed(1000);
stepperY.setAcceleration(500);

//homing stepperX
Serial.print("stepperX is homing...");
while (digitalRead(limitSwitchX)!= 1) {
stepperX.moveTo(initial_homingX);
initial_homingX++;
stepperX.run();
delay(0.5);
}
stepperX.setCurrentPosition(0);
stepperX.setMaxSpeed(500);
stepperX.setAcceleration(500);
initial_homingX=-1;

while (digitalRead(limitSwitchX)==1) {
stepperX.moveTo(initial_homingX);
stepperX.run();
initial_homingX--;
128
delay(0.5);
}
stepperX.setCurrentPosition(0);
Serial.print("homing stepperX completed");
stepperX.setMaxSpeed(500);
stepperX.setAcceleration(500);

void movement1(){
stepperX.setMaxSpeed(500);
stepperX.setAcceleration(250);
stepperY.setMaxSpeed(1200);
stepperY.setAcceleration(500);
stepperZ.setMaxSpeed(500);
stepperZ.setAcceleration(250);
stepperA.setMaxSpeed(1600);
stepperA.setAcceleration(630);

stepperA.moveTo(-2000);
stepperY.moveTo(-1910);
stepperX.moveTo(-1240);

while((stepperA.currentPosition() != -2000 || stepperY.currentPosition() != -1910 ||


stepperX.currentPosition() != -1240 )){
stepperA.run();
stepperY.run();
stepperX.run();
}
stepperA.moveTo(-2820);
while((stepperA.currentPosition() != -2820)){
stepperA.run();
}

if(stepperA.currentPosition() == -2820 && stepperY.currentPosition() == -1910 &&


stepperX.currentPosition() == -1240){
gripperServo.write(145);
}
delay(1500);
stepperA.moveTo(-2000);
while((stepperA.currentPosition() != -2000)){
stepperA.run();
}

stepperX.setMaxSpeed(500);
stepperX.setAcceleration(250);
129
stepperY.setMaxSpeed(1200);
stepperY.setAcceleration(500);
stepperZ.setMaxSpeed(500);
stepperZ.setAcceleration(250);
stepperA.setMaxSpeed(1500);
stepperA.setAcceleration(500);

stepperA.moveTo(-2000);
stepperY.moveTo(-1400);
stepperX.moveTo(-880);

while((stepperA.currentPosition() != -2000 || stepperY.currentPosition() != -1400 ||


stepperX.currentPosition() != -880 )){
stepperA.run();
stepperY.run();
stepperX.run();
stepperZ.run();
}
stepperA.moveTo(-2800);
while((stepperA.currentPosition() != -2800)){
stepperA.run();
}
if(stepperA.currentPosition() == -2800 && stepperY.currentPosition() == -1400 &&
stepperX.currentPosition() == -880){
gripperServo.write(40);
}
delay(1000);
stepperA.moveTo(-1500);
while((stepperA.currentPosition() != -1500)){
stepperA.run();

}
}

void movement2(){
stepperX.setMaxSpeed(500);
stepperX.setAcceleration(250);
stepperY.setMaxSpeed(1200);
stepperY.setAcceleration(500);
stepperZ.setMaxSpeed(500);
stepperZ.setAcceleration(250);
stepperA.setMaxSpeed(1600);
stepperA.setAcceleration(630);

stepperA.moveTo(-2000);
stepperY.moveTo(-1610);
130
stepperX.moveTo(-1390);

while((stepperA.currentPosition() != -2000 || stepperY.currentPosition() != -1610 ||


stepperX.currentPosition() != -1390 )){
stepperA.run();
stepperY.run();
stepperX.run();
}
stepperA.moveTo(-2825);
while((stepperA.currentPosition() != -2825)){
stepperA.run();
}

if(stepperA.currentPosition() == -2825 && stepperY.currentPosition() == -1610 &&


stepperX.currentPosition() == -1390){
gripperServo.write(140);
}
stepperA.moveTo(-2000);
while((stepperA.currentPosition() != -2000)){
stepperA.run();
}

stepperX.setMaxSpeed(700);
stepperX.setAcceleration(350);
stepperY.setMaxSpeed(1200);
stepperY.setAcceleration(500);
stepperZ.setMaxSpeed(500);
stepperZ.setAcceleration(250);
stepperA.setMaxSpeed(1500);
stepperA.setAcceleration(500);

stepperA.moveTo(-2000);
stepperY.moveTo(-450);
stepperX.moveTo(-150);

while((stepperA.currentPosition() != -2000 || stepperY.currentPosition() != -450 ||


stepperX.currentPosition() != -150 )){
stepperA.run();
stepperY.run();
stepperX.run();
}
stepperA.moveTo(-2800);
while((stepperA.currentPosition() != -2800)){
stepperA.run();
}
if(stepperA.currentPosition() == -2800 && stepperY.currentPosition() == -450 &&
stepperX.currentPosition() == -150){
131
gripperServo.write(40);
}
delay(1500);

stepperA.moveTo(-2000);
while((stepperA.currentPosition() != -2000)){
stepperA.run();
}
}
The following code is for the conveyor belts:
#define in1 9
#define in2 8
#define in3 7
#define in4 6
#define enA 10
#define enB 5

const int S0=2;


const int S1=3;
const int S2=4;
const int S3=11;
const int sensorOut=12;

int frequency = 0;
int color=0;

void setup() {

pinMode(in1,OUTPUT);
pinMode(in2,OUTPUT);
pinMode(in3,OUTPUT);
pinMode(in4,OUTPUT);

pinMode(S0,OUTPUT);
pinMode(S1,OUTPUT);
pinMode(S2,OUTPUT);
pinMode(S3,OUTPUT);
pinMode(sensorOut,INPUT);

digitalWrite(S0,HIGH);
digitalWrite(S1,LOW);

pinMode(enA,OUTPUT);
pinMode(enB,OUTPUT);

pinMode(A0, INPUT);

132
pinMode(A2, INPUT);
Serial.begin(9600);

void loop() {

int LEFT_SENSOR = digitalRead(A0);


int COV2_SENSOR = digitalRead(A2);

//CONVEYOR 1 MOVEMENT
if( LEFT_SENSOR==0 ){
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
analogWrite(enA, 100);
}
color = readColor();
delay(10);
switch (color) {
case 1:
delay(1000);
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
analogWrite(enA, 0);
break;
case 2:
delay(400);
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
analogWrite(enA, 0);
break;
case 0:
break;
}
// CONVEYOR 2 MOVEMENT
if(COV2_SENSOR==0 ){
delay(6000) ;
digitalWrite(in3, HIGH);
digitalWrite(in4, LOW);
analogWrite(enB, 100);
delay(3000);
digitalWrite(in3, LOW);
digitalWrite(in4, LOW);
analogWrite(enB, 0);

}
133
color=0
}
int readColor() {
// Setting red filtered photodiodes to be read
digitalWrite(S2, LOW);
digitalWrite(S3, LOW);
// Reading the output frequency
frequency = pulseIn(sensorOut, LOW);
int R = frequency;
// Printing the value on the serial monitor
Serial.print("R= ");//printing name
Serial.print(frequency);//printing RED color frequency
Serial.print(" ");
delay(50);
// Setting Green filtered photodiodes to be read
digitalWrite(S2, HIGH);
digitalWrite(S3, HIGH);
// Reading the output frequency
frequency = pulseIn(sensorOut, LOW);
int G = frequency;
// Printing the value on the serial monitor
Serial.print("G= ");//printing name
Serial.print(frequency);//printing RED color frequency
Serial.print(" ");
delay(50);
// Setting Blue filtered photodiodes to be read
digitalWrite(S2, LOW);
digitalWrite(S3, HIGH);
// Reading the output frequency
frequency = pulseIn(sensorOut, LOW);
int B = frequency;
// Printing the value on the serial monitor
Serial.print("B= ");//printing name
Serial.print(frequency);//printing RED color frequency
Serial.println(" ");
delay(50);
if(R<85 & R>30 & G<80 & G>25){
color = 1; // GREEN
}
if(G<150 & G>75 & B<95 &B>35){
color = 2; // Orange
}
return color;
}

134
APPENDIX G: SPECIFCATION SHEETS

Table 11 Servo motor specification sheet

Item Specification
Size 40.4*19.9*37.5mm
Weight 58g
Gear type 5 Metal Gear
Limit angle 180°±5°
Bearing DUAL BB
Horn gear spline
Horn type Metal
Case Engineering plastics(Polyamide)
FP: 240mm±5mm JR:
Connector wire 300mm±5mm
Motor DC motor
Splash water resistance No

Item Specification
Operation voltage 4.8V
Idle current 5mA
No load speed 0.17sec/60°
Running current 350mA
Peak stall torque 9.0kg.cm
Stall current 1500mA

Item Specification
Command signal Pulse width modification
Amplifier type Digital controller
Pulse width range 500~2500usec
Neutral position 1500usec
Running degree 180±2°(when 500~2500usec)
Dead band width 4 use
Rotating direction Counterclockwise (when 500~2500usec)

135
Table 12 PLA Spec. Sheet
Identification of Material
Chemical Name Polylactic Acid
Chemical Family Thermoplastic Polylactic Acid
Use 3D Printing
Table 13 Printing Spec. Sheet

Printing settings guideline


Nozzle temp. 220+- 10 degrees celsius
Bed temp. Approximately 60 degrees celsius
Active cooling Fan Yes 100%
Layer height 0.08 – 0.2 mm
Shell thickness 0.4 – 0.8 mm
Printing speed 40 – 80 mm/s
Table 14 Arduino Spec. Sheet

Microcontroller ATmega328P – 8 bit AVR family microcontroller

Operating Voltage 5V

Recommended Input 7-12V


Voltage

Input Voltage Limits 6-20V

Analog Input Pins 6 (A0 – A5)

Digital I/O Pins 14 (Out of which 6 provide PWM output)

DC Current on I/O Pins 40 mA

DC Current on 3.3V Pin 50 mA

Flash Memory 32 KB (0.5 KB is used for Bootloader)

SRAM 2 KB

Frequency (Clock Speed) 16 MHz

136
Table 15 NEMA 17 Stepper motor spec. sheet.

Item Specification

Manufacturer Part Number: 17HS13-0316S

Motor Type: Unipolar Stepper

Step Angle: 1.8 deg

Holding Torque: 15.8Ncm(22.4oz.in)

Rated Current/phase: 0.31A

Voltage: 12V

Phase Resistance: 38.5ohms

Inductance: 21mH ± 20%(1KHz)

Item Specification

Frame Size: 42 x 42mm

Shaft Diameter: Φ5mm

Front Shaft Length: 24mm

Number of Leads: 6

Lead Length: 300mm

Weight: 220g

Body Length: 33mm

137
Table 16 12V-100RPM DC Gear Motor Spec. Sheet

Item Specification

Model: GA25YN370

Rated power: 3.5W

Product type: Brush dc motor

Rated voltage: 5-12V

Rated current: 0.06A

Outer diameter 25mm/1.0 in

Rated Torque: 4.2kg/cm

Stalled torque: 10.5kgf.cm

Shaft diameter: 3mm /0.1in

Shaft length: 10mm/0.4in

Weight: 96g/3.4oz

138

You might also like