You are on page 1of 93

&

H:

AEM: 4749

: 6

2012
&

&

:
:

. .

: .

: 6/2012

i
&

,
,
. ,
, ,
.
,
online .
online ,
, offline ,
( )
.

offline
,
, .

.

:

)
) .

.
,
( ).
,
.
:

, .

: A*, grassfire,
, pattern search.
* *.
1.
MATLAB.

ii
&

1:


( ), .

.

,
.
5 2 4
. .

iii
&

2:

3: *

iv
&

4: 5
* .

, 1
5

()

A* 1.01 4.14 18000


A* 1.8 5.94 660
1.8 4.11 550

1: *


, 2 ,
* . 2

.
,
.
v
&

*

.
*
.

vi

1. ........................................................................................................................................ 1

1.1. ................................................................................................................ 2

2.
.............................................................................................................................................................. 3

2.1. Denavit-Hartenberg .......................................................................................... 3

2.2. 3
....................................................................................................................................... 4

2.3. 5
....................................................................................................................................... 7

3. ........................................................................................................................... 10

3.1. Grassfire .............................................................................................................. 10

3.2. A* ......................................................................................................................... 10

3.3. Bresenham line ................................................................................................... 14

3.4. .............................................................................................................. 14

3.5. Pattern Search .................................................................................................... 15

4. ...................................... 16

4.1. ........................................................................... 16

4.2. ...................................................................................................... 17

4.2.1. .............................................................................................................. 17

4.2.2. ............................................................................................................ 19

4.2.2.1. 1 .................................................................................................... 19

4.2.2.2. 2 .................................................................................................... 19

4.2.2.3. 3 .................................................................................................... 19

4.2.2.4. 4 .................................................................................................... 23

5. ............................................................................. 24

5.1. 3 ........................................................................ 24

5.1.1. A* .......................................................... 26
5.1.1. 1 ................................................................................................... 30

5.1.1.2. 2 ................................................................................................ 34

5.1.1.3. 3 ................................................................................................ 37

5.1.1.4. 4 ................................................................................................ 39

5.1.1.5. 5 ................................................................................................ 42

5.1.2. A* .............................. 44

5.1.2.1. 6 ................................................................................................ 44

5.1.3. A*
.................................................................................................................................. 47

5.2. 5 ....................................................................... 52

5.2.1. ............................... 52

5.2.1.1. 1 ................................................................................................ 53

5.2.1.2. 2 ................................................................................................ 57

5.2.2. A*
............................................................................................................................ 61

5.2.2.1. 3 ................................................................................................ 62

5.2.2.2. 4 ................................................................................................ 67

5.2.2.3. 5 ................................................................................................ 72

6. .............................................................................................................................. 78

7. ................................................................................................. 79

..................................................................................................................................... 80

8. ................................................................................................................. 81
1.
,
,
. ,
,
.

.

,
, ,
. ,
.

. ,
. ,
1
,
, , .
.


. online
. online
, ,
offline ,
( ) .
offline ,
,
.
, . offline
,
,
. [1]

1.1.

,
,
. off-line
.

.

Denavit - Hartenberg.


( ).

3 5
.

2
2.


( 3-R) 5 ( 5-R).
:

Denavit Hartenberg
.
3
.
5

2.1. Denavit-Hartenberg


( ).
,

.
Denavit Hartenberg
, .


:

(2.1)

ai di i i . K
P Fi F0
:

(2.2)

Pi P Fi P0
P F0 [1],[2],[3]

3
2.2. 3

o 3
1.

1: 3 3-R Denavit Hartenberg

Denavit-
Hartemberg 1 2.
,
.

4
2: Denavit-Hartemberg,

Denavit-Hartemberg
:

i i (o) (mm) d i (mm) i

1 1 -90 0 0 -160 160

2 2 0 432 149.5 -225 45

3 3 90 0 0 -45 225

(2.3)

(2.4)

5
(2.5)

1, 2, 3 3 d2
a2 1.

.
3
.

3: 3

6
2.3. 5

3 5
.
Denavit-Hartemberg
4 5.

4: 5 Denavit-
Hartenberg

7
5: Denavit-Hartenberg,

Denavit-Hartenberg
:

i i (o) (mm) d i (mm) i

1 1 -90 0 0 -160 160

2 2 0 432 149.5 -225 45

