Mathematics and Computers in Simulation 75 (2007) 231–250
Optimization and correction of the tool path of the five-axis milling machine Part 2: Rotations and setup Stanislav Makhanov Sirindhorn International Institute of Technology, Thammasat University, 131 Moo 5, Tiwanont Road, Bangkadi, Pathum Thani 12000, Thailand Available online 6 February 2007
Abstract We present two new algorithms (which supplement Algorithms 1, 2 and 3 presented in part 1) to optimize the tool path of the five-axis numerically controlled milling machine. Algorithm 4 optimizes a set of feasible rotations. Algorithm 5 presents a least-square optimization with regard to a setup of the machine © 2006 IMACS. Published by Elsevier B.V. All rights reserved. Keywords: NC-programming; CAD/CAM; Optimization; Milling machines
1. Introduction Milling machines are programmable mechanisms for cutting complex industrial parts designed in such a way that the cutting device (the tool) is capable of approaching the desired surface at a given point with a required orientation. The machine consists of several moving parts designed to establish the required coordinates and orientations of the tool during the cutting process (see Figs. 1–3). The movements of the machine parts are guided by a controller which is fed with a so-called NC program comprising commands carrying three spatial coordinates of the tool-tip and a pair of rotation angles needed to rotate the machine parts to establish the orientation of the tool. The general optimization problem requires to find such set of positions and orientations of the tool as well as the machine and the tool related parameters that the part surface is produced for a minimal time with a minimal error. the general Recall mathematical description given in part 1 [4]. A tool path of the five-axis machine is given by = { 0 , 1 ,. . ., m }, where p = (Wp ,p ), Wp = (xp ,yp ,zp ) is the position of the tool and p = (ap ,bp ) a pair of angles required to rotate the machine tables to establish the orientation of the tool. Let M be a set of parameters related to the configuration of the machine and the workpiece setup. This set may include relative positions of the centers of rotations, the dimensions of the machine parts, etc., as well as the position and orientations of the workpiece on the mounting table. Furthermore, let T be a set of parameters related to the tool. This set usually includes the shape and the size of the tool. Finally, let S(u, v) = (xS (u, v), yS (u, v), zS (u, v)) be the required part surface, where u, v are the parametric coordinates. The optimization problem is then given by minimize (C), Π,M,T
E-mail address:
[email protected]. 0378-4754/$32.00 © 2006 IMACS. Published by Elsevier B.V. All rights reserved. doi:10.1016/j.matcom.2006.12.001
232
S. Makhanov / Mathematics and Computers in Simulation 75 (2007) 231–250
Fig. 1. Five-axis milling machine MAHO600E.
Fig. 2. Five-axis milling machine HERMLE.
Fig. 3. MAHOO600 during the cutting operations.
S. Makhanov / Mathematics and Computers in Simulation 75 (2007) 231–250
233
where C denotes a criteria vector which usually includes errors, the length of the path, the negative of the machining strip (strip maximization), the machining time, etc. [1,3]. The optimization could be subjected to constraints the most important of which are the scallop height constraints and the local as well as the global accessibility constraints [5,6,9]. The engineering literature presents a variety of particular optimizations which can be considered as a particular case of the general problem (1), however, there does not exist a commonly accepted general system of equations representing optimization of the cutting operations of the five-axis milling machines. We present two new optimization algorithms which supplement Algorithms 1, 2 and 3 presented in part 1 [4]. The optimizations are performed in the angular domain and with regard to the machine setup. Algorithm 4 optimizes a sequence of rotations of the five-axis milling machine given by {1 ,1 ,. . .,N }. Algorithm 5 solves an important problem of finding an optimal position and orientation of the workpiece which minimizes the kinematics error. We also optimize parameters relevant to the machine configuration such as positions of the centers of rotation, tool length, etc. As opposed to part 2, the novelty of the proposed algorithms is new formulations of the optimization problems and their analysis rather than the method of solution. 2. Algorithm 4: optimization of rotation angles 2.1. Introduction to Algorithm 4 Error analysis and optimization of the sequence of the rotation angles have not been provided by commercial CAD/CAM systems. Besides, only a few research papers deal with the subject. In ref. [3], the authors analyze the sequence of rotations to minimize the number of the phase reverse steps at discontinuities of the first derivative of the surface (corners, etc.). A method of avoiding singularities has been presented in ref. [1]. However, it is not hard to give examples when methods in refs. [1,3] are not applicable. The lack of appropriate techniques motivates our optimization algorithm performed in the angular domain. The algorithm optimizes the sequence of rotations of the five-axis milling machine which contributes to the inaccuracy of a machined workpiece. The algorithm is based on global optimization with regard to feasible solutions of the inverse kinematics first proposed in ref. [5]. Algorithm 4 extends these techniques to the case of undercut and overcut error and shows that such optimization increases the accuracy of the milling operations and is the most appropriate in the case of a rough cut. The shortest path procedure is applied to either the entire set of trajectories or to only the most inappropriate trajectories (the so-called undercuts) inside the workpiece. 2.2. The overcut and undercut error The case of rough cut requires differentiating the undercut and the overcut error. By undercut we understand a part of the trajectory resulting in an excessive amount of the removed material. The overcut is understood as removing less material than required. Since a trajectory may include the overcuts as well as undercuts we define the undercut and overcut error as follows 2 D 1 (W D p,p+1 − Wp,p+1 ) , if zp,p+1 (t) > zp,p+1 (t) εU = dt , 0 0, otherwise p 2 D 1 (W D p,p+1 − Wp,p+1 ) , if zp,p+1 (t) ≤ zp,p+1 (t) εO = dt . 0 0, otherwise p Clearly, the total error given by 1 2 D (Wp,p+1 − Wp,p+1 ) dt ε= 0
p
=
p
0
1
2
2
2
D D ((xp,p+1 − xp,p+1 ) + (yp,p+1 − yp,p+1 ) + (zD p,p+1 − zp,p+1 ) ) dt
(1)
234
S. Makhanov / Mathematics and Computers in Simulation 75 (2007) 231–250
satisfies ε = ε0 + εU , however, since the undercuts are not repairable, minimizing the undercut error is often more important than minimizing the overcut or the total error. 2.3. The shortest path optimization Suppose that the orientation of the tool coincides with the surface normal. Then a stationary point appears when the x and the y components of the normal are equal to zero. When the tool passes through the point, the rotation angles may jump considerably leading to unexpected deviations from the prescribed trajectory and large kinematics errors (loops). A fine cut of a smooth surface employing small spatial and angular steps may not demonstrate the detrimental effects near the stationary points. However, a rough cut of a surface characterized by large gradients may produce considerable deviations. The sharp angular jumps create loop-like trajectories of the tool. Our introductory example presents a two bell surface S1 given by ⎞ ⎛ 100u − 50 ⎟ ⎜ 100v − 50 S1 (u, v) = ⎝ ⎠, −80v(v − 1)(3.55u − 14.8u2 + 21.15u3 − 9.9u4 ) − 28 depicted in Fig. 4. Fig. 5 demonstrates a large loop in the case of machining a single curve belonging to S1 . Fig. 6 shows that as opposed to a linearized version of the tool path, the real machining produces a loop-like trajectory induced by the large angular steps. Moving the tool along the loop like trajectories could destroy the workpiece and even lead to unwanted collisions with the machine parts. Such trajectories could be repaired as shown in Fig. 6, by adjusting the rotation angles in such a way that the kinematics error is minimized. Furthermore, detecting and minimizing irreparable undercuts caused by the loops is more important than minimizing the overcuts. In the case of a five-axis milling machine with the rotary axis on the table such as MAHO600E and HERMLE UWF902H, the feasible rotation angles (Fig. 7) are calculated by ⎧ ⎪ −1 Iy , ⎪ ⎧ tan if Ix > 0 and Iy > 0 ⎪ ⎪ bbase abase , ⎪ ⎪ Ix ⎪ ⎪ ⎪ ⎪ ⎨ ⎨a − 2π, bbase I base y abase = tan−1 + π, if Ix < 0 , , bbase = −sin−1 Iz , Λ = ⎪ ⎪ Ix abase − π, −bbase − π ⎪ ⎪ ⎪ ⎪ ⎪ ⎩ ⎪ Iy ⎪ abase + π, −bbase − π ⎪ + 2π, otherwise ⎩ tan−1 Ix (2)
Fig. 4. Experimental curve C on the test surface.
S. Makhanov / Mathematics and Computers in Simulation 75 (2007) 231–250
235
Fig. 5. The experimental curve before optimization.
where I ≡ (Ix ,Iy ,Iz ) is the tool orientation vector. Similar solutions can be established for other types of the machine kinematics such as, “one axis on the tool and one on the table” and “both axis on the tool” (see also our forthcoming theoretical part on the machine kinematics in Sections 3.1–3.3). Let = {1 ,2 ,. . .,N } be a set of all possible rotations such that p ∈ Λp and where Λp is given by (2). Consider the following minimization problem (wO εO + wU εU ). minimize
(3)
The above discrete functional represents the total kinematics error given in terms of a linear combination of the overcut and undercut errors (1),wO , wU represent the importance of the overcuts and undercuts. For instance, if
Fig. 6. The experimental curve after optimization.
236
S. Makhanov / Mathematics and Computers in Simulation 75 (2007) 231–250
Fig. 7. Four feasible rotations in a and b.
wO = wU = 0.5, then the total kinematics error is minimized. If wO = 0, wU = 1, the kinematics error is minimized only with regard to the undercuts, if wO = 0.1, wU = 1.0, then the error is minimized with regard to both the undercuts and overcuts but the importance of the undercuts is 10 times larger than that of the overcuts. The optimization is nothing else than the shortest path problem. The corresponding graph is constructed in such a way that each position p is characterized by the four graph nodes Λp whereas the edge between the nodes represents the kinematics error (1). Such minimization could be performed by a conventional so-called greedy discrete algorithm. We construct the error graph to represent the feasible paths from the source to the destination using the adjacency list. Next, we detect numerically the overcuts and undercuts. Every trajectory Wp,p+1 (t) = (xp,p+1 (t),yp,p+1 (t),zp,p+1 (t)) is subdivided by a certain number of points tk . At every point Wp,p+1,k = (xp,p+1,k ,yp,p+1,k ,zp,p+1,k ), we find the corresponding parametric coordinates (uk , vk ) by solving a system given by xp,p+1,k = xS (u, v),
yp,p+1,k = yS (u, v).
(4)
Given the solution (uk , vk ), we categorize Wp,p+1,k as the undercut if zS (uk , vk ) > zp,p+1,k . Finally, we weight the errors using wO and wU and apply the Dijkstra’s shortest path optimization algorithm [9]. 2.4. Numerical examples and cutting experiments We have shown that a loop due to large variation in the rotation angles can be almost entirely eliminated (Fig. 6) in the case of a single curve extracted from a surface S1 . Table 1 shows the performance of the method in the case of machining the entire experimental surface S1 on MAHOO600E. Note that wO = wU = 0.5, that is, the optimization has been performed without discriminating between εU and εO . Note that increasing the number of points does not necessarily lead to a decrease of the error (see the lines 40 × 20 and 100 × 20) since the grids are not nested (the points Table 1 Kinematics error for the optimized and non-optimized tool path Grid size
No optimization max error/max angle var (mm/degree)
Optimization max error/max angle var (mm/degree)
Max error/angle var decrease (%)
Path length, non-opt/opt (mm)
10 × 20 15 × 20 20 × 20 30 × 20 40 × 20 100 × 20 130 × 20
23.862/168.779 19.300/162.186 20.228/160.08 16.253/141.89 8.711/103.885 7.395/90.898 3.999/68.416
12.426/78.072 8.517/101.524 7.558/84.927 7.162/88.23 6.878/88.399 7.103/89.102 3.999/68.416
47.925/53.743 55.870/34.403 62.636/46.947 55.934/37.818 21.042/14.907 3.949/1.976 0.000/0.000
2825.67/2255.54 2500.3/2123.02 2367.57/2101.15 2183.63/2038.27 2069.32/2020.11 1916.11/1911.17 1876.49/1876.49
Surface S1 MAHO600E.
S. Makhanov / Mathematics and Computers in Simulation 75 (2007) 231–250
237
of the coarse grid do not necessarily belong to the fine grid). The table shows that minimization of the angle variation may also lead to minimization of the total error and the decrease in the length of the tool path. A very useful optimization can be performed when the undercuts and overcuts are differentiated. Consider machining surface S1 by HERMLE UWF902H. Let wO = 0, wU = 1, that is, the minimization is performed only with regard to the undercuts. Fig. 8(a) displays the conventional tool path with undercuts (the thick curves). Fig. 8(b) shows how minimization of the total error eliminates the loops located at the right side of the workpiece. However, minimization of only the undercut error produces an entirely different path. The undercut loops at the boundary of the workpiece have been replaced by large but harmless overcuts (see Fig. 8(c)). Table 2 shows the behavior of the undercut and overcut error along with the angle variation as the number of points in the cutting direction increases. The decrease in the undercut error has been achieved at the expense of the increase of the overcuts and the length of the path. Let us demonstrate the techniques by optimizing the undercuts on MAHO600E. The conventional tool path and the tool path optimized by means wO = 1, wU = 1 are displayed in Figs. 9(a) and 10(a) whereas a tool path optimized with wO = 0, wU = 1 in Fig. 11(a). The corresponding machined surfaces are displayed in Figs. 9(b)–11(b), respectively. Clearly, optimization with regard to the undercuts only makes it possible to cut a rough but reasonable surface which could be further refined whereas cutting without the undercut optimization may destroy the workpiece. The behavior of the kinematics error versus the number of points and the maximum angle variation is displayed in Table 3. Comparing HERMLE UWF902H and MAHO600E (Tables 2 and 3) shows that the accuracy of the two cuts without optimization
Fig. 8. (a) Conventional cut, (b) optimization with regard to the total error and (c) with regard to the overcut error.
238
S. Makhanov / Mathematics and Computers in Simulation 75 (2007) 231–250
Table 2 Undercut error optimization Grid size
10 × 20 15 × 20 20 × 20 30 × 20 40 × 20 100 × 20 130 × 20
No optimization max error/max angle var (mm/degree)
Undercut optimization max error/max angle var (mm/degree)
Undercut
Overcut
Undercut
Overcut
19.11/131.94 9.54/6.41 8.07/86.49 6.28/49.23 5.41/39.58 0/0 0/0
23.40/168.71 19.28/162.11 20.21/160.0 16.24/141.82 8.81/103.81 7.40/90.83 4.00/68.34
13.33/101.86 9.52/6.41 4.41/9.13 2.40/44.93 1.60/5.23 0/0 0/0
56.16/356.22 60.93/364.84 60.93/364.84 51.55/372.03 13.24/128.83 7.13/89.17 4.00/68.34
Path length, non-opt/opt (mm)
2929.02/3641.59 2676.55/3985.66 2486.07/5021.87 2253.76/3845.65 2117.19/2166.59 1924.58/1919.35 1880.72/1880.72
S1 on HERMLE UWF902H.
Fig. 9. Conventional cut: (a) simulation and (b) real cut.
is comparable whereas the optimized cut on MAHO600E outperforms HERMLE UWF902H. The reasons of this advantage are due to the kinematics of the machines. It should be noted that the method applies not only to a surface but to a CNC program that is, to a code containing only a sequence of coordinates of the tool in the five-dimensional space. In this case, the minimization can be performed D with regard to error (1) where Wp,p+1 is replaced by a linearized tool path. Fig. 12 illustrates the techniques applied Table 3 Undercut error optimization Grid size
10 × 20 15 × 20 20 × 20 30 × 20 40 × 20 100 × 20 130 × 20
No optimization max error/max angle var (mm/degree)
Optimization max error/max angle var (mm/degree)
Undercut
Overcut
Undercut
Overcut
8.41/169.65 7.23/164.57 6.78/159.42 6.25/149.31 5.39/139.65 0/0 0/0
23.86/168.78 19.30/162.19 20.23/166.21 16.25/141.89 8.71/103.88 7.40/90.9 4.00/68.42
1.84/25.87 1.98/38.67 0.967/26.24 0/0 0/0 0/0 0/0
38.46/136.48 32.92/140.56 7.56/84.93 7.16/88.23 6.88/88.40 7.10/89.10 4.00/68.41
S1 on MAHO600E.
Path length, non-opt/opt (mm)
2825.67/3575.11 2500.3/2417.3 2367.57/2101.15 2183.63/2032.2 2069.32/2020.11 1916.11/1911.17 1876.49/1876.49
S. Makhanov / Mathematics and Computers in Simulation 75 (2007) 231–250
239
Fig. 10. Total error optimization: (a) simulation and (b) real cut.
Fig. 11. Overcut error optimization: (a) simulation and (b) real cut.
to a multi patch surface designed to produce an industrial impeller. The length of the tool path has been reduced by 18.2% or by almost 5000 mm. 3. Algorithm 5: optimization of the setup 3.1. Introduction to Algorithm 5 In this section, we solve an important problem of finding an optimal position and orientation of the workpiece on the mounting table to minimize the kinematics error (see Fig. 13). We also optimize parameters relevant to the machine configuration such as positions of the centers of rotation, tool length, etc. Such analysis is not provided by commercial CAD/CAM software such as Unigraphics, EdgeCam, Vericut, etc. Besides, only a few recent research
240
S. Makhanov / Mathematics and Computers in Simulation 75 (2007) 231–250
Fig. 12. (a) Conventional tool path for impeller surface. The path length is 30707 mm. (b) Optimized tool path for the impeller. The path length is 25129.4 mm.
papers deal with the subject. Jung et al. [3] propose a general five-axis postprocessor, however, the possibilities of optimization were not introduced and analyzed. Sijie et al. [6] optimize the position and orientation of the stock relative to the CAD modeling surface. However, the machine related parameters were not addressed. A survey and analysis of the five-axis configurations is given in refs. [2,7,8]. However, we can find no academic papers dealing with the machining setup optimal for the specified surface. The proposed optimization is compared with the results obtained by traditional positioning of the workpiece, chosen from convenience. Namely, the minimal z is at a certain distance above the mounting table (collusion avoidance). The center of the base of the part (which is the square 100 mm × 100 mm) is positioned at the center of rotation of the mounting table. The x-axis and y-axis of the workpiece coordinate are parallel to the surface of the mounting table and the z-axis is perpendicular to the table. The following introductory example shows that the optimization could be surprisingly efficient. Let Wp , Wp+1 be two successive spatial positions of the tool path and Ip , Ip+1 the corresponding tool orientations. The actual tool trajectory between Wp and Wp+1 depends on the initial workpiece position T12 and the orientation ra ,rb with regard to
Fig. 13. Initial workpiece setup by rotating around the Z1 -axis and Y1 -axis.
S. Makhanov / Mathematics and Computers in Simulation 75 (2007) 231–250
241
Fig. 14. Comparison of tool trajectories before and after optimization (depicted in original workpiece coordinate). The optimal workpiece setup is achieved at ra = 0.42, rb = 0.00, T12 = [−70.55, 3.52, 125.48] mm.
the mounting table. Fig. 14 shows the workpiece setup performed by first rotating the workpiece around the Z1 -axis by ra and around the Y1 -axis by rb . The workpiece is offset from the center of the first rotary axis coordinate O2 by T12 . In the new workpiece coordinates we have Wp = Rb [rb ]Ra [ra ]Wp + T12 ,
Ip = Rb [rb ]Ra [ra ]Ip ,
(5)
where Ra , Rb are the corresponding matrices of rotation. Let us now find such ra , rb and T12 that minimize the difference D (t) between Wp and Wp+1 and the actual tool path. Fig. 14 shows the actual tool between a desired tool path Wp,p+1 trajectories before and after the optimization. Astonishingly, the optimal setup has reduced the error by a factor of 1000. 3.2. Kinematics of the five-axis milling machine Let ≡ {angles}[coordinates] ≡ {}[M] be a kinematics transformation from the machine coordinates to the workpiece coordinates composed from the above mentioned rotations and translations. We will omit the {angles} and write [M] when appropriate. Let −1 ≡ −1 {}[W] be the inverse transformation such that ∀W, M, , −1[[M]] = M and [−1 [W]] = W. Let Wp , Wp+1 be two successive spatial positions of the tool path and p = (ap , bp ), p+1 = (ap+1 , bp+1 ) the corresponding rotation angles. In order to calculate the tool trajectory between Wp and Wp+1 , we first invoke the inverse kinematics to transform the part-surface coordinates into the machine coordinates Mp ≡ (Xp , Yp , Zp ) and Mp+1 ≡ (Xp+1 , Yp+1 , Zp+1 ). Namely, Mp ≡ −1 {p }[Wp ]. Second, the rotation angles ≡ (t) = (a(t), b(t)) and the machine coordinates M ≡ M(t) ≡ (X(t), Y(t), Z(t)) are assumed to change linearly between the prescribed points, namely, M(t) = tMp+1 + (1 − t)Mp , (t) = tp+1 (1 − t)p , where t is the fictitious time coordinate (0 ≤ t < ≤1). Finally, transforming M back to W for every t yields a trajectory of the tool tip in the workpiece coordinates given by Wp,p+1 (t) = {(t)}[M(t)] = {tp+1 + (1 − t)p }[tMp+1 + (1 − t)Mp ]. In order to represent the tool path in terms of the workpiece coordinates, we eliminate Mp , Mp+1 by using the inverse transformation Mp = −1 {p }[Wp ]. Substituting, Mp , Mp+1 yields Wp,p+1 (t) = K{tp+1 + (1 − t)p }[tK−1 {p+1 }[Wp+1 ] + (1 − t)K−1 {p }[Wp ]].
(6)
The above formulae applicable to an arbitrary machine configuration allows for evaluating the kinematics error defined as the difference between the desired and the actual trajectory. In particular, we consider kinematics of the five-axis milling machine MAHO600E depicted in Fig. 1 and HERMLE UWF902H depicted in Figs. 1 and 2. The inverse kinematics are represented by matrices A ≡ A[a(t)], B ≡ B[b(t)] associated with the rotations around the primary and the secondary axes, respectively, namely, ⎛ ⎞ 0 0 −1 ⎜ ⎟ −1 {}[W] = GB[b](A[a](W + T12 ) + T23 ) + T34 − T4 , where G = ⎝ 0 1 0 ⎠ (7) 1
0
0
242
S. Makhanov / Mathematics and Computers in Simulation 75 (2007) 231–250
Fig. 15. The 2-0 machine and the reference coordinate systems.
and where T12 , T23 , T34 are, respectively, the coordinates of the origin of the workpiece in the rotary table coordinates, coordinates of the origin of the rotary table coordinates in the tilt table coordinates and the origin of the tilt table coordinates in the cutter center coordinates, T4 = (0,0,−TL ), where TL is the tool length. 3.3. Optimization problem Let us now introduce a general framework of the setup optimization. Clearly, this optimization is a particular case of the general optimization when the set of the optimization parameters M consists of (1) the workpiece setup MS = {T12 , ra , rb }, where T12 = (T12,x ,T23,y ,T23,z ) is the position of the origin of the workpiece coordinates with respect to O2 (the coordinate system of the first rotary part) and ra , rb are the angles of rotation corresponding to the initial orientation of the workpiece, (2) the machine design MT = {T23 , T34 , T4 },where T23 = (T23,x ,T23,y ,T23,z ) denotes the position of the origin of the first rotary part in the coordinate system of the second rotary part, T34 = (T34,x ,T34,y ,T34,z ) denotes the position of the second rotary part in the spindle coordinate system, and T4 is a vector describing the tool length. Note that the tool length L is treated as a translation T4 which is either (0,0,L) or (0,0,−L) depending on the position of the tool tip in the spindle coordinate system. Consider the following optimization problem: minimize ,
(8)
where ε is the kinematics error defined by (1). M = {MS , MT } consists of the 12 parameters introduced above. It will be proven that only 6 parameters from the 12 need to be considered, since the remaining 6 parameters do not have any effect on the kinematics error. The actual identities of the six parameters to be ignored depend on the type of five-axis milling machine being used. A machine can be categorized by the relative positions of its rotary axes, as follows: • The 2-0 machine has two rotary axes on the table (see Fig. 15). • The 1-1 machine has one rotary axis on the table and one on the tool (see Fig. 16). • The 0-2 machine has two rotary axes on the tool (see Fig. 17). The six parameters are selected as follows. First, for each type of machine, some of the setup parameters have no effect on the tool trajectory at all. These parameters can be immediately excluded from the optimization. Next, for each type of machine, an additional set of dependent parameters is found. Although each of these parameters does affect the tool trajectory when manipulated independently, each can be replaced by a linear combination of the other parameters, so
S. Makhanov / Mathematics and Computers in Simulation 75 (2007) 231–250
243
Fig. 16. The 1-1 machine and the reference coordinate systems.
these linearly dependent parameters can also be eliminated. Finally, the elimination of invariant and linearly dependent variables leads to a non-linear system of equations that can be solved numerically by a Newton–Raphson procedure. The solution of this system establishes, for a particular machine and desired surface, not only the optimal position and orientation of the workpiece with respect to the mounting table, but also the optimal initial configuration of the five-axis machine. As previously mentioned, the method has proven extremely effective in many cases. Moreover, it requires nothing of the operator except changing the initial setup, which is a very simple, nearly zero-cost, operation. 3.4. Tool path invariants In order to classify the machine kinematics, we, first, introduce the following coordinate systems: the workpiece coordinate system O1 , a coordinate system of the first rotary part O2 , a coordinate system of the second rotary part O3 and a coordinate system of the spindle O4 . We shall call the first rotary axis the A-axis and the second rotary axis the B-axis. Next, consider the three most important machine kinematics categorized by the positions of the rotational joints in the kinematics chain. The 2-0 machine. Two rotary axes on the table (see Fig. 15). In this case, the kinematics is given by (7) and the rotation angles should be calculated by (2). The 1-1 machine. One rotary axis on the table and one on the tool (see Fig. 16). In this case M = K−1 {}[W] ≡ GA[a](W + T12 ) + T23 + B−1 [b](T34 − T4 )
Fig. 17. The 0-2 machine and the reference coordinate systems.
244
S. Makhanov / Mathematics and Computers in Simulation 75 (2007) 231–250
⎧ Iy ⎪ −1 ⎪ −tan , ⎪ ⎪ ⎪ I ⎪ ⎪ x ⎨ Iy + π, a = −tan−1 ⎪ Ix ⎪ ⎪ ⎪ ⎪ Iy ⎪ ⎪ + 2π, ⎩ −tan−1 Ix
if Ix < 0 and Iy > 0 if Ix > 0
,
(8)
otherwise
b = cos−1 Iz , ⎛ ⎞ −1 0 0 ⎜ ⎟ where G = ⎝ 0 1 0 ⎠ and T4 = (0,0,L). 0 0 −1 The 0-2 machine. Two rotary axes on the tool (see Fig. 17). In this case M = K−1 {}[W] ≡ GW + T12 + A−1 [a](T23 + B−1 [b](T34 − T4 )), ⎧ Iy ⎪ −1 ⎪ tan , ⎪ ⎪ ⎪ Ix ⎪ ⎪ ⎨ Iy a = tan−1 + π, ⎪ Ix ⎪ ⎪ ⎪ ⎪ Iy ⎪ ⎪ + 2π, ⎩ tan−1 Ix
if Iz > 0 and Iy > 0 if Iz < 0
,
(9)
otherwise
b = cos−1 Ix , where T4 = (0,0,L). Remark 1. The above machines are characterized by orthogonal coordinates. Machines with non-orthogonal axis lie out of the scope of this paper. ∗. Remark 2. In (7), T34 –T4 can be replaced by a new variable T34
We now will prove simple but important proposals which characterize optimization of the setup for five-axis machining. Proposal 1. The kinematics of the 2-0 machine (7) implies that the tool path between two arbitrary points is invariant ∗ , and with regard to T with regard to T34 23,y . Proof. Denote A[a(t)] by A, B[b(t)] by B, A[ap ] by Ap , B[bp ] by Bp . ˆ −1 [W] + T ∗ , where K ˆ −1 [W] = A(W + T12 ) + T23 . The tool First of all, we represent −1 [W] by K−1 [W] = GBK 34 tip trajectory is then given by ˆ −1 + tT ∗ + (1 − t)GBp K ˆ −1 + (1 − t)T ∗ ], Wp,p+1 (t) = K[tGBp+1 K p+1 p 34 34 ˆ −1 denotes K ˆ −1 {p }[Wp ]. where K p ∗)−T )−T . Clearly, K[M] = A−1 (B−1 G−1 (M − T34 23 12
S. Makhanov / Mathematics and Computers in Simulation 75 (2007) 231–250
245
ˆ such that K[S] ˆ Introduce K = A−1 (S − T23 ) − T12 . We have ˆ −1 G−1 (tGBp+1 K ˆ −1 + tT ∗ + (1 − t)GBp K ˆ −1 + (1 − t)T ∗ − T ∗ )] Wp,p+1 (t) = K[B p+1 p 34 34 34 ˆ −1 + (1 − t)B−1 Bp K ˆ −1 ]. ˆ −1 Bp+1 K = K[tB p+1 p
(10)
ˆ nor K ˆ −1 depends on T ∗ , Wp,p+1 (t) does not depend on T ∗ either. Therefore, the first statement has Since neither K 34 34 ˆ −1 [W] = A(W + T12 ) + T23 into (10) been proven. Let us now prove the invariance with regard to T23,y . Substituting K yields ˆ −1 Bp+1 K ˆ −1 + (1 − t)B−1 Bp K ˆ −1 ] Wp,p+1 (t) = K[tB p+1 p ˆ −1 Bp+1 (Ap+1 (Wp+1 + T12 ) + T23 ) + (1 − t)B−1 Bp (Ap (Wp + T12 ) + T23 )] = K[tB = A−1 (tB−1 Bp+1 (Ap+1 (Wp+1 + T12 ) + T23 ) + (1 − t)B−1 Bp (Ap (Wp + T12 ) + T23 ) − T23 ) − T12 = A−1 (tB−1 Bp+1 Ap+1 (Wp+1 + T12 ) + (1 − t)B−1 Bp Ap (Wp + T12 ) + tB−1 Bp+1 T23 + (1 − t)B−1 Bp T23 − T23 ) − T12 . Consider terms that include T23 . Since B−1 ,Bp+1 ,Bp are rotations around the y-axis they do not change the y component of T23 . Consequently, (tB−1 Bp+1 T23 + (1 − t)B−1 Bp T23 − T23 )y = 0. Therefore, the entire tool path does not depend on T23,y . This completes the proof of the proposal. Proposal 2. The kinematics of the 1-1 machine (8) implies that the tool path is invariant with regard to T12,z , T23 , T34,y . The proof of Proposal 2 is analogous to that of Proposal 1. Proposal 3. The kinematics of the 0-2 machine (9) implies that the tool path is invariant with regard to T12 , T23,y . The proof of Proposal 3 is analogous to that of Proposal 1. 3.5. Orientation of the workpiece Let us now analyze how the orientation of the workpiece changes the kinematics equations. Suppose the workpiece has been rotated clockwise by ra around the x-axis and by rb around the y-axis (Fig. 13). The five-axis kinematics is affected by the rotations in a different way which depends on the type of the machine. Proposal 4. Let ra , rb be the rotation angles defining the orientation of the workpiece and Ra , Rb the corresponding rotation matrices. Then the kinematics of the 2-0 machine is given by ∗ M = GB[b ](A[a ](W + T12 ) + T23 ) + T34
where
⎡
⎤ cos(rb ) cos(ra )x + cos(rb ) sin(ra )y − sin(rb )z ⎢ ⎥ −sin(ra )x + cos(ra )y W = Rb [ra ]Ra [rb ]W = ⎣ ⎦, sin(rb ) cos(ra )x + sin(rb ) sin(ra )y + cos(rb )z ⎡
⎤ cos(a − ra ) cos(b) cos(rb ) + sin(b) sin(rb ) ⎢ ⎥ sin(a − rb ) cos(b) I = ⎣ ⎦. cos(a − ra ) cos(b) sin(rb ) − sin(b) cos(rb )
(11)
246
S. Makhanov / Mathematics and Computers in Simulation 75 (2007) 231–250
Proof. The conversion between tool orientation I = (Ix ,Iy ,Iz ) and two rotary angles a and b is given by Ix = cos(a) cos(b),
Iy = sin(a) cos(b),
Iz = −sin(b).
After the rotations, the tool orientation becomes I = Rb [ra ]Ra [rb ]I. After some algebraic manipulations, we have ⎡ ⎤ cos(a − ra ) cos(b) cos(rb ) + sin(b) sin(rb ) ⎢ ⎥ sin(a − ra ) cos(b) I = ⎣ ⎦.
cos(a − ra ) cos(b) sin(rb ) − sin(b) cos(rb ) Proposal 5. Let ra , rb be the rotation angles defining the orientation of the workpiece and Ra , Rb the corresponding rotation matrices. Then the kinematics of the 1-1 machine is given by ∗ , M = GA[a ](W + T12 ) + T23 + B−1 [b ]T34
where
(12)
⎡
⎤ −cos(a + ra ) sin(b) cos(rb ) − cos(b) sin(rb ) ⎢ ⎥ sin(b) sin(a + ra ) I = ⎣ ⎦. −cos(a + ra ) sin(b) sin(rb ) + cos(b) cos(rb )
The proof is analogous to that of Proposal 4. Proposal 6. Let ra , rb be the rotation angles defining the orientation of the workpiece and Ra , Rb the corresponding rotation matrices. Then the kinematics of the 0-2 machine is given by ∗ ) M = GW + T12 + A−1 [a ](T23 + B−1 [b ]T34
where
(13)
⎡
⎤ (sin(a) sin(b) sin(ra ) + cos(b) cos(ra )) cos(rb ) − cos(a) sin(b) sin(rb ) ⎢ ⎥ cot(b) sin(ra ) − sin(a) cos(ra ) I = ⎣ ⎦. (cot(b) cos(ra ) + sin(a) sin(ra )) sin(rb ) + cos(a) cos(rb )
The proof is analogous to that of Proposal 4. 3.6. Least-square optimization and dependent variables D Let Wp,p+1 (t) ∈ S(u, v) be a curve between Wp and Wp+1 extracted from surface S(u, v) in such a way that it represents the desired tool path between p and p+1 . Consider the error given by (1). Let us minimize (1) with regard to MT = {T23 , T34 , T4 } and MS = {ra , rb , T12 }. Differentiating (1) with regard to independent variables v = (v1 , . . . , vn ) yields ∂W 1 p,p+1 D − Wp,p+1 dt = 0. (14) Wp,p+1 ∂ν p 0 p
The number of parameters n is at most six, but if the optimization is only performed with respect to the machine setup, the number of the parameters will vary with the type of machine. ∗ . Consequently, if T ∗ = T ∗ Consider the 2-0 machine. Observe that T34 − T4 has been replaced by one variable T34 34 34,o is a component of the solution of the transformed optimization problem then any T34 and T4 that satisfy T34 − T4 = ∗ are components of the solutions of the original optimization problem. In terms of the error, the dependence T34,o is expressed as follows: v1 , v2 are dependent if ε(ν1 , ν2 , ν3 , . . . , νn ) ≡ εˆ (c1 ν1 + c2 ν2 , ν3 , . . . , νn ), where c1 and c2 are constants. In this case, ∂ˆε/∂v1 = 0 and ∂ˆε/∂v2 = 0 produce the same equations. Therefore, c1 v1 + c2 v2 can be
S. Makhanov / Mathematics and Computers in Simulation 75 (2007) 231–250
247
replaced by one variable. When the optimal solution to the transformed problem is found, either v1 or v2 is considered a free variable. We will now prove that Eq. (14) for kinematics (11) have one more less obvious pair of dependent variables. Proposal 7. T12,z and T12,z are linearly dependent for the 2-0 machine. ˆ −1 + (1 − t)B−1 Bp K ˆ −1 ], where K ˆ −1 Bp+1 K ˆ −1 = Ap (Wp + Proof. Consider a tool path given by Wp,p+1 (t) = K[tB p+1 p p T12 ) + T23 . Since Ap and Ap+1 are the rotations around the z-axis they do not change the z component of T12 . Therefore, (Ap T12 + T23 )z = (Ap+1 T12 + T23 )z = T12,z + T23,z . Hence, (Ap T12 + T23 )z and (Ap+1 T12 + T23 )z can be replaced by one ˆ variable. Furthermore, K[S] = A−1 (S − T23 ) − T12 . Therefore, (A−1 T23 +T12 )z = T23,z + T12,z can be replaced by the same variable. Consequently, T12,z and T12,z are linearly dependent. Proposal 8. T34 and T4 are linearly dependent for the 1-1 machine. The proof of Proposal 8 is analogous to that of Proposal 7. Remark 3. Kinematics (12) of the 1-1 machine does not have other dependent parameters rather than T34 ,T4 . We summarize our results in Table 4 as follows. The least-square optimization can be performed with regard to the following variables. 3.7. Numerical method We solve the resulting system of non-linear equations by the standard Newton’s method. To achieve the best possible solution, we execute the Newton’s method several times with a different initial approximation for each run. A set of initial approximations is generated by equi-spaced or random sampling of each variable within the feasible range. Our experiments reveal a good performance of this simple approach. The required derivatives of the objective function with regard to the rotation angles are obtained by the chain rule as follows
∂ε(ra , rb ) ∂ε ∂ε ∂ap ∂ε ∂bp ∂ε ∂ap+1 ∂ε ∂bp+1 = + + + + , ∂rL ∂ap ∂rL ∂bp ∂rL ∂ap+1 ∂rL ∂bp+1 ∂rL ∂rL where L = a or L = b. 3.8. Examples, practical machining and simulation To demonstrate the performance of our optimization procedure, we apply the optimal setup to two test surfaces: the two bell surface S1 given on page 2 and a sweep surface S2 is given by x = 100u − 50,
y = 100v − 50,
z = −40(v − 0.8)2 − 50 sin(3u − 0.3) sin(u − 0.5) sin(u − 0.8) − 5.
where 0 ≤ u, v ≤ 1. Let Wp = S(up, vp ) and Wp+1 = S(up+1, vp+1 ) be two successive CC points. The desired curve between these two CC points is extracted from the surface as follows D Wp,p+1 (t) = S((1 − t)up + tup+1 , (1 − t)vp + tvp+1 ),
Table 4 The minimal sets of optimization parameters Machine type
The 2-0 machine The 1-1 machine The 0-2 machine
Optimization parameters Workpiece setup
Tool
Machine settings
ra , rb , T12,x , T12,y , T12,z ra , rb , T12,x , T12,y ra , rb
None T4,z T4,z
T23,x T34,x T23,x , T23,y , T34,y
248
S. Makhanov / Mathematics and Computers in Simulation 75 (2007) 231–250
Table 5 Performance of the optimization method, S1 Machine type
The 2-0 machine The 1-1 machine The 0-2 machine
ε (mm2 )/reduction Before optimization
Optimization w.r.t. the workpiece setup
Optimization w.r.t. the workpiece setup and the tool length
Optimization w.r.t. the entire set
570.87 1270.39 311.74
67.28/88.21% 289.71/77.20% 294.27/5.60%
221.94/82.53% 67.12/78.47%
59.69/89.54% 197.69/84.44% 2.08/99.33%
The performance of the optimization is presented in Table 5 (the two bell surface) and Table 6 (the sweep surface). The desired and the actual tool path obtained for the sweep surface is depicted in Fig. 18 along with the corresponding error. The results reveal that the error can be reduced as much as 99%! Table 5 shows almost the same accuracy increase achieved for geometrically complex double bell surface.
Fig. 18. (a) The desired tool path, (b) the extracted tool path, (c) the actual tool path before optimization, (d) the error, (e) the tool path with an optimal setup ra , rb , T12 , (f) the error, (g) the tool path with an optimal setup ra , rb , T12 , T13 and (h) the error.
S. Makhanov / Mathematics and Computers in Simulation 75 (2007) 231–250
249
Table 6 Optimal setup performance comparison for the sweep surface, S2 Machine type
The 2-0 machine The 1-1 machine The 0-2 machine
ε (mm2 )/reduction Before optimization
Optimization w.r.t. the workpiece setup
Optimization w.r.t. the workpiece setup and the tool length
Optimization w.r.t. the entire set
64.72 80.86 0.82
0.43/99.33% 1.46/98.19% 0.77/6.16%
0.59/99.27% 0.25/70.15%
0.35/99.47% 0.37/99.54% 0.20/76.09%
Fig. 19. S1 with different setups. The workpiece on the left has been cut with an optimal setup whereas the workpiece on the right has been cut with a conventional setup (ra = 0, rb = 0). Table 7 Performance of the optimization measured by the required number of CC points. 2-0 machine. The maximum allowed machining error = 0.01 mm Surface
The sweep surface The double bell surface
# of CC points/reduction Before optimization
Optimization w.r.t. ra and rb
Optimization w.r.t. ra , rb , and T12
3900 7925
1247/68.0% 6935/12.5%
1233/68.4% 6847/13.6%
The real cutting of the workpiece on MAHO600 (a 2-0 machine) is shown in Fig. 19. The workpiece on the left has been cut with a setup optimized with regard to ra and rb (the error reduction is 92.79%). Another measure to evaluate the performance of optimization is the number of the CC points required to maintain the kinematics error within a prescribed tolerance. This estimate is in particular important for high speed milling when an increase in the number of the points leads to a substantial increase in the machining time. Table 7 displays the number of CC points required to cut the workpiece to within a prescribed maximum machining error. The optimal setup applied to the sweep and the double bell surface reduces the number of CC points by 68 and 13%, respectively. Note that even though the reduction achieved for the double bell is not that large, the optimization is still appropriate since it requires nothing else but changing the initial setup which is a very simple, zero cost operation. 4. Conclusions As opposed to part 1 the novelty of the proposed techniques is new mathematical formulation and its analysis rather than a method of solution. Furthermore, Algorithms 1, 2 and 3 presented in part 1 are designed to optimize the tool positions and orientations. That is why they are based on adaptable geometrical structures such as the curvilinear grids, space filling curves and domain decompositions. Algorithms 4 and 5 are based on entirely different optimizations. These optimizations do not change the spatial tool path in the workpiece coordinates. The orientations of the tool
250
S. Makhanov / Mathematics and Computers in Simulation 75 (2007) 231–250
are unchanged by the optimizations as well. The unifying idea of Algorithms 4 and 5 is adjustment of the machine kinematics rather than finding the optimum given fixed kinematics equations. Optimization based on finding the best sequence of rotations presented by Algorithm 4 leads to a substantial accuracy increase ranging from 10 to 80%. The optimization can be formulated in terms of the total error as well as in terms of the undercut and overcut error. The method is the most efficient in the case of the rough cut characterized by large gradients which produce considerable errors. A fine cut of a smooth surface employing small spatial and angular steps may not display the detrimental effects near the stationary points. In this case the methods do not lead to a substantial accuracy increase. Algorithm 5 presents a new optimization of five-axis machining through positioning of the blank workpiece in the 5D working space. The proposed least-square techniques leads to a system of non-linear equations with regard the position and orientation of the workpiece. The optimization depends on the type of the five-axis kinematics since for each type of the machine there exists a certain number of tool path invariants and dependent variables. The resulting non-linear system of equations can be efficiently solved numerically by a Newton–Raphson type procedure. The method has proven extremely effective in many cases displaying the accuracy increase up to 99%. Moreover, it requires nothing of the operator except changing the initial setup, which is a very simple, nearly zero-cost, operation. Finally, numerical examples of optimization verified by computer simulations as by real machining show the efficiency of the proposed optimization models. Acknowledgements This work is supported by the National Electronics and Computer Technology Center of Thailand, National Science and Technology Development Agency of Thailand and Thailand Research Fund. The author wish to thank Dr. W. Anotaipaiboon, Ir. E.L.J. Bohez and Dr. M. Munlin for their contributions and fruitful discussions. References [1] A. Affouard, E. Duc, C. Lartigue, J.-M. Langeron, P. Bourdet, Avoiding five-axis singularities using tool path deformation, Int. J. Machine Tools Manuf. 44 (2004) 415–425. [2] E.L.J. Bohez, Five-axis milling machine tool kinematics chain design and analysis, Int. J. Machine Tools Manuf. 42 (4) (2002) 505–520. [3] Y.H. Jung, D.W. Lee, J.S. Kim, H.S. Mok, NC post-processor for five-axis milling machine of table-rotating/tilting type, Mater. Process. Technol. 130–131 (2002) 641–646. [4] S.S. Makhanov, Optimization and correction of the tool path of the five-axis milling machine. Part 2: spatial optimization, Mathematics and Computers in Simulation 75 (2007) 210–229. [5] M. Munlin, S.S. Makhanov, E.L.J. Bohez, Optimization of rotations of a five-axis milling machine near stationary points, Comput. Aided Des. 36 (2004) 1117–1128. [6] Z. Sijie, Z. Yunfei, P. Fangyu, L. Xide, Research on localization of the workpiece with large sculptured surfaces in NC machining, Int. J. Adv. Manuf. Technol. 23 (2004) 429–435. [7] O.R. Tutunea-Fatan, H.Y. Feng, Configuration analysis of five-axis machine tools using a generic kinematics model, Int. J. Prod. Res. 44 (2004) 1235–1243. [8] A. Warkentin, P. Hoskins, F. Ismail, S. Bedi, Computer aided 5-axis machining, in: Systems Techniques and Computational Methods, CRC Press, Boca Raton, FL, 2001. [9] M.A. Weiss, Data Structures and Algorithm Analysis, Addison–Wesley, Reading, MA, 1997.