Computers in Industry 55 (2004) 125–145 www.elsevier.com/locate/compind
Dexel-based force–torque rendering and volume updating for 5-DOF haptic product prototyping and virtual sculpting Weihang Zhu, Yuan-Shin Lee* Department of Industrial Engineering, North Carolina State University, Raleigh, NC 27695-7906, USA Received 8 September 2003; accepted 5 July 2004 Available online 11 September 2004
Abstract This paper presents new techniques of Dexel-based force–torque rendering and volume-updating for haptic virtual sculpting of complex surfaces with a developed 5-DOF (degree of freedom) haptic interface. In the proposed methodology, 5-axis tool motion and analytical tool swept volume are formulated for updating the virtual stock material, which is represented with the Dexel volume model. Based on the tool motion analysis, a Dexel-based collision detection method and a force–torque feedback algorithm are proposed for virtual sculpting. A lab-built 5-DOF force–torque output haptic interface system is developed for the proposed haptic sculpting system. With the proposed methodology, a user can virtually sculpt a volume stock to get an intuitive design by using the haptic interface. From the haptic sculpting system, both the corresponding tool motion of the creative process and the sculpted model can be recorded and output. The output STL models of the haptic sculpting system can be processed for machining planning. Based on the proposed techniques, hardware and software implementation of the haptic sculpting system as well as the illustrative examples are also presented in this paper. # 2004 Elsevier B.V. All rights reserved. Keywords: Haptic rendering; CAD/CAM; Product prototyping; Virtual sculpting; Volume sculpting
1. Introduction In reality artists are creating intuitive art works to make the world more wonderful. Every so often CAD (computer-aided design) system users wish to have an intuitive way to create something that a normal CAD system cannot create easily. Our research focuses on * Corresponding author. Tel.: +1 919 515 7195; fax: +1 919 515 5281. E-mail address:
[email protected] (Y.-S. Lee).
helping them to realize this dream in the virtual world. Virtual sculpting arose more than a decade ago when it was presented as a novel free-form interactive modeling technique [1,2]. Theoretically, there are two kinds of virtual sculpting systems. One is derived from surface-based deformable geometric object modeling, which may be vertex-based, spline-based, particlebased, FEM (finite element modeling)-based, etc. [3]. The other one is analogous to the NC (numericallycontrolled) simulation process, by which stock material is removed whenever a virtual tool sweeps
0166-3615/$ – see front matter # 2004 Elsevier B.V. All rights reserved. doi:10.1016/j.compind.2004.07.003
126
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145
a stock [4–6]. This type of virtual sculpting is usually based on volume models, e.g., Voxel or Dexel models. The Voxel model represents an object with many small cubes in a regular lattice (see Fig. 1(a)). The Dexel model represents an object with a grid of long columns compacted together (see Fig. 1(b)). It has been recognized that the feeling of actuality may be greatly enhanced with a force feedback interface [2]. Earlier integration of force feedback interface with a machining system was attempted as in [7,8]. Haptics is a novel discipline concerned with information and objects manipulation through touch and force feedback. Haptic interface provides force and/or torque feedback to the user in a virtual environment. In recent years, a dynamic sculpting system for free-form subdivision solids was developed at SUNY Stony Brook [3]. A virtual carving system was developed at the University of Missouri-Rolla [5]. Both systems were integrated with a 6-DOF input and 3-DOF output commercially available haptic device. In our earlier work presented in [9,10], a lab-built 6-DOF input and 5-DOF output haptic interface system has been developed for 5-axis machining planning. In [11], a marching algorithm were
developed for the conversion between a volumetric Dexel model and its polyhedron model. In [12,13], techniques and detailed algorithms based on the rolling-ball method were developed for pencil-cut machining of the corner or highly curved regions on sculptured surfaces. In this paper, techniques of Dexelbased force–torque rendering and volume-updating are proposed for haptic virtual sculpting and product prototyping. In the system, a user can virtually sculpt a raw stock to get an intuitive design by using a haptic interface. The developed 5-DOF force–torque output haptic device is integrated with the proposed haptic sculpting system. The remainder of this paper is organized as follows. Section 2 narrates the methodology of the Dexel volume-updating process with multi-axis tool motion. Section 3 describes the 5-DOF Dexel-based haptic rendering (force and torque feedback) programming in detail. Section 4 illustrates the integrated software and hardware developed in the haptic interface system. Section 5 provides some discussion about the current methodology. Implementation and experiment results are presented in Section 6, followed by the concluding remarks and suggestions for future work.
Fig. 1. Volume models and different volume-updating situations. (a) Voxel volume model, (b) Dexel volume model, (c) shorten the top of a Dexel element, (d) shorten the bottom of a Dexel, (e) cut a Dexel in the middle.
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145
2. Methodology of Dexel-based virtual sculpting
127
updating process, each Dexel is treated as a vector (see Fig. 2(a) and (b)).
2.1. Object modeling in virtual sculpting A virtual sculpting system usually contains two basic components: a stock material to be sculpted and a virtual tool. In this paper, the stock material is represented with the Dexel volume model. The Dexel volume model, as shown in Fig. 1(b), has been used widely in NC simulation process [14,15]. Compared to the Voxel model (Fig. 1(a)), which is used extensively in Volume Graphics, the advantage of using the Dexel volume model is its smaller memory requirement and fewer processing volume elements. The Dexel volume model represents an object with a grid of long columns compacted together (see Fig. 1(b)). Three possible situations may happen to a Dexel element during a Dexel-updating process: (i) The top part of a Dexel element is shortened by a cutter (Fig. 1(c)). (ii) The bottom part of a Dexel element is shortened by a cutter (Fig. 1(d)). (iii) A Dexel element is broken into two parts if a cutter cuts the Dexel element in the middle (Fig. 1(e)). Therefore in the data structure, a Dexel volume model is recorded as a regular 2D grid, with each grid point associated with a linked list of Dexel elements (Fig. 2(a)). For simplicity, only a few sample Dexel linked lists are shown in Fig. 2(a). In the Dexel-
2.2. Fundamentals of tool swept volume and the haptic sculpting tool motion In the design of a virtual sculpting process, the tool definition is defined as a milling cutter used in a machining workshop. As shown in Fig. 3, the tool can be defined as a combination of 2D circular arcs and straight lines [4]. Thus it can represent a ball endmill cutter, flat endmill cutter or taper endmill cutter in NC (numerically controlled) machining (see Fig. 3(a)–(c)). As a tool sweeps across a space, it generates a swept volume. The requirement of the Dexel-updating process is: given a pair of (X, Y) coordinates, calculate the Z values of tool swept volume (Fig. 3(d)). The general theory of swept volume is dominated by the geometric relationship defined by some differential equations [16,17]. The computation based on the differential equations is complex and it does not apply well to the Dexel-updating process due to the different parameterization. In the calculation of swept volume in [16], the tool swept volume has to be triangulated nevertheless. In our earlier work presented in [18], a formulation was proposed to find the analytical solution for the tool swept volume. This method also has limitations similar to those in [16]. In [19], a generalized imprint method was used to find the general swept surface of revolution in NC machining. This imprint method connects grazing points of two
Fig. 2. Data structure of Dexel volume models and Dexel-updating processing. (a) Linked list data structure of Dexel elements, (b) treating Dexels as vectors.
128
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145
haptic probe does not move rapidly. Therefore the complications, such as self-intersection, involved in general swept volume rarely happen between any two successive digital sampling instances. The task of haptic sculpting is more time-critical than NC simulation. Hence in haptic sculpting the objective is to get fast haptic rendering by finding a trade-off between updating precision and the speed requirement. Based on the above observations, the following approach is proposed. The objective of the proposed approach is to find analytical solutions for a fast and stable Dexel model updating process. 2.3. Tool cutting profile analysis for different cutters in multi-axis tool motion
Fig. 3. Different endmill cutters and the tool swept volume with a Dexel vector. (a) Ball endmill, (b) flat endmill, (c) taper endmill, (d) finding intersection points of a tool swept volume with a Dexel vector (ray).
adjacent tool positions with line segments and then gets approximation of the swept surface by triangulation. The method has the potential defect that two adjacent tool positions do not have the corresponding grazing points to connect. In [15], many instances of the tool are densely arranged along the tool path to update the Dexel model. In this paper, a method based on tool motion analysis and analytical swept volume is proposed for fast updating of Dexel volume models. The proposed Dexel-updating method is used for a haptic virtual sculpting process. For virtual sculpting, some important observations are shown as follows: The tool motion is determined from the posture of the haptic probe. It is determined in real time, instead of by a pre-determined NC code command as in NC simulation. The posture information of the haptic probe is discrete depending on the sample digital signal from the electronic haptic controller. Usually the haptic sampling frequency is very high (about 1000 Hz), and thus between two sampled tool motion, the tool motion changes very little if the
In this paper, the tool motion is analyzed to find the tool swept volume. The tool swept volume is modeled and calculated to update stock material represented with the Dexel volume model. To get the tool swept volume, first the tool cutting profile (TCP) needs to be found for the tool. As presented in our earlier work in [4], the tool cutting profile is defined as the profile curve, which is the solution to the following equation: ~ n~ V¼0
(1)
where ~ n is the tool surface normal and ~ V is the instantaneous tool moving direction (Fig. 4). It can be imagined that if a light source is shedding along the ~ V direction, the tool cutting profile TCP becomes the boundary curve of two regions: the lighted region and the dark region, as shown in Fig. 4. In fact, the continuous set of the instantaneous TCP, defined by Eq. (1), form the swept envelope during the cutter motion. More details of using the continuous set of the instantaneous TCP to generate the NC machined surface shapes can be found in our earlier work presented in [17]. In machining, the tool motion can be discretized into small linear segments. Assume that after the discretization of the tool motion, the two adjacent discretized tool orientations are linearly interpolated and a local coordinate system (LCS) can be set up as shown in Fig. 5(a). During the Dexel-updating process, a local coordinate system (LCS) needs to be set up first so that the current tool orientation is the local Z
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145
129
Fig. 4. Tool cutting profile (TCP) of a cutter moving along the cutting direction ~ V [4].
axis and X axis point from the tool tip of the first tool position to the second tool position, as shown in Fig. 5(a). In Fig. 5(a), ~ V is the direction of the tool movement and is within the X–Z plane. Using Eq. (1), the cutting profile of a cutter moving along the vector ~ V can be solved [17]. If the tool is a
ball endmill (a half sphere plus a cylinder) or flat endmill cutter (a cylinder), the cutting profile can be found easily. It is composed of two half circular arcs plus two straight lines, as shown in Fig. 5(b) and (c). For an endmill with (truncated) cone(s) at the bottom (e.g., taper endmill), the cutting profile of the cone
Fig. 5. Finding the tool cutting profiles of different endmills moving along vector ~ V. (a) Local coordinate system setup with current tool orientation as Z axis, (b) flat endmill, (c) ball endmill, (d) taper endmill.
130
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145
If ~ V is along the X axis direction, then: ~ V ¼ ½1
0 0 T
(4)
Now let the cone rotate around Y axis for a certain angle l, that is, the cone is moving along a direction vector that forms a l angle with X axis, as shown in Fig. 5, and then also rotate around Z axis for a certain angle v, so that: 2 3 cosðvÞ sinðvÞ 0 ~ V ¼ 4 sinðvÞ cosðvÞ 0 5 0 0 1 2 32 3 cosðlÞ 0 sinðlÞ 1 54 0 5 40 1 0 (5) sinðlÞ 0 cosðlÞ 0 where l is the tool inclination angle rotating around Y axis, v is the tilt angle rotating around Z axis. By substituting Eqs. (3) and (5) into Eq. (1), the following equation can be obtained: cos v cos l cos u sin l tan bc sin v cos l sin u ¼ 0 (6) Eq. (6) can be rearranged into the following: So Eq. (6) can be further reduced to the following equation: cosðv þ uÞ ¼ tan ltan bc
(7)
Fig. 6. Calculating the tool cutting tool profile of complex tools. (a) Definition of a generalized cone on endmill and the geometric relationship, (b) tool cutting profile details of a cone end tool.
By solving Eq. (7), the cutting profile angle ucp for the tool cutting profile, which satisfies the condition of Eq. (1), can be found shown as follows:
portion has to be derived. In Fig. 6, a truncated cone is defined as follows: 2 3 ðrc þ lc tan bc Þ cos u Cone ¼ 4 ðrc þ lc tan bc Þ sin u 5 (2) hc þ lc
ucp ¼ arccosðtanðlÞ tanðbc ÞÞ v
where lc is the height parameter of the truncated cone, u is the angle parameter around the Z axis, hc is the distance from the origin point to the cone lower end, rc is the radius of the lower end, bc is the cone angle. Its surface normal can be found as follows: 2
~ ncone
3 cos u @ðConeÞ @ðConeÞ 4 5 ¼ sin u ¼ @lc @u tan bc
(3)
(8)
Eq. (8) gives the explicit relation between tool orientation (l, v), cone angle bc and cutting profile angle ucp on the generalized tool geometry. Eq. (8) means that, given a tool orientation (l, v), the cutting profile angle ucp can be found by directly using Eq. (8) (see Fig. 6). In the current local coordinate system defined as in Fig. 5(a), v is usually set as 08 as in Eq. (8). For multi-axis machining, when both l and v angles are used, Eq. (8) can be used for finding the tool cutting profiles of different endmill cutters in 5-axis tool motions. The above discussion narrated the calculation of tool cutting profiles for cylinder, sphere and truncated cones. The tool cutting profile of a tool composed
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145
of 2D arcs and straight lines can be derived by combining its component tool cutting profiles. For example, for a tool with two stacked cones at the bottom, the cutting profile is composed of the top arc, several line segments and border arcs, as shown in Fig. 6(b) [17]. Fig. 5(b)–(d) list the tool cutting profile of different kinds of cutting tools. The movement of the cutting profiles generates a swept envelope across the space (Figs. 6 and 7). The swept envelope together with two end tool shapes constitutes a swept volume as a result of tool motion (Figs. 6 and 7). The tool cutting profile defined by Eq. (8) is used in generating the 3D swept envelope as detailed in the following paragraphs.
2.4. Dexel model updating processes for virtual sculpting For virtual sculpting, we are interested in analyzing the 3D swept volume generated by multi-axis tool motion and the Dexel-updating processes. In the following discussion, a generalized tool with the tool tip consisting of two cones is used as an example for illustration (see Fig. 6). This generalized tool is referred to as cone end tool. In this paper, four different general tool motion situations are considered, detailed as follows: (1) Tool moves up and down along the tool axis: the intersection calculation tasks include intersection with a tool M and a cylinder, which is the swept volume SVðMÞ for this case (see Fig. 7(a)): SVðMÞ ¼ [ fM; cylinderg
(9)
(2) Tool rotates around an axis without translation (see Fig. 7(b)): the rotation of straight lines around an axis can be handled as general cones (see Fig. 9) and the rotation of a sphere around its center is always a ball. Notice that, for some extreme case of the rotating axis perpendicular to the cutter axis, the rotation of straight lines around an axis may become a circle (a special case of a general cone) instead of a cone. Taking taper endmill as the example, the swept volume SVðMi Þrotate of tool rotation motion can be broken down to two side planes, two cones (bottom
131
rotation) and a top cylinder (approximately) (Fig. 7(c)): SVðMi Þrotate ¼ [ fMi ; rotate swept envelope; Miþ1 g ¼ [ fMi ; left side rotate; right side rotate; cones rotate; Miþ1 g
(10)
The swept surface of the top circle is approximated with a partial cylindrical surface. This is an acceptable approximation since the tool tip, not the tool top, is used for sculpting. Hence it becomes the problems of the ray–cone intersection and the ray–sphere intersection. An analytical solution is not difficult to find while coordinate transformation needs to be carefully treated. (3) Tool translates without rotation: the tool movement is linear and orientation is fixed, as shown in Fig. 7(d). The cutting profile is utilized to calculate the swept volume. As mentioned before, for this cone end tool, the cutting profile is composed of the top arc, several line segments and border arcs, as shown in Fig. 6(a). Hence this tool swept volume SVðMi ! Miþ1 Þtranslate of a tool M movement from Mi to Mi+1 can be broken down to top arc swept pipe, sides, border arc swept pipes and cone swept (see Fig. 7(d)), shown as follows: SVðMi ! Miþ1 Þtranslate ¼ [ fMi ; translate swept envelope; Miþ1 g Mi ; left side; right side; top swept pipe; ¼ [ border swept pipes; cones swept; Miþ1 ð11Þ (4) Tool moves around with both rotation and translation: this is the most common case during virtual sculpting (see Fig. 8). In this case, the tool movement is discretized into small linear segments as shown in Fig. 8(a). The difference between each adjacent tool orientation is limited to a small increment angle. Inside each such discretized segment, the tool movement is approximated with a translation tool movement SVðMi ! Miþ1 Þtranslate plus a rotation tool movement SVðMiþ1 Þrotate (see Fig. 7(c)). Thus the tool swept volume SV(M) of a tool M movement from M1 to Mn is the union of (n 1) discretized sub
132
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145
Fig. 7. Finding tool swept volume of generalize cutters for different tool motions. (a) Tool move up and down along the tool axis, (b) tool rotates only, (c) swept volume breakdown for a tool rotates, (d) swept volume breakdown for a tool moves linearly without rotation.
swept volume SVðMi ! Miþ1 Þ, shown as follows (Fig. 8(b)): SVðMÞ ¼ [ n1 i¼1 ðSVðMi ! Miþ1 Þtranslate þ SVðMiþ1 Þrotate Þ
(12)
where SVðMiþ1 Þrotate is defined in Eq. (10), and SVðMi ! Miþ1 Þtranslate is defined in Eq. (11). After the tool swept volume SV(M) is identified by using the above Eqs. (9)–(12), it is used to update the
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145
133
Fig. 8. General tool motion discretization during the virtual sculpting process. (a) Tool rotates and translates at the same time: discretize tool motion, (b) each discretized tool motion segment is approximated by one translation (Fig. 7d) plus one rotation (Fig. 7(c)).
stock material represented with Dexel volume models. As mentioned before, the task for the Dexel-updating process is: given a pair of (X, Y) coordinates, calculate the Z values of tool swept envelope (Fig. 3(d)). The advantage of the current approach is that all the intersection calculation can be found from analytical solutions and thus any numerical iteration is avoided. During the tool interference tests, coordinate transformations are heavily involved to facilitate the calculation of the intersection problem. According to the above tool cutting profile and tool motion analysis, the intersection between the tool swept volume and the Dexel vectors breaks down to several basic intersection problems (also see Figs. 9 and 10): (1) Intersection between a tool and a Dexel vector (ray): this is to find the intersection of ray– cylinder, ray–cone and/or ray–sphere. The deriva-
tion is not difficult and there are available algorithms in [20]. (2) Intersection between a cone end tool rotational swept surface and a Dexel vector (ray): as mentioned above, ray–cone intersection can also
Fig. 9. Intersection of a cone with a Dexel vector during a tool’s rotation.
134
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145
arc can sweep along a straight line to form a ruled surface with the shape of a partial pipe. Assume that the circular arc with radius r lies in the X–Y plane with the center at (0, 0, zh) and the arc is moving along the direction V ! (Vx, 0, Vz), as shown in Fig. 10(b). The 3D ruled surface generated by a planar circular arc’s linear movement may be represented in the local coordinate system as follows (Fig. 10(b)): 2 3 x 6 7 Pipe ¼ 4 y 5 ¼ arc þ s~ V 2
z r cos a
3
2
Vx
3
2
r cos a þ sVx
6 7 6 7 6 ¼ 4 r sin a 5 þ s4 0 5 ¼ 4 r sin a zh Vz zh þ sVz
3 7 5
ð14Þ where s is the parameter of the tool moving direction vector ~ V, and a is the angle parameter of the 2D planar circular arc. As shown in Fig. 10(b), a Dexel vector (ray) may be represented in the local coordinate system as: Fig. 10. Finding the intersection between a Dexel vector and a swept cutter in linear tool motion. (a) Parameterization of a parallelogram to find the intersection of a Dexel vector, (b) intersection between a swept pipe and a Dexel vector (ray).
be used during the rotation of a tool with cones as the tool tip, e.g., taper endmill or a cone end tool. In such a situation, a straight line rotates around an axis to form a partial cone (Fig. 9). (3) Intersection between a parallelogram and a Dexel vector (ray): as shown in Fig. 10(a), the parametric representation of a parallelogram can be as follows: P ¼ bðP3 P1 Þ þ aðP2 P1 Þ þ P1
2 3 2 3 2 3 x Wx P0x ~ ¼ 4 P0y 5 þ t4 Wy 5 Q ¼ 4 y 5 ¼ P0 þ t W z P0z Wz 2 3 P0x þ tWx ¼ 4 P0y þ tWy 5 P0z þ tWz
(15)
where P0(P0x, P0y, P0z) is the start point of a Dexel vector,t is the parameter of the Dexel vector, and ~ x ; Wy ; Wz Þ is the direction cosine of the Dexel WðW vector ray. To find the intersection point between the pipe and the Dexel vector ray, the following equation needs to be solved:
(13)
where a and b are two parameters. Since (x, y) coordinate of point P is given, the parameter a and b can be solved (see Fig. 10(a)) and consequently the Z coordinate of intersection point P can be found. (4) Intersection between a pipe and a Dexel vector (ray): as shown in Fig. 10(b), a 2D planar circular
Pipe ¼ Q
(16)
By solving Eq. (16), parameter t can be obtained from the following quadratic equation: ðb21 þ W 2y Þt2 þ 2ða1 b1 þ P0y Wy Þt þ ða21 þ P20y r 2 Þ ¼ 0
(17)
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145
where a1 ¼ P0x ðP0z zh ÞðVx =Vz Þ, and b1 ¼ Wx Wz ðVx =Vz Þ. The other two parameters s, a can be calculated accordingly, and finally the intersection point coordinates can be obtained. The above analysis is used for updating the Dexel volume models. According to the analysis, no triangulation of the swept volume is needed, and an analytical solution can be found for all related component problems, which include ray–cylinder, ray–cone, ray–sphere, ray–parallelogram and ray– pipe intersections. In the next section, a Dexel-based 5-DOF force–torque feedback algorithm for virtual sculpting is proposed based on the previous analysis.
135
removal at a given instance. The force can be considered to be proportional to the material removal rate (MRR). In this paper, a Dexel removal rate (DRR) approach is proposed to analyze the haptic sculpting force– torque feedbacks. MRR can be considered to be proportional to the Dexel volume removed accumulatively per unit time, which is defined by us as Dexel removal rate (DRR). The haptic force response is calculated based on the DRR that is proportional to the Dexel volume removal. Based on the analysis from the previous section, the DRR can be calculated during the Dexel-updating process. 3.1. Finding the force and torque response of a removal Dexel element
3. Five-DOF force–torque haptic rendering for virtual sculpting Haptic rendering refers to the task of detecting interference between objects in a virtual environment and accordingly calculating the force and/or torque feedback. The common requirement for the haptic feedback rate is 1000 Hz in order to sustain a continuous force feedback. When this rate cannot be obtained due to the limitation of computation power, extrapolation of force data may be pursued to meet the 1000 Hz rate requirement. Unlike a common 3-DOF force feedback, where intermediate representation [21] and ‘god object’ [22,23] are usually used, 5-DOF Dexel-based collision detection and force– torque feedback is completely different. In this paper, the force feedback is formulated based on the material
As shown in Fig. 11(a), a component force magnitude fi;mag can be defined as proportional to the removed Dexel volume and given by the following formula: fi;mag ¼ kðDxi Dxarea Þ ¼ ðkDxarea ÞDxi ¼ k0 Dxi
(18)
where Dxi is the height of the Dexel segment, Dxarea is the cross-section of the Dexel elements, k is the predefined cross-section dependent force coefficient, and k0 is the cross-section independent force coefficient. Although similar in form, this is not Hooke’s law. It is based on the assumption that the force is proportional to the removed Dexel volume (or the penetration depth if it’s a tool collision, as discussed later). The force feedback direction ~ f i;dir is opposite to
Fig. 11. Calculation of force and torque during multi-axis tool motion interfering with Dexel volume. (a) Force is proportional to the Dexel removal rate (DRR), (b) calculation of torque based on the force and pivot point.
136
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145
the ‘tool-approaching direction’ to each removed Dexel volume. The torque calculation method is shown as in Fig. 11(b) and ~ ti is calculated by the following formula: ~ f i;dir ðPi Ppvt ! ÞÞ t i ¼ fi;mag ð~
(19)
where ~ f i;dir is the direction of a component force, Pi is the center of the removed Dexel, Ppvt is the virtual tool pivot point, and Pi Ppvt ! is the vector from Pi to Ppvt. The ‘tool approaching direction’ or force direction ~ f i;dir needs to be defined explicitly since it is a mass rod, instead of a mass point. As discussed above, there are four different kinds of tool movement situations. Accordingly, there are four different situations in locating the force exertion point and thus in calculating the torque (see Fig. 12): (1) Tool moves along the tool axis: this is the simplest situation. The force direction is along the current
tool orientation (see Fig. 12(a)): tool orientation; if going down ~ f i;dir ¼ tool orientation; if going up
(20)
(2) Tool rotates around an axis without translation: there are both force and torque in this situation. Suppose the center of the removed Dexel segment is at point Pi, then the corresponding pivot point is on the straight line of Pi and the rotational center point (see Fig. 12(b)). The force direction can thus be defined as perpendicular to the corresponding tool orientation. ~ f i;dir ¼ normalizeððPi;tip Pi ! Þ ðOrii;1 Orii;2 ÞÞ
(21)
where Pi,tip is the tool tip position, Orii,1 and Orii,2 are the orientations of the rotation start and end tool, respectively. Note that the extreme case, when (Orii,1 Orii,2) is parallel to the direction of ðPi;tip Pi ! Þ, must be considered during the programming.
Fig. 12. Calculation of force–torque feedback for different tool motions. (a) Tool moves up and down, (b) tool rotates only, (c) tool translates only (after discretization of tool motion).
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145
(3) Tool moves with translation only: in this case, the ‘tool approaching direction’ is the vector from start tool tip position to end tool tip position: ~ f i;dir ¼ normalizeðPi;tip;end Pi;tip;start ! Þ
(22)
In Eq. (22), Pi;tip;start and Pi;tip;end are the tool tip positions of the start tool and end tool, respectively. There are both force and torque in this situation (see Fig. 12(c)). (4) Tool moves around with rotation and translation: this is the most common case during virtual sculpting. Since the tool motion is discretized into parallel linear segments, in each linear segment, the tool is considered to be moving linearly. Hence the ‘tool approaching direction’ in each discretized segment is also calculated by using Eq. (22).
3.2. Finding the accumulated force and torque response of all the removed Dexels The force and torque calculated on each removed Dexel are accumulated and fed back to a user through haptic interface. Assuming that there are totally m Dexels removed in the current instance, the accumulated force and torque feedback are calculated as follows (refer to Eqs. (18) and (19)): ! m m X X 0 ~ ~ f ¼ f i;dir Þ ¼ k Dxi ~ f i;dir f i ðfi;mag ;~ (23) i¼1
~ t¼
m X i¼1
i¼1
~ ti ¼ k
m X
ðDxi ð~ f i;dir ðPi Ppvt ! ÞÞÞ
(24)
i¼1
It is noted that in a comprehensive virtual environment, the tool may collide with some environmental models other than the Dexel model being sculpted [24,25]. In this case, a relatively big force ~ F collision and torque ~ tcollision are added to the final force–torque feedback to prevent the user from penetrating some environmental models. Then the total force and torque can be calculated as: ~ f þ~ F collision f total ¼ ~
(25)
~ t þ~ t collision ttotal ¼ ~
(26)
137
In the current implementation, due to the limitation of computation power, the collisions with the environmental models are not included. The calculated force and torque as in Eqs. (25) and (26) are distributed to the haptic arms and fed back to the user.
4. Developing 5-DOF haptic interface for virtual sculpting Fig. 13(a) shows our lab set-up of a lab-built 5-DOF (degree of freedom) pen-based electro-mechanical haptic device made by Suzuki, Inc., Japan. It can detect 6-DOF of haptic probe movement and gives 5DOF force and torque feedback. Fig. 13(a) shows the lab set-up with the haptic device located in the middle. In Fig. 13(a), the left hand side is the constructed controller. Its right hand side is the dual 2.4 GHz CPU workstation with the implemented haptic rendering programs discussed in this paper. The haptic device has a left-manipulator and a right one as shown in Fig. 13(a). The haptic device controller and the software driver were developed in our lab. They serve the purpose of interfacing between the user and the haptic device. The force and torque calculated from Eqs. (23) and (24) pass through the hardware driver to drive the motors on the haptic device and to provide force feedback to the user [13]. Due to the heavy computing task of the Dexelupdating process and also considering the control stability of the haptic device, the haptic rendering software is composed of two cycles: haptic cycle and graphic cycle (see Fig. 13(b)). In a dual CPU computer, each cycle runs as a thread on one CPU. In the graphic cycle thread, the virtual stock material is updated according to the movement of the virtual cutter, which corresponds to the haptic probe. In this process, the Dexel volume model (stock material) is updated. At the same time, the force and torque are calculated according to the stock material removal, with Eqs. (23) and (24). The graphic rendering is refreshed every 50 ms (20 Hz). In the haptic cycle, one CPU keeps fetching the current force and torque calculated by the graphic cycle every 10 ms (100 Hz). In the meantime, every 1 ms (1000 Hz) this CPU interpolates between the previous force/torque and the current force/torque
138
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145
Fig. 13. Lab set-up and hardware/software implementation of the haptic sculpting system. (a) Lab set-up of haptic controller and 5-DOF haptic device with a dual-CPU workstation, (b) haptic rendering, controller and computer interface system loops.
and then outputs the interpolated force–torque. By doing so the output rate for the haptic device is sustained as 1000 Hz, which is required to provide a continuous feeling of force/torque to the user. An argument here is that the force felt by the user may not be the concurrent force (see Fig. 14). This argument is true. However, this is acceptable since the graphic cycle refresh rate (20 Hz) is much lower than the force–torque calculation rate (100 Hz). Our later experiments also reported that no user can detect that the force/torque is not truly concurrent with the visual graphic display. On the other hand, if faster algorithms can be developed or the computer speed is much faster, it is best to sustain the haptic rendering as 1000 Hz directly without interpolation.
5. Implementation and examples The proposed methodology has been implemented in the developed haptic sculpting system at North Carolina State University. As shown earlier in Fig. 13(a), the haptic system controller and the haptic rendering programming were implemented on a dual 2.4 GHz CPU workstation, using Visual C++ programming language and OpenGL1 library functions. The computer also comes with 2G memory and a highend video card. Since we constructed the haptic device controller and developed the haptic rendering programs from the hardware level, we have the greatest flexibility in designing and developing our specific haptic applications.
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145
Fig. 14. Challenging synchronous issue of force–torque feedback and graphics display in the haptic system.
Fig. 15(a) shows an example operation process of the haptic sculpting system based on the proposed methodology. The user was moving the haptic probe of the haptic device. Concurrently the tool was displayed on the screen and sculpting the stock material. When the tool was carving the stock, the user could actually feel the force and torque. There are two forms of the output from the haptic sculpting system (both have been implemented as subsidiary functions of the system): The sculpted model can be output as an STL polyhedral surface model. This turns out to be a difficult problem. Details of the constructing of STL models and Dexel volume models were presented in our earlier work in [11]. The tool motion can be recorded and output as NC (numerically controlled) code command. In this case, the user’s creative work can be recorded and played back at will. As shown in Fig. 15(a), a user defines a tool and then uses the tool to sculpt the stock material in the Dexel model format. Fig. 15(b) shows an example design of a bird modeled with the haptic sculpting tool. The sculpted stock material in the Dexel model format is then exported as an STL model. The rendered view of the output STL model is shown in Fig. 15(c). The output STL model is composed of
139
about 87,000 triangles. Fig. 15(d) shows some details near the head of the bird STL model. Fig. 16(a) shows the design sketch of a cartoon character (Doraemon Cat) being sculpted on a Dexel volume model. Fig. 16(b) shows the output STL model of the cartoon character. Fig. 16 also shows the experiment on force and torque calculation. A tool moves along a curved path as shown in Fig. 16(c). The force and torque calculated based on the tool motion and the Dexel removal rate (DRR) are sampled and visualized as vectors in Fig. 16(d). On a color printout, the force is in blue and the torque is in red. The calculated force and torque are illustrated in Fig. 16(e) and (f), respectively. It can be seen from Fig. 16(e) that basically the force is following the tangential director of the tool path with changing magnitudes. In Fig. 16(f), the torque is proportional to the force magnitude and its direction is determined by the right-hand rule. Fig. 17(a) shows an example of free-hand sculpting design on a Dexel volume model by using the developed haptic sculpting system. Fig. 17(b) shows some details on the output STL model of the free-hand design (notice the pen brush effect on the haptic sculpting model). The free-hand design example in Fig. 17 is difficult to be designed or processed by using traditional CAD systems due to its free-form and artistic tool/pen motion. The tool motion was recorded while the design was conducted. The tool motion was then output as NC code and re-played on a stock volume material using NC simulation, as shown in Fig. 17(c). The result shows that the developed tool can simulate the motion and the brush pen effects on the sculpted volume model. Fig. 18 shows another example of free-form haptic sculpting of a furniture part surface. Fig. 18(a) shows an example sculpting tool motion of a tool sculpting some curved details of the example part. Fig. 18(b) shows some illustrative 5-axis tool motions of a cutter during sculpting the example part. Fig. 18(c) shows the Dexel volume model of the example sculptured surface part.
6. Discussion In this paper, the Dexel-based force–torque rendering and 5-DOF haptic sculpting techniques have been proposed and implemented for the
140
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145
Fig. 15. Virtual sculpting Dexel volume model and the output of STL surface model. (a) Experimental operation of the haptic virtual sculpting, (b) virtual sculpting the Dexel volume model, (c) converting into STL output model, (d) some details of the output STL model of the sculpted design.
possibility of a better and more effective product prototyping and manufacturing. Compared to previous related work in haptic systems, our methodology of Dexel-based haptic sculpting features: (i) Fast approximation of swept volume for Dexelupdating: as a tool sweeps across the space, it
generates a swept volume. As mentioned before, in haptic sculpting the objective is to get fast haptic rendering by finding a trade-off between the Dexel-updating precision and the speed requirement. In this implementation, the swept volume of the 5-axis tool motion (translation and rotation) is modeled and analyzed. The tool
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145
141
Fig. 16. Visualization of the force–torque feedback of sculpting the example part. (a) Virtual sculpting of a cartoon character (Doraemon Cat) on Dexel volume model, (b) the output of STL surface model, (c) an example sculpting tool motion, (d) display of the force and toque feedback along sculpting tool motion, (e) the force feedback displayed with direction and force magnitude, (f) the torque feedback displayed with direction and magnitude (directions follow the right-hand rule).
swept volume is used to update the stock material, which is represented with the Dexel model. The Dexel-updating process is decomposed into ray–parallelogram and ray–pipe intersection problems, etc. Analytical solutions are found for these problems. (ii) 5-DOF Dexel-based collision detection and force–torque feedback algorithm: the current
algorithm takes advantage of the Dexel-updating calculation and calculates the force–torque feedback by the removed Dexel segments. The method of force–torque feedback for the 5-DOF output haptic device differs greatly from that for the 3-DOF output haptic device. (iii) Different tool definitions: commercially available free-form modeling defines the tool tip as only a
142
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145
Fig. 17. Free-hand haptic sculpting and the output of NC codes from the developed haptic sculpting system. (a) Free-hand haptic sculpting on Dexel volume model, (b) some details of the free-hand sculpting on STL output model, (c) simulation of the output NC codes from the recorded haptic sculpting tool motion.
simple sphere. The tool is defined as combination of 2D circular arcs and straight lines. Thus it can represent ball-end mill, flat-end mill or taper-end mill tool (and with the possibility of other types of cutters) in the common NC machining. (iv) Two forms of output: there are two forms of output from the haptic sculpting system. The
user’s creative work process can be recorded as NC codes. In this way, the work can be played back at will. The created artwork can also be output as an STL model, which can be further processed to be manufactured. (v) Hardware integration: the force and torque feedback calculation is tightly integrated with
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145
143
Fig. 18. Haptic sculpting of an example free-form surface part. (a) Haptic sculpting of a complex surface, (b) continuous 5-axis sculpting tool motion, (c) Dexel volume models of the example.
the hardware driver level. No commercial haptic library functions were utilized and haptic interface was constructed from the hardware level. In this case, although it was much harder to initiate at the beginning, it turns out that we could enjoy the greatest flexibility in designing and implementing the software algorithms. 7. Conclusions In this paper, detailed techniques of a Dexel-based force–torque rendering and 5-DOF haptic sculpting have been presented for product prototyping and virtual sculpting. Five-axis tool motion and analytical tool swept volume intersection are formulated for updating the virtual stock material represented in the Dexel volume model format. A Dexel removal rate (DRR) analysis has been developed for haptic force– torque response calculation. Based on the analysis, a
Dexel-based collision detection method and a force– torque feedback algorithm have been presented for virtual prototyping. With the proposed methodology, a user can virtually sculpt a stock volume to get an intuitive design by using the developed 5-DOF (degree of freedom) force–torque haptic interface. From the haptic sculpting system, both tool path for the creative process and the sculpted model can be output. The output model of the virtual prototyping system can be processed for machining planning and NC program generation for NC machining [10]. The presented techniques can be used for virtual prototyping, CAD/ CAM and NC machining planning.
Acknowledgement This work was partially supported by the National Science Foundation (NSF) CAREER Award (DMI-
144
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145
9702374), NSF Grant (DMI-0300297) and the Army Research Office (Grant #DAAG55-98-D-0003) to Dr. Y.S. Lee at North Carolina State University. Their support is greatly appreciated. The authors would also like to thank Dr. Y. Adachi at Suzuki Inc. (Japan), Dr. S. Sarma at MIT, and Dr. Y. Ren at NCSU for their helpful discussion and suggestions.
References [1] S. Coquillart, Extended free-form deformation: a sculpting tool for 3D geometric modeling, Computer Graphics (Proc. SIGGRAPH ‘90) 24 (4) (1990) 187–196. [2] T.A. Gaylean, J.F. Hughes, Sculpting: an interactive volumetric modeling technique, Computer Graphics (Proc. SIGGRAPH ‘91) 25 (4) (1991) 267–274. [3] F. Dachille IX, H. Qin, A. Kaufman, A novel haptic-based interface and sculpting system for physics-based geometric design, Computer Aided Design 33 (2001) 403–420. [4] C.J. Chiou, Y.-.S. Lee, A shape-generating approach for multiaxis machining G-buffer models, Computer Aided Design 31 (1999) 761–776. [5] M.C. Leu, A. Velivelli, X. Peng, Creating freeform model by carving virtual workpiece with haptic interface, in: Proceedings of the ASME International Mechanical Engineering Congress and Exposition (IMECE), New Orleans, Louisiana, November 17–22, 2002, Paper number (CD): 2002-32467. [6] W.S. Wang, A.E. Kaufman, Volume sculpting, in: Proceedings of the ACM Symposium on Interactive 3D Graphics, Monterey CA, USA, 1995, pp. 151–156, 214. [7] M. Balasubramaniam, S.Ho Stephen, S. Sarma, Y. Adachi, Generation of collision-free 5-axis tool paths using a haptic surface, Computer Aided Design 34 (2002) 267–279. [8] S. Ho, S. Sarma, Y. Adachi, Realtime interference analysis between a tool and an environment, Computer Aided Design 33 (2001) 935–947. [9] W. Zhu, Y.-S. Lee, Haptic sculpting and machining planning with 5-DOF haptic interface for virtual prototyping and manufacturing, in: Proceedings of the 2003 International Conference on Advanced Research in Virtual and Rapid Prototyping (VRAP), Leiria, Portugal, October 1–3, 2003, pp. 225–232. [10] W. Zhu, Y.-S. Lee, Haptic sculpting and pencil-cut planning in virtual prototyping and manufacturing, in: Proceedings of The ASME International Mechanical Engineering Congress and Exposition (IMECE) Conference, Washington, DC, November 16–21, 2003, Paper number (CD): IMECE200342489. [11] W. Zhu, Y.-S. Lee, A marching algorithm of constructing polyhedral models from Dexel models for haptic virtual sculpting, Robotics and Computer-Integrated Manufacturing, in press.
[12] Y. Ren, H.T. Yau, Y.-S. Lee, Contraction tool method and clean-up tool path generation for machining complex polyhedral models, Computers in Industry 54 (2004) 17–33. [13] W. Zhu, Y.-S. Lee, Five-axis pencil-cut planning and virtual prototyping with a 5-DOF haptic interface, Computer Aided Design 36 (13) (2004) 1295–1307. [14] T. Van Hook, Real-time shaded NC milling display, Computer Graphics (Proc. SIGGRAPH ‘86) 20 (4) (1986) 15–20. [15] Y. Huang, O.H. Oliver, NC milling assessment and tool path correction, Computer Graphics (Proc. SIGGRAPH ‘94), July 24–19 (1994) 287–294. [16] D. Blackmore, M.C. Leu, L.P. Wang, The sweep-envelope differential equation algorithm and its application to NC machining verification, Computer Aided Design 29 (1997) 629–637. [17] C.J. Chiou, Y.-S. Lee, Swept surface determination for fiveaxis numerical control machining, International Journal of Machine Tools and Manufacture 42 (2002) 1497–1507. [18] C.J. Chiou, Y.-S. Lee, A machining potential field approach to tool path generation for multi-axis sculptured surface machining, Computer Aided Design 34 (2002) 357–371. [19] S. Mann, S. Bedi, Generalization of the imprint method to general surfaces of revolution for NC machining, Computer Aided Design 34 (2002) 373–378. [20] M. Held, ERIT: a collection of efficient and reliable intersection tests, Journal of Graphics Tools 2 (4) (1997) 25–44. [21] Y. Adachi, T. Kumano, K. Ogino, Intermediate representations for stiff virtual objects, Proceedings IEEE Virtual Reality Annual International Symposium (1995) 203–210. [22] C.B. Zilles, J.K. Salisbury, A constraint-based god-object method for haptics display, in: Proceedings of IEEE/RSJ International Conference on Intelligent Robots and Systems, 1995, pp. 146–151. [23] S. Gottschalk, M.C. Lin, D. Manocha, OBBTree: a hierarchical structure for rapid interference detection, Computer Graphics (Proc. SIGGRAPH ‘96), August 1996, 171–180. [24] Y.-S. Lee, Mathematical modeling using different endmills and tool placement problems for 4- and 5-axis NC complex surface machining, International Journal of Production Research 36 (3) (1998) 785–814. [25] A. Srinivasan Mandayam, Basdogan, Cagatay, Haptics in virtual environments: taxonomy, research status, and challenges, Computer Graphics 21 (4) (1997) 393–404. Weihang Zhu is a Ph.D. student in the Department of Industrial Engineering, North Carolina State University, USA. He received his B.S. (1997) and M.S. (2000), both in Energy Engineering from School of Mechanical and Energy Engineering at Zhejiang University, China. His research interests include Computer haptics, CAD/CAM, multi-axis NC surface machining, polyhedral machining, applied computational geometry, discrete-event computer simulation, and logistics.
W. Zhu, Y.S. Lee / Computers in Industry 55 (2004) 125–145 Yuan-Shin Lee is Professor of Industrial Engineering at North Carolina State University, USA. He received his Ph.D. (1993) and MS (1990) degrees from Purdue University, USA, both in industrial engineering, and his BS degree from National Taiwan University, Taiwan, in mechanical engineering. His research interests include 3- and 5-axis sculptured surface manufacturing, CAD/CAM, rapid prototyping, high speed machining, and computational geometry for design and manufacturing. He is a registered
145
professional engineer (PE) in mechanical engineering. He is also a certified manufacturing engineer in system integration and control. Dr. Lee received the National Science Foundation (NSF) CAREER Award. He also received the 1997 Outstanding Young Manufacturing Engineer Award from the Society of Manufacturing Engineers (SME), the 1998 Norman Dudley Award from the Taylor & Francis Journals, London, U.K., the 1999 Anderson Outstanding Faculty Award and the 2000 Alumni Faculty Outstanding Teaching Award from North Carolina State University, and the 2001 ALCOA Foundation Engineering Research Achievement Award. He serves as an Associate Editor for the Journal of Manufacturing Systems (JMS). He can be reached via email at
[email protected].