3 3 90 0 0 -45 225

4 4 -90 0 432 -110 170

5 5 90 0 0 -100 100

(2.6)

(2.7)

8
(2.8)

(2.9)

(2.10)

d2 d4 a2 4 1 5
. 6
.

6: 5

9
3.

.

3.1. Grassfire (Dijkstra algorithm)


grassfire (single-source shortest
path problem) . [4]

: -
. , ,
, (105),
0

1.
.

2. , c,
.

c ,

. ,
, (
).

3.
, , 1

4.

3.2. A*
O A*
(path finding) . 'best first'
.

: 2 ,
.

(3.1)


.

, ,
.
10
(3.2)


. ,
. >1
, ,
, .
, , .
*
* =1.
, .

grassfire,
, a priori
.

grassfire
. . H
:

,
open list. ,
.
,
.

.
* 7 . [5]

11
7: A* .

8 9 A*
xy .
.
, x y
. open list,
.

12
. .
.
* [6].

8: * =1

9: * >1

13
3.3. Bresenham line
Bresenham -

.
. O Bresenham
2 .
10
[7],[8]
.

10: Bresenham 2 .

3.4.
.
,
.

' - ,
- "".

"".


, "" . ,
,

.
.

.

(0/1).
() .

, / ,

14
, . (
)
,
(.).
, , .,
.
,
/
/
..

.
() /
. ()
, .
. .
[1],[2],[9].

3.5. Pattern Search


pattern Search
.

, .. 2 (x1,x2),
.
(x1+d,x2), (x1-d,x2), (x1,x2+d), (x1,x2-d), d .

d .
d ( ).
d
. 11
[10].

11: Pattern search 5

15
4.

.
3

4.1.
m
m .


xn xn+1 ,
:

(3.3)

i
.
:

(3.4)


.
(3.5)
.

(3.5)


. :

(3.6)

16

F:

(3.7)

4.2.

.

. 12
.

12:

4.2.1.
C-space -.
C-space
. C-space,
.

Configuration space (C-space).

17
O .
,
. :

d(R(i),r(j))
( R(i), i i )
( (j), j j) [11].

13:

d(R(i),r(j)) R(i)+r(j),
.
.

. .
14 C-space -
(workspace) [12],[13].

14: Work space Configuration Space (C-space) 2


18
4.2.2.
C-space.
4
. 3 ,
.
:

4.2.2.1. 1
grassfire.
, ,
.
.
.

4.2.2.2. 2
* .
* grassfire,
grassfire, *
.
.

4.2.2.3. 3
*
, *
. 1 2

.
.
,
.
* . *
15.

19
15: A*

20
:
A* .
( A*). To k(x)
, n, , n-1,
n s. To s
n :

n-1 n-2.
n (
2 , ),
n-2 n-1 k(n)
n-1 n.
n-1
initial.

2
bressenham, o
2 .
(
C-space ),
.
A*.

16 A*
xy, .
.
[1,1] [100,100].
open list, .
.
.

21
16:
* .

17
A*.
[1,1] [100,100].

17: A* A*

22
A*,
A* . A*
, , , , ,
.
.

4.2.2.4. 4

*, pattern search
.
. 4
:

1 : ,
, star. H
2.
.

2 :
.


.

3 : m


.
.
F (3.7)
.

(3.9)

m
m
.
bresenham C-space
. =0
. = c = .

.

,
( ).

4 : pattern search
23
3 . pattern search

.
3 .

5.
3
5 3.
, , ,
.

5.1. 3
. 3
3.1 o 18.

18:

80 mm.
19.

24
19: ( )

C-space -.
:

-160o < 1 < 160o


-225o < 2 < 45o
-45o < 3 < 225o

C-space 5.15o (1, 2, 3).


C-space 20 21.
.

20: C-space.
5.15o .

25
21: C-space

5.1.1 A*

22 25,
.
A* .
:

C-space

X1 2 X3 1 2 3

50 1 1 93 -225 -45

5 1 40 -139 -225 156

C-space/
(/sec)

1 2 3 1 2 3

26
1 1 1 1 5 5 5

2 5 1 5 25 5 25

3 5 1 2 25 5 10

22: [ 50, 1, 1 ]

23:
27
24: [ 5, 1, 40]

25:

28

26 27. 3
A* . 4
5 :

C-space

