an articulated robotic arm

74
Shadow Function-based Articulated Robotic Arm (SFARA) Dissertation submitted in partial fullment of the requirement for the degree of Bachelor of Technology In Electronics and Communication Enginee ring Under the Supervision of Mr. Haraprasad Mondal Assistant Professor, Dept. of E.C.E., D.U.I.E.T., Dibrugarh University By Himanshu Ranjan Das (EC – 09/09) Manas Pratim Kalita (EC – 17/09) Mondeep Paul (EC – 23/09) Pronadeep Bora (EC – 31/09) Vishwajit Nandi (EC – 41/09) T o Dibruga rh Univ ersit y Instit ute of Engineering and Technology Dibrugarh University Dibrugarh, Assam-786004 July 2013

Upload: vishwajit-nandi

Post on 08-Feb-2018

241 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 1/74

Shadow Function-based ArticulatedRobotic Arm (SFARA)

Dissertation submitted in partial fulfilment of the requirement for the degree of 

Bachelor of Technology 

In 

Electronics and Communication Engineering

Under the Supervision of 

Mr. Haraprasad Mondal

Assistant Professor, Dept. of E.C.E.,

D.U.I.E.T., Dibrugarh University

By 

Himanshu Ranjan Das (EC – 09/09)

Manas Pratim Kalita (EC – 17/09)Mondeep Paul (EC – 23/09)

Pronadeep Bora (EC – 31/09)

Vishwajit Nandi (EC – 41/09)

To

Dibrugarh University Institute of Engineering and Technology

Dibrugarh University

Dibrugarh, Assam-786004

July 2013

Page 2: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 2/74

DeclarationWe declare that this thesis titled,  ‘Shadow Function-based Articulated Robotic

Arm (SFARA)’   and the work presented in it are our own and is submitted by us in

practical fulfillment of the requirement for the award of the degree Bachelor of Technol-

ogy in Electronics and Communication Engineering to DUIET, Dibrugarh University,

Dibrugarh, Assam comprises only my original work and due acknowledgement has been

made in the text to all other material used.

Date:

Himanshu Ranjan Das

Manas Pratim Kalita

Mondeep Paul

Pronadeep Bora

Vishwajit Nandi

Approved by:

Director,

Dibrugarh University Institute of 

Engineering and Technology

ii

Page 3: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 3/74

Certificate

This is to certify that the Thesis/Report entitled   ‘Shadow Function-based Articu-

lated Robotic Arm (SFARA)’   which is submitted by  Himanshu Ranjan Das,Manas Pratim Kalita, Mondeep Paul, Pronadeep Bora  and  Vishwajit Nandi

in practical fulfillment of the requirement for the award of the degree B.Tech. in Elec-

tronics and Communication Engineering to DUIET, Dibrugarh University, Dibrugarh,

Assam is a record of the candidate own work carried out by him under my supervision.

The matter embodied in this thesis is original and has not been submitted for the award

of any other degree.

Date:

Mr. Haraprasad Mondal

Assistant Professor, Department of Electronics

and Communication Engineering

Dibrugarh University Institute of Engineering

and Technology

Dibrugarh University

Forwarded by:

Head of Department,

Department of Electronics and Communication Engineering

Dibrugarh University Institute of Engineering and Technology,

Dibrugarh University

Date:

Examiner

(External) (Internal)

iii

Page 4: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 4/74

Acknowledgements 

It is a privilege to be associated with this Project. This acknowledgement is not only the

means of formality, but it is a way to show the deep sense of gratitude and obligationto all the people who have provided us with inspiration, guidance and help for the

preparation of the project.

First and foremost, we would like to express our outmost gratitude to our Project Guide,

Mr. Haraprasad Mandal, Asst. Professor, D.U.I.E.T., Dibrugarh University for al-

lowing us to work on this project under his supervision and for his overall valuable advice

and guidance. We would also like to thank all other faculty members of Department of 

Electronics and Communication, D.U.I.E.T., Dibrugarh University who have provided

valuable inputs during the course of our project.

We are also thankful to  Dr. Mukul Chandra Bora, Director, D.U.I.E.T., Dibrugarh

University for providing us the opportunity to realize this project by providing all the

facilities in the college.

We thank   Mr. Pankaj Konwar, Workshop Superintendent, Engineering Workshop,

D.U.I.E.T., Dibrugarh University for allowing us to use the workshop for the fabrica-

tion of the Robotic arm. We also thank  Mr. Mintu Bora, Jr. Instructor (Machine

Shop), Mr. Nirmal Gohain, Jr. Instructor (Fitting Shop) and   Mr. Pradip KumarSharma, Jr. Instructor (Welding Shop) of Engineering Workshop, D.U.I.E.T., Dibru-

garh University for their help and support during the fabrication of the Robotic arm.

We would also like to thank  Mr. Lakhyajit Borpatro Gohain sharing his knowledge

and experiences on metal cutting and shaping with us.

Last but not the least; we would like to thank our parents, friends and all wellwishers

for supporting us in our project.

iv

Page 5: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 5/74

Contents

Declaration   ii

Certificate   iii

Acknowledgements   iv

List of Figures   viii

List of Tables   ix

Abbreviations   x

Abstract   xi

1 Introduction   12

1.1 Preamble   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

1.2 Laws Of Robotics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

1.2.1 Robotic Arm   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

1.2.2 Classification Of Robotic Arms   . . . . . . . . . . . . . . . . . . . . 14

2 Literature Review   17

2.1 Mechanics And Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

2.2 Manipulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

2.3 Positioning, Orienting and Degrees of Freedom   . . . . . . . . . . . . . . . 18

2.4 Arm Geometries   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192.4.1 Cartesian or Rectangular Work Envelope   . . . . . . . . . . . . . . 19

2.4.2 Cylindrical Work Envelope   . . . . . . . . . . . . . . . . . . . . . . 20

2.4.3 Polar or Spherical Work Envelope   . . . . . . . . . . . . . . . . . . 20

2.4.4 The Wrist Work Envelope  . . . . . . . . . . . . . . . . . . . . . . . 21

2.4.5 Grippers Work Envelope . . . . . . . . . . . . . . . . . . . . . . . . 21

2.5 Material Selection for Robotic Arm Fabrication   . . . . . . . . . . . . . . . 22

2.5.1 Factors under Consideration . . . . . . . . . . . . . . . . . . . . . . 22

2.5.2 Material Selection   . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

2.6 Servo Motors   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

2.6.1 Servo Motor Applications   . . . . . . . . . . . . . . . . . . . . . . . 252.6.2 Servo Motor Manufacturers   . . . . . . . . . . . . . . . . . . . . . . 25

v

Page 6: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 6/74

Contents    vi

2.6.3 Servo Motor Wiring and Plugs   . . . . . . . . . . . . . . . . . . . . 25

2.6.4 Servo Control   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

2.6.5 Power Supply for Servo   . . . . . . . . . . . . . . . . . . . . . . . . 28

2.6.6 Selection of a Servo   . . . . . . . . . . . . . . . . . . . . . . . . . . 28

2.7 Arduino Micro-Controller Board   . . . . . . . . . . . . . . . . . . . . . . . 292.8 Software  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

2.8.1 Choice of Programming Language for the Software on the Computer   30

2.8.2 Choice of Programming Language for the Micro-Controller   . . . . 30

3 Hardware Components   31

3.1 Electronics Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

3.1.1 Atmega328 Microcontroller   . . . . . . . . . . . . . . . . . . . . . . 31

3.2 The Custom-Made Arduino Duemilanove   . . . . . . . . . . . . . . . . . . 33

3.2.1 Arduino Duemilanove   . . . . . . . . . . . . . . . . . . . . . . . . . 33

3.2.2 The Custom Made Board   . . . . . . . . . . . . . . . . . . . . . . . 34

3.3 Servo Motor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

3.3.1 High Torque Servo Motor With Metal Gears   . . . . . . . . . . . . 37

3.3.2 Very High Torque Servo Motor With Metal Gears   . . . . . . . . . 37

3.4 The Gripper Module   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

4 Design and Fabrication   40

4.1 Torque Calculation Of Joints   . . . . . . . . . . . . . . . . . . . . . . . . . 40

4.2 Basic Design Considerations  . . . . . . . . . . . . . . . . . . . . . . . . . . 42

4.3 Mechanical Fabrication of The Arm   . . . . . . . . . . . . . . . . . . . . . 43

4.3.1 Construction   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

4.4 Summary   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

5 Control system for the Robotic Arm   44

5.1 Power Supply Unit   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

5.2 Different Modes of Control   . . . . . . . . . . . . . . . . . . . . . . . . . . 45

5.2.1 Manual Control Mode   . . . . . . . . . . . . . . . . . . . . . . . . . 45

5.2.2 Computer Control Mode . . . . . . . . . . . . . . . . . . . . . . . . 46

5.3 Miscelleneous Modes   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

6 Result of the Project   49

Conclusion   51

Future Scope   52

A Atmega 32 Microcontroller   53

A.1 Pin Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

A.2 Pin Description   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

A.2.1 VCC  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

A.2.2 GND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

Page 7: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 7/74

Contents    vii

A.2.3 PORT B (PB7:0) XTAL1/XTAL2/TOSC1/TOSC2   . . . . . . . . 54

