Anda di halaman 1dari 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 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

Declaration
We 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 fulllment of the requirement for the award of the degree Bachelor of Technology 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.

Himanshu Ranjan Das Manas Pratim Kalita Date: Mondeep Paul Pronadeep Bora Vishwajit Nandi

Approved by:

Director, Dibrugarh University Institute of Engineering and Technology

ii

Certicate
This is to certify that the Thesis/Report entitled Shadow Function-based Articulated Robotic Arm (SFARA) which is submitted by Himanshu Ranjan Das, Manas Pratim Kalita, Mondeep Paul, Pronadeep Bora and Vishwajit Nandi in practical fulllment of the requirement for the award of the degree B.Tech. in Electronics 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.

Mr. Haraprasad Mondal Assistant Professor, Department of Electronics Date: 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

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 obligation to 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 allowing 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 fabrication of the Robotic arm. We also thank Mr. Mintu Bora, Jr. Instructor (Machine Shop), Mr. Nirmal Gohain, Jr. Instructor (Fitting Shop) and Mr. Pradip Kumar Sharma, Jr. Instructor (Welding Shop) of Engineering Workshop, D.U.I.E.T., Dibrugarh 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

Contents
Declaration Certicate Acknowledgements List of Figures List of Tables Abbreviations Abstract 1 Introduction 1.1 Preamble . . . . . . . . . . . . . . . . 1.2 Laws Of Robotics . . . . . . . . . . . . 1.2.1 Robotic Arm . . . . . . . . . . 1.2.2 Classication Of Robotic Arms ii iii iv viii ix x xi 12 12 13 14 14 17 17 17 18 19 19 20 20 21 21 22 22 23 24 25 25

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

2 Literature Review 2.1 Mechanics And Motion . . . . . . . . . . . . . . . 2.2 Manipulator . . . . . . . . . . . . . . . . . . . . . 2.3 Positioning, Orienting and Degrees of Freedom . 2.4 Arm Geometries . . . . . . . . . . . . . . . . . . 2.4.1 Cartesian or Rectangular Work Envelope 2.4.2 Cylindrical Work Envelope . . . . . . . . 2.4.3 Polar or Spherical Work Envelope . . . . 2.4.4 The Wrist Work Envelope . . . . . . . . . 2.4.5 Grippers Work Envelope . . . . . . . . . . 2.5 Material Selection for Robotic Arm Fabrication . 2.5.1 Factors under Consideration . . . . . . . . 2.5.2 Material Selection . . . . . . . . . . . . . 2.6 Servo Motors . . . . . . . . . . . . . . . . . . . . 2.6.1 Servo Motor Applications . . . . . . . . . 2.6.2 Servo Motor Manufacturers . . . . . . . . v

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

Contents 2.6.3 Servo Motor Wiring and Plugs . . . . . . . . . . . . . . . . . . . . 2.6.4 Servo Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.6.5 Power Supply for Servo . . . . . . . . . . . . . . . . . . . . . . . . 2.6.6 Selection of a Servo . . . . . . . . . . . . . . . . . . . . . . . . . . Arduino Micro-Controller Board . . . . . . . . . . . . . . . . . . . . . . . Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.8.1 Choice of Programming Language for the Software on the Computer 2.8.2 Choice of Programming Language for the Micro-Controller . . . .

vi 25 26 28 28 29 29 30 30 31 31 31 33 33 34 37 37 37 38 40 40 42 43 43 43 44 44 45 45 46 48 49 51 52

2.7 2.8

3 Hardware Components 3.1 Electronics Hardware . . . . . . . . . . . . . . . . . . . . . 3.1.1 Atmega328 Microcontroller . . . . . . . . . . . . . 3.2 The Custom-Made Arduino Duemilanove . . . . . . . . . 3.2.1 Arduino Duemilanove . . . . . . . . . . . . . . . . 3.2.2 The Custom Made Board . . . . . . . . . . . . . . 3.3 Servo Motor . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.1 High Torque Servo Motor With Metal Gears . . . 3.3.2 Very High Torque Servo Motor With Metal Gears 3.4 The Gripper Module . . . . . . . . . . . . . . . . . . . . . 4 Design and Fabrication 4.1 Torque Calculation Of Joints . . . . 4.2 Basic Design Considerations . . . . . 4.3 Mechanical Fabrication of The Arm 4.3.1 Construction . . . . . . . . . 4.4 Summary . . . . . . . . . . . . . . . 5 Control system for the Robotic Arm 5.1 Power Supply Unit . . . . . . . . . . 5.2 Dierent Modes of Control . . . . . 5.2.1 Manual Control Mode . . . . 5.2.2 Computer Control Mode . . . 5.3 Miscelleneous Modes . . . . . . . . . 6 Result of the Project Conclusion Future Scope

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . . . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