X1 2 X3 1 2 3

60 53 30 144 43 104

5 1 40 -139 -225 156

C-space/
(/sec)

1 2 3 1 2 3

4 1 1 1 5 5 5

5 5 1 2 25 5 10

26:

29
27: [ 5, 1, 40]

5.1.1.1. 1
(
C-space) .
.

28 ,
*.
. ,
, .
31 .
1,2 3.

30
28: ( ) (weight)

29 .
= 1
*
,
. 1,
,

.
= 1 1.001
.

31
29:

,
, ,
, cpu
(.. antivirus, internet explorer ..),
( 30) C-
space ( open list)
.

30: C-space
32
31 32 C-space,
=1 , =2 =3.

31: C-space 1 *
1,2 3

32:

,

33
=1 (). ,
, .
2 .

3 C-space
31 32 33 .

33: 1 *
1,2 3

5.1.1.2. 2

. .
A*
.

34
, .
.
* 3,
.

35 ,
.

34
34: ( )
(weight)

35: C-space

36 37 C-space
A* =1 =2.

35
36: C-space 2 *
1 2

37:

38
* , 1 2.
36
38: 2 *
1 2

5.1.1.3. 3

. A*
.

39
*.
>1.7 3
.

39: .

37
1-2.5
40.

.
40: .

C-space A*
=1 41
42.

41: C-space 3 *
=1
38
42: 3 *
=1

5.1.1.4. 4
4 A*
.

, 43
. 44
. >1.5
, > 2.

43: ( )
39
44:

C-space A*
=1 2 45.

45: C-space 4 *
1 2
40
*
=1 46, =2
47.

46: 4 *
=1

47: 4 *
=2

41
5.1.1.5. 5
5 A*
.

48
49 .

48: ( )

49:

42
* = 1 2 C-
space 50, 51
.

50: C-space 5 *
1 2

51: 5 *
1 2
43
:


1-2 .

.


.
= 1 .
= 1
. .
A*,
.

5.1.2. A*
A*
,
. A*
A* .

.

5.1.2.1. 6
6 A* A*.

C-space

X1 2 X3 1 2 3

60 53 30 144 43 104

5 1 40 -139 225 156

C-space/
(/sec)

6 3 2 1 15 10 5

=1 1.5.
.

44
1 1.5

A* A* A* A*

35.66 29 36.33 29.667

122 345 23 44
()

2 = 1 1.5
C-spac, 52 53.

52: C-space 6
* 1 1.5

45
53: C-space 6 *
1 1.5,

54 55
.

54: 6 *
1 1.5

46
55: 6 *
1 1.5

A* ,
A* .

. 6
5 A*
.

5.1.3. A*
.
5
,
.
*
,
.
.

47
C-space

X1 2 X3

33 32 32

1 1 1

1 2 3

C- 1 1 1
space/

56 61 C-space *
.
A*
. A* .

56: A* ( )
( ).

48
57: A* =1.3 ( )
( ).

58: 57

49
59: * =1.7 ( )
( ).

60: * =2.5 ( )
( ).

50
61: 60

A*
( ).

51
5.2 5
5
3. 2

A*.

5.2.1.
62

62:

C-space [0.1, 0.1, 0.11, 0.3, 0.4] rad.


C-space,
, C-space 5-. C-space
,
, -
. 65 C-space.
C-space ,
.
:

1 2 3 4 5

-10 -220 223 -93 -77

52
-121 -220 197 113 -54

(/sec)

1 2 3 4 5

5.7 5.7 6.3 17.2 23

1 2 3 4 5

-135 -225 223 113 -54

-34 -185 169 45 60

(/sec)

1 2 3 4 5

11.4 11.4 12.6 34 45.8

5.2.1.1. 1
.
63 64.

63:

53
64:

, ,
A* = 1.8. A* 65.

. 354 .

65: A* =1.8

,
, 66.
54

.
39, A*, 8.
.

66: ( ) -Pattern search


()

. :

: 1000
: 5
: 500 ( )
: 0.12
: 0.8

: 2

67 .
,
.
,
.

55
67:

pattern search
4.3479 4.3312 45
. 66.
pattern search ( )
2 .
, .

68 ,
.
.

56
68:

5.2.1.2. 2
,
. 69
70.

69:

57
70:

A* = 1.8.
71
. 288

71: A* =1.8