A.2.4 PORT C (PC5:0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

A.2.5 PC6/RESET   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

A.2.6 Port D (PD7:0)   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

A.2.7 AVCC   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55A.2.8 AREF   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

A.2.9 ADC7:6 (TQFP AND QFN/MLF PACKAGE ONLY)   . . . . . . . 55

A.3 AVR CORE   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

B Arduino Duemilanove   59

B.1 Overview   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

B.2 Summary   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

B.3 Schematic   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

B.4 Power   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

B.5 Memory   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

B.6 Input and Output   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

B.7 Communication  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

B.8 Programming   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

B.9 Automatic (Software) Reset   . . . . . . . . . . . . . . . . . . . . . . . . . . 64

B.10 Usb Overcurrent Protection   . . . . . . . . . . . . . . . . . . . . . . . . . . 65

B.11 Physical Characteristics   . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

C Arduino Programming Language   66

D Source Code for the Software Implementation   67

D.1 Manual Control Mode   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67D.2 Computer Control Mode  . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

D.3 Servo Library   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

Bibliography   74

Page 8: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 8/74

List of Figures

1.1 An Articulated Robotic Arm and its Workspace . . . . . . . . . . . . . . . 14

1.2 A Gantry Robot and its Workspace . . . . . . . . . . . . . . . . . . . . . . 15

1.3 A Cylindrical Robot and its Workspace   . . . . . . . . . . . . . . . . . . . 15

1.4 A Spherical robot and its Workspace   . . . . . . . . . . . . . . . . . . . . . 16

1.5 A SCARA robot and its Workspace   . . . . . . . . . . . . . . . . . . . . . 16

2.1 A commercially available Servo Motor   . . . . . . . . . . . . . . . . . . . . 24

2.2 Control Signals for Servo Motor . . . . . . . . . . . . . . . . . . . . . . . . 26

2.3 Inside a Servo Motor  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

2.4 Step-by-step disassembly of a Servo Motor  . . . . . . . . . . . . . . . . . . 27

2.5 Feedback Mechanism Employed by Servo Motor . . . . . . . . . . . . . . . 28

3.1 Arduino Duemilanove   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

3.2 Schematic Of The Custom Made Development Board . . . . . . . . . . . . 35

3.3 PCB Layout of the Custom Made Development Board   . . . . . . . . . . . 36

3.4 The Gripper Module   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

4.1 Robotic Arm shape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

4.2 Top Down Approach   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

4.3 A Block Diagram Model of the Robot Arm   . . . . . . . . . . . . . . . . . 42

5.1 Wire Connection for the Sensor Control   . . . . . . . . . . . . . . . . . . . 45

5.2 Schematic for the Sensor Control   . . . . . . . . . . . . . . . . . . . . . . . 46

5.3 Serial Communication between Computer and COntroller Board   . . . . . 47

6.1 Final Working Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

A.1 Pinout of ATmega328P   . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

A.2 Block Diagram of the AVR Architecture   . . . . . . . . . . . . . . . . . . . 56

B.1 Schematic of Arduino Duemilanove  . . . . . . . . . . . . . . . . . . . . . . 60

viii

Page 9: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 9/74

List of Tables

5.1 Current requirement of servo motors at 6V   . . . . . . . . . . . . . . . . . 44

5.2 Keys Assignned for Controlling the Arm  . . . . . . . . . . . . . . . . . . . 47

ix

Page 10: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 10/74

Abbreviations

JARVIS Just A Rather  Very  Intelligent  System

SFARA Shadow Function-based Articulated  Robotic  Arm

PWM Pulse  Width  Modulation

APL Arduino  Programming  Language

Servo Servo Motor

PUMA Programmable  Universal Manipulation Arm

DOF Degree  Of   Freedom

GRP Glasselective  Reinforced  Plastic

CAD Computer Aided  Design

GUI Graphical  User InterfaceDU Duemilanove

x

Page 11: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 11/74

Page 12: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 12/74

Chapter 1

Introduction

1.1 Preamble

In the modern world, robotics has become popular, useful, and has achieved great suc-

cesses in several fields of humanity. Robotics has become very useful in medicine, ed-

ucation, military, research and mostly, in the world of manufacturing. It is a term

that has since been used to refer to a machine that performs work to assist people or

work that humans find difficult or undesirable. Robots, which could be destructive or

nondestructive, perform tasks that would have been very tedious for human beings to

perform. They are capable of performing repetitive tasks more quickly, cheaply, and

accurately than humans. Robotics involves the integration of many different disciplines,

among them kinematics, signal analysis, information theory, artificial intelligence, and

probability theory. These disciplines when applied suitably, lead to the design of a very

successful robot.

The advent of robotics started in the year 350 B.C. when a Greek mathematician Archy-

tas of Tarentum built a mechanical bird, which was called the pigeon. This mechanical

bird was powered using steam. With further advancements, Leonardo Da Vinci in the

year, 1495 designed a mechanical device that looked like an armored knight. The knight

was designed to move as if there was a real person inside. In 1898, Nikola Tesla designed

the first remote-controlled robot in Madison Square Garden. The robot designed was

modelled after a boat.

12

Page 13: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 13/74

Chapter 1.   Introduction    13

The first industrial robots were Unimates developed by George Devol and Joe Engel-

berger in the late 50s and early 60s. The first patents were by Devol but Engelberger

formed Unimation which was the first market robots. Therefore, Engelberger has been

called the father of robotics. For a while, the economic viability of these robots proved

disastrous and thing slowed down for robotics. However, by mid-80s, the industry re-

covered and robotics was back on track. George Devol Jr, in 1954 developed the multi-

 jointed artificial arm, which lead to the modern robots. However, mechanical engineer

Victor Scheinman, developed the truly flexible arm known as the Programmable Uni-

versal Manipulation Arm (PUMA).

Mobile Robotics moved into its own in 1983 when Odetics introduced a six-legged vehicle

that was capable of climbing over objects. This robot could lift over 5.6 times its own

weight parked and 2.3 times it weight moving. There were very significant changes in

robotics until the year 2003 when NASA launched two robots MER-A Spirit and MER-B

Opportunity rovers which were destined for Mars. Up till date, Robotic developers have

kept researching on how to make robots very interactive with man in order to be able

to communicate efficiently in the social community.

1.2 Laws Of Robotics

Many scientist and science fiction writer give law for robotics. But the first and most

popular law was given by Sir Isaac Assimov in his science fiction Runaround in 1942.

His proposed law for robotics are:

1. A Robot may not injure a human being or, through inaction, allow a human being

to come to harm.

2. A robot must obey orders given to it by human beings, except where such orders

would conflict with the first law.

3. A robot must protect its own existence as long as such protection does not conflict

with the first or second law.

Assimov later adds a Zeroth law to the list: Zeroth law: A robot may not injure hu-

manity, or enough inaction, allow humanity to come to harm.

Page 14: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 14/74

Chapter 1.   Introduction    14

1.2.1 Robotic Arm

A robotic arm is a robot manipulator, usually programmable, with similar functions to

a human arm. The links of such a manipulator are connected by joints allowing eitherrotational motion (such as in an articulated robot) or translational (linear) displacement.

The links of the manipulator can be considered to form a kinematic chain. The business

end of the kinematic chain of the manipulator is called the end effector and it is analogous

to the human hand. The end effector can be designed to perform any desired task such

as welding, gripping, spinning etc., depending on the application. For example robot

arms in automotive assembly lines perform a variety of tasks such as welding and parts

rotation and placement of objects with a number of degrees of freedom, under automatic

control during assembly.

1.2.2 Classification Of Robotic Arms

The Robotic Arms may be classified as follows:

1.  Articulated robot– Used for assembly operations, die casting, fettling machines,

gas welding, arc welding, and spray painting. It’s a robot whose arm has at least

three rotary joints.

Figure 1.1:   An Articulated Robotic Arm and its Workspace

2.  Cartesian robot / Gantry robot– Used for pick and place work, application of sealant, assembly operations, handling machine tools and arc welding. It’s a robot

Page 15: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 15/74

Chapter 1.   Introduction    15

whose arm has three prismatic joints, whose axes are coincident with a Cartesian

coordinator.

Figure 1.2:  A Gantry Robot and its Workspace

3.   Cylindrical robot– Used for assembly operations, handling at machine tools,

spot-welding, and handling at die casting machines. It’s a robot whose axes form

a cylindrical coordinate system.

Figure 1.3:   A Cylindrical Robot and its Workspace

4.   Parallel robot– One use is a mobile platform handling cockpit flight simulators.

It’s a robot whose arms have concurrent prismatic or rotary joints.

5.  Spherical robot / Polar robot– Used for handling at machine tools, spot weld-

ing, die casting, fettling machines, gas welding and arc welding. Its a robot whose

axes form a polar coordinate system.

Page 16: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 16/74

Chapter 1.   Introduction    16

Figure 1.4:   A Spherical robot and its Workspace

Figure 1.5:  A SCARA robot and its Workspace

6.   SCARA robot– Used for pick and place work, application of sealant, assembly

operations and handling machine tools. It’s a robot which has two parallel rotary

 joints to provide compliance in a plane.

Page 17: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 17/74

Chapter 2

Literature Review

2.1 Mechanics And Motion

Mechanics deals with the analysis of the forces that cause a body to be in physical

motion. The motion of the robot arm will be achieved with the use of four servo motors

and a dc motor as actuators. Since servo motors are designed to achieve an accurate

resolution of up-to 1 degree, feedback is not necessary and therefore it is possible to

track the position of the respective link with relatively high accuracy. Since mechanics

involves also the parts of the robot that are acted upon directly by the motors and the

gears to achieve motion, the tensile strengths of those areas were designed to withstand

the stresses generated due to friction and force of propulsion.

2.2 Manipulator

Manipulator is another commonly used name for a robot or mechanical arm and it

will be used intermittently with robot arm in this document. A manipulator is an

assembly of segments and joints that can be conveniently divided into three sections:

the arm, consisting of one or more segments and joints; the wrist, usually consisting

of one to three segments and joints; and a gripper or other means of attaching or

grasping. Alternatively, the manipulator can be divided into only two sections, arm

and gripper, but for clarity the wrist is separated out as its own section because it

performs a unique function. Industrial robots are stationary manipulators whose base is

17

Page 18: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 18/74

Chapter 2.  Literature Review    18

permanently attached to the floor, a table, or a stand. In most cases, however, industrial

manipulators are too big and use a geometry that is not effective on a mobile robot, or

lack enough sensors (indeed many have no sensors at all) to be considered for use on a

mobile robot. There is a section covering them as a group because they demonstrate a

wide variety of sometimes complex manipulator geometries. We will review the robot

arm based on the three general layouts of the arm section of a generic manipulator, and

wrist and gripper designs. It should be pointed out that there are few truly autonomous

manipulators in use except in research labs. The task of positioning, orienting, and doing

something useful based solely on input from frequently inadequate sensors is extremely

difficult. In most cases, the manipulator is tale-operated (remotely controlled using

radio transmission technology).

2.3 Positioning, Orienting and Degrees of Freedom

Generally, the arm and wrist of a basic manipulator perform two separate functions,

positioning and orienting. There are layouts where the wrist or arm is not distinguish-

able. In the human arm, the shoulder and elbow do the gross positioning and the wrist

does the orienting. Each joint allows one degree of freedom of motion. The theoretical

minimum number of degrees of freedom to reach to any location in the work envelope

and orient the gripper in any orientation is six; three for location, and three for orienta-

tion. In other words, there must be at least three bending or extending motions to get

position, and three twisting or rotating motions to get orientation.

Actually, the six or more joints of the manipulator can be in any order, and the arm and

wrist segments can be any length, but there are only a few combinations of joint order

and segment length that work effectively. They almost always end up being divided into

arm and wrist. The three twisting motions that give orientation are commonly labeled

pitch, roll, and yaw, for tilting up/down, twisting, and bending left/right respectively.

Unfortunately, there is no easy labeling system for the arm itself since there are many

ways to achieve gross positioning using extended segments and pivoted or twisted joints.

A good example of a manipulator is the human arm, consisting of a shoulder, upper

arm, elbow, and wrist. The shoulder allows the upper arm to move up and down which

is considered one degree of freedom (DOF). It allows forward and backward motion,

Page 19: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 19/74

Chapter 2.  Literature Review    19

which is the second DOF, but it also allows rotation, which is the third DOF. The elbow

 joint gives the forth DOF. The wrist pitches up, down and rolls, giving two DOFs in

one joint. Theoretically the best wrist joint geometry is a ball joint, but even in the

biological world, there is only one example of a true full motion ball joint (one that

allows motion in two planes, and twists 360◦) because they are so difficult to power and

control. The human hip joint is a limited motion ball joint. On a mobile robot, the

chassis can often substitute for one or two of the degrees of freedom, usually fore/aft

and sometimes to yaw the arm left/right, reducing the complexity of the manipulator

significantly. Some special purpose manipulators do not need the ability to orient the

gripper in all three axes, further reducing the DOF. At the other extreme, there are

arms in the conceptual stage that have more than fifteen DOF.

2.4 Arm Geometries

The three general layouts for 5-DOF arms are called Cartesian, cylindrical, and polar (or

spherical). They are named for the shape of the volume that the manipulator can reach

and orient the gripper into any position within the work envelope. They all have their

uses, but as will become apparent, some are better for use on robots than others. Some

use all sliding motions, some use only pivoting joints, some use both. Pivoting joints

are usually more robust than sliding joints but, with careful design, sliding or extending

can be used effectively for some types of tasks. Pivoting joints have the drawback of 

preventing the manipulator from reaching every cubic centimeter in the work envelope

because the elbow cannot fold back completely on itself. This creates dead spaces places

where the arm cannot reach that are inside the gross work volume. On a robot, it is

frequently required for the manipulator to fold very compactly.

2.4.1 Cartesian or Rectangular Work Envelope

On a mobile robot, the manipulator almost always works beyond the edge of the chassis

and must be able to reach from ground level to above the height of the robots body.

This means the manipulator arm works from inside or from one side of the work enve-

lope. Some industrial gantry manipulators work from outside their work envelope, and

it would be difficult indeed to use their layouts on a mobile robot. In fact, that is how

Page 20: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 20/74

Chapter 2.  Literature Review    20

it is controlled and how the working end moves around in the work envelope. There

are two basic layouts based on how the arm segments are supported, gantry and can-

tilevered. Mounted on the front of a robot, the first two DOF of a cantilevered Cartesian

manipulator can move left/right and up/down; the Y-axis is not necessarily needed on

a mobile robot because the robot can move back/forward.

2.4.2 Cylindrical Work Envelope

This is the second type of robot arm work envelope. Cylindrical types usually incorporate

a rotating base with the first segment able to telescope or slide up and down, carrying

a horizontally telescoping segment. While they are very simple to picture and the workenvelope is intuitive, they are hard to implement effectively because they require two

linear motion segments, both of which have moment loads in them caused by the load

at the end of the upper arm. In the basic layout, the control code is fairly simple, i.e.,

the angle of the base, height of the first segment, and extension of the second segment.

On a robot, the angle of the base can simply be the angle of the chassis of the robot itself,

leaving the height and extension of the second segment. A second geometry that still has

a cylindrical work envelope is the SCARA design. SCARA means Selective Compliant

Assembly Robot Arm. This design has good stiffness in the vertical direction, but some

compliance in the horizontal. This makes it easier to get close to the right location and

let the small compliance take up any misalignment. A SCARA manipulator replaces the

second telescoping joint with two vertical axis-pivoting joints.

2.4.3 Polar or Spherical Work Envelope

The third, and most versatile, geometry is the spherical type. It is the type used in our

project. In this layout, the work envelope can be thought of as being all around. In

practice, though, it is difficult to reach everywhere. There are several ways to layout an

arm with this work envelope. The most basic has a rotating base that carries an arm

segment that can pitch up and down, and extend in and out. Raising the shoulder up

changes the envelope somewhat and is worth considering in some cases.

Page 21: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 21/74

Chapter 2.  Literature Review    21

2.4.4 The Wrist Work Envelope

The arm of the manipulator only gets the end point in the right place. In order to orient

the gripper to the correct angle, in all three axes, second set of joints is usually required- the wrist. The joints in a wrist must twist up/down, clockwise/counter-clockwise, and

left/right. They must pitch, roll, and yaw respectively. This can be done all-in-one

using a ball-in-socket joint like a human hip, but controlling and powering this type

is difficult. Most wrists consist of three separate joints. The order of the degrees of 

freedom in a wrist has a large effect on the wrists functionality and should be chosen

carefully, especially for wrists with only one or two DOF.

2.4.5 Grippers Work Envelope

The end of the manipulator is the part the user or robot uses to affect something in

the environment. For this reason it is commonly called an end-effector, but it is also

called a gripper since that is a very common task for it to perform when mounted on a

robot. It is often used to pick up dangerous or suspicious items for the robot to carry,

some can turn doorknobs, and others are designed to carry only very specific things like

beer cans. Closing too tightly on an object and crushing it is a major problem with

autonomous grippers. There must be some way to tell how hard is enough to hold the

object without dropping it or crushing it. Even for semi-autonomous robots where a

human controls the manipulator, using the gripper effectively is often difficult. For these

reasons, gripper design requires as much knowledge as possible of the range of items the

gripper will be expected to handle. Their mass, size, shape, and strength, etc. all must

be taken into account. Some objects require grippers that have many jaws, but in most

cases, grippers have only two. There are several basic types of gripper geometries. The

most basic type has two simple jaws geared together so that turning the base of one

turns the other. This pulls the two jaws together. The jaws can be moved through a

linear actuator or can be directly mounted on a motor gear boxes output shaft, or driven

through a right angle drive which places the drive motor further out of the way of the

gripper. This and similar designs have the drawback that the jaws are always at an

angle to each other which tends to push the thing being grabbed out of the jaws.

Page 22: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 22/74

Chapter 2.  Literature Review    22

2.5 Material Selection for Robotic Arm Fabrication

2.5.1 Factors under Consideration

In choosing the materials and the shape for the fabrication of the robotic arm, the

following were taken into consideration:

1. The ease of manufacturing the parts

2. The mode of manufacturing

3. Ease of assembly

4. Strength and durability of the parts

5. Weight of robot

6. Cost

The principal requirements for power transmission of robots are:

1. Small size

2. Low weight and moment of inertia

3. High effective stiffness

4. Accurate and constant transmission ratio

5. Low energy losses and friction for better responsiveness of the control system.

6. Elimination of backlash

Hence, the combination of these factors has greatly influenced all the choices made in

the design selection of the robotic arm.

Page 23: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 23/74

Chapter 2.  Literature Review    23

2.5.2 Material Selection

In manipulator structures, stiffness-to-weight ratio of a link is very important since

inertia forces induce the largest deflections. Therefore, an increase in the Elastic mod-ulus, E would be very desirable if it is not accompanied by an unacceptable increase

in specific density. The Elastic modulus is an indication of the materials resistance to

breakage when subjected to force. The best properties are demonstrated by ceramics

and beryllium but ceramics have a problem of brittleness and beryllium is very ex-

pensive. Structural materials such as magnesium (Mg), Aluminum (Al), and titanium

(Ti) which are light have about the same E/ ratios as steel and are used when high

strength and low weight are more important than E/ ratios. Factors like aging, creep

in under constant loads, high thermal expansion coefficient, difficulty in joining with

metal parts, high cost and the fact that they are not yet commercially available make

the use of fiber-reinforced materials limited though they have good stiffness-to-weight

ratios. However, with advances in research, some of the mentioned setbacks have been

significantly reduced. Hence, the use of fiber-reinforced materials (known as composites)

is becoming more attractive. Aluminum lithium alloy have better processing properties

and is not very expensive. Alloyed materials such as Nitinol (nickel titanium Aluminum),

Aluminum incramute (copper - manganese Aluminum) are also commercially available.

Therefore, the materials recommended for use in this project are:

  Al-Li alloys

 Nitinol (nickel-titanium-Aluminum)

  Incramute (copper-manganese-Aluminum)

  Glass-reinforced Plastic (GRP)

 Fiber plastic (FP)

The external dimensions are limited in order to reduce waste of the usable workspace.

They are as light as possible to reduce inertia forces and allow for the highest external

load per given size of motors and actuators. For a given weight, links have to possess the

highest possible bending (and torsional) stiffness. The parameter to be modified to com-

ply with these constraints is the shape of the cross-section. The choice is between hollowround and hollow rectangular cross-section. From design standpoint of view, the links

Page 24: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 24/74

Chapter 2.  Literature Review    24

of square or rectangular cross-section have advantage of strength and machinability ease

over round sections. Despite the recommendations mentioned above as regards choice

of materials, our options were narrowed down to a choice between steel, GRP, and Alu-

minum, FP based on feasibility studies carried out. Current trend in robotics (especially

industrial robotics) shows a quest to achieve lighter designs with reasonable strength.

This design goal has always meant a trade-off in terms of cost. Composite materials are

generally more expensive than most metals used in industrial robots fabrication. For

the particular case of our project, we narrowed our options down to composite material

fiber plastic which are available in market as electrical wiring casing. They not of the

best quality, which are to be used in industries but for project and testing purpose they

are quite efficient and effective as well as low cost.

2.6 Servo Motors

Servo refers to an error sensing feedback control which is used to correct the performance

of a system. Servo or RC Servo Motors are DC motors equipped with a servo mechanism

for precise control of angular position. The RC servo motors usually have a rotation

limit from 90◦

to 180◦

. Some servos also have rotation limit of 360◦

or more. But servos

do not rotate continually. Their rotation is restricted in between the fixed angles.

Figure 2.1:  A commercially available Servo Motor

Page 25: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 25/74

Chapter 2.  Literature Review    25

2.6.1 Servo Motor Applications

The Servos are used for precision positioning. They are used in robotic arms and legs,

sensor scanners and in RC toys like RC helicopter, airplanes and cars. They are, in factvery popular among hobbyists.

2.6.2 Servo Motor Manufacturers

There are four major manufacturers of servo motors: NexRobotics, Futaba, Hitec,

Airtronics and JR radios. Futaba and Hitec servos have nowadays dominated the market.

Their servos are same except some interfacing differences like the wire colors, connector

type, spline etc.

2.6.3 Servo Motor Wiring and Plugs

The Servo Motors come with three wires or leads. Two of these wires are to provide

ground and positive supply to the servo DC motor. The third wire is for the control

signal. These wires of a servo motor are color coded. The red wire is the DC supply lead

and must be connected to a DC voltage supply in the range of 4.8 V to 6V (may vary

with manufacture or power of the servo motor). The brown/black wire is to provide

ground. The color for the third wire (to provide control signal) varies for different

manufacturers. It can be yellow (in case of Hitec), white (in case of Futaba), brown etc.

Futaba provides a J-type plug with an extra flange for proper connection of the servo.

Hitec has an S-type connector. A Futaba connector can be used with a Hitec servo by

clipping of the extra flange. Also a Hitec connector can be used with a Futaba servo

 just by filing off the extra width so that it fits in well. Hitec splines have 24 teeth while

Futaba splines are of 25 teeth. Therefore splines made for one servo type cannot be used

with another. Spline is the place where a servo arm is connected. It is analogous to the

shaft of a common DC motor.

Unlike dc motors, reversing the ground and positive supply connections does not change

the direction (of rotation) of a servo. This may, in fact, damage the servo motor. That

is why it is important to properly account for the order of wires in a servo motor.

Page 26: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 26/74

Chapter 2.  Literature Review    26

2.6.4 Servo Control

The servo motor can be moved to a desired angular position by sending PWM (pulse

width modulated) signals on the control wire. The servo understands the language of pulse position modulation. A pulse of width varying from 1 millisecond to 2 milliseconds

in a repeated time frame is sent to the servo for around 50 times in a second. The width

of the pulse determines the angular position.

Figure 2.2:   Control Signals for Servo Motor

The pulse width for in between angular positions can be interpolated accordingly. Thus

a pulse of width 1.5 milliseconds will shift the servo to 90. It must be noted that these

values are only the approximations. The actual behavior of the servos differs based on

their manufacturer. A sequence of such pulses (50 in one second) is required to be passed

to the servo to sustain a particular angular position. When the servo receives a pulse,

it can retain the corresponding angular position for next 20 milliseconds. So a pulse in

every 20 millisecond time frame must be fed to the servo.

A servo motor mainly consists of a DC motor, gear system, a position sensor which is

mostly a potentiometer, and control electronics.

The DC motor is connected with a gear mechanism which provides feedback to a position

sensor which is mostly a potentiometer. From the gear box, the output of the motor

is delivered via servo spline to the servo arm. The potentiometer changes position

Page 27: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 27/74

Chapter 2.  Literature Review    27

Figure 2.3:  Inside a Servo Motor

corresponding to the current position of the motor. So the change in resistance produces

an equivalent change in voltage from the potentiometer. A pulse width modulated signal

is fed through the control wire. The pulse width is converted into an equivalent voltage

that is compared with that of signal from the potentiometer in an error amplifier.

Figure 2.4:   Step-by-step disassembly of a Servo Motor

The feedback circuit employed by a servo motor is shown in figure  2.5. The differencesignal is amplified and provided to the DC motor. So the signal applied to the DC servo

Page 28: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 28/74

Chapter 2.  Literature Review    28

motor is a damping wave which diminishes as the desired position is attained by the

motor.

Figure 2.5:  Feedback Mechanism Employed by Servo Motor

When the difference between the desired position as indicated by the pulse train and

current position is large, motor moves fast. When the same difference is less, the motor

moves slow. The required pulse train for controlling the servo motor can be generated by

a timer IC such as 555 or a microcontroller can be programmed to generate the requiredwaveform.

2.6.5 Power Supply for Servo

The servo requires a DC supply of 4.8 V to 6 V. For a specific servo, its voltage rating

is given as one of its specification by the manufacturer. The DC supply can be given

through a battery or a regulator. The battery voltage must be closer to the operating

voltage of the servo. This will reduce the wastage of power as thermal radiation. A

switched regulator can be used as the supply for better power efficiency. We have used

6 V (using voltage regulator 7806) for all the servos to achieve maximum torque.

2.6.6 Selection of a Servo

The typical specifications of servo motors are torque, speed, weight, dimensions, motor

type and bearing type. The motor type can be of 3 poles or 5 poles. The pole refers to the

Page 29: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 29/74

Chapter 2.  Literature Review    29

permanent magnets that are attached with the electromagnets. 5 pole servos are better

than 3 pole motor because they provide better torque. The servos are manufactured

with different torque and speed ratings. The torque is the force applied by the motor

to drive the servo arm. Speed is the measure that gives the estimate that how fast the

servo attains a position. A manufacturer may compromise torque over speed or speed

over torque in different models. The servos with better torque must be preferred. The

weight and dimensions are directly proportional to the torque. Obviously, the servo

having more torque will also have larger dimensions and weight. The selection of a

servo can be made according to the torque and speed requirements of the application.

The weight and dimension may also play a vital role in optimizing the selection such

as when a servo is needed for making an RC airplane or helicopter. The website of themanufacturers can be seen to obtain details about different models of the servos. Also

their product catalogue can be referred to. Some manufacturers like Futaba also provide

online calculator for the selection of a servo.

2.7 Arduino Micro-Controller Board

Arduino is an open-source electronics prototyping platform based on flexible, easy to

use hardware and software. Its intended for artists, designers, hobbyists, and anyone

interested in creating interactive objects or environments. Arduino can sense the envi-

ronment by receiving input from a variety of sensors and can affect its surroundings by

controlling lights, motors, and other actuators. The micro-controller on the board is pro-

grammed using the Arduino programming language (based on Wiring) and the Arduino

development environment (based on Processing). Arduino projects can be standalone

or they can communicate with software on running on a computer (e.g. Flash, Process-

ing, and MaxMSP). The boards can be built by hand or purchased preassembled; the

software can be downloaded for free. The hardware reference designs (CAD files) are

available under an open-source license.

2.8 Software

A robot, by definition, must have intelligence and this actually means some software thatdirects it on what to do, given zero or more input conditions. This section describes

Page 30: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 30/74

Chapter 2.  Literature Review    30

the software tools used in the project. We had chosen two different software design

tools, one for the software that runs on the computer, another for the micro-controller

programming.

2.8.1 Choice of Programming Language for the Software on the Com-

puter

From analysis on our project, we arrived at the conclusion that two separate pieces of 

software would be required. One would run on the PCs processor and would take care

of the user interface (GUI) or what could be called the robots dashboard. For this, we

did some extensive research on the programming language that would be most suitable.We chose the Processing programming language (sketch based) based on some of its

desirable characteristics.

Processing is for writing software to make images, animations, and interactions. The

idea is to write a single line of code, and have a circle show up on the screen. Add a few

more lines of code, and the circle follows the mouse. Another line of code, and the circle

changes color when the mouse is pressed. We call this sketching with code. You write

one line, then add another, then another, and so on. The result is a program created

one piece at a time.

2.8.2 Choice of Programming Language for the Micro-Controller

The second piece of software was to exist in the micro-controller code memory, and ac-

tually form the intelligence of the robot. Its written in Arduino Programming Language

(APL) specifically designed for all range of Arduino boards. The trade-off in using a

high-level language instead of the native instruction set to program a micro-controller

would be a slightly less efficient utilization of the limited code memory and slightly

slower programs. Arduino code is clearer and easier to handle. This outweighed the

disadvantages in the case of our project so we chose the APL which has an almost

one-to-one correspondence with the micro-controller assembly language.

Page 31: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 31/74

Chapter 3

Hardware Components

This chapter describes, in detail, selected raw materials, hardware components and

software resources used by us.

3.1 Electronics Hardware

This subsection deals with the components we have selected for the control system of therobotic arm. The arm is controlled by a micro-controller board called Arduino Duemi-

lanove driving the actuators (servo motors and dc motor) with an Atmels ATmega328

microcontroller (with pre-loaded Arduino-DU bootloader 1) embedded on it. The mi-

crocontroller receives control signal from the USB port via Serial Communication or

from the sensors connected to its input digital and analog pins.

3.1.1 Atmega328 Microcontroller

Overview

The ATmega328P is a low-power CMOS 8-bit microcontroller based on the AVR en-

hanced RISC architecture. By executing powerful instructions in a single clock cycle, the

ATmega48PA/88PA/168PA/328P achieves throughputs approaching 1 MIPS per MHz

allowing the system designers to optimize power consumption versus processing speed.

31

Page 32: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 32/74

Chapter 3.  Hardware Components    32

Features

•  High Performance, Low Power AVR 8-Bit Microcontroller

•   Advanced RISC Architecture

–131 Powerful Instructions Most Single Clock Cycle Execution

–32 x 8 General Purpose Working Registers

–Fully Static Operation

–Up to 20 MIPS Throughput at 20 MHz

–On-chip 2-cycle Multiplier

•   High Endurance Non-volatile Memory Segments

–32K Bytes of In-System Self-Programmable Flash program memory

–1K Bytes EEPROM

–2K Bytes Internal SRAM

–Write/Erase Cycles: 10,000 Flash/100,000 EEPROM

–Data retention: 20 years at 85C/100 years at 25C

–Optional Boot Code Section with Independent Lock Bits

–In-System Programming by On-chip Boot Program–True Read-While-Write Operation

–Programming Lock for Software Security

•  Peripheral Features

–Two 8-bit Timer/Counters with Separate Prescaler and Compare Mode

–One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture

Mode

–Real Time Counter with Separate Oscillator

–Six PWM Channels

–8-channel 10-bit ADC in TQFP and QFN/MLF package

–6-channel 10-bit ADC in PDIP Package

–Programmable Serial USART

–Master/Slave SPI Serial Interface

–Byte-oriented 2-wire Serial Interface (Philips I2C compatible)

–Programmable Watchdog Timer with Separate On-chip Oscillator

Page 33: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 33/74

Chapter 3.  Hardware Components    33

–On-chip Analog Comparator

–Interrupt and Wake-up on Pin Change

•   Special Microcontroller Features

–Power-on Reset and Programmable Brown-out Detection

–Internal Calibrated Oscillator

–External and Internal Interrupt Sources

–Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby,

and Extended Standby

•   I/O and Packages

–23 Programmable I/O Lines

–28-pin PDIP, 32-lead TQFP, 28-pad QFN/MLF and 32-pad QFN/MLF

•  Operating Voltage: 1.8 - 5.5V

•   Temperature Range: -40◦C to 85◦C

•  Speed Grade: 0 - 20 MHz @ 1.8 - 5.5V

•  Low Power Consumption at 1 MHz, 1.8V, 25◦C –Active Mode: 0.2 mA

–Power-down Mode: 0.1 A

–Power-save Mode: 0.75 A (Including 32 kHz RTC)

3.2 The Custom-Made Arduino Duemilanove

3.2.1 Arduino Duemilanove

The Arduino Duemilanove (“2009”) is a microcontroller board based on the ATmega328.

It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog

inputs, a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header,

and a reset button. It contains everything needed to support the microcontroller; simply

Page 34: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 34/74

Chapter 3.  Hardware Components    34

connect it to a computer with a USB cable or power it with a AC-to-DC adapter or

battery to get started. The Duemilanove is the latest in a series of USB Arduino boards.

Figure 3.1:  Arduino Duemilanove

3.2.2 The Custom Made Board

A Custom-made board based on Arduino Duemilanove has been made, optimized in de-

sign for the purpose of the project. The Atmega32 bought from   Embedded Market with

preloaded Arduino Duemilanove Bootloader 1 directly supports Arduino Programming

Language making the programming simpler. The circuit schematic of the Custom-made

board is shown in Figure  3.2 and the PCB layout of the Custom-made board is shown

in Figure 3.3.

Page 35: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 35/74

Chapter 3.  Hardware Components    35

    A    T    M    E    G    A    4    8    /    8    8    /    1    6    8  -    P

    U

    1    k

   1   k   1   k

   1   0   k

   1   k

    1    0    0   n    F

    1    0    0   n    F

    1    0    0   n    F

    1    0    0   n    F

    1

    0   u    F    /    4    0    V

    V    C    C

    V    C    C

    V    C    C

    G    N    D

    G    N    D

    G    N    D

    G    N    D

    G    N    D

   2   2   p    F 2   2   p    F

    P      W     M   3

    P    W    M    5

    P    W    M    6

    P    W    M    9

    P      W     M   1   0

    P      W     M   1   1

    G    N    D

    G    N    D

    G    N    D

    G    N    D

    G    N    D

    7    8    0    5

    7    8    0    6

    7    8    0    6

    7    8    0    6

    7    8    0    6

    7    8    0    6

    7    8    0    6

    G    N    D

    G    N    D

    G    N    D

    G    N    D

    G    N    D

    G    N    D

    G    N    D

    G    N    D

    G    N    D

    G    N    D

    V    C    C

    G    N    D

    1    0   u    F    /    4    0    V

    1    0   u    F    /    4    0    V

    1    0   u    F    /    4    0    V

    1    0   u    F    /    4    0    V

    1    0   u    F    /    4    0    V

    1    0   u    F    /    4    0    V

    V    C    C

    P    O    W    E

    R_

    J    A    C    K    S    L    T

    I    C    1

    P    B    5    (    S    C    K    /    P    C    I    N    T    5    )

    1    9

    P    B    7    (    X    T    A    L    2    /    T    O    S    C

    2    /    P    C    I    N    T    7    )

    1    0

    P    B    6    (    X    T    A    L    1    /    T    O    S    C

    1    /    P    C    I    N    T    6    )

    9

    G    N    D

    8

    V    C    C

    7

    A    G    N    D

    2    2

    A    R    E    F

    2    1

    A    V    C    C

    2    0

    P    B    4    (    M    I    S    O    /    P    C    I    N    T    4    )

    1    8

    P    B    3    (    M    O    S    I    /    O    C    2    A    /    P    C    I    N    T    3    )

    1    7

    P    B    2    (    S    S    /    O    C    1    B    /    P    C    I    N    T    2    )

    1    6

    P    B    1    (    O    C    1    A    /    P    C    I    N    T    1    )

    1    5

    P    B    0    (    I    C    P    1    /    C    L    K    O    /    P    C    I    N    T    0    )

    1    4

    P    D    7    (    A    I    N    1    /    P    C    I    N    T    2    3    )

    1    3

    P    D    6    (    A    I    N    0    /    O    C    0    A    /    P    C    I    N    T    2    2    )

    1    2

    P    D    5    (    T    1    /    O    C    0    B    /    P    C    I    N    T    2    1    )

    1    1

    P    D    4    (    T    0    /    X    C    K    /    P    C    I    N    T    2    0    )

    6

    P    D    3    (    I    N    T    1    /    O    C    2    B    /    P    C    I    N    T    1    9    )

    5

    P    D    2    (    I    N    T    0    /    P    C    I    N    T    1    8    )

    4

    P    D    1    (    T    X    D    /    P    C    I    N    T    1    7    )

    3

    P    D    0    (    R    X    D    /    P    C    I    N    T    1    6    )

    2

    P    C    5    (    A    D    C    5    /    S    C    L    P    C    I    N    T    1    3    )

    2    8

    P    C    4    (    A    D    C    4    /    S    D    A    /    P    C    I    N    T    1    2    )

    2    7

    P    C    3    (    A    D    C    3    /    P    C    I    N    T    1    1    )

    2    6

    P    C    2    (    A    D    C    2    /    P    C    I    N    T    1    0    )

    2    5

    P    C    1    (    A    D    C    1    /    P    C    I    N    T    9    )

    2    4

    P    C    0    (    A    D    C    0    /    P    C    I    N    T    8    )

    2    3

    P    C    6    (    /    R    E    S    E    T    /    P    C    I    N    T    1    4    )

    1

    R    1

    R   2    R   3

    R   4

    R   5

    C    1    0

    C   2

    C    1    1

    C    6

    C    8

    C

    7

    S    1

    1

    3 4

    2

     Q   1

   2   1

    C   3 C   4

   L    E    D   1   J    P   2   1

   2

   3

   J    P   3   1

   2

   3

    J    P    4   1 2 3

    J    P    5   1 2 3

    J    P    6   1 2 3

   J    P   7

   1

   2

   3

   J    P   8

   1

   2

   3

   L    E    D   2

    I    C    2

    G    N    D

    I    N

    O    U    T

    I    C    3

    G    N    D

    I    N

    O    U    T

    I    C    4

    G    N    D

    I    N

    O    U    T

    I    C    5

    G    N    D

    I    N

    O    U    T

    I    C    6

    G    N    D

    I    N

    O    U    T

    I    C    7

    G    N    D

    I    N

    O    U    T

    I    C    8

    G    N    D

    I    N

    O    U    T

    J    P    1   1 2 3 4 5 6

    J    P    9   1

    2

    3

    4

    5

    6

    C    1    5

    C    1    6

    C    1    7

    C    1    8

    C    1    9

    C    2    0

    J    1

    R    S    T

    R    S    T

Figure 3.2:   Schematic Of The Custom Made Development Board

Page 36: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 36/74

Chapter 3.  Hardware Components    36

Figure 3.3:   PCB Layout of the Custom Made Development Board

Page 37: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 37/74

Chapter 3.  Hardware Components    37

3.3 Servo Motor

This section describes the servo motors that are used in the project. The motors were

bought from   Nex-Robotics .

3.3.1 High Torque Servo Motor With Metal Gears

These motors are used in the base and wrist joints of the Robotic Arm. The specifications

of the Servo Motor used are:

•  Dimension: 40mm x 20mm x38mm

•  Torque: 5.5kg/cm at 4.8V, 6kg-cm at 6V

•   Stall current: 900mA

•   Idle current: 5mA

•   Operating voltage: 4.8V to 6V

•  Dual bearing with metal gear

•  Motor weight: 60gms

•  Operating speed: 0.15sec/60 degree

•   Temperature range: -20◦C to 55◦C

•  0.6 ms for 0◦ Rotation

•  2.2 ms for 180◦ Rotation

3.3.2 Very High Torque Servo Motor With Metal Gears

These motors are used in the shoulder and elbow joints of the Robotic Arm. The

specifications of the Servo Motor used are:

•  Dimension: 40.7mm x 20.5mm x39.5mm

•  Torque: 15.5kg/cm at 4.8V, 17kg/cm at 6V

Page 38: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 38/74

Chapter 3.  Hardware Components    38

•  Dual bearing with metal gear

•  Motor weight: 60gms

•  Operating speed: 0.15sec/60 degree

•   Operating voltage: 4.8V to 6V

•  Temperature range: 0-55◦C

•  0.6 ms for 0◦ Rotation

•  2.2 ms for 180◦ Rotation

3.4 The Gripper Module

Based on the feasibility analysis carried out in the last semester, we decided to purchase

the gripper from a commercial supplier. We bought the readymade gripper from Em-

bedded Market. Figure 3.4 shows the image of the General purpose gripper displayed

on their website.

Figure 3.4:  The Gripper Module

Page 39: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 39/74

Chapter 3.  Hardware Components    39

The gripper module includes a dc motor which can be used in variou ’pick and place’

kind of robots. It works on DC Motor(9V to 12V DC). Change in rotation direction of 

the DC motor generates the Jaw Open and Close action.

Page 40: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 40/74

Chapter 4

Design and Fabrication

In this chapter we describe the design and fabrication process of the robotic arm.

4.1 Torque Calculation Of Joints

The point of doing force calculations is for motor selection. We had to make sure that

the motor we chose could not only support the weight of the robot arm, but also whatthe robotic arm would carry.

Chosen parameters were:

•   weight of each linkage

•   weight of each joint

•  weight of object to lift

•  length of each linkage

We calculated the torques, multiplying downward force times the linkage lengths. This

calculation must be done for each lifting actuator. This particular design has just three

DOF that requires lifting, and the center of mass of each linkage is assumed to be

1

2 × Length.

40

Page 41: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 41/74

Chapter 4.   Design and Fabrication    41

Figure 4.1:  Robotic Arm shape

Referring to Figure 4.1, Torque about Joint 1:

T 1 = L1

2  ×W 1 + (L1 +

 L2

2  ) ×W 2 + (L1 + L2+

L3

2  ) ×W 3 + (L1 + L2 + L3 +

 L4

2  ) ×W 4

+ (L1 + L2 + L3 + L4) ×W 5   (4.1)

Torque about Joint 2:

T 2  = L2

2  ×W 2 + (L2 +

 L3

2  ) ×W 3 + (L2 + L3 +

 L4

2  ) ×W 4 + (L2 + L3 + L4) ×W 5

(4.2)

And Torque about Joint 3:

T 3 = L3

2  ×W 3 + (L3 +

 L4

2  ) ×W 4 + (L3 + L4) ×W 5   (4.3)

The servo motors used in the arm are thus chosen according to this calculation.

Page 42: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 42/74

Page 43: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 43/74

Chapter 4.   Design and Fabrication    43

A block diagram model of the robot arm control is shown in Figure  4.3.  The actuators

are the servo motors at each joint. The computer/sensors will control the servo motors

indirectly through the control unit.

4.3 Mechanical Fabrication of The Arm

It is pertinent to note that this part of the project requires very high expertise in

mechanical design and fabrication, hence, and understandably too, it was a major source

of concern for us considering our limited exposure in the above mentioned area.

We therefore sought the assistance of experts in the mechanical engineering design field,and, with grateful hearts, we want to thank the faculties of the Engineering Workshop,

D.U.I.E.T. as they helped us a lot in the entire mechanical fabrication. They lent us

their valuable time, and helped us to fabricate the arm. Apart from the excitement

of seeing abstract drawings transform into real mechanical components, we learnt some

important things in the mechanical engineering design field while working with them.

4.3.1 Construction

The base of the arm was built by cutting a steel box and drilling it as per our requirement.

The shoulder, elbow and wrist were build using Aluminum bars which were quite easy

to cut and shape as per our requirement. The drilling for the nuts and bolts were done

using a hand drill machine.

4.4 Summary

The total arm weight was 1.04kg. Most of the weight is at the base to avoid cantilever

beam type of problems that would otherwise result when the arm is extended.

Page 44: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 44/74

Chapter 5

Control system for the Robotic

Arm

In this chapter we describe the control system of the robotic arm..

5.1 Power Supply Unit

The current requirement of motors is given in Table 5.1.   Also each motor needs 6V to

ensure maximum torque. Hence we decided use a a 24V, 6A power adapter. A total of 

144W of power is available which is more than the required power.

Servo motor Current requirement(in mA)

Base 800Shoulder(2) 2 ×  1000

Elbow 1000Wrist 800

Gripper 450

Table 5.1:   Current requirement of servo motors at 6V

A High Current Step-Down Transformer is used to drop the voltage of the input AC

line. The Bridge Rectifier Circuit is made using IN5408 Power Diodes and High Storage

Capacitor(3300µF).Each motor is given a separate voltage regulator to provide enough

power. The voltage regulator used is 7806 which can give a maximum of 1A.

44

Page 45: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 45/74

Chapter 5.  Control system for the Robotic Arm    45

5.2 Different Modes of Control

The Robotic Arm is designed to be controlled in different modes. In one mode of 

control, the actuators are controlled using Positiion Sensors. In another, the actuators

are controlled using a keyboard connected via computer.

5.2.1 Manual Control Mode

In this mode of control, the Robotic Arm is Controlled using Position Sensors (Poten-

tiometers). A potentiometer is a simple knob that provides a variable resistance, which

we can read into the Arduino board as an analog value. In this case, that value controlsthe position of the Servo Motor. The Servo Motor copies the movement of the knob of 

the Potentiometer.

We connect three wires to the Arduino board. The first goes to ground from one of the

outer pins of the potentiometer. The second goes to 5 volts from the other outer pin

of the potentiometer. The middle pin of the potentiometer is connected to the analog

inputs of the Arduino Board.

Figure 5.1:   Wire Connection for the Sensor Control

Page 46: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 46/74

Chapter 5.  Control system for the Robotic Arm    46

By turning the shaft of the potentiometer, we change the amount of resistance on either

side of the wiper which is connected to the center pin of the potentiometer. This changes

the relative ”closeness” of that pin to 5 volts and ground, giving us a different analog

input. When the shaft is turned all the way in one direction, there are 0 volts going

to the pin, and we read 0(decimal). When the shaft is turned all the way in the other

direction, there are 5 volts going to the pin and we read 1023(decimal).

These decimal values from 0 to 1024 is mapped to servo rotation from o(degree) to

180(degree). This has been replicated for all the actuators of the Robotic Arm.

Figure 5.2:  Schematic for the Sensor Control

5.2.2 Computer Control Mode

In this mode of control, the Robotic Arm is controlled by the key board of a Computer

through Serial Communication.

We specify two keys in the keyboard; one to increase the duty cycle of the PWM Signal

and the other to decrease the duty cycle of the PWM Signal. We know that if the duty

Page 47: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 47/74

Chapter 5.  Control system for the Robotic Arm    47

cycle of PWM signal fed to the signal input of the Servo Motor increases the angular

position of the motor increases and vice versa. When we press a user defined key, the

Servo Motor increases or decreases its angular position at a particular user defined turn

rate. Different pair of keys is defined to control all the actuators of the servo motor as

shown in Table 5.2.

Keys Actuator

A & D BaseS & W ShoulderQ & E ElbowZ & C WristG & F Gripper

Table 5.2:  Keys Assignned for Controlling the Arm

Serial Communication is used for communication between the Arduino board and a

computer or other devices. All Arduino boards have at least one serial port (also known

as a UART or USART). It communicates on digital pins 0 (RX) and 1 (TX) as well

as with the computer via USB. We have use the Arduino environment’s built-in serial

monitor to communicate with an Arduino board.

Figure 5.3:  Serial Communication between Computer and COntroller Board

Page 48: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 48/74

Chapter 5.  Control system for the Robotic Arm    48

5.3 Miscelleneous Modes

There are many other ways to control the Robotic Arm. One option is by using a

Computer Mouse. In this method, the movement of the mouse, right button, left button

and Scroll button can be used to control the Arm. The implementation is quite similar

to the Keyboard-Computer Control Mode.

Another way to Control the Arm is by implementation of Inverse Kinematics and Image

Processing. This mode is quite difficult to achieve as processing of live video feed require

extreme processing power and speed, and complex image processing algorithms may need

to be applied for proper and desirable behaviour of the Robotic Arm.

Page 49: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 49/74

Chapter 6

Result of the Project

The Final Working Model of the Project taken in hand is a–

1. 5 DOF Articulated Robotic Arm.

2. Robotic Arm which can replicate a Human Hand movement by using Position

Sensors.

3. Robotic Arm which can be controlled using a computer keyboard.

Specifications of the Robotic Arm

Weight Lifting Capacity 150 gramsInput Supply Requirement 220 V – 60 Hz – ACCurrent Rating 6 AVoltage Rating 4.8 – 6 V

Serial Communication Protocol USB

49

Page 50: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 50/74

Chapter 6.  Result of the Project    50

Figure 6.1:  Final Working Model

Page 51: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 51/74

Conclusion

Achievements

In spite of our lack of knowledge in the mechanical fabrication field, we were able to

achieve the following:

•   Portable robotic arm that can be connected to almost any machine and controlled

with the right software installed or directly by position sensors.

•  Robotic Arm with 4 degrees of freedom.

•   Inverse kinematics was understood.

•  Platform for direct control of all 4 servo motors and 1 dc motor from computer.

•   We developed a respect towards and understanding of mechanical engineering

branch through hands-on experiences whilst fabricating the arm.

•   We understood modular embedded systems applications and operations while

working on the project.

Limitations

The project has the following limitations.

•   Our lack of mechanical knowledge resulted in a loss of considerable time, which

otherwise could have been used for developing more efficient feedback based roboticarm.

•  Irregularity in the power supply causes excess power loss.

•  The servos have unpredictable accuracy outside the limit of 25◦ to 160◦. This has

direct consequence because we could not achieve the desired work envelop.

•   Inverse kinematics fails when any one of the motors has reached its upper limit

(160◦) or lower limit (25◦).

51

Page 52: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 52/74

Future Scope

The project can be extended to add the following functionality:

•   Infrared sensors can be used to sense proximity of the object. This will prevent

the object from being knocked over.

•   Image processing can be done to recognize user hand movement and the robotic

arm can imitate.

•  Image processing can be used allow the user to pick up the desired object just by

clicking on it in the video feed.

•  Sixth degree of freedom in the form of wrist sideways (yaw) motion could be added.

This allows the user to grip the object in any desired position.

52

Page 53: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 53/74

Appendix A

Atmega 32 Microcontroller

A.1 Pin Configuration

Figure A.1:  Pinout of ATmega328P

53

Page 54: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 54/74

Appendix A.  Atmega 32 Microcontroller    54

A.2 Pin Description

A.2.1 VCC

Digital supply voltage.

A.2.2 GND

Ground.

A.2.3 PORT B (PB7:0) XTAL1/XTAL2/TOSC1/TOSC2

Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for

each bit). The Port B output buffers have symmetrical drive characteristics with both