A Atmega 32 Microcontroller A.1 Pin Conguration . . . . . A.2 Pin Description . . . . . . A.2.1 VCC . . . . . . . . A.2.2 GND . . . . . . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

53 53 54 54 54

Contents A.2.3 PORT B (PB7:0) XTAL1/XTAL2/TOSC1/TOSC2 . A.2.4 PORT C (PC5:0) . . . . . . . . . . . . . . . . . . . . . A.2.5 PC6/RESET . . . . . . . . . . . . . . . . . . . . . . . A.2.6 Port D (PD7:0) . . . . . . . . . . . . . . . . . . . . . . A.2.7 AVCC . . . . . . . . . . . . . . . . . . . . . . . . . . . A.2.8 AREF . . . . . . . . . . . . . . . . . . . . . . . . . . . A.2.9 ADC7:6 (TQFP AND QFN/MLF PACKAGE ONLY) A.3 AVR CORE . . . . . . . . . . . . . . . . . . . . . . . . . . . . B Arduino Duemilanove B.1 Overview . . . . . . . . . . B.2 Summary . . . . . . . . . . B.3 Schematic . . . . . . . . . . B.4 Power . . . . . . . . . . . . B.5 Memory . . . . . . . . . . . B.6 Input and Output . . . . . B.7 Communication . . . . . . . B.8 Programming . . . . . . . . B.9 Automatic (Software) Reset B.10 Usb Overcurrent Protection B.11 Physical Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

vii 54 54 55 55 55 55 55 56 59 59 59 60 60 61 62 63 64 64 65 65 66 67 67 69 73

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

. . . . . . . . . . .

C Arduino Programming Language D Source Code for the Software Implementation D.1 Manual Control Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D.2 Computer Control Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . D.3 Servo Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Bibliography

74

List of Figures
1.1 1.2 1.3 1.4 1.5 2.1 2.2 2.3 2.4 2.5 3.1 3.2 3.3 3.4 4.1 4.2 4.3 5.1 5.2 5.3 6.1 An Articulated Robotic Arm and its Workspace . A Gantry Robot and its Workspace . . . . . . . . A Cylindrical Robot and its Workspace . . . . . A Spherical robot and its Workspace . . . . . . . A SCARA robot and its Workspace . . . . . . . A commercially available Servo Motor . . . . . . Control Signals for Servo Motor . . . . . . . . . . Inside a Servo Motor . . . . . . . . . . . . . . . . Step-by-step disassembly of a Servo Motor . . . . Feedback Mechanism Employed by Servo Motor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 15 15 16 16 24 26 27 27 28 34 35 36 38

Arduino Duemilanove . . . . . . . . . . . . . . . . . . Schematic Of The Custom Made Development Board . PCB Layout of the Custom Made Development Board The Gripper Module . . . . . . . . . . . . . . . . . . .

Robotic Arm shape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Top Down Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 A Block Diagram Model of the Robot Arm . . . . . . . . . . . . . . . . . 42 Wire Connection for the Sensor Control . . . . . . . . . . . . . . . . . . . 45 Schematic for the Sensor Control . . . . . . . . . . . . . . . . . . . . . . . 46 Serial Communication between Computer and COntroller Board . . . . . 47 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

List of Tables
5.1 5.2 Current requirement of servo motors at 6V . . . . . . . . . . . . . . . . . 44 Keys Assignned for Controlling the Arm . . . . . . . . . . . . . . . . . . . 47

ix

Abbreviations
JARVIS SFARA PWM APL Servo PUMA DOF GRP CAD GUI DU Just A Rather Very Intelligent System Shadow Function-based Articulated Robotic Arm Pulse Width Modulation Arduino Programming Language Servo Motor Programmable Universal Manipulation Arm Degree Of Freedom Glasselective Reinforced Plastic Computer Aided Design Graphical User Interface Duemilanove

