A tool-path planning method used in computer controlled optical surfacing based on improved prim algorithm

In view of the disadvantages of existing planning methods used in CCOS techniques, such as low efficiency and workpieces containing obvious mid-frequency error after polishing, a new tool-path planning method based on improved Prim algorithm is presented. The core idea of method consists of the following steps: surface data reading, mesh generation, distribution of resident points determining, and polishing path generating. Then, comparison of raster path and the path based on improved Prim algorithm are carried out by simulations from aspects of path length and polishing texture. The results indicate that the path based on improved Prim algorithm can shorten path length as well as increase polishing efficiency; moreover, both the texture and mid-frequency errors can be improved by using the path presented. Finally, the processing experiments of raster path and the path presented are carried out. The experimental results show that the polishing efficiency and precision are improved by using the proposed method. Moreover, it can reduce the mid-frequency error of workpiece effectively. Thus, the experimental results which are in good agreement with the simulation results prove the feasibility of proposed method.


Introduction
Computer controlled optical surfacing (CCOS) was developed in the 1970s as a new type of optical processing technology. It is widely used in aspheric optical lens fabrication because of its high accuracy [1][2][3][4]. The researches of tool-path have important implication for the polishing craft of optical lenses. Reasonable tool-path can reduce processing time to increase polishing efficiency and obtain better surface shape. Two fundamental tool-paths are conventional now in CCOS techniques: raster path and spiral path. The former is in commonly used in complete machining of workpiece because it has advantages of simple operation and easy process control.
However, there are too many unnecessary routes which increase the processing time and reduce efficiency. Due to the rotating motion of workpiece, the spiral path is easy, stable, and efficient which need not reverse frequently and reduces the motion stroke requirement. But it is only fit for the fabrication of spherical lens [5,6].
In order to avoid the problems of common machining path, different tool-path optimizations were proposed by researchers to improve the surface quality of workpiece in CCOS techniques. Deng et al. [7] developed a polishing toolpath based on an algorithm named adaptive programming model. It could improve the quality of aspheric surface; however, polishing efficiency had not been increased. Zhou et al. [8] studied spiral path and put forward a novel path based on uniform-area-increment spiral. The path could avoid the excessive machining in the central region and result in higher precision, but was only fit for the fabrication of spherical lens. Zhao et al. [9] adopted a polishing path generation for physical uniform coverage of the aspheric surface based on the Archimedes spiral in bonnet polishing. The revised path achieves lower roughness and surface tolerance than the traditional Archimedes path, which indicates that the revised path can achieve uniform physical coverage on the surface. Zhang et al. [10] proposed a new polishing path planning method for physically uniform overlap of polishing ribbons instead of traditional geometrically uniform coverage of polishing path on freeform surfaces. The path extraction algorithm (PEA) was given to predict the location of the adjacent polishing path. Proposed polishing path planning was implemented for a typical freeform surface, and the polishing paths with physically uniform overlap of polishing ribbons between two adjacent paths were obtained. Han et al. [11] presented a toolpath generation strategy for polishing of freeform surface with physically uniform coverage. This strategy used surface expansion and re-parameterization techniques to avoid edge effect in polishing. The effectiveness and robustness of the developed polishing path generation technique were proved by case studies. Chen et al. [12] developed a trochoidal toolpath for the pad-polishing of freeform surfaces with global control of material removal distribution. The flexibility of a trochoidal toolpath has been applied in the pad-polishing of freeform surfaces using a tilted elastic disk, with global control of material removal distribution over part surfaces. The material removal variation along the guide-line of the trochoidal toolpath is addressed by using optimized trochoidal step and radius, after precisely calculating the effect of overlapped toolpath trajectories. Huang et al. [13] proposed a trajectory planning of optical polishing based on optimized implementation of dwell time. Simulation and experimental results show that the proposed dwell time algorithm and spline interpolation method can considerably improve the solution accuracy of dwell time and the convergence rate of the form error during polishing.
The above several methods are mainly applied to global polishing of workpiece, and there are few researches about local polishing. The common path planning methods are easy to cause low polishing efficiency in local polishing of workpiece. And there were some reports that revealed that tool-path had a significant impact on mid-frequency error [14][15][16]. Regular tool-path will produce polishing texture with regularity and higher mid-frequency error. In this paper, aimed to improve polishing efficiency and polishing texture, an optimized strategy including a new tool-path planning method based on improved Prim algorithm is presented.