high sink and source capability. As inputs, Port B pins that are externally pulled low

will source current if the pull-up resistors are activated. The Port B pins are tri-stated

when a reset condition becomes active, even if the clock is not running.

Depending on the clock selection fuse settings, PB6 can be used as input to the inverting

Oscillator amplifier and input to the internal clock operating circuit.

Depending on the clock selection fuse settings, PB7 can be used as output from the

inverting Oscillator amplifier.

If the Internal Calibrated RC Oscillator is used as chip clock source, PB7:6 is used as

TOSC2:1 input for the Asynchronous Timer/Counter2 if the AS2 bit in ASSR is set.

A.2.4 PORT C (PC5:0)

Port C is a 7-bit bi-directional I/O port with internal pull-up resistors (selected for each

bit). The PC5:0 output buffers have symmetrical drive characteristics with both high

sink and source capability. As inputs, Port C pins that are externally pulled low will

source current if the pull-up resistors are activated. The Port C pins are tri-stated when

a reset condition becomes active, even if the clock is not running.

Page 55: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 55/74

Appendix A.  Atmega 32 Microcontroller    55

A.2.5 PC6/RESET

If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note that the

electrical characteristics of PC6 differ from those of the other pins of Port C.If the RSTDISBL Fuse is unprogrammed, PC6 is used as a Reset input. A low level