Abstract
Shadow Function-based Articulated Robotic Arm (SFARA)

This project deals with the design, fabrication and control of an Articulated Robotic Arm which can shadow the movement of a Human Arm by using Sensor Interfacing, Image Processing, and Computer Control etc. Robotic Arms are extensively used in Automobile Industries, Microelectronics Industries, Chemical Industries, Agriculture eld, Biomedical eld, Defense, Material Handling and Welding etc. Robotics arms can be implemented using Inverse Kinematics, Forward Kinematics etc. In this project, four Servo motors control the motion of the arm while one controls the orientation of the wrist and one is used for controlling the gripper to form a 5 DOF Robotic Arm. Initially, a Robotic Arm is build which can be controlled by using position sensors. After that the Arm is tried to be controlled by computer using USART Serial Communication. Later, using a webcam the Arm is controlled by live video stream of a human hand by implementing techniques of Image processing and Inverse Kinematics.

xi

Chapter 1

Introduction
1.1 Preamble

In the modern world, robotics has become popular, useful, and has achieved great successes in several elds of humanity. Robotics has become very useful in medicine, education, 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 nd dicult 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 dierent disciplines, among them kinematics, signal analysis, information theory, articial 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 Archytas 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 rst remote-controlled robot in Madison Square Garden. The robot designed was modelled after a boat.

12

Chapter 1. Introduction

13

The rst industrial robots were Unimates developed by George Devol and Joe Engelberger in the late 50s and early 60s. The rst patents were by Devol but Engelberger formed Unimation which was the rst 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 recovered and robotics was back on track. George Devol Jr, in 1954 developed the multijointed articial arm, which lead to the modern robots. However, mechanical engineer Victor Scheinman, developed the truly exible arm known as the Programmable Universal 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 signicant 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 eciently in the social community.

1.2

Laws Of Robotics

Many scientist and science ction writer give law for robotics. But the rst and most popular law was given by Sir Isaac Assimov in his science ction 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 conict with the rst law. 3. A robot must protect its own existence as long as such protection does not conict with the rst or second law.

Assimov later adds a Zeroth law to the list: Zeroth law: A robot may not injure humanity, or enough inaction, allow humanity to come to harm.

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 either rotational 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 eector and it is analogous to the human hand. The end eector 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

Classication Of Robotic Arms

The Robotic Arms may be classied as follows:

1. Articulated robot Used for assembly operations, die casting, fettling machines, gas welding, arc welding, and spray painting. Its 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. Its a robot

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. Its 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 ight simulators. Its a robot whose arms have concurrent prismatic or rotary joints. 5. Spherical robot / Polar robot Used for handling at machine tools, spot welding, die casting, fettling machines, gas welding and arc welding. Its a robot whose axes form a polar coordinate system.

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. Its a robot which has two parallel rotary joints to provide compliance in a plane.

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

Chapter 2. Literature Review

18

permanently attached to the oor, a table, or a stand. In most cases, however, industrial manipulators are too big and use a geometry that is not eective 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 dicult. 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 distinguishable. 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 orientation. 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 eectively. 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,

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 dicult 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 signicantly. 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 fteen 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 eectively 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 envelope. Some industrial gantry manipulators work from outside their work envelope, and it would be dicult indeed to use their layouts on a mobile robot. In fact, that is how

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 cantilevered. Mounted on the front of a robot, the rst 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 rst segment able to telescope or slide up and down, carrying a horizontally telescoping segment. While they are very simple to picture and the work envelope is intuitive, they are hard to implement eectively 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 rst 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 stiness 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 dicult 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.

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 dicult. Most wrists consist of three separate joints. The order of the degrees of freedom in a wrist has a large eect 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 aect something in the environment. For this reason it is commonly called an end-eector, 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 specic 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 eectively is often dicult. 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.

Chapter 2. Literature Review

22

2.5
2.5.1

Material Selection for Robotic Arm Fabrication


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 eective stiness 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 inuenced all the choices made in the design selection of the robotic arm.

Chapter 2. Literature Review

23

2.5.2

Material Selection

