Geometric Algorithms for Trap Design - CiteSeerX

Report 2 Downloads 78 Views
Geometric Algorithms for Trap Design  Robert-Paul Berretty yz

Ken Goldberg x{

Abstract Geometric algorithms have successfully been applied to solve or give insight into problems in robotic manipulation. In this paper, we present a framework to lter polygonal parts on a track. The lter consists of a polygonal hole in the track; we refer to the lters as traps. For an n-sided polygonal part and an m-sided polygonal trap, we give an O((nm(n + m))1+ ) algorithm to decide whether the part in a speci c orientation will safely move across the trap or will fall through the trap and thus be ltered out. Furthermore, we show how to design various parameterized traps, ranging from simple gaps to arbitrary polygons which will lter out all but one of the di erent stable orientations of a given part. 1 Introduction Geometric algorithms are important tools to solve or give insight into real world problems. In this paper, we transform the problem of designing traps into geometric problems, which are then solved with the use of techniques from computational geometry. The real world application of our work is the analysis and design of a part feeder. A part feeder takes in a stream of identical parts in arbitrary orientations and outputs them in a uniform orientation. Part feeders often use data obtained from some kind of sensing device to accomplish their task. We consider the problem of sensorless orientation of parts, in which the initial pose of the part is assumed to be unknown. In sensorless manipulation, parts are positioned and/or oriented using passive mechanical compliance. The input is a description of the part shape and the output is a sequence of open-loop actions that moves a part from an unknown initial pose into a unique nal pose. Among the sensorless part feeders considered in literature are the paralleljaw gripper [17, 21], the single pushing jaw [3, 26, 27, 32], the  Research is supported by NATO Collaborative Research Grant CRG 951224. y Department of Computer Science, Utrecht University, PO Box 80089, 3508 TB Utrecht, The Netherlands. z Berretty's research is supported by the Dutch Organization for Scienti c Research (N.W.O.) x Industrial Engineering and Operations Research, University of California at Berkeley, Berkeley, CA 94720, USA. { Goldberg is supported by the National Science Foundation under Award CDA-9726389.

Mark H. Overmars y

A. Frank van der Stappen y

conveyor belt with a sequence of (stationary) fences placed along its sides [14, 33, 37, 10], the conveyor belt with a single rotational fence (1JOC) [2], the tilting tray [20, 30], vibratory plates and programmable vector elds [11, 12]. The oldest and still most common approach to automated feeding is the vibratory bowl feeder which consists of a bowl lled with parts surrounded by a helical metal track [13]. The bowl and track undergo an asymmetric helical vibration that causes parts to move up the track, where they encounter a sequence of mechanical devices such as wiper blades, grooves and traps. Most of these devices are lters that serve to reject (force back to the bottom of the bowl) parts in all orientations except for the desired one. Thus a stream of oriented parts emerges at the top after successfully running the gauntlet. In this paper, we present a framework to lter polygonal parts on a track using traps. A trap is described by removing polygonal sections from the track. Speci c to vibratory bowls, researchers have used simulation [23, 8, 28], heuristics [25], and genetic algorithms [18] to design traps. Perhaps closest in spirit to our work is M. Caine's PhD thesis which develops geometric analysis tools to help designers by rendering the con guration-space for a given combination of part, trap, and obstacle [15], see also [16]. This paper reports on algorithms that design traps which establish a feeder, i.e., it outputs parts in the same orientation. To the extent of our knowledge, no systematic design of traps has been previously reported. In Section 2 we give a geometric model of the bowl feeder; this model is the basis for our algorithms. In Section 3 we analyse whether a part in a given orientation will safely move across the trap, or will be ltered out and fall back into the bowl. The resulting algorithm runs in O((nm(n + m))1+ ) time. This can be improved to O((n + m) log(nm)) time if the part and the trap are convex. In Section 4 we give algorithms for designing traps in the feeder track. We construct, for example, a gap, which is a rectilinear interruption of the track. Given the geometry of the part, we compute in O(n2 log n) time how wide the gap should be to establish a feeder. This bound is reduced to O(n2 ) for convex parts. We also consider other trap shapes and conclude with a general approach for designing parameterized traps. 2 Preliminaries In this section we discuss the geometric properties of the device. We address the problem in the plane. Throughout this paper, we assume that the railing of the track is frictionless, and the parts move with constant velocity up the track. We neglect the circularity of the track. We let P denote a 2-dimensional polygonal part. The trap in the track is denoted by R. The complexity of the part is expressed by its number of vertices n, the complexity of the Page 1

8< e:

e P (q)

Figure 1: The part P and its center-of-mass at con guration q, intersecting trap R. CH(S (q)) is grey. trap is given by m. The part is mobile, and a con guration of the part, i.e., its position and orientation, is denoted by q; the part P at q by P (q). The supported area of the part at q is S (q) = P (q) ? int(R). Slightly abusing notation, we shall denote the center-of-mass of a part P at con guration q by c(q). We de ne how to decide if a part in a given con guration will be rejected or remain safely on the track.

De nition 2.1 Let P be a part with center of mass c. Let R be a trap. The part P at con guration q is safe if and only if there exists a triangle  = ft1 ; t2 ; t3 g with c(q) 2 , and t1 ; t2 ; t3 2 S (q). Otherwise, the part is rejected. In words, the part will drop if there is no supporting triangle of the center-of-mass. Note that not necessarily c(q) 2 S (q). Figure 1 depicts a part and a trap together with the convex hull of the supported surface. The following lemma gives us an easy way to decide whether the part is safe or not.

Lemma 2.2 P (q) is safe if and only if c(q) 2 CH(S (q)). Proof: ()) P (q) is safe. Therefore there is a triangle  = t ; t ; t , with t ; t ; t 2 S (q), and c(q) 2 . Clearly, t ; t ; t 2 CH(S (q)), and, consequently, c(q) 2 CH(S (q)). (() c(q) 2 CH(S (q)). We construct a triangle , by computing a triangulation T of CH(S (q)). Clearly there is one triangle in T which contains c(q). Furthermore, the vertices of CH(S (q)) are in S (q). 2 1

2

2

3

R

9 > > > =0 e > > > ;

R

P (q )

1

e0

1

2

3

3

In our model, the possible orientation of the part is restricted to O(n) di erent, discrete orientations. The track is slightly tilted toward the railing so the part remains in contact with the railing as it moves along the railing. The radius function for the part identi es the stable orientations of the part against the railing [21]. De nition 2.3 The radius of a part at an angle  is the distance from the center of mass to the line tangent to the part, and orthogonally intersecting the ray from the center of mass in the direction of . Each stable orientation of P corresponds to a local minimum in the radius function. The stable orientations of the part can easily be computed in linear time from the description of the part [27]. Furthermore, for each of these stable minima, the distance from the center-of-mass to the railing of the track is xed; the part has only one degree of freedom as it moves along the track.

Figure 2: The y-coordinates of the part (solid) and the trap (dotted). In the gures in this paper, the railing is coincident with the x axis and the part moves in the positive x direction. The railing is depicted at the bottom of the gures. The surface of the track is shaded in some of the pictures, and CH(S (q)) is grey. 3 Analyzing a trap In this section we discuss how to test an orientation of a polynonal part against a polygonal trap in the track. From Section 2 we know that there are only O(n) di erent possible orientations for the part on the track. Given one of these stable orientations, the y-coordinate of the center-of-mass and the orientation of the part are xed during the motion of the part on the track. Therefore, the problem we have to solve is: Given a trap R and a part P , with center-of-mass c, and xed y and , determine whether for all con gurations q = (x; y; ) P (q) is safe. The most natural way to look at this problem is to sweep the part across the trap and check if safeness is maintained during the sweep. Lemma 2.2 gives us the idea of the algorithm. Namely, we maintain the convex hull of the supporting surface during the motion of the part. We distinguish three types of vertices in the arrangement of the two possibly intersecting polygons R and P .  The vertices of P .  The vertices of R.

 The vertices due to the intersection of an edge of P and

an edge of R. The convex hull CH(S (q)) can be computed by computing the convex hull of a subset of these vertices. Recall that S (q) = P (q) ? int(R). The vertices of P contribute only to CH(S (q)) if they are not in R. R does not contribute to CH(S (q)), but we have to take into account the vertices due to the intersection of edges of P and R. We determine in which order the edges intersect each other during the motion of the part. Therefore, we rst sort the vertices of the part and the trap by their y-coordinate. Now, we have the y-coordinates of every edge, either from the trap, or the part. For a picture, see Figure 2 For each pair of edges (one from the part, the other from the trap), overlapping in the y-direction, we determine the x-value they start and stop intersecting. We sort the corresponding set of x-positions of the part. Page 2

These \events" characterize the combinatorial changes in the intersection of the trap and the part during the sweep. This preprocessing step takes O(nm log(nm)) time. Now we know when which edges of P and R intersect during the sweep. We have obtained a set of O(nm) moving and possibly appearing and disappearing points (intersections and vertices of P outside R) of which we want to maintain the convex hull, and, of course, check whether the center-of-mass is in the interior of the convex hull during the sweep. Hence, the problem boils down to maintenance of the convex hull of a set of O(nm) moving and appearing and disappearing points. In the literature, there are two types of methods dealing with related problems. The so-called dynamic convex hull algorithms, which allow insertion and deletion of points in O(log 2 nm) time per operation (see e.g. [31] or [19]), and the kinetic convex hull algorithms [4], and especially the algorithm of Basch et al. [5], which deal with points moving along continuous trajectories. In our case, it appears that adaptation of the algorithm of Basch et al. is the best way to maintain the convex hull. The algorithm of Basch et al. stores the points in a divideand-conquer tree, with certi cates that ensure the convex hull at the root is correct. Every time a predicate fails due to the motion of the points, the tree in which the points are stored is updated appropriately. To ensure that this update can be carried out eciently, the choice of the certi cates is delicate. We shall quickly sketch how the certi cates of Basch et al. were designed. Their algorithm is described in the geometric dual form, i.e. they compute the upper envelope of a set of lines in the plane. Consider two upper envelopes which have to be merged in a node of the divide-and-conquer tree. For every vertex v in one envelope, there is an edge in the other envelope that is either below or above it. This edge is called the contender edge of v. The merged upper envelope is constructed by walking through the two hulls simultaneously from left to right and report in sequence each vertex that is above its contender edge. In the dynamic algorithm, we need certi cates for each vertex v that state whether v is in the upper envelope or not. A naive approach might be to store the contender edge of each vertex, and simply check if the vertex is above its contender edge. Unfortunately a linear number of vertices can have the same contender edge which might give rise to very expensive certi cate updates when this contender edge changes. In their paper, Basch et al. present certi cates which are local and compact, i.e. the number of events depending on a single object is polylogarithmic, and the size of the total data structure is linear in the number of objects. For O(nm) points for which the trajectories are speci ed by algebraic curves of bounded degree, their algorithm runs in O((nm)2+ ) time. We cannot apply their algorithm directly because we have to take care of the appearing and disappearing points. Fortunately, there is one special point in the convex hull, the center of mass c of the part. This point should always be inside the convex hull if the part is safe during the motion. Initially, we assume all points to be at c. Then, if a new vertex has to be `inserted in the data structure', we take a

point in the center and move it towards the position where the vertex should appear. During this motion, we maintain the certi cates of the data structure, in the manner Basch et al. describe in their paper. The trajectories of the points are polylines in this setting. We shall rst design the trajectories of the points in such a way that the complexity of the individual polylines is constant, and then show that the time bound of the algorithm of Basch et al. is still valid. Every pair of an edge of the trap, and an edge of the part only intersect during an interval of positions of the part. For every pair consisting of an edge of the part and an edge of the trap, there is a dedicated point in the center. The trajectories of these points consist of being stationary at c, moving in nitely fast towards the rst intersectionpoint, moving linearly along both edges as the part moves across the trap, then moving in nitely fast towards c, and remaining there during the rest of the motion. We still have to cope with the vertices of the part which are not in the trap. The part has n vertices, but each of them can appear and disappear m times. A straightforward method is to add for each vertex of the part m points in the center, and then use for each appearance of this vertex another of these m vertices, having basically the same trajectory as the points which correspond to intersections of a pair of edges. Summing up, we have O(nm) vertices moving along constant complexity polylines. Recall that the points in the paper of Basch et al. move continuously along trajectories parameterized by algebraic curves of constant complexity. The trajectories of our points are continuous, but the direction of motion changes at the vertices of the polylines number of times, which makes it appropriate to use the algorithm of Basch et al. which allows so-called ight-plan updates|the interested reader is referred to [5]. We have to make sure the number of certi cates that fail in our setting does not grow asymptotically due to these ight-plan updates. Basch et al. use results on the complexity of upper envelopes [35, 1] which lead to their time bound. These upper envelopes of surfaces in the 3-dimensional time-position space have the same asymptotic complexity as upper envelopes of algebraic surface patches, which come into play if we let the points move along polylines. Another problem is constituted by the introduced degeneracies in the center point. This might lead to an excessive growth of the number of dependencies of the certi cates if we would allow every center vertex to appear on the convex hull. To prevent this from happening, we take only one center vertex at each node of the divide-and-conquer tree. Let vl be the center vertex of the left subtree, and vr be the center vertex of the right subtree. In the parent of vl and vr , we only include vl . We add a certi cate to the set of Basch et al., which captures this strategy. This certi cate retains the locality and compactness of the data structure, since it only connects the vr and vl . If vl starts to move, we can easily compute new certi cates for vr . Here, the locality of Basch et al.'s original data structure is the clue. The certi cates that need to be added to the data structure can be computed from vl , vr , and their neighboring vertices. Page 3

Summarizing, we have succesfully augmented the algorithm of Basch et al. [5] to compute the kinetic hull of a set of moving points, leading to the aforementioned running time of O((nm)2+ ). This result can be improved. We notice that for each edge of the trap, at any time, only two points contribute to the convex hull. Hence, we only have to take into account O(m + n) out of O(mn) points at a time. Therefore, we only store O(m + n) points at the position of the center of mass, and maintain for each edge of the trap, the order of the present intersection points. This can for example be done, using a balanced binary search tree. Careful analysis [9] of the complexity of the modi ed algorithm leads to the following result. Theorem 3.1 Testing one orientation of a polygonal part against a polygonal trap can be accomplished in O((nm(n + m))1+ ) time. In the case of a convex part and a convex trap the problem can be solved more eciently. The vertices resulting from the intersecting edges of the part and the trap are sucient to compute safeness of the part. Lemma 3.2 Given a convex part P with center of mass c at con guration q, and a convex trap R, P is safe if and only if c is in the convex hull of the vertices of S (q) \ R or c(q) 2= R. Proof: ()) Trivial. (() We elaborate on the case that c(q) 2 CH(S (q)) \ R, because if c(q) 2= R the part is evidently safe. We will show that CH(S (q) \ R) = CH(S (q)) \ R. Let us, for a contradiction, assume that there is a point p in CH(S (q)) \ R which is not in CH(S (q) \ R). This0 point is00 in CH(S (q)). Consequently, there are two points p and p in S , such that p lies on the edge p0 ; p00 . Furthermore, p0 and p00 have to lie outside CH(S (q)) \ R, since otherwise p is in CH(S (q)) \ R also. But, since P is a convex shape, any point on this edge is contained in P , and the intersection points of p0 ; p00 with the boundary of CH(S (q)) \ R are evidence for p to lie inside CH(S (q)) \ R. 2 Lemma 3.2 leads to a considerable eciency gain for the algorithm to analyze traps. We no longer have to take into account vertices which lie not on the boundary of the convex trap, and moreover, the changes to CH(s(q)) can be computed in logarithmic time per event. Also, the number of events drops down to O(n + m). For a thorough discussion of the analysis of convex traps with convex parts, we refer the reader to the full version of our work [9]. This leads to the following theorem. Theorem 3.3 Testing one orientation of a convex part against a convex trap can be accomplished in time O((n + m) log(n + m)). 4 Designing Traps In this section we discuss how to design a trap such that the track satis es the feeder property, i.e. only one orientation of the part survives the trap. We start with one-parameter traps, but increase the number of parameters as we go along. In Section 4.5 we show how to compute the parameters of a general parameterized trap.

 railing

Figure 3: A balcony in the track. The surface of the track is shaded. 4.1 One-Parameter Trap: the Balcony In this section, we treat a trap called a balcony which narrows the supporting surface of the track. A balcony is rectilinear. We can de ne this trap by giving the width, , of the track. The trap is at least a long as the length of the part. See Figure 3 for an example. A part only drops when its center-of-mass is in the interior of the trap. For a balcony, this is also a sucient condition.

Lemma 4.1 Let P be a part with center of mass c. Let R be a balcony trap having width . If at some con guration q during the motion, c(q) 2 int(R), then the part will be rejected.

Proof: Let  denote the distance from c to the railing edge of the track. Suppose that at some con guration q, c(q) 2 int(R). This implies that  < . Since the track has width  over a length greater than the length of the part, at some con guration q0 during the motion, the intersection of P (q0 ) ? int(R) will be in the half-plane, bounded by the line of distance  from the railing of the track. This halfplane separates the center of mass from the supported area. Therefore, the part is rejected at this position. 2 Recall that the distance from c to the railing is exactly the radius of the part in the orientation it is travelling in (Definition 2.3, and the discussion below). Hence, the theorem tells us that orientations with radius greater than the balcony-width drop o the track, and orientations with radius smaller than the balcony-width remain stable. The critical balcony-width for a given orientation is exactly its radius. Therefore, using a balcony, the orientation with the smallest radius can be selected by the bowl feeder. Clearly, this minimum can be computed in linear time. Theorem 4.2 Let P be a polygonal part with n vertices. In

O(n) time we can design a feeder using a balcony, if such feeder exists, or report failure otherwise.

Proof: The stable orientations and radii corresponding to these orientations of P are computed in linear time. If the minimum if the radii is unique, the feeder is constructed using a balcony slightly higher than this minimum radius. Otherwise, we will always end up with two or more orientations. 2 Note that the railing of the track always touches the part at the convex hull. Therefore, the given analysis holds for both convex and non-convex parts. A balcony can select orientations with a unique smallest radius. The only parts Page 4

side. The second type of rejected poses correspond to poses in which the part is supported by both sides of the gap. See Figure 5.

gap railing

Figure 4: A gap in the track. The edges of the gap are orthogonal to the railing. we cannot feed using a balcony are parts for which the minimal radius|recall De nition 2.3|is not unique. We might also use a balcony at the other side of the track, facing the railing. This `reverse' balcony can be used to select part orientations with a radius greater than the width of the reverse balcony. The combination of a balcony and a reverse balcony in succession on the feeder track is very powerful. Actually, we can select any radius, by rst trapping radii which are too big, and then trapping radii which are too small. So only parts for which each radius occurs more than once cannot be handled in this way. 4.2 One-Parameter Trap: the Gap In this section, we treat a trap called a gap which is an interruption of the surface of the track. A gap is rectilinear. We can de ne this trap by giving the width, , of the track. See Figure 4 for an example. To get some feeling for the problem, we rst show what happens if we move the part along a gap of arbitrary width. We start with the part to the left of the gap; the part is safe. During the motion, there might be a rejected position, if the gap is wide enough. At the end, when the center of mass is to the right of the right edge of the gap, the part is safe again. The position of the part at which the safeness of the part changes is called a critical pose. If the gap is small enough, then the part remains safe throughout the whole motion, and there are no critical poses. We focus on the critical gap-width, : the part passes safely over this gap but is rejected for gap-widths + , for any  > 0. We compute the critical gap-width for a part in a given orientation. The part is safe if and only if there is a supported triangle around the center-of-mass. This implies that, when the part is rejected, the supported area of the part is contained in a half-plane that does not contain the center of mass. We distinguish two di erent types of rejected poses of the part: 1. The part is only supported to the left (or the right) of the center of mass. 2. The supports are contained in a half-plane below (or above) the center of mass. In the rst type of rejected poses, the part can only be supported by one side of the gap, either the left or the right

(a)

(b)

(c)

(d)

Figure 5: The types of rejected poses. CH(S (q)) is grey. (a) The supports are to the left of the center of mass. (b) The supports are to the right of the center of mass. (c) The supports are in a half-plane below the center of mass. (d) The supports are in a half-plane above the center of mass. The critical gap-widths related to the rst type of poses are relatively easy to compute by considering the radius function of the part in orientation  at  ? 2 and  + 2 . Clearly, if one of these radii is less than the gap-width, then the part will fall either forward or backward. Thus, the critical gap-width is at most minfradius( ? 2 ); radius( + 2 )g. The critical gap-width for the second type of critical poses is a bit harder to compute. Let us investigate how the supports of the part can be contained in a half-plane below the center of mass (the case for the supports above the center of mass is similar). The line de ning the half-plane plays a crucial role in the analysis. Let us picture a part that is supported by two sides of the gap (See Figure 6). gap

CH(S (q)) P (q) Figure 6: A critical pose. The supported area of the part now consists of two regions, one to the left of the gap, and one to the right of Page 5

the gap. The center of mass is in the gap. A half-plane extending downward and containing the supported area will always contain the entire lower half of the convex hull of the part. Therefore, the center of mass has to lie in the upper hull of the part to obtain a rejected pose. The tightest half-planes containing the supported area and possibly separating the center of mass from the supported area are half-planes de ned by lines tangent to both the supported areas. Recall we are, for now, only considering half-planes extending downward. A tightest half-plane, therefore, is de ned by the line tangent to the top of both regions. A half-plane corresponding to a critical pose of the part is tangent to both the supported regions, as well as to the center of mass. In other words, the topmost intersection points of the upper hull of the part with the gap, and the center of mass are collinear. Figure 6 shows an example of a critical pose of a convex part. In order to compute the minimal gap-width, we investigate the relation between the angle of a line tangent to the supported regions, and the distance of the gap edges to the center-of-mass of P . Firstly, only the upper envelope of the part is relevant for the supported area, since we consider a half-plane below c. The upper envelope can be computed in O(n log n) time, using an algorithm for computing the upper envelope of line segments by Hershberger [22]. Secondly, we sweep the left edge of the gap across the upper envelope and determine the angle of the line tangent to S , and the center of mass as a function of the position of the gap-edge. Clearly, this function is monotonically increasing, since the supported area of the part only augments as we slide the edge to the right. We call this shape the upper tangent envelope. Computing the critical gap-width is accomplished by rotating a line around the center of mass, hereby sweeping over all critical poses of the part which in general have di erent gap-widths. The gap-widths corresponding to a critical pose is the horizontal distance between the intersection points of the line and the edges of the (upper tangent envelope) part. During the sweep, a linear number of pairs of edges are intersected by the line. For each such pair of edges of the upper tangent envelope of the part, we compute the smallest gapwidth such that there is a critical pose during the motion. The maximum of these gap-widths is the critical gap-width corresponding to the second type of rejected poses of the gap. The minimal gap-width is the minimum of the computed critical gap-widths for any relevant pair of edges of the part. This computation takes linear time.

Lemma 4.3 For any orientation of the part, the critical gap-width can be computed in O(n log n) time.

Theorem 4.4 Let P be a polygonal part with n edges. In O(n2 log n) time we can design a feeder with a gap, if such a feeder exists, or report failure otherwise.

Proof: The stable orientations of P are computed in O(n).

For each stable orientation we compute the critical gapwidth. If the minimum of the critical gap-widths is unique,

the feeder is constructed using the minimum critical gapwidth. Otherwise, we will always end up with two or more orientations. 2 If the part is convex, the upper envelope of the upper hull of the part is simply the boundary of the part. This allows for a faster computation of the feeder gap width. The critical gap-width of a given orientation can now be computed in linear time.

Theorem 4.5 Let P be a convex, polygonal part with n

edges. In O(n2 ) time we can design a feeder with a gap, if such a feeder exists, or report failure otherwise.

Proof: The stable orientations of P are computed in linear

time. For each stable orientation we compute the critical gap-width. If the minimum of the critical gap-widths is unique, the feeder is constructed using the minimum critical gap-width. Otherwise, we will always end up with two or more orientations. 2 4.3 Two-Parameter Trap: the Canyon In this section we discuss a trap that can be speci ed by two parameters. The trap is a canyon in the track. The canyon is a rectangular trap parallel to the railing of the track. The length is greater than the length of the part. The two parameters that specify the canyon de ne the position of the two edges parallel to the railing of the track. More specifically, the distance from railing of the track to the nearest edge of the canyon and the distance from the railing of the track to the furthest edge of the canyon: see Figure 7. We call these distances  and  respectively. The corresponding edges of the canyon are referred to as e and e . Since the canyon is longer than the part, it is fair to simplify the discussion and assume that the canyon is in nitely long. The advantage is that, like with the balcony, the position of the part is irrelevant for the safeness of the part. e e 



railing

Figure 7: A canyon is speci ed by the distance from the railing of the track to the nearest edge of the canyon and the distance from the railing of the track to the furthest edge of the canyon. We observe that the support of the part is similar to the support in the case of a gap. The mayor di erence is the direction of motion of the part as it travels along the trap. One can look at a canyon as a 90 rotated gap. Analogously to Section 4.2, we have two types of rejected poses. 1. The part is only supported by the upper part of the canyon ( = 0,  greater than the distance of c to the Page 6

railing of the track). Similarly, the part is only supported by the lower part of the canyon ( smaller than the distance of c to the railing of the track,  greater than the height of the part.) 2. The supports are contained in a half-plane to the left (or to the right) of the center of mass. We investigate the critical parameters for the trap. We rst determine how  depends on  for a speci c part in a speci c orientation. We start with a canyon with  = 0. Practically speaking, the part can only be supported by e . The part will drop if the distance of c to the railing is smaller than  . Otherwise, the part will be supported. Now, if we increase , the supporting area increases. Clearly, if  is smaller than the distance of c to the railing of the track, the part is supported. Moreover, we can recompute  for the new value of  to determine at which parameter setting, the safeness of the part is critical. We concentrate on the second type of rejected poses. Let us suppose, without loss of generality, that the center-ofmass is in the left hull of the part. In Figure 8 a critical pose of the second type with the center-of-mass in the left hull is depicted. l





Figure 8: A critical pose q for the depicted part. l is the line through the center of mass tangent to CH(S (q)) (grey). Note, that in order to compute the critical poses, we have to compute the left tangent envelope of the part. This is carried out analogously to Section 4.2 in O(n log n) time. There is a linear number of pairs of edges from the left tangent envelope which are simultaneously intersected by a line through the center of mass. For every pair of edges, we can compute the dependency on  and  , using elementary trigonometry. Mapping this on the (;  )-plane, we get O(n) curves, per stable orientation of the part. For each stable orientation of the part, we compute the curves, each corresponding to a critical parameter setting for a speci c orientation of P . The curves are connected and the relation between  and  is monotonous: increasing  increases the supported area of the part below the center-of-mass and can never lead to a lower  value. The curves of a speci c orientation divide the (;  )-plane into a safe and a rejected region for this orientation. Starting at a critical con guration, i.e. a point on the curve, moving to a neighboring parameter setting not on the curves by increasing  or decreasing  yields a rejected pose. Decreasing  or increasing  yields a safe pose. In other words, the area above the (connected) curves for a speci c orientation is the rejected area, the area below the curves is the safe area of parameter settings.

Our ultimate goal is to get a parameter setting which will preserve only one orientation of the part. The overlay of connected curves of all orientations form an arrangement. Acceptable parametersettings are these between the upper envelope and the 2-level of this arrangement. We use the algorithm of Hershberger [22] to compute the upper envelope of a set of curves that intersect pairwise at most k times. Therefore, the upper envelope of our curves has worst case complexity (k+2 (n2 )), where s (n2 ) is the maximum length of a Davenport-Schinzel sequence of order s on n2 symbols (see e.g. [36]). The algorithm of Hershberger runs in O(k+1 (n2 ) log n) time. After having computed the upper envelope, we strip the upper envelope from the arrangement, and run the algorithm of Hershberger again. This gives us the 2-level of the arrangement in the same time bound. In our case, each pair of curves intersect at most 2 times, leading to the following theorem.

Theorem 4.6 Let P be a polygonal part with n vertices. In

O(3 (n2 ) log n) time we can design a feeder using a canyon,

if such a feeder exists, or report failure otherwise.

In the convex case, the running time remains the same, since the stage which computes the upper envelope dominates the running time of our algorithm. 4.4 Three Parameter Trap: the Slot In this section we brie y discuss a three parameter trap which is a natural extension of the traps in the previous sections. The slot is rectangular, the edges of the slot are parallel or orthogonal to the railing. The slot can be speci ed by three parameters: its length, the distance of its closest edge to the railing, and the distance of its furthest edge to the railing. We denote the parameters by ,  and  respectively. Each edge of the slot provides a half-plane of possible support. In the interior the slot, there is no support. The part is supported outside the slot. The strategy to determine critical poses of the part is the same as in the Section 4.2 and 4.3. We have two types of supported poses of the part 1. The part is supported by one side of the slot, i.e. the center-of-mass of the part is always in the supporting half-plane of one edge of the slot. 2. The part is supported by two sides of the slot, i.e. there is a line tangent to the intersection of the part and the supporting half-planes of two sides of the slot, containing the center-of-mass of the part. For critical parameter settings ( ; ;  ), there is at least one position of the part at which it is at the verge of falling into the bowl. Slightly widening the slot at a critical parameter setting will let the part be rejected at some moment during its motion across the slot. We can nd critical parameter settings by looking at critical poses for the part, and construct a parameter setting which establishes this critical pose. At a critical pose of the part, there is a line through the center-of-mass of the part which is tangent to the supported area of the part and de nes a half-plane which contains the total supported area of the part. Page 7

Since at most two sides of the slot determine a critical pose, the critical parameter setting involves at most two parameters of the slot. Hence, there is at least one parameter of the slot which is `free' for a given critical parameter setting. In Figure 9 a critical parameter setting of the slot is depicted, with one free parameter.

l

Figure 10: A general parameterized trap. The position of the vertices are parameterized.

e P (q )

The sign conditions state at which side of each surface the cell is located.



CH(S (q ))

e



Theorem 4.7 Let P be a polygonal part with n vertices. In O(n8 ) time we can design a feeder using a slot, if such a feeder exists, or report failure otherwise.

Figure 9: A critical slot parameter setting for the depicted part. l is the line trough the center of mass tangent to CH(S (q)) (grey). Parameter established a critical pose for the line through e and e. Note that increasing  still yields a critical parameter setting.

The running time of the algorithm of this section can most likely be improved. The main goal of the presentation of the slot feeder is, however, to give an introduction to the next section in which we compute more generalized parameterized traps.

Now we know the characteristics of a critical parameter setting, we shall discuss an algorithm to compute a parameter setting which rejects all but one orientation of a given part. To this end, we de ne the slot parameter space. This is the 3-dimensional ( ; ;  )-space of all possible slot parameter settings. In this space, we build an arrangement of surfaces corresponding to critical parameter settings. In each cell of this arrangement, we store which orientations of the part are rejected, and which are safe. Since we have two types of critical parameter settings, we have two types of surfaces we have to compute. We determine the critical parameter settings involving one parameter, and we determine the critical parameter settings involving two parameters. The computation of these parameter settings can be accomplished by rotating a line around the center-of-mass of the part, tracing the critical poses of the part, and computing the corresponding critical parameter settings. The critical parameter settings correspond to area's in the parameter space, bounded by planes or curved surfaces. If we nd a cell in this arrangement for which only one orientation is safe, and the other orientations are rejected, we have a slot feeder. Let us analyze the complexity of the proposed algorithm. For each orientation there are O(n) surfaces of constant complexity. Thus the arrangement consists of O(n2 ) surfaces in a 3-dimensional space. We use a recent result of Basu et al.[7] to compute this arrangement. This leads to an O(n8 ) algorithm to compute the arrangement. The size of the output is O(n8 ) as well. In each cell of the arrangement we have to check which poses of the part are safe, and which are rejected. This can easily be computed using the sign conditions, which are generated by the algorithm, in each sub-cell of the arrangement.

4.5 General Parameterized Traps In this section we will show how to design a general trap. Our goal here is not to provide an optimal algorithm, but to give a general framework. The proposed general trap is a k-gon. The position of each vertex of the k-gon is speci ed by two parameters. This implies that a general k-gon can be speci ed by 2k parameters. (Other parametrizations are also possible, e.g. parameterize the angles between (some) edges of the traps, and parameterize the lengths of some of the edges. The latter parameterization is maybe a more natural extension of the traps of the previous sections, but involves a harder to construct con guration space than the space we present below). The problem of this section is as follows. Let P be a polygonal part and let k be an integer. Design a polygonal trap with k vertices such that P is rejected by the trap in all but one stable orientation, as P moves across the trap. Like in the previous section, we embed the problem in an appropriate Euclidian space. In this section, the computations will be carried out in a higher-dimensional Euclidian space which is spanned by the 2k parameters of the trap, the position of the part and the x; y-plane. We have to compute surfaces which correspond to critical poses of the part. We follow an approach which is related to robot motion planning, using a cell decomposition. We refer the reader to Latombe's book [24] for an overview of robot motion planning, and to the paper of Schwartz and Sharir [34] on a solution to the general motion planning problem, using the arrangement of higher-dimensional curved, algebraic surfaces. Our approach to compute the safe poses of the part uses Tarski sets, which are semi-algebraic sets. For ease of presentation, we describe the problem as if the part will remain stationary during the motion, and the trap moves across the part. Page 8

We shall denote the trap, speci ed by a 2k-dimensional vector q 2 R2k, at position s 2 R, by Rq [s]. Let int(Rq [s])() be the de ning formula of the translated trap in R2  R2k, i.e. int(Rq [s])(v), v 2 R2 is true if and only if v 2 int(Rq [s]). Let P () be the de ning formula of the part in R2, i.e. P (v), v 2 R2 is true if and only if v 2 P . We assume that P (), int(Rq [s]() are semi-algebraic sets. The intersection of the part and the supporting area of the track, P ? int(R(q)) is denoted by the following Tarski set S1 .

S = f(v; q; s) 2 R k j P (v) ^ : 2 +3

1

int(Rq [s])

(v)g

To determine the safe poses of the part, we take points of

S1 , and interpolate between points with the same q and s,

i.e. we construct the convex hull of the supported area of the part in the direction of the plane for each trapsize and trap position. This leads to the set

S = f(v; q; s) 2 R k j 0 9v 2 R 9v00 2 R 9i 2 [0; 1] : v =0 iv0 + (1 ? i)v0000 ^ (v ; q; s) 2 S ^ (v ; q; s) 2 S g 2

2 +3

2

2

1

1

Remember that a part is safe, if its center of mass is inside this convex hull. The safe parametrizations in R2k are the parametrizations for which the center of mass of P , c, is safe for every position of the trap. A few easy transformations transform the set S2 into the a lower-dimensional arrangement which captures the safeness of the part. The only part of the arrangement that is of interest is the part which corresponds to the center of mass of the part. Therefore, we intersect S2 with the 2k +1-dimensional space corresponding to the center of mass. This results in

S = f(q; s) 2 R k j (c; q; s) 2 S g 2 +1

3

2

If, during the motion, the center of mass is rejected at some pose, the part is rejected. Therefore, we project the complement of the arrangement, onto R2k, obtaining

S = fq 2 R k j 9s 2 [0; 1] : (q; s) 2= S g 2

4

3

We now have an arrangement which divides R2k into safe and rejected cells. For each orientation of the part, we have to compute this arrangement. The next step is to merge the m di erent S4 arrangements, and nd a cell for which all but one orientation is rejected. Let us denote S4 for orientation i by S4 (i). In the remaining part of this section, we discuss how to compute a parametersetting selecting the rst stable orientation of the part, if such a parametersetting exists. Repeating this procedure for the other orientations completes our extensive search for a feeder. Possible feeder parameter settings selecting the rst orientation are given by

S = fq 2 S (1)j8o 2 [2; : : : ; m] : q 2= S (o0)g 5

4

4

Note that o is not a real algebraic variable, and its universal quanti er represents an ordinary for-loop. Unfortunately, the remaining quanti ers (found in the expansion of S4 (i) are harder to deal with. In order to be able to eliminate these quanti ers, we rst nd the prenex form of the resulting formula, i.e. we transform it to an equivalent sentence with the quanti ers to the left. This is standard procedure and can be found in e.g. the book of Mishra [29]. We denote the resulting formula by S . Second, elimination of the quanti ers in S can be done by Collins' decomposition which is a (doubly) exponential algorithm in the number of parameters specifying the trap. The output of Collins' algorithm are the cells in the arrangement in R2k of any dimension. If we would settle for only the semi-algebraic description of the arrangement (without decomposing it into cells), we could use the algorithm of Basu [6], which uses singly exponential time in our case. The latter output can be further processed using the algorithm of Basu et al. [7]. 5 Conclusion In this paper, we gave a geometrical framework for the trap design problem, and reported algorithms for the analysis and design of various traps for polygonal parts moving across a feeder track. We are not aware of any previous algorithms for the systematic design of vibratory bowl traps. Open problems are the design of more ecient algorithms, especially for generalized parameterized gaps, dealing with special cases, friction, and the extension to 3-dimensional parts. In the 3-dimensional case it becomes more important to decide whether, when a part is rejected, it will fall back into the bowl, or get stuck halfway falling. The model we propose does not take into account the inherent uncertainty of the real world. Due to the vibration of the bowl, the position and orientation are only known up to a small uncertainty measure. The design of algorithms which take into account this uncertainty is future work. Acknowledgements We wish to thank J. Basch and M. de Berg for discussion on Section 3, and L. Cheung and G. Smith for useful feedback. References [1] P. K. Agarwal, O. Schwarzkopf, and M. Sharir. The overlay of lower envelopes and its applications. Discrete Comput. Geom., 15:1{13, 1996. [2] S. Akella, W. Huang, K.M. Lynch, and M.T. Mason. Sensorless parts feeding with a one joint robot. Algorithms for Robotic Motion and Manipulation (J.-P. Laumond and M. Overmars (Eds.)), A.K. Peters, pages 229{238, 1996. [3] S. Akella and M.T. Mason. Posing polygonal objects in the plane by pushing. In IEEE International Conference on Robotics and Automation, Nice, pages 2255{ 2268, 1992. [4] M. J. Atallah. Some dynamic computational geometry problems. Comput. Math. Appl., 11:1171{1181, 1985. Page 9

[5] J. Basch, Leonidas J. Guibas, and J. Hershberger. Data structures for mobile data. In Proc. 8th ACM-SIAM Sympos. Discrete Algorithms, pages 747{756, 1997. [6] S. Basu. New results on quanti er elimination over real closed elds and applications to constraint databases. to appear in J. A.C.M., 1999. [7] S. Basu, R. Pollack, and Marie-Francoise Roy. Complexity of computing semi-algebraic descriptions of the connected components of a semi-algebraic set. to appear at ISSAC 98, 1998. [8] D. Berkowitz and J. Canny. Designing parts feeders using dynamic simulation. In IEEE International Conference on Robotics and Automation (ICRA), Minneapolis, MN, 1996. [9] R.-P. Berretty, K. Goldberg, L. Cheung, M.H. Overmars, G. Smith, and A.F. van der Stappen. Trap design for vibratory bowl feeders. Technical report, Department of Computer Science, Utrecht University, 1999. To appear. [10] R.-P. Berretty, K. Goldberg, M. Overmars, and A.F. van der Stappen. Computing fence designs for orienting parts. Computational Geometery, Theory and Applications, 10(4):249{262, 1998. [11] K.-F. Bohringer, V. Bhatt, and K.Y. Goldberg. Sensorless manipulation using transverse vibrations of a plate. In Proc. IEEE Int. Conf. on Robotics and Automation, Nagoya, Japan, pages 1989{1996, 1995. [12] K.-F. Bohringer, B.R. Donald, and N.C. MacDonald. Upper and lower bounds for programmable vector elds with applications to mems and vibratory plate part feeders. Algorithms for Robotic Motion and Manipulation, J.-P. Laumond and M. Overmars (Eds.), A.K. Peters, pages 255{276, 1996. [13] G. Boothroyd, C. Poli, and L. Murch. Automatic Assembly. Marcel Dekker, Inc., New York, 1982. [14] M. Brokowski, M.A. Peshkin, and K. Goldberg. Optimal curved fences for part alignment on a belt. ASME Transactions of Mechanical Design, 117, March 1995. [15] M. E. Caine. The Design of Shape from Motion Constraints. Ph.D. dissertation, MIT arti cial Intelligence Laboratory, 1993. AI-TR 1425. [16] M. E. Caine. The design of shape interactions using motion constraints. In IEEE International Conference on Robotics and Automation, 1994. [17] Y.-B. Chen and D.J. Ierardi. The complexity of oblivious plans for orienting and distinguishing polygonal parts. Algoritmica, 14:367{397, 1995. [18] A. Christiansen, A. Edwards, and C. Coello. Automated design of parts feeders using a genetic algorithm. In IEEE International Conference on Robotics and Automation (ICRA), Minneapolis, MN, 1996. [19] K. L. Clarkson and P. W. Shor. Applications of random sampling in computational geometry, II. Discrete Comput. Geom., 4:387{421, 1989. [20] M.A. Erdmann and M.T. Mason. An exploration of sensorless manipulation. IEEE Journal of Robotics and Automation, 4:367{379, 1988. [21] K. Goldberg. Orienting polygonal parts without sensors. Algorithmica, 10(2):201{225, August 1993. [22] J. Hershberger. Finding the upper envelope of n line

[23] [24] [25]

[26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37]

segments in O(n log n) time. Inform. Process. Lett., 33:169{174, 1989. M. Jakiela and J. Krishnasamy. Computer simulation of vibratory parts feeding and assembly. In 2nd International Conference on Discrete Element Methods, March 1993. J.-C. Latombe. Robot Motion Planning. Kluwer Academic Publishers, Boston, 1991. L. Lim, B. Ngoi, S. Lee, S. Lye, and P. Tan. A computer-aided framework for the selection and sequencing of orientating devices for the vibratory bowl feeder. International Journal of Production Research, 32(11), 1994. K. M. Lynch and M.T. Mason. Stable pushing: Mechanics, controllability, and planning. International Journal of Robotics Research, 6(15):533{556, 1996. M. Mason. Manipulator grasping and pushing operations. PhD thesis, MIT, 1982. published in Robot Hands and the Mechanics of Manipulation, MIT Press, Cambridge, 1985. G. Maul and M. Thomas. A systems model and simulation of the vibratory bowl feeder. Journal of Manufacturing Systems, 16(5), 1997. B. Mishra. Algorithmic Algebra. Springer-Verlag, New York Berlin Heidelberg, 1993. B.K. Natarajan. An algorithmic approach to the automated design of parts orienters. In IEEE Annual Symposium on Foundations of Computer Science, pages 132{142, 1986. M. H. Overmars and J. van Leeuwen. Maintenance of con gurations in the plane. J. Comput. Syst. Sci., 23:166{204, 1981. M.A. Peshkin and A.C. Sanderson. The motion of a pushed sliding workpiece. IEEE Journal of Robotics and Automation, 4(6):569{598, 1988. M.A. Peshkin and A.C. Sanderson. Planning robotic manipulation strategies for workpieces that slide. IEEE Journal of Robotics and Automation, 4(5):524{ 531, 1988. J. T. Schwartz and M. Sharir. On the \piano movers" problem II: general techniques for computing topological properties of real algebraic manifolds. Adv. Appl. Math., 4:298{351, 1983. M. Sharir. Almost tight upper bounds for lower envelopes in higher dimensions. Discrete Comput. Geom., 12:327{345, 1994. M. Sharir and P. K. Agarwal. Davenport-Schinzel Sequences and Their Geometric Applications. Cambridge University Press, New York, 1995. J. Wiegley, K. Goldberg, M. Peshkin, and M. Brokowski. A complete algorithm for designing passive fences to orient parts. Assembly Automation, 17(2):129{136, August 1997.

Page 10