on this pin for longer than the minimum pulse length will generate a Reset, even if the

clock is not running.

A.2.6 Port D (PD7:0)

Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for

each bit). The Port D output buffers have symmetrical drive characteristics with both

high sink and source capability. As inputs, Port D pins that are externally pulled low

will source current if the pull-up resistors are activated. The Port D pins are tri-stated

when a reset condition becomes active, even if the clock is not running.

A.2.7 AVCC

AVCC is the supply voltage pin for the A/D Converter, PC3:0, and ADC7:6. It should

be externally connected to VCC, even if the ADC is not used. If the ADC is used, it

should be connected to VCC through a low-pass filter. Note that PC6..4 use digital

supply voltage, VCC.

A.2.8 AREF

AREF is the analog reference pin for the A/D Converter.

A.2.9 ADC7:6 (TQFP AND QFN/MLF PACKAGE ONLY)

In the TQFP and QFN/MLF package, ADC7:6 serve as analog inputs to the A/D

converter. These pins are powered from the analog supply and serve as 10-bit ADC

channels.

Page 56: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 56/74

Appendix A.  Atmega 32 Microcontroller    56

A.3 AVR CORE

Figure A.2:  Block Diagram of the AVR Architecture

The main function of the CPU core is to ensure correct program execution. The CPU

