Sei sulla pagina 1di 5

Optimisation I - TMA4180

Project 1 - Sprint 2017


Student nr. 767893

Abstract
We consider the problem of finding the state of a robot consisting of rigid
segments connected by revolute joints, for which the end of the last segment is
as close as possible to a given point in the plane. We present some properties
of this optimisation problem, among others that it has no local minima that
are not also global minima, and that all stationary points require all segments
of the robot to be parallel to p. We also implement a slightly modified
Newtons method and discuss its performance.

Introduction
We consider a planar robot consisting of n rigid segments of lengths li , 1
i n, that are connected by revolute joints. The hand or tool is attached,
by means of a freely orientable joint, to the last segment, while the first
segment is attached to the origin of the plane, again by means of a revolute
joint. We describe the state of the robot by a set of angles i , 1 i n,
where 1 describes the angle between the first segment and the x-axis, and
i , 2 i n describes the angle between segment #i and segment #(i-1).
We want to find a configuration of angles for which the tool or hand is as
close as possible to a given point p. This can be described mathematically
by the optimisation problem
1
minn kF () pk22 (1)
R 2
n
!
cos ij=1 j
X P
F () = li Pi
i=1
sin j=1 j

1
Theoretical investigations
Configuration space
We first notice that if F () = p, then by changing 1 we can can reach all
points x where kxk2 = kpk2 . This means either all points on a circle with
center at origo are reachable, orP none of them are reachable. The furthest
n
the robot can reach is of course
Pn i=1 li . The robot can not reach a point x
with kxk2 < 2 max1in li i=1 li . Because of the circular symmetry of the
configuration space and F is continuous, all points with norms in between
are reachable. So the configuration space of F is
n
X n
X
C = {x : 2 max li li kxk2 li }
1in
i=1 i=1

Existence of a solution
1
min n kF () pk22 (2)
[0,2] 2
Because we are working with angles, all solutions can be reduced to
[0, 2]n . So (1) admits a solution if and only if (2) admits one. (2) has a
joint space with compact support and is lower semi-continuous (because it is
continuous). Proposition 7 from [1] then tells us the optimisation problem
admits a solution.

Some properties of (1)


First, we observe that if p is in the configuration space of the robot, there
are generally many solutions.
To simplify calculations we define
i
X
i = j , 1 i n
j=1

There is a one to one map between and .


We name the segments
 
cos k
Zk () = lk
sin k
 
Pn Zk 0 1
Notice that F = i=1 Zi and l
= RZk k,l where R = .
1 0

2
We now look for stationary points in the function to be optimized.
2 n
12 k ni=1 Zi pk2
P
X
=( Zi p)T RZk
k i=1

For a stationary point the gradient must be zero. This is the case if F = p
for which we are already in the global minima. Else, the gradient is zero iff
all Zk are parallel to p.
We now look at the hessian to classify the stationary points.

2 n
2 12 k ni=1 Zi pk2 ( ni=1 Zi p)T RZk
P P X
T
= = (RZl ) RZk +( Zi p)T RRZk k,l =
k l l i=1

n
X
ZlT Zk + (p Zi )T Zk k,l
i=1

If we are examining a stationary point that is not a global minima (F 6=


p), then we recall all Zk are parallel to p, this means there are only two
possibilities for each Zk , either in the direction of p or opposite. For a local
minima, the hessian needs to be positive semi-definite. In this case (F 6= p),
the hessian is only positive semi-definite in one configuration of directions
and if the p is unreachable, this means any local minima is also a global
minima.

Numerical experiments
Numerical algorithm
We implement a slightly modified Netwons method for this problem, because
it has a good convergence rate close to the solution, and we already have the
hessain from previous calculations in theoretical investigations (not the ones
currently present, because now we are optimizing and not as in those
formulas).
Because there are multiple stationary points which are not global minima, we
need to take extra care not to converge to a saddle point (or even maxima).
This is done by calculating the minimum eigenvalue min of the hessian, and
adding C min times the identity to the hessian if min is too small or
negative. This ensures positive definiteness of the used hessian and gives
approximately gradient-decent steps until we are close to a minima, where
faster convergence is achieved. We picked C = 2 heuristically.

3
Random initialization is also used to make it unlikely that we start at a
stationary point.
The code is attached separately.

Results
We ran our implementation on the following test cases:
Test 1: n = 3, l = (3, 2, 2), p = (3, 2)
Test 2: n = 3, l = (1, 4, 1), p = (1, 1)
Test 3: n = 4, l = (3, 2, 1, 1), p = (3, 2)
Test 4: n = 4, l = (3, 2, 1, 1), p = (0, 0)

Figure 1: Plots of optimal solutions of test 1-4 from left to right

We averaged the number of iterations spent before kF P k2 1010 or


kF k2 1010 (needed if global minima is not 0) for 100 runs.
Test 1: 15.15 iterations
Test 2: 8.88 iterations
Test 3: 17.44 iterations
Test 4: 65.81 iterations

Figure 2: Plots of typical convergence of test 1-4 from left to right

Discussion
Note that when F approaches p, the hessian becomes singular, so we do not
get quadratic convergence except in test 3.
We notice that Test 4 has slower convergence than the other tests, this is
because in this case p = (0, 0), which makes the hessian singular everywhere.
Singular hessian gives slower convergence of the Newton steps because a

4
damping factor must be used (the hessian modification described in the Nu-
merical algorithm section). As expected because of no local minima that
are not also global minima, we have not observed a case where the algorithm
does not converge.

Conclusion
We have presented a numerical solution and some insight to the problem of
optimizing (1). Some of the most important insight where: The problem
typically has many stationary points, but no local minima that are not also
global minima. Also, for all stationary points, all robot segments are parallel
to p.
We also validated the numerical solution on a few inputs where it shows good
convergence properties as expected.
Note however that (1) could be solved optimally and analytically in O(n)
time with the insight gained in section Configuration space by only finding
F as close as possible to a given radius from origo, and then rotating it to
the specific point by changing 1 . This optimization could be done in O(n)
time by applying dynamic programming on the interval of reachable radiuses
of each joint.

Bibliography
[1] Markus Grasmair (2017). Minimisers of optimisation problems Lecture
notes from Optimization I : 4-5.

Potrebbero piacerti anche