Tool-path planning based on improved Prim algorithm
The technology of CCOS polishing is to determine material removal amount by using computer to control pressure of polishing position, relative velocity, and polishing time. Figure 1 illustrates process flow chart of CCOS.

Data processing of surface shape
Data processing of surface shape includes surface fitting, mesh generation, generation of eigenvalue, and distribution of resident points determining. Reasonable distribution of resident points is the precondition of obtaining reasonable polishing tool-path. Before determining workpiece distribution of resident points, mesh generation is performed firstly.
In different stage of polishing, while choosing different polishing tool size, the corresponding grid size is different. With increasing polishing tool size, the gird size increases. For instance, large grid can reduce polishing area and increase polishing efficiency in step of rough polishing. And polishing precision can be guaranteed through making grid size become smaller in step of fine polishing. When mesh generation is performed, the number of data points is set to be same in each grid. The surface height of workpiece is one of factors affecting the grid size. The grid size and dwell time are adjusted to achieve efficient polishing according to surface height. In order to express the surface height of each grid, a new parameter is defined, namely, eigenvalue of grid M. Then, it is supposed that the number of data points is k in The distribution of resident points is determined by the eigenvalue of grid before processing. And a critical value of processing e has been set at the beginning. The center points of grids are defined as resident points which satisfies condition M ≥ e . Then distribution of resident points is generated. Therefore, according to this condition, the processing points which are unnecessary will be deleted. It can avoid redundant movement of polishing tool to shorten the path length and reduce processing time thereby increasing polishing efficiency.

Principle of improved Prim algorithm
Prim algorithm is a kind of minimum spanning tree algorithm. Minimum spanning tree algorithm is to make the path shortest on premise that every point is connected in the network. The basic idea of Prim algorithm is that firstly, all points in the undirected network which is connected by a number of points are divided into two sets: internal set which a point randomly is selected at the beginning and external set which is composed by the rest of the points. Secondly, a point in the internal set and a point in external set are selected respectively to make the edge connecting by the two points be the shortest. And the point in the external set will be added to the internal set. Lastly, repeat until all points in the external set are added to the internal set. The minimum spanning tree is obtained [17,18]. However, the result of Prim algorithm is minimum spanning tree but not a path; thus, improved Prim algorithm is presented in order to find the better polishing path.
The flow chart of improved Prim algorithm is shown in Fig. 2. The set of resident points R {P 1 , P 2 , P 3 , …P n } is obtained according to distribution of resident points, as shown in Fig. 3. A point P i is selected from the set R to be the starting point; then, this point is deleted from the set R. The nearest point P j to P i is found out. If there are points of equal distance, the eigenvalues of the points whose equal distance is equal are compared to find the highest one. They are connected, and P j is defined as the new starting point. Then, P j is deleted from the set R, and the nearest point to P j is found out in the rest points of the set R. Repeat until all the resident points are connected.
The set of resident points R represents the projections of resident points in plane XOY, namely, position of resident points. It can be expressed as The distance of any two resident points D ij is given by Fig. 2 The flow chart of improved Prim algorithm And the distance matrix of any two resident points D is expressed by The distance matrix D is a matrix of size n × n. According to flow chart of improved Prim algorithm, the point P i is set to be starting point and the minimum D ij which is greater than zero in i row and i column is found out. Then, P i and P j were linked and i row and i column are deleted. The distance matrix of rest resident points D 1 is got. D 1 is expressed by The distance matrix D 1 becomes a matrix of size (n − 1) × (n − 1). The point P j is set to be starting point. Last, repeat until the distance matrix become null matrix. The algorithm is finished to output the points in order and generate polishing path.