must therefore be able to access memories, perform calculations, control peripherals,

and handle interrupts. In order to maximize performance and parallelism, the AVR

uses a Harvard architecture with separate memories and buses for program and data.

Instructions in the program memory are executed with a single level pipelining. While

one instruction is being executed, the next instruction is pre-fetched from the program

memory. This concept enables instructions to be executed in every clock cycle. The

program memory is In-System Reprogrammable Flash memory. The fast-access Register

File contains 32 x 8-bit general purpose working registers with a single clock cycle access

Page 57: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 57/74

Appendix A.  Atmega 32 Microcontroller    57

time. This allows single-cycle Arithmetic Logic Unit (ALU) operation. In a typical ALU

operation, two operands are output from the Register File, the operation is executed,

and the result is stored back in the Register File in one clock cycle. Six of the 32 registers

can be used as three 16-bit indirect address register pointers for Data Space addressing

enabling efficient address calculations. One of the address pointers can also be used as

an address pointer for look up tables in Flash program memory. These added function

registers are the 16-bit X-, Y-, and Z-register, described later in this section. The ALU

supports arithmetic and logic operations between registers or between a constant and a

register. Single register operations can also be executed in the ALU. After an arithmetic

operation, the Status Register is updated to reflect information about the result of the

operation. Program flow is provided by conditional and unconditional jump and callinstructions, able to directly address the whole address space. Most AVR instructions

