universiti tun hussein onn malaysia for cartesian...

24

Upload: others

Post on 13-Feb-2020

14 views

Category:

Documents


0 download

TRANSCRIPT

UNIVERSITI TUN HUSSEIN ONN MALAYSIA

PENGESAHAN STATUS PROJEK SARJANA

DEVELOPMENT OF A GENETIC ALGORITHM CONTROLLER FOR CARTESIAN ROBOT

SESI PENGAJIAN: 2008/2009

Saya ONG JOO HUN mengaku membenarkan Projek SaIjana ini disimpan di Perpustakaan dengan syarat -syarat kegunaan seperti berikut:

1. Tesis adalah hakrnilik Universiti Tun Hussein Onn Malaysia. 2. Perpustakaan dibenarkan membuat salinan tmtuk tujuan pengqjian sahaja. 3. Perpustakaan dibenarkan mcmbuat salinan tesis ini sebagai bahan pertukaran antara institusi

pengajian tinggi. 4. ** Sila tandakan (..j)

o SULIT

TERHAD

TIDAK TERHAD

(TANDATANGAN PENULIS)

Alamat Tetap:

72, Mcdan Mayang Pasir,

Bayan Baru,

11950 Pulau Pinang

Tarikh: 5 NOVEMBER 2008

CATATAN:

(Mcngandungi maklumat yang berdaIjalt keselamatan atau kcpcntingan Malaysia seperti yang tcrmaktub di dalam AKT A RAHSIA RASMI 1972)