Generating polishing path
Based on the above procedures, polishing path is generated through combining with data processing of surface shape and improved Prim algorithm. Figure 4 shows the flow chart of generating polishing path. Firstly, data of surface shape is read and mesh generation is performed. According to Eq. (1), the eigenvalue of grid is got to determine distribution of resident points. Secondly, the processing order of resident points is obtained based on Eqs. (2), (3), (4), and (5). Finally, the polishing path is output. These points that are connected would be deleted from the set of resident points by controlling of the improved Prim algorithm. It guarantees that the path is simply connected to be polishing path.

Path simulation and comparison study
In order to confirm the advantages of the improved Prim algorithm, comparison of raster path and the path based on improved Prim algorithm was carried out by simulated experiments from aspects of path length and polishing texture [19]. Simulated experiments were conducted on the same workpiece. And the chart of workpiece surface residual error from interferometer is shown in Fig. 5.

Comparison of path length
Mesh generation was performed by setting the grid size to be 10 mm × 10 mm. Raster path and the path based on improved Prim algorithm were obtained respectively through simulation, as shown as Figs. 6 and 7. In Fig. 7, the condition of experiment was that the critical value of processing e was set to be zero, namely, the eigenvalue of grid M was equal or greater than zero.  It is easy to find from Figs. 6 and 7 that the length of raster path is 5970 mm and the length of the path based on improved Prim algorithm is 3513.5 mm. The results show that the length of the path based on improved Prim algorithm is shorter than raster path by 41.15%. The path based on improved Prim algorithm can reduce the moving time of tool between resident points. Thus, processing time can be reduced to improve polishing efficiency.

Comparison of polishing texture
As discussed previously, regularity of the path directly affects polishing texture and has a significant impact on midfrequency error. The mid-frequency error of workpiece with regular texture is obvious. Rather, the error of workpiece with disorderly and irregular texture is lower. In order to observe polishing texture clearly, simulations of two paths were carried out by intercepting a local part of workpiece whose size was 50 mm × 50 mm (the range in x direction: 0 ~ 50 mm, the range in y direction: 0 ~ 50 mm). Polishing texture of the workpiece is reflected by drawing trajectory of the point A. The conditions of experiments were set to be: ρ = 6.25 mm (ρ is the radius of polishing tool), ρ 0 = 5.0 mm, r 1 = 2.0 mm. It is potential that polishing texture will be different when the processing speed is different. The experiments were divided into two conditions: low-speed condition and high-speed condition. And the simulations were carried out for the two paths. Under conditions of the low-speed and high-speed, the trajectories of the point A are shown in Figs. 9 and 10, respectively. (low 6 Raster path Fig. 7 The path based on improved Prim algorithm Fig. 8 Motion of polishing tool in CCOS speed: precession speed of polishing tool is 10 mm/min. High-speed: precession speed of polishing tool is 50 mm/ min.) It is discovered from Fig. 9a that under the condition of low speed, the trajectory which the point A moves in accordance with the resident points order of raster path presents regular pattern of reciprocating motion. Similarly, it is shown from Fig. 10a that under the condition of high speed, the trajectory which the point A moves in accordance with the resident point order of raster path presents regularity and definite symmetry. Therefore, the results indicate from Figs. 9a and 10a that the trajectories of the point A in raster path present regularity. And the polishing texture of workpiece processed presents regularity and symmetry that makes mid-frequency error after polishing be obvious.
It is discovered from Fig. 9b that under the condition of low speed, the trajectory which the point A moves in  Fig. 10b that under the condition of high-speed, the trajectory which the point A moves in accordance with the resident point order of the path based on improved Prim algorithm presents irregularity and asymmetry. Therefore, the results indicate from Figs. 9b and 10b that the trajectories of the point A move in the path based on improved Prim algorithm present irregularity and definite complexity. The polishing texture of workpiece which is processed in this path is disorderly and irregular so as to reduce the mid-frequency error.