58
,
23 ( A* ) 6.
72

72: ().
pattern-search ()

. :

: 1000
: 5
: 500 ( )
: 0.12
: 0.8

: 2

73.
,
,
.

59
73:

pattern search
2.1823 2.1801. 19 .
72.

74 ,
.
.

74: ,
60
5.2.2.
A*
75.

75:

C-space [0.09, 0.09, 0.09, 0.3, 0.4] rad


76 .
.

1 2 3 4 5

-129 -220 99 113 -54

77 7 104 -93 60

(/sec)

1 2 3 4 5

3 5.2 5.2 5.2 17.2 22.9

4 5.7 6.2 6.7 24 45.8

61

1 2 3 4 5

108 -60 176 165 -54

-155 -200 176 62 77

(/sec)

1 2 3 4 5

5 5.7 6.2 6.7 24 45.8

5.2.2.1. 3
76 77.

76:

62
77:

. A*
= 1.8. 78

. 64 .

78: A*
=1.8

63
, 65 5
65*5=325.
7.

: 1000
: 5
: 500
: 0.12
: 0.8

: 2

79.
,
,
.

79:

pattern search
80. 5.9382,
, 5.9080. 52 .

64
80: Pattern search

81 ,
.
.

81: ,
65
A*. =1.8
A*, A* 11 .
*
82.

82: A*

83: 3,
*
66
:

()

A* 1.01 4.14 7200


A* 1.8 8.54 64
A* 1.01 4.14 18000
A* 1.8 5.94 660
- 5.53

-Pattern search - 4.11 400(
)+86 ( pattern search)


* .
* .


* . C-space ,
* *
, .
=1.01
, 4.14. A* 2
A* 5 . A* *
1.01 -pattern search ( A*
) -pattern search
C-space A*
C-space.
.


A* ,
.

5.2.2.2. 4
3,
[1.1, 1.2, 1.3, 1.4, 2] ( C-space/sec)
[5.7, 6.2, 6.7, 24.1, 45.8] (rad/sec). ,
A* =1 A*
=1 .

67
.
A* =1.8 84,

. 22 .

84: A*

58
5. :

: 1000
: 5
: 500
: 0.12
: 0.8

: 2
85.
,
,
.

68
85: '

pattern search 90
4.8499 4.8143.
86. 87.

86:
Pattern-Search
69
87: .

( 88) 3 4
.

88: 3 4 .

70
4 A* = 1.8.
12
5,02. 89.
90. ( 91)
, 4,
* .

89: *

90: A*
71
91:

5.2.2.3. 5
92 93
.

92:

72
93:

A* =1.8 4 .
94,
.

94: A*.

73

55 7.

O ,
95.

: 1000
: 5
: 500
: 0.12
: 0.8

: 2

pattern search 4.7078 4.7019.


96.

95: , .

74
96: ,
Pattern search


97.

97:
75
, 5 A* 1.8
1.05. (> 3 ). 98

* , 99
* 1.8.

98:
A*. 1.8
1.05.

99:
76
,
5 ( )
* ,
:


() ()

A* 1.8 5.1878 5.7964 3

- 4.4008 4.9442

pattern search - 4.1984 4.7019 500

1.8 4.2432 4.9439 4


A*

1.05 4.1853 4.8791 13


A*

A*
.

.

77
6.
4
, .
2 (A* )
.
A* .
C-space.
C-space,
C-space,
.

*
A*
C-space.
A* .
A*

.
.

* .
.

(
),
.
1.8
, .

A*
.
,
,
. pattern search

. A*
, ,
.
,
.
,
A*, ,
A*, ,
78
. (
pattern search) .


C-space. ,
, (A*,
A*).
C-space.
C-space ,
C-space .

7.

off-line .
. ,


. ,
.


,
.
, 2
, spline, Bezier
.

C-space
.
.

C-space, , pattern search



.

79

1. . , off-line
RV6, (13-2001), ..., ..., 2001.

2. . ,
, , ..., 2007

3. . , , ,
1995.

4. http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm

5. Pearl, Judea, Heuristics: Intelligent Search Strategies for Computer Problem Solving, Addison-
Wesley. Longman Publishing Co, 1984

6. http://en.wikipedia.org/wiki/A*

7. Jack E. Bresenham, "Algorithm for computer control of a digital plotter", IBM Systems Journal, Vol.
4, No.1, January 1965