In manipulator structures, stiness-to-weight ratio of a link is very important since inertia forces induce the largest deections. Therefore, an increase in the Elastic modulus, E would be very desirable if it is not accompanied by an unacceptable increase in specic 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 expensive. 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 coecient, diculty in joining with metal parts, high cost and the fact that they are not yet commercially available make the use of ber-reinforced materials limited though they have good stiness-to-weight ratios. However, with advances in research, some of the mentioned setbacks have been signicantly reduced. Hence, the use of ber-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) stiness. The parameter to be modied to comply with these constraints is the shape of the cross-section. The choice is between hollow round and hollow rectangular cross-section. From design standpoint of view, the links

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 Aluminum, 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-o 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 ber 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 ecient and eective 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 xed angles.

Figure 2.1: A commercially available Servo Motor

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 fact very 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 dierences 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 dierent 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 ange 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 ange. Also a Hitec connector can be used with a Futaba servo just by ling o the extra width so that it ts 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.

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 diers 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

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 amplier.

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

The feedback circuit employed by a servo motor is shown in gure 2.5. The dierence signal is amplied and provided to the DC motor. So the signal applied to the DC servo

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 dierence between the desired position as indicated by the pulse train and current position is large, motor moves fast. When the same dierence 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 required waveform.

2.6.5

Power Supply for Servo

The servo requires a DC supply of 4.8 V to 6 V. For a specic servo, its voltage rating is given as one of its specication 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 eciency. 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 specications 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

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 dierent 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 dierent 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 the manufacturers can be seen to obtain details about dierent 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 exible, 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 environment by receiving input from a variety of sensors and can aect its surroundings by controlling lights, motors, and other actuators. The micro-controller on the board is programmed 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, Processing, and MaxMSP). The boards can be built by hand or purchased preassembled; the software can be downloaded for free. The hardware reference designs (CAD les) are available under an open-source license.

2.8

Software

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

Chapter 2. Literature Review

30

the software tools used in the project. We had chosen two dierent 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 Computer

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 actually form the intelligence of the robot. Its written in Arduino Programming Language (APL) specically designed for all range of Arduino boards. The trade-o in using a high-level language instead of the native instruction set to program a micro-controller would be a slightly less ecient 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.

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 the robotic arm. The arm is controlled by a micro-controller board called Arduino Duemilanove driving the actuators (servo motors and dc motor) with an Atmels ATmega328 microcontroller (with pre-loaded Arduino-DU bootloader 1) embedded on it. The microcontroller 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 enhanced 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

Chapter 3. Hardware Components 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

32

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

Chapter 3. Hardware Components On-chip Analog Comparator Interrupt and Wake-up on Pin Change

33

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
3.2.1

The Custom-Made Arduino Duemilanove


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

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 design 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.

C10
GND GND GND GND GND

IN

OUT

VCC

J1
IN OUT

C7 C15 10uF/40V IC3 7806 GND GND


1 2 3

IN

OUT

C16 10uF/40V IC4 7806 C18 10uF/40V GND IC5 7806 IC6 C19 7806 10uF/40V 10uF/40V

IN

OUT

C17

IN GND

OUT

IN

OUT

IN

OUT

GND

POWER_JACKSLT IC8 7806 GND JP2

100nF

IC2 7805

10uF/40V

VCC

GND

IC7 7806 C20 10uF/40V GND

GND

10k

R4

S1
1 2 3

JP3

1 2

3 4

PWM3

PC6(/RESET/PCINT14)

GND

C2

GND JP4 R3 1k R2
1 2 3

RST

RST

23 24 25 26 27 28 1 2 3 4 5 6

GND

VCC JP9
1 3 5 2 4 6

IC1 JP1

Q1

22pF

C3

PC0(ADC0/PCINT8) PC1(ADC1/PCINT9) PC2(ADC2/PCINT10) PC3(ADC3/PCINT11) PC4(ADC4/SDA/PCINT12) PC5(ADC5/SCLPCINT13) PB6(XTAL1/TOSC1/PCINT6)

Chapter 3. Hardware Components

GND PWM5

GND

C4

VCC

22pF

1k

10

GND JP5
1 2 3

20 21

C11

C6