have a single 16-bit word format. Every program memory address contains a 16- or

32-bit instruction.

Program Flash memory space is divided in two sections, the Boot Program section and

the Application Program section. Both sections have dedicated Lock bits for write and

read/write protection. The SPM instruction that writes into the Application Flash

memory section must reside in the Boot Program section.

During interrupts and subroutine calls, the return address Program Counter (PC) is

stored on the Stack. The Stack is effectively allocated in the general data SRAM,

and consequently the Stack size is only limited by the total SRAM size and the usage

of the SRAM. All user programs must initialize the SP in the Reset routine (before

subroutines or interrupts are executed). The Stack Pointer (SP) is read/write accessible

in the I/O space. The data SRAM can easily be accessed through the five different

addressing modes supported in the AVR architecture. The memory spaces in the AVR

architecture are all linear and regular memory maps. A flexible interrupt module has

its control registers in the I/O space with an additional Global Interrupt Enable bit in

the Status Register. All interrupts have a separate Interrupt Vector in the Interrupt

Vector table. The interrupts have priority in accordance with their Interrupt Vector

position. The lower the Interrupt Vector address, the higher the priority. The I/O

memory space contains 64 addresses for CPU peripheral functions as Control Registers,

SPI, and other I/O functions. The I/O Memory can be accessed directly, or as the