(Mengandungi maklumat TERHAD yang telalt ditcntukan oleh organisasilbadan di mana pcnyclidikan dijalankan

(TANDATANti ~PENYELIA)

HJ. MOHD AZLAN BIN

ABD.SHUKOR

(Nama Pcnyelia)

Tarikh: 5 NOVEMBER 2008

** Jika tcsis saIjana ini SULIT atau TERHAD, siIa lampirkan surat daripada pihak berkuasalorganisasi bcrkcnaan dengan mcnyatakan sekali scbab dan tempoh tcsis ini perlu di kclaskan scbagai SULIT atau TERHAD.

"I hereby declare that I have read this thesis and in my opinion this thesis in terms of

content and quality requirements fulfill the purpose for the award ofthe

Master of Electrical Engineering."

Signature

Name of Supervisor HJ. MOHO AZLAN BIN ABD. SHUKOR

Date 5 NOVEMBER 2008

DEVELOPMENT OF A GENETIC ALGORITHM CONTROLLER

FOR CARTESIAN ROBOT

ONGJOOHUN

Thesis submitted as a partial fulfilment of the requirement for the degree of

Master of Electrical Engineering

Faculty of Electrical and Electronic Engineering

University Tun Hussein Onn Malaysia

NOVEMBER 2008

DEVELOPMENT OF A GENETIC ALGORITHM CONTROLLER

FOR CARTESIAN ROBOT

ONGJOOHUN

Thesis submitted as a partial fulfilment of the requirement for the degree of

Master of Electrical Engineering

Faculty of Electrical and Electronic Engineering

University Tun Hussein Onn Malaysia

NOVEMBER 2008

"I hereby declare that the work in this thesis is my own except for quotations and

summaries which have been duly acknowledged"

Signature h/U-7J~

............... /. .................... .

Name of Student ONGJOOHUN

Date 5 NOVEMBER 2008

11

III

This thesis is especially dedicated to my beloved parents.

IV

ACKNOWLEDGEMENT

The success of this thesis involves many valued contributions from a number

of persons. I am grateful to my project supervisor, Tuan Haji Mohd Azlan Bin Abd.

Shukor and co-supervisor, Pn. Hjh. Anita Binti Azmi for their invaluable

supervision, advice and guidance in the development of this project till its

completion. They have given me lot of encouragements, and supports that had

motivated me to successfully manage this project.

I would like to acknowledge the Public Service Department of Malaysia

(JP A) for sponsoring my master degree study. I also thank to Associate Professor Mr.

Pang Che Fong for his support. I am deeply indebted to Dr. Johnny Koh Siaw Paw

whose professional careers have always revolved around motion control, reviewed

the motion systems chapter for me, and participated in many more technical

discussions.

Finally, I would like to thank my friend especially Mr. Kantan NL P.

Saminathan who has always given me a full support in studies. Heartfelt gratitude

dedicated to my father, mother and sisters for their kindness, care and

encouragements.

It is my hope that this thesis would contribute to the organizations In

furthering their research.

\.

ABSTRACT

In some daily tasks such as drilling, laser marking or spot welding

application, the Cartesian robot is requested to reach with its hand tip to a desired

target location. Such tasks become more complex if it has to handle multiple points

in shortest travelling time and space. It is with these reasons that this study was

conducted with the primary objective to develop a computational intelligent system

that would contribute towards encouraging a productive and quality way of material

handling and processing. The objective of this project is to design, develop and

optimize the performance of a Cartesian robotic arm in terms of its positioning and

speed to perform spot welding application. The genetic algorithm (GA) will be

introduce, it will be able to look for the optimum sequences to solve its path planning

via evolutionary solutions. GA will determine the best combination paths in order to

minimize the total motion of welding time in shortest travel distance. The new

algorithm is tested and implemented in this Cartesian robot. Laser pointer will

replace the spot welding torch for the demonstration purpose in this project. This

project involves in developing a machine learning system that is capable of

performing independent learning capability for a given tasks. The design and

development of this project will involve two major sections. First section concerns

about the hardware construction, wiring and testing. Second section involves

software design to control the movement of the robot for the spot welding. The

hardware design can be categorized into two aspects i.e. the electrical design and

mechanical design. The electrical design involves wiring of control components such

as the stepper motor controller, input and output devices as well as the power supply

and the safety devices. Finally, the developed algorithm will been tested and

implemented into in this Cartesian robot system.

VI

ABSTRAK

Untuk tugasan harian seperti penggerudian, 'laser mark' atau applikasi

kim pal an titik, robot kartesian adalah disuruh untuk mencecah objek pada lokasi

tertentu dengan menggunakan tip pada lengannya. Tugasan itu akan menjadi rumit

jika ia hendak mengendalikan pelbagai kerja jenis titik pada masa yang singkat dan

jarak yang terdekat. Untuk tujuan ini, kajian ini dijalankan dengan matlamat utama

untuk menghasilkan sebuah sistem pintar komputasi yang dapat menyumbang

kepada peningkatan produktiviti dalam pengendalian dan pemprosesan bahan yang

berkualiti. Secara umumnya, objektifkajian adalah untuk merekacipta, membina dan

mengoptimumkan prestasi sistem kartesian robot untuk kedudukan dan kelajuannya

dalam mengendalikan applikasi kimpalan titik. Algoritma genetik (GA) akan

diperkenalkan dan ianya berkeupayaan untuk mengoptimumkan jujukan robot dalam

menyelesaikan rancangan pergerakan robot melalui penyeIesaian evolusi. GA akan

menentukan kombinasi pergerakan yang paling baik demi meminimumkan jumlah

masa kimpalan dalam jarak yang terdekat. Algoritma baru ini diuji dan dilaksanakan

untuk kartesian robot ini. Penunjuk laser yang menggantikan alat kimpalan titik telah

digunakan dalam projek ini untuk tujuan demonstrasi. Projek ini melibatkan

pembangunan sistem mesin belajar yang berupaya untuk menunjukkan kebolehan

untuk ditugaskan belajar secara tersendiri. Rekacipta dan pembangunan projek ini

melibatkan dua bahagian. Bahagian pertama melibatkan pembangunan perkakasan,

pendawaian dan ujian. Bahagian kedua melibatkan rekaan perisian untuk mengawal

pergerakan paksi robot untuk melakukan kimpalan titik. Rekaan perkakasan

dikategorikan kepada dua bahagian iaitu rekabentuk elektrikal dan mekanikal.

Rekaan elektrikal melibatkan pendawaian komponen seperti kawalan stepper motor,

peranti masukan dan keluaran, sistem bekalan h.llasa dan peranti keselamatan.

Akhirnya, algoritma yang dibangunkan ini telah diuji dan berjaya dilaksanakan

dalam sistem kartesian robot.

CHAPTER

CHAPTER I

TABLE OF CONTENTS

CONTENTS

THESIS STATUS CONFIRMATION

SUPERVISOR'S CONFIRMATION

TITLE

TESTIMONY

DEDICATION

ACKNOWLEDGEMENT

ABSTRACT

ABSTRAK

TABLE OF CONTENTS

LIST OF FIGURES

LIST OF TABLES

INTRODUCTION

1.1 Introduction

1.2 Problem Statement

1.3 Project Aims and Objectives

1.4 Project Scope

1.5 Overview of the Project

1.6 Project Contributions

1.7 Thesis Layout

\'\1

PAGE

II

III

IV

V

VI

VII

XII

XV

2

4

5

6

7

8

CHAPTER II LITERA TURE REVIEW

2.1

2.2

2.3

2.4

2.5

2.6

2.7

2.8

2.9

2.10

2.11

2.12

2.13

Introduction

Modem Technology of Robots

Applications of Robot

Laws of Robots

Classification of Robots

Robot Configurations

Literature Review for Similar Cartesian Robot

Drive Technology

2.8.1 Stepper Motor

Electro-Pneumatic System

Types of Robot Controller and Programming

Software

Literature Review for Similar Projects

2.11.1 Offline Path Planning of Cooperative

Manipulators Using Co-evolutionary

Genetic Algorithm

2.11.2 Cartesian Path Generation of Robot

Manipulators Using Continuous Genetic

Algorithms

Other Intelligent Control Techniques

2.12.1 Neural Networks

2.12.2 Hill Climbing

2.12.3 Simulated Annealing

Overview of Genetic Algorithm (GA)

2.13.1 Encoding

2.13.2 Initial Population Generation

2.13.3 Selection Criteria

2.13.3.1 Methods of Selection

2.13.4 Genetic Algorithm Operators

2.13.4.1 Crossover

2.13.4.2 Mutation

VIII

9

9

11

12

13

14

16

16

17

19

20

20

20

21

22

22

23

24

25

29

30

30

31

33

34

35

CHAPTER III

2.14

2.15

2.16

2.13.5 Fitness Evaluation

Genetic Algorithm Parameters

2.14.1 Crossover Rate

2.14.2 Mutation Rate

2.14.3 Population Size

Advantages of Genetic Algorithms

Summary of Literature Review

METHODOLOGY

3.1 Introduction

3.2 Hardware Development

3.3 Electrical Design

3.3.1 Electrical Protection System

3.3.2 Power Distribution System

3.3.3 Main Controller

3.3.4 Input and Output Module

3.3.4.1 Optical Micro Sensor

3.3.4.2 LED Equipped Reed Switch

3.3.5 Electro-Pneumatic System Design for End

Effector (Z Axis)

3.3.6 Control of Stepper Motors

3.3.7 Encoder

3.4 Mechanical Design

3.4.1 Mechanical Drives

3.4.2 Leadscrew Driven Load

3.4.2.1 Movement Profile

3.4.2.2 Acceleration Torque

3.5 Software Development

3.5.1 Simulation Package

3.5.2 GUI Control System

3.5.3 Machine Learning and Database

IX

36

37

37

38

38

39

40

41

43

44

44

45

46

48

48

48

50

53

54

55

55

56

58

59

64

64

66

68

3.6

3.5.4

3.5.5

GA and Database

Genetic Algorithm Optimization Method

3.5.5.1 Genetic Algorithm Operation

3.5.5.2

3.5.5.3

3.5.5.4

3.5.5.5

Population

Crossover Operation

Mutation Method

GA Optimization Result

Machine Synchronization Method

CHAPTER IV RESULTS AND DISCUSSION

4.1

4.2

4.3

4.4

4.5

4.6

4.7

4.8

Overview

Cartesian Robot Arm Kinematics

XY Axes Move Module

Parts Fabrication

Machine Performance Results

Comparison of GA and Random

Efficiency of GA Operators

Effect of GA Control Parameters

4.8.1

4.8.2

4.8.3

4.8.4

Number of Maximum Generation

Population Size

Effect of Crossover Rate

Effect of Mutation Rate

x

72

72

73

76

79

81

83

84

86

87

88

90

91

92

95

96

96

97

98

98

CHAPTER V CONCLUSION

5.1 Conclusion

5.2 Recommendations

REFERENCES

APPENDICES

XI

100

102

104

108

XII

LIST OF FIGURES

FIGURE TITLE PAGE

1.1 A typical genetic algorithm control system for Cartesian robot 5

1.2 Cartesian robot for laser marking / spot welding application 6

1.3 Block diagram of genetic algorithm controller for Cartesian robot 7

2.1 Components of a robot system 10

2.2 Sensor and control system 11

2.3 Comparison chart ofleading robot applications 12

2.4 Classification of robots 14

2.5 Robot configurations 15

2.6 Stepper motor movements 18

2.7 Electro-pneumatic drive system 19

2.8 A simple feedforward neural network 23

2.9 Flow chart of genetic algorithm 27

2.10 General structure of genetic algorithm 28

2.11 Situation before ranking (graph of fitnesses) 33

2.12 Situation after ranking (graph of order numbers) 33

2.13 Illustration of crossover operation 34

2.14 Mutation operator 35

3.1 Flow chart of the developed Cartesian robot system 42

3.2 Block diagram of the robotic system design 43

3.3 Circuit breaker and noise filter 44

3.4 Wiring diagram for electrical protection system 45

3.5 Power supply distributions 45

FIGURE TITLE

3.6

3.7

3.8

3.9

3.10

3.11

3.12

3.13

3.14

3.15

3.16

3.17

3.18

3.19

3.20

3.21

3.22

3.23

3.24

3.25

3.26

-3.27

3.28

3.29

3.30

3.31

3.32

3.33

3.34

3.35

3.36

3.37

OEM750X micro stepping drive/controller and wiring connections

Photo micro sensor for limit and horne signal

Reed switch

Signal flow diagram and pneumatic elements

Pneumatic system

Electronic control circuit diagram

The use of limit switches

Operating pattern of detecting horne position

Incremental encoder (Omron E6B2-CWZ6C)

Leadscrew drive system

Basic motion system

Move profile

The generated XY axes report

Basic system software architecture

Simulation package for Cartesian robot system control

VB form layout window

VB source code for opening and reading data from Excel file

Conceptual design of the machine learning process

Machine learning database

Block diagram of machine learning

Visual Basic code for rank based selection

Genetic algorithm operation program

Population with permutation encoding chromosomes

Random numbers for 9 coordinates points

Ranked population

Evaluation subroutine for population

Sorting subroutine

Crossover operation

Mutation subroutine

Resultant of mutation

Resultant of genetic algorithm optimization

Machine synchronization method

XIII

PAGE

47

49

49

50

51

52

53

54

55

56

59

60

61-63

65

65

67

68

69

70

71

74

75

76

77

77

78

79

81

82

82

83

84

FIGURE TITLE

3.38

4.1

4.2

4.3

4.4

4.5

4.6

4.7

4.8

4.9

4.10

4.11

4.12

4.13

4.14

4.15

4.16

Daisy chain configuration for PC communication with controller

The developed Cartesian robot with laser head

Denavit~Hartenberg (D-H) transformation matrix for Cartesian robot

Velocity graph for stepper motor axis # 1 & #2

Torque graph for stepper motor axis #1 & #2

Performance curves for XY axes using S57-102-MO stepper motor

VB source code for XY axes motion and laser marking

Step angle accuracy

Distance comparison between GA and random

Real time control for GA and random

Random search

GA optimization

Percentage of each operator in searching the best solution

Graph of difference versus number of maximum generation

Graph of difference versus population size

Graph of difference versus crossover rate

Graph of difference versus mutation rate

XIV

PAGE

85

87

88

89

89

90

91

92

93

93

94

95

96

97

97

98

99

LIST OF TABLES

TABLE TITLE

1.1

2.1

2.2

3.1

3.2

4.1

Number of possible solutions

Explanation of genetic algorithm terms

Various encoding methods

OEM750X micro stepping drive/controller's performance parameter

Leadscrew coefficient of friction and typical efficiencies

Performance parameters

xv

PAGE

3

25

29

46

56

91

CHAPTER I

INTRODUCTION

1.1 Introduction

A Cartesian coordinate robot is an industrial robot whose one or more

principal axes of control are linear. They move in a straight line rather than rotate.

Among other advantages is that this mechanical arrangement simplifies the robot

control arm solution. Cartesian robots are being widely employed in industrial

applications such as automobile spot welding or assembling lines that handle a

variety of car models. In order to avoid the risk factor in spot welding application,

various steps can be taken. One of the prominent method is by substituting the human

hands with the robotic arm in handling these dangerous and hazardous environments.

It is with these reasons that this study was conducted with the primary

objective to design and develop a new low-cost, high-efficiency Cartesian robotic

arm for application such as spot welding. A new evolutionary computation method

using Genetic Algorithm (GA) to control and optimize the system performance in

terms of its positioning and speed that would contribute towards encouraging a

productive and quality process will be developed. GA operates on populations of

candidate controllers, initially selected from some distribution. This population of

2

candidate controller is repeatedly grown according to crossover, mutation and other

GA operators and then culled according to the fitness function.

The competition between different companies regarding pnce and

performance of the Cartesian robot and control system has been the most important

motivation. In case of cost saving on robotics equipments, the solution is an

alternative. It also to aware national interest in science and technology and this

constitutes a prerequisite for an inventive society.

1.2 Problem Statement

The problem can be stated as: Given a Cartesian robot with a spot welding

torch (laser head as replacement of torch), a set of known fixed coordinates with the

initial and final configurations, find a coordinated motion plan for the laser head

from its initial to final configuration and optimizing the overall time taken for the

laser head to perform the spot welding.

To give an idea of the complexity of the problem, let's consider a number of

n coordination points and one origin points for the laser head to be fixed at positions

(xo, yo). For this application, the search space is a discrete space and there are (n!)

permutation scheme of the close routes or path that this robot has to go through. GA

will be the search algorithm to find the best or approximate optimization solution for

the shortest path and time in this problem.

The above mentioned problem is actually the same as the well-known

"Traveling Salesman Problem (TSP)" that of finding the shortest closed tour through

a given set of cities visiting each city exactly once. The objective function is the sum

of the Euclidian lengths of all edges among the salesman's route. The Euclidean [40]

distance between points P (Pl,P2, ... ,pn) and Q (q"q2, ... ,qn) in Euclidean n-space is

defined as:

3

n

~(PI _ql)2 +(P2 -q2)2 + ... +(Pn -qn)2 = 2)p, _q,)2 (Ll) ;=1