PB7(XTAL2/TOSC2/PCINT7) PD0(RXD/PCINT16) PD1(TXD/PCINT17) PD2(INT0/PCINT18) VCC PD3(INT1/OC2B/PCINT19) PD4(T0/XCK/PCINT20) PD5(T1/OC0B/PCINT21) AVCC PD6(AIN0/OC0A/PCINT22) AREF PD7(AIN1/PCINT23) 2 3 4 5 6 11 12 13

GND

C8 100nF

100nF

PWM6

100nF

22

GND

AGND

GND

PB0(ICP1/CLKO/PCINT0) PB1(OC1A/PCINT1) PB2(SS/OC1B/PCINT2) PB3(MOSI/OC2A/PCINT3) PB4(MISO/PCINT4) PB5(SCK/PCINT5)

14 15 16 17 18 19

JP6 LED1
1 2 3

ATMEGA48/88/168-PU

GND

VCC PWM9 GND LED2

R5 1k

GND GND

GND

3 2 1

JP7

PWM10

3 2 1

PWM11

JP8

Figure 3.2: Schematic Of The Custom Made Development Board


R1 1k GND

35

Chapter 3. Hardware Components

36

Figure 3.3: PCB Layout of the Custom Made Development Board

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 specications 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 specications 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

Chapter 3. Hardware Components 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

38

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 Embedded Market. Figure 3.4 shows the image of the General purpose gripper displayed on their website.

Figure 3.4: The Gripper Module

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.

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 what the 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

Chapter 4. Design and Fabrication

41

Figure 4.1: Robotic Arm shape

Referring to Figure 4.1, Torque about Joint 1: T1 = L1 L2 L3 L4 W1 + (L1 + ) W2 + (L1 + L2 + ) W3 + (L1 + L2 + L3 + ) W4 2 2 2 2 + (L1 + L2 + L3 + L4 ) W5 Torque about Joint 2: T2 = L2 L3 L4 W2 + (L2 + ) W3 + (L2 + L3 + ) W4 + (L2 + L3 + L4 ) W5 2 2 2 (4.2) (4.1)

And Torque about Joint 3: T3 = L3 L4 W3 + (L3 + ) W4 + (L3 + L4 ) W5 2 2 (4.3)

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

Chapter 4. Design and Fabrication

42

4.2

Basic Design Considerations

In the design of systems, there are generally two methods of approach namely:

Top-down method Bottom-Up method

Figure 4.2: Top Down Approach

The top-down method is usually applied in designing a system from the scratch while the down-top method is used for reverse designing of an already existing system or functional design as in software engineering. We employed the top-down approach in the design of the robot arm project and Figure 4.2 shows how the various modules were integrated to arrive at the entire system.

Figure 4.3: A Block Diagram Model of the Robot Arm

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 eld, 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 eld 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.

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 Base Shoulder(2) Elbow Wrist Gripper Current requirement(in mA) 800 2 1000 1000 800 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 Rectier Circuit is made using IN5408 Power Diodes and High Storage Capacitor(3300F).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

Chapter 5. Control system for the Robotic Arm

45

5.2

Dierent Modes of Control

The Robotic Arm is designed to be controlled in dierent 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 (Potentiometers). 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 controls the 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 rst 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

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 dierent 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

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 dened key, the Servo Motor increases or decreases its angular position at a particular user dened turn rate. Dierent pair of keys is dened to control all the actuators of the servo motor as shown in Table 5.2. Keys A&D S&W Q&E Z&C G&F Actuator Base Shoulder Elbow Wrist 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 environments built-in serial monitor to communicate with an Arduino board.

Figure 5.3: Serial Communication between Computer and COntroller Board

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 dicult 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.

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.

Specications of the Robotic Arm


Weight Lifting Capacity Input Supply Requirement Current Rating Voltage Rating Serial Communication Protocol 150 grams 220 V 60 Hz AC 6A 4.8 6 V USB

49

Chapter 6. Result of the Project

50

Figure 6.1: Final Working Model

Conclusion
Achievements
In spite of our lack of knowledge in the mechanical fabrication eld, 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 ecient feedback based robotic arm. 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

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

Appendix A

Atmega 32 Microcontroller
A.1 Pin Conguration

Figure A.1: Pinout of ATmega328P

53

Appendix A. Atmega 32 Microcontroller

54

A.2
A.2.1

Pin Description
VCC

Digital supply voltage.

A.2.2
Ground.