Data Space locations following those of the Register File, 0x20 - 0x5F. In addition,

Page 58: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 58/74

Appendix A.  Atmega 32 Microcontroller    58

the ATmega328P has Extended I/O space from 0x60 - 0xFF in SRAM where only the

ST/STS/STD and LD/LDS/LDD instructions can be used.

Page 59: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 59/74

Appendix B

Arduino Duemilanove

B.1 Overview

The Arduino Duemilanove (“2009 ”) is a microcontroller board based on the ATmega168

or ATmega328. It has 14 digital input/output pins (of which 6 can be used as PWM

outputs), 6 analog inputs, a 16 MHz crystal oscillator, a USB connection, a power jack,

an ICSP header, and a reset button. It contains everything needed to support the

microcontroller; simply connect it to a computer with a USB cable or power it with an

AC-to-DC adapter or battery to get started. “Duemilanove”means 2009 in Italian and

is named after the year of its release. The Duemilanove is the latest in a series of USB

Arduino boards.

B.2 Summary

Microcontroller ATmega168Operating Voltage 5VInput Voltage (recommended) 7-12VInput Voltage (limits) 6-20VDigital I/O Pins 14 (of which 6 provide PWM output)Analog Input Pins 6DC Current per I/O Pin 40 mADC Current for 3.3V Pin 50mAFlash Memory 32 KB of which 2 KB used by bootloaderSRAM 2 KB

EEPROM 1 KB

59

Page 60: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 60/74

Appendix B.  Arduino Duemilanove    60

B.3 Schematic

Figure B.1:  Schematic of Arduino Duemilanove

B.4 Power

The Arduino Duemilanove can be powered via the USB connection or with an external

power supply. The power source is selected automatically.

External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or

battery. The adapter can be connected by plugging a 2.1mm center-positive plug into

the board’s power jack. Leads from a battery can be inserted in the Gnd and Vin pin

headers of the POWER connector.

The board can operate on an external supply of 6 to 20 volts. If supplied with less than

7V, however, the 5V pin may supply less than five volts and the board may be unstable.

If using more than 12V, the voltage regulator may overheat and damage the board. The

recommended range is 7 to 12 volts.

The power pins are as follows –

Page 61: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 61/74

Appendix B.  Arduino Duemilanove    61

VIN

The input voltage to the Arduino board when it’s using an external power source (as

opposed to 5 volts from the USB connection or other regulated power source). You cansupply voltage through this pin, or, if supplying voltage via the power jack, access it

through this pin.

5V

The regulated power supply used to power the microcontroller and other components

on the board. This can come either from VIN via an on-board regulator, or be supplied

by USB or another regulated 5V supply.

3V3

A 3.3 volt supply generated by the on-board FTDI chip. Maximum current draw is 50

mA.

GND

Ground pins.

B.5 Memory

The ATmega168 has 16 KB of flash memory for storing code (of which 2 KB is used for

the bootloader); the ATmega328 has 32 KB, (also with 2 KB used for the bootloader).

The ATmega168 has 1 KB of SRAM and 512 bytes of EEPROM (which can be read

and written with the EEPROM library); the ATmega328 has 2 KB of SRAM and 1 KB

of EEPROM.

Page 62: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 62/74

Appendix B.  Arduino Duemilanove    62

B.6 Input and Output

Each of the 14 digital pins on the Duemilanove can be used as an input or output, using

pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each

pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor

(disconnected by default) of 20-50 kOhms.

In addition, some pins have specialized functions:

Serial

0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These

pins are connected to the corresponding pins of the FTDI USB-to-TTL Serial chip.

External Interrupts

2 and 3. These pins can be configured to trigger an interrupt on a low value, a rising orfalling edge, or a change in value. See the attachInterrupt() function for details.

PWM

3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.

SPI

10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication using

the SPI library.

LED

13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value,

the LED is on, when the pin is LOW, it’s off.

Page 63: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 63/74

Appendix B.  Arduino Duemilanove    63

The Duemilanove has 6 analog inputs, each of which provide 10 bits of resolution (i.e.

1024 different values). By default they measure from ground to 5 volts, though is it

possible to change the upper end of their range using the AREF pin and the analogRef-

erence() function. Additionally, some pins have specialized functionality:

I2C

analog input pins A4 (SDA) and A5 (SCL). Support I2C (TWI) communication using

the Wire library.

AREF

Reference voltage for the analog inputs. Used with analogReference().

Reset

Bring this line LOW to reset the microcontroller. Typically used to add a reset button

to shields which block the one on the board.

B.7 Communication

The Arduino Duemilanove has a number of facilities for communicating with a computer,

another Arduino, or other microcontrollers. The ATmega168 and ATmega328 provide

UART TTL (5V) serial communication, which is available on digital pins 0 (RX) and 1

(TX). An FTDI FT232RL on the board channels this serial communication over USB

and the FTDI drivers (included with Windows version of the Arduino software) provide

a virtual com port to software on the computer. The Arduino software includes a serial

monitor which allows simple textual data to be sent to and from the Arduino board.

The RX and TX LEDs on the board will flash when data is being transmitted via the

FTDI chip and USB connection to the computer (but not for serial communication onpins 0 and 1).

Page 64: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 64/74

Appendix B.  Arduino Duemilanove    64

A SoftwareSerial library allows for serial communication on any of the Duemilanove’s

digital pins.

The ATmega168 and ATmega328 also support I2C (TWI) and SPI communication. The

Arduino software includes a Wire library to simplify use of the I2C bus; see the docu-

mentation for details. For SPI communication, use the SPI library.

B.8 Programming

The Arduino Duemilanove can be programmed with the Arduino software. Select “Ar-

duino Duemilanove w/ ATmega328”from the Tools ¿ Board menu. The ATmega168 or

ATmega328 on the Arduino Duemilanove comes preburned with a bootloader that al-

lows you to upload new code to it without the use of an external hardware programmer.

It communicates using the original STK500 protocol.

You can also bypass the bootloader and program the microcontroller through the ICSP

(In-Circuit Serial Programming) header.

B.9 Automatic (Software) Reset

Rather than requiring a physical press of the reset button before an upload, the Arduino

Duemilanove is designed in a way that allows it to be reset by software running on a

connected computer. One of the hardware flow control lines (DTR) of the FT232RL

is connected to the reset line of the ATmega168 or ATmega328 via a 100 nanofarad

capacitor. When this line is asserted (taken low), the reset line drops long enough to

reset the chip. The Arduino software uses this capability to allow you to upload code

by simply pressing the upload button in the Arduino environment. This means that the

bootloader can have a shorter timeout, as the lowering of DTR can be well-coordinated

with the start of the upload.

This setup has other implications. When the Duemilanove is connected to either a

computer running Mac OS X or Linux, it resets each time a connection is made to it

from software (via USB). For the following half-second or so, the bootloader is running

on the Duemilanove. While it is programmed to ignore malformed data (i.e. anythingbesides an upload of new code), it will intercept the first few bytes of data sent to the

Page 65: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 65/74

Appendix B.  Arduino Duemilanove    65

board after a connection is opened. If a sketch running on the board receives one-time

configuration or other data when it first starts, make sure that the software with which

it communicates waits a second after opening the connection and before sending this

data

. The Duemilanove contains a trace that can be cut to disable the auto-reset. The

pads on either side of the trace can be soldered together to re-enable it. It’s labeled

”RESET-EN”. You may also be able to disable the auto-reset by connecting a 110 ohm

resistor from 5V to the reset line; see this forum thread for details.

B.10 Usb Overcurrent Protection

The Arduino Duemilanove has a resettable polyfuse that protects your computer’s USB

ports from shorts and overcurrent. Although most computers provide their own internal

protection, the fuse provides an extra layer of protection. If more than 500 mA is

applied to the USB port, the fuse will automatically break the connection until the

short or overload is removed.

B.11 Physical Characteristics

The maximum length and width of the Duemilanove PCB are 2.7 and 2.1 inches respec-

tively, with the USB connector and power jack extending beyond the former dimension.

Three screw holes allow the board to be attached to a surface or case. Note that the