Experiment validation
In order to verify the simulation results, the two polishing paths were successively used to process the same workpiece, and the experimental results were recorded and analyzed.
The experiments were carried out with three times of processing. The first processing was used raster path, and the second and third processing were used the path based on the improved Prim algorithm. During the experiments, the path parameters were set same to explore the influence of two paths on the polishing efficiency and the polishing texture of workpiece. The OP1000 three-axis CNC plane polishing machine and plane optical elements were used in the processing experiments (optical element material: K9 glass, size: 100 mm × 100 mm × 10 mm), and the data of surface shape was got from interferometer by offline measurement. Then, the specific experimental steps were shown as follows: 1. The side of workpiece was marked for interferometric measurement, and the surface shape of workpiece was read. 2. Reserved edge was set to conduct grid division. 3. The raster path was adopted to process the workpiece, and the surface shape of workpiece was measured after processing. The processing time was recorded. 4. The corresponding characteristic values of grid according to the previously divided grid were obtained, and processing critical value of the path based on improved Prim algorithm was set. The path based on the improved Prim algorithm was generated according to the data of surface shape measured, and the path was carried out in the second processing. The processing time was recorded. 5. The surface shape of workpiece was measured after the second processing. A new path based on the improved Prim algorithm according to the data of surface shape measured was generated, and the path was carried out in the third processing. The processing time was recorded, and the surface shape of workpiece was measured after the third processing.
The parameters and results of experiment are shown in Table 1 (Prim path represents the path based on the improved Prim algorithm). Figures 11, 12, 13 and 14 show the corresponding results of experiment in Table 1.
According to the results of experiment in Table 1, under the same conditions, the processing time of path based on improved Prim algorithm is shorter than that of raster path. The path based on improved Prim algorithm can improve the polishing efficiency. paths. Figure 11 is surface shape of workpiece before processing. The raster path is used for processing, and the workpiece surface shape is measured. As can be seen from Fig. 12a, surface shape of workpiece presents obvious stripe marks and regular texture. Figure 13a is surface shape of workpiece processed by path based on improved Prim algorithm (after first processing). The stripe marks of surface shape are not obvious. Figure 13b is path based on improved Prim algorithm (after second processing) generated according to surface shape of workpiece in Fig. 13a. The path based on improved Prim algorithm (after second processing) is adopted to process the workpiece, and stripe marks of surface shape are gradually disappeared, as shown in Fig. 14. It can be seen from when the path based on improved Prim algorithm is used for processing, the surface shape PV presents a downward trend and the surface accuracy of workpiece is improved. Then, the results of three processing experiments are processed by a Fourier transform to get the spectrum diagram of workpiece, as shown in Fig. 15. The mid-frequency error of workpiece after processing experiment of raster path is mainly contain periodic components which is 9.01 mm, and the midfrequency error of workpiece after two processing experiments of Path based on improved Prim algorithm is mainly contain periodic components which is 8.197 mm. It can reduce the mid-frequency error of workpiece effectively through processing experiments of path based on improved Prim algorithm. Therefore, the experimental results which are consistent with the simulation results verify the feasibility of proposed method.

Conclusion
1. After analyzing the influence of polishing craft for optical lenses that polishing path exerted, an optimized strategy including a new tool-path planning method based on improved Prim algorithm is proposed. Firstly, mesh generation is performed and distribution of resident points is determined according to the eigenvalue of grid. Then, the improved Prim algorithm is applied to path planning to obtain simply connected polishing path. 2. Comparison of raster path and the path based on improved Prim algorithm was carried out by simulated experiments from aspects of path length and polishing texture. The results indicate that from the comparison of Figs. 6 and 7, the length of the path based on improved Prim algorithm is shorter than raster path by 41.15%. The path based on improved Prim algorithm can reduce processing time and increase the polishing efficiency effectively. And through Figs. 9 and 10, the path based on improved Prim algorithm has been found to be different with raster path in the aspect of polishing texture. The polishing texture of workpiece which is processed in proposed path presents irregularity and disorderliness; thereby, mid-frequency error can be reduced. 3. The processing experiments were carried out. The experimental results show that when the path based on improved Prim algorithm is used for processing, the surface shape PV presents a downward trend and the surface accuracy of workpiece is improved. Moreover, it can reduce the mid-frequency error of workpiece effectively through processing experiments of path based on improved Prim algorithm. Thus, the experimental results which are in good agreement with the simulation results prove the feasibility of proposed method.