GND

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 buers 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 amplier 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 amplier. 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 buers 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.

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 dier 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 buers 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 lter. 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.

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

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 ecient 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 reect information about the result of the operation. Program ow is provided by conditional and unconditional jump and call instructions, 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 eectively 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 ve dierent addressing modes supported in the AVR architecture. The memory spaces in the AVR architecture are all linear and regular memory maps. A exible 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,

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.

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. Duemilanovemeans 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
ATmega168 5V 7-12V 6-20V 14 (of which 6 provide PWM output) 6 40 mA 50mA 32 KB of which 2 KB used by bootloader 2 KB 1 KB

Microcontroller Operating Voltage Input Voltage (recommended) Input Voltage (limits) Digital I/O Pins Analog Input Pins DC Current per I/O Pin DC Current for 3.3V Pin Flash Memory SRAM EEPROM

59

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 boards 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 ve 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

Appendix B. Arduino Duemilanove VIN

61

The input voltage to the Arduino board when its using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). You can supply 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 ash 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.

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 congured to trigger an interrupt on a low value, a rising or falling 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, its o.

Appendix B. Arduino Duemilanove

63

The Duemilanove has 6 analog inputs, each of which provide 10 bits of resolution (i.e. 1024 dierent 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 analogReference() 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 ash when data is being transmitted via the FTDI chip and USB connection to the computer (but not for serial communication on pins 0 and 1).

Appendix B. Arduino Duemilanove

64

A SoftwareSerial library allows for serial communication on any of the Duemilanoves 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 documentation for details. For SPI communication, use the SPI library.

B.8

Programming

The Arduino Duemilanove can be programmed with the Arduino software. Select Arduino Duemilanove w/ ATmega328from the Tools Board menu. The ATmega168 or ATmega328 on the Arduino Duemilanove comes preburned with a bootloader that allows 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 ow 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. anything besides an upload of new code), it will intercept the rst few bytes of data sent to the

Appendix B. Arduino Duemilanove

65

board after a connection is opened. If a sketch running on the board receives one-time conguration or other data when it rst 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. Its 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 computers 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 respectively, 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.

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 rst section we declare pins and other variables which are needed for the program. The second section is the setup section in which we congure the device pins and other peripherals. This section is handled by a function void setup(). The third and nal section contains all our conditional logic that is going to be executed indenitely until the Arduino board is turned o. 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 specic activity. The rest part is common C.

66

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

Appendix D. Source Code for the Software Implementation 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); }

68

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); }

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);

Appendix D. Source Code for the Software Implementation pulseWidthbase = centerServo; // Give the servo a starting point (or it oats) pulseWidthelbow1 = centerServo; pulseWidthelbow2 = centerServo; pulseWidthwrist = centerServo; pulseWidthgripper =centerServo; } void loop() { if (Serial.available()) { val=Serial.read(); if (val ==D if (val ==A if (val ==S val ==d){pulseWidthbase = pulseWidthbase - turnRate;} val ==a){pulseWidthbase = pulseWidthbase + turnRate;}

70

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 if (val ==H if (val ==J terServo; } if (val ==U if (val ==M val ==u){pulseWidthwrist = pulseWidthwrist - turnRate;} val ==m){pulseWidthwrist = pulseWidthwrist + turnRate;} val ==k){pulseWidthgripper = pulseWidthgripper - turnRate;} val ==h){pulseWidthgripper = pulseWidthgripper + turnRate;} val ==j){pulseWidthgripper = centerServo; pulseWidthwrist= cen-

Serial.ush(); 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);

Appendix D. Source Code for the Software Implementation Serial.println(); Serial.print(Moving gripper servo to); Serial.print(pulseWidthgripper,DEC); Serial.println();

71

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 } }

Appendix D. Source Code for the Software Implementation 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 } }

72

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 pulse lastPulsewrist = 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 } }

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 Arduino 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.

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 Media, 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 Manipulators, 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 Tutorial - Society of Robots, 21 September, 2012, <http://www.societyofrobots.com/robotarmtutorial.shtml > Ritesh Kumar, Sugam and Ritesh Gautam, Robotic Arm, roboticsclubroboticarm [Projects], 13 September, 2012, <http://students.iitk.ac.in/projects/roboticsclubroboticarm > 74

Anda mungkin juga menyukai