The developed Cartesian robot is scheduled of a route for the spot welder to

perfonn welding on a work piece. In this robotic application, the "cities" are points to

weld, and the "cost of travel" includes the time for retooling the robot (single

machine job sequencing problem).

Thus, given a set of points C = {ct, C2, ... ,cd, for each pair (cj, Cj), ii:j, let

d(cj, Cj) be the distance between point Cj and c} Solving the TSP entails finding a

pennutation n' of the points (c 1t' (1), ... ,C 1t'(k)), such that

k k

Ld(c"'(i),c"'(i+I)) ~ Ld(c"(i)'C"('+I)) (1.2) ;=1 ;=1

The size of the solution space, q is given in equation 1.2 for n > 2, where n is

the number of points. This is the number of Hamiltonian cycles in a complete graph

of n nodes, that is, closed paths that visit all nodes exactly once.

1 q = -(n-l)! 2

(1.3)

For a laser head with n number of coordination points, the numbers of

possible solutions / routes are n! where n = the number of points are given in Table

1.1. Therefore, an evolutionary solution such as genetic algorithm is introduced to

optimize the perfonnance and solve the path planning sequences problem in shortest

time.

No. of Points M Number of Solutions

5 120 10 3628800 50 3.04E+64

Table 1.1: Number of possible solutions

4

1.3 Project Aims and Objectives

The main objective of this project is to design and develop a new low-cost,

high efficiency Genetic Algorithm (GA) controller used in Cartesian robotic arm for

spot welding application. To achieve this objective, the following works will be

carried out during the research period:

1. To design and develop the hardware of the proposed robotic system. This

includes both its electrical and mechanical components.

(a) The electrical components consist of two Parker Compumotor

OEM750X micro stepping drive/controller as the main controller, an

electrical protection system, a power distribution system, input/output

modules, an electro-pneumatic-based Z axis, two stepper motors with

encoder feedback system and a laser pointer that will replace the spot

welding torch for demonstration purpose in this project.

(b) The mechanical components of the proposed robotic system consist of

two lead screw drive systems for both X and Y axes, a jig and fixture

module and a mechanical base.

2. To develop a machine-learning system and program via a new genetic

algorithm that is capable of performing the following analysis:

(a) Reliably and consistently learn and repeat a given tasks.

(b) Ability to look for the optimum sequences via genetic algorithm

evolutionary solutions.

3. To develop a PC-based control simulator for the proposed system using

Visual Basic and Microsoft Excel as the database to simulate and evaluate the

possible solution for path planning process. Simulation package consists of a

graphical user interface (GUI) where it links and directs the flow of the

working process. It is a medium to allow interaction between the hardware,

GA control system and database. In this simulation package, the input data

will be stored and learned in the database. The data from database can be

eXiracted to be processed and executed via the hardware. This simulator is

capable to control the I/O module, robot learning module, a manual output

trigger module, a horne routine and a process module.