8. http://www.cs.helsinki.fi/group/goa/mallinnus/lines/bresenh.html

9. A. J. Chipperfield and P. J. Fleming, The MATLAB Genetic Algorithm Toolbox, Applied Control
Techniques Using MATLAB, IEE Colloquium on, 1995

10. Torczon, V.J., On the convergence of pattern search algorithms, SIAM Journal on Optimization ,
1997

11. http://softsurfer.com/Archive/algorithm_0106/algorithm_0106.htm#dist3D_Segment_to_Segment

12. A.A. Maciejewski and J.J. Fox, Path Planning and the Topology of Configuration Space, IEEE Trans.
on Robotics and Automation, vol.9, No. 4, pp.444-456,1993

13. C.S. Zhao, M. Farooq, M.M. Bayoumi, Analytical solution for configuration space obstacle
computation and representation, Industrial Electronics, Control, and Instrumentation, pp.1278-
1283, 1995

80
8. Summary
The robotic manipulators have a wide range of use in the industries, particularly in the last decade
a very big proportion of human labor has been replaced by them. The progress in this sector of
technology is very important and it is can be seen from the start of industrial revolution up to
today. In the past the determination of the path of a robotic arm was done by driving the robotic
arm by the hand, a process known as online programming, which was ineffective and time
consuming. For this reason, a process known as offline programming was invented so as to
determine the path of a manipulator without or with little human intervention.

The work that has been done in this thesis is made in the context of the offline programming with
the aim of finding an optimal path, for a manipulator, free of obstacle collisions inside the
workspace. The algorithms that were used and developed for this reason were applied in
problems with 3 and 5 degrees of freedom manipulators.
The input of the heuristic and genetic algorithms that were used is the start and final position of
the manipulator, and the output of the algorithms is a collision free optimal path according to
these criteria:

a) Minimization of the movement time


b) Minimization of the energy spent for the movement

Finding the optimal path is equivalent to specifying the values of the angles of the manipulators
joints along the path. Those paths should be collision free and should be within the movement
limits of the joints (due to constructional constraints). Finally the path should be optimal in respect
to the time and energy spent. So the objective function which the algorithms try to minimize is the
following equation:

where the first part of the equation represents the energy spent, while the second the movement
time.

The algorithms that were used are a combination of the following algorithms: A*, genetic
algorithm, pattern search. There was also developed an algorithm based on A*, named modified
A*. The algorithms that were used are shown in the figure 1. The simulation and the solving of the
problems were done in the programming environment of MATLAB.

81
Figure 1: Algorithms used for finding the optimal path

One of the aims of this work is that the recommended algorithms do not only produce an optimal
result but also are computationally feasible. This was a very challenging task because the
increment of the number of degrees of freedom increases the calculation needs to be done.

The recommended algorithms, in most cases, seem to be converging in an optimal result, while
when they fail to do that, the result seems to be a local minimum instead of a global minimum.
Comparison of the results of the hybrid and modified A* algorithms in a problem of finding the
optimal path of a 5 dof manipulator, given the initial and last position, are shown in the figures 2-4
below. The results of the 2 algorithms seem to converge.

82
Figure 2: Values of the joints angles along the optimal path using hybrid algorithm

Figure 3 Values of the joints angles along the optimal path when solving with modified A* algorithm

83
Figure 4: Trajectories of the edge of manipulator according to the paths found with modified Aand hybrid
algorithms

Indicatively in the table 1 are shown the movement and computational time of the 2 algorithms
mentioned before.

Weightng Movement Computational time (sec)


factor time

modified A* 1.01 4.14 18000


modified A* 1.8 5.94 660
hybrid 1.8 4.11 550

Table 1: Comparative results of the modified A* and hybrid algorithm.

Conclusions

Among the four developed methodologies, only two of them seem to be applied in practice
in path finding problems of five or more degrees of freedom manipulators. That was due to
the computing requirements and the simplifying assumptions the two other algorithms
have.
The optimal choice of the weights of the functions is an important factor for computing an
optimal path in acceptable computational time.
The advantage of using the modified A* algorithm rather than the hybrid algorithm is that
the user can definitely know among what limits the resulted path is optimal or not. On the
other hand the hybrid algorithm has the advantage that in most cases need less
computational time.
84

You might also like