distance between digital pins 7 and 8 is 160 mil (0.16”), not an even multiple of the 100

mil spacing of the other pins.

Page 66: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 66/74

Appendix C

Arduino Programming Language

Like all other programming language Arduino programming also has a structure. The

program can be divided into three sections. In the first section we declare pins and other

variables which are needed for the program. The second section is the setup section in

which we configure the device pins and other peripherals. This section is handled by

a function void setup(). The third and final section contains all our conditional logic

that is going to be executed indefinitely until the Arduino board is turned off. The logic

should be enclosed in the void loop() function. The following lines gives a better view

of the structure. The syntax followed is same as that of C. Arduino programming is

assisted with a set of built in functions for each of the controller specific activity. The

rest part is common C.

66

Page 67: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 67/74

Appendix D

Source Code for the Software

Implementation

D.1 Manual Control Mode

#include  <Servo.h> // use servo libary

Servo baseservo; // create servo object to control the base servo of the robotic arm

Servo elbowservo1; // create servo object to control the elbow servo 1

Servo elbowservo2; // create servo object to control the elbow servo 2

Servo wristservo; // create servo object to control the wrist servo

Servo gripservo; // create servo object to control the gripper servo

int potpinb = 0; // analog pin used to connect the potentiometer

int potpine = 1;

int potpinw = 2;

int potping = 3;

int val0; // variable to read the value from the analog pin

int val1;

int val2;

int val3;

67

Page 68: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 68/74

Appendix D.   Source Code for the Software Implementation    68

void setup()

{  baseservo.attach(9); // attaches the servo on pin 9 to the servo object base servo

elbowservo1.attach(10);

elbowservo2.attach(11);

wristservo.attach(6);

gripservo.attach(5);

}

void loop()

{

val0 = analogRead(potpinb); // reads the value of the potentiometer (value between 0

and 1023)

val0 = map(val0, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0

and 180)

baseservo.write(val0); // sets the servo position according to the scaled value

delay(15); // waits for the servo to get there

val1 = analogRead(potpine);

val1 = map(val, 0, 1023, 0, 179);elbowservo1.write(val1);

delay(15);

val1 = analogRead(potpine);

val1 = map(val, 0, 1023, 0, 179);

elbowservo2.write(val2);

delay(15);

val2 = analogRead(potpinw);

val2 = map(val, 0, 1023, 0, 179);

wristservo.write(val3);

delay(15);

val3 = analogRead(potping);

val3 = map(val4, 0, 1023, 0, 179);

gripservo.write(val4);

delay(15);

}

Page 69: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 69/74

Appendix D.   Source Code for the Software Implementation    69

D.2 Computer Control Mode

int servoPinbase = 9; // control pin for servo base motor

int servoPinelbow1 = 10; // control pin for servo elbow motor1

int servoPinelbow2 = 11; // control pin for servo elbow motor2

int servoPinwrist = 6; // control pin for servo wrsit

int servoPingripper= 5; // control pin for servo gripper

long pulseWidthbase;

long pulseWidthelbow1;

long pulseWidthelbow2;

long pulseWidthwrist;long pulseWidthgripper;

char val;

int minPulse = 500; // minimum servo position

int maxPulse = 2500; // maximum servo position

int turnRate = 50; // servo turn rate increment (larger value, faster rate)

int refreshTime = 20; // time (ms) between pulses (50Hz)

long lastPulsebase = 0; // recorded time (ms) of the last pulse of the base

long lastPulselbow1 = 0; // recorded time (ms) of the last pulse of the elbow1

long lastPulselbow2 = 0; // recorded time (ms) of the last pulse of the elbow2

long lastPulsewrist = 0; // recorded time (ms) of the last pulse of the wrist

long lastPulsegripper= 0; // recorded time (ms) of the last pulse of the gripper

long centerServo;

void setup()

{

pinMode(servoPinbase,OUTPUT);

pinMode(servoPinelbow1,OUTPUT);

pinMode(servoPinelbow2,OUTPUT);

pinMode(servoPinwrist,OUTPUT);

pinMode(servoPingripper,OUTPUT);

Serial.begin(115200);centerServo = maxPulse - ((maxPulse - minPulse)/2);

Page 70: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 70/74

Appendix D.   Source Code for the Software Implementation    70

pulseWidthbase = centerServo; // Give the servo a starting point (or it floats)

pulseWidthelbow1 = centerServo;

pulseWidthelbow2 = centerServo;

pulseWidthwrist = centerServo;

pulseWidthgripper =centerServo;

}

void loop()

{

if (Serial.available())

{

val=Serial.read();if (val ==’D’    val ==’d’){pulseWidthbase = pulseWidthbase - turnRate;}

if (val ==’A’    val ==’a’){pulseWidthbase = pulseWidthbase + turnRate;}

if (val ==’S’     val ==’s’){pulseWidthbase = centerServo; pulseWidthelbow1 = cen-

terServo;pulseWidthelbow2 = centerServo;  }

if (val ==’X’  val ==’x’){pulseWidthelbow1 = pulseWidthelbow1 - turnRate;pulseWidthelbow2

= pulseWidthelbow2 - turnRate;}

if (val ==’W’  val ==’w’){pulseWidthelbow2 = pulseWidthelbow1 + turnRate;pulseWidthelbow2

= pulseWidthelbow2 + turnRate;}

if (val ==’K’    val ==’k’){pulseWidthgripper = pulseWidthgripper - turnRate;}

if (val ==’H’    val ==’h’){pulseWidthgripper = pulseWidthgripper + turnRate;}

if (val ==’J’     val ==’j’){pulseWidthgripper = centerServo; pulseWidthwrist= cen-

terServo; }

if (val ==’U’    val ==’u’){pulseWidthwrist = pulseWidthwrist - turnRate;}

if (val ==’M’    val ==’m’){pulseWidthwrist = pulseWidthwrist + turnRate;}

Serial.flush();

Serial.print(“Moving base servo to”);

Serial.print(pulseWidthbase,DEC);

Serial.println();

Serial.print(“Moving elbow servo to”);

Serial.print(pulseWidthelbow1,DEC);

Serial.print(“Moving wrist servo to”);Serial.print(pulseWidthwrist,DEC);

Page 71: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 71/74

Appendix D.   Source Code for the Software Implementation    71

Serial.println();

Serial.print(“Moving gripper servo to”);

Serial.print(pulseWidthgripper,DEC);

Serial.println();

updateServobase(); //update base servo position

updateServoelbow1(); //update elbow1 servo postion

updateServoelbow2(); //update elbow2 servo position

updateServowrist(); //update wrist servo position

updateServogripper(); //update gripper servo position

}}

void updateServobase()

{

if (millis()-lastPulsebase>=refreshTime)

{

digitalWrite(servoPinbase,HIGH); //turn the motor on

delayMicroseconds(pulseWidthbase); // pulse width of the base

digitalWrite(servoPinbase, LOW); // stop the pulse

lastPulsebase = millis(); // save the time of the last pulse of the base

}

}

void updateServoelbow1()

{

if (millis()-lastPulselbow1>=refreshTime)

{

digitalWrite(servoPinelbow1,HIGH); //turn the motor on

delayMicroseconds(pulseWidthelbow1); // pulse width of the elbow1

digitalWrite(servoPinelbow1, LOW); // stop the pulse

lastPulselbow1= millis(); // save the time of the last pulse of the elbow1

}

}

Page 72: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 72/74

Appendix D.   Source Code for the Software Implementation    72

void updateServoelbow2()

{

if (millis()-lastPulselbow2>=refreshTime)

{

digitalWrite(servoPinelbow2,HIGH); //turn the motor on

delayMicroseconds(pulseWidthelbow2); // pulse width of the elbow2

digitalWrite(servoPinelbow2, LOW); // stop the pulse

lastPulselbow2 = millis(); // save the time of the last pulse of the elbow2

}

}

void updateServowrist()

{

if (millis()-lastPulsewrist>=refreshTime)

{

digitalWrite(servoPinwrist,HIGH); //turn the motor on

delayMicroseconds(pulseWidthwrist); // pulse width of the wrist

digitalWrite(servoPinwrist, LOW); // stop the pulselastPulsewrist = millis(); // save the time of the last pulse of the wrist

}

}

void updateServogripper()

{

if (millis()-lastPulsegripper>=refreshTime)

{

digitalWrite(servoPingripper,HIGH); //turn the motor on

delayMicroseconds(pulseWidthgripper); // pulse width of the gripper

digitalWrite(servoPingripper, LOW); // stop the pulse

lastPulsegripper = millis(); // save the time of the last pulse of the gripper

}

}

Page 73: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 73/74

Appendix D.   Source Code for the Software Implementation    73

D.3 Servo Library

This library allows an Arduino board to control RC (hobby) servo motors. Servos have

integrated gears and a shaft that can be precisely controlled. Standard servos allow the

shaft to be positioned at various angles, usually between 0 and 180 degrees. Continuous

rotation servos allow the rotation of the shaft to be set to various speeds.

The Servo library supports up to 12 motors on most Arduino boards and 48 on the Ar-

duino Mega. On boards other than the Mega, use of the library disables analogWrite()

(PWM) functionality on pins 9 and 10, whether or not there is a Servo on those pins.

On the Mega, up to 12 servos can be used without interfering with PWM functionality;

use of 12 to 23 motors will disable PWM on pins 11 and 12.

Page 74: An Articulated Robotic Arm

7/22/2019 An Articulated Robotic Arm

http://slidepdf.com/reader/full/an-articulated-robotic-arm 74/74

Bibliography

•   Paul RP (1981) Robot Manipulators: mathematics, programming and control,

MIT, Boston

•   Craig JJ (1989) Introduction to robotics: mechanics and control, 2nd Edition

Addison-Wesley, New York

•  Massimo Banzi(2009), Getting Started with Arduino, First Edition, OReilly Me-

dia, Inc., CA

•   Casey Reas and Ben Fry(2010), Getting Started with Processing, First Edition,

OReilly Media, Inc., CA

•  Yih-Ping Luh(1987), Complete Inverse Kinematics Solutions for Robot Manipula-

tors, Cornell University, New York

•   Craig, Craig John J.(2008), Introduction To Robotics: Mechanics And Control,

3rd Edition, Pearson Education, India

•  Wilfried Voss (2007), A Comprehensible Guide To Servo Motor Sizing, Copperhill

Technologies Corporation, Massachusetts

•   Steven Frank Barrett and Daniel J. Pack(2008), Atmel AVR Microcontroller Primer:Programming and Interfacing, Morgan & Claypool Publishers

•  Society of Robots copyright 2005-2012, Robot Arm Tutorial, How to Build a Robot