## 3 Determination of Wheel Location and Orientations with a 2D Projection
### Calculation Procedure with the Improved GA and PSO  
To solve the above-constrained optimization problem, the projection model with the GA and PSO was integrated to calculate the wheel's location and orientation for flute-grinding operation. As mentioned, the initial points would greatly affect the optimization results. In this work, an initial points generation algorithm was proposed in Algorithm 1, which could be used for the population initialization for GA or PSO. It is noted that all the initial points would be checked by the over-cut and interference constraints in the projection model. Furthermore, the flowchart of improved GA and PSO (IGA, IPSO) integrated with the projection model is shown in Figure 6. First, a set of initial points were generated with the algorithm in, which is used to calculate the following wheel's location and the generated flute parameters. In light of this, the grinding errors were evaluated and set as the fitness function for the GA and PSO. For the IGA and IPSO, the off springs or particles generated by the iteration operators, e.g., mutation or crossover, will be checked by the proposed over-cut and interference constraints. The iteration will stop while satisfying either of the following conditions: (1) iterations n > 100 (2) there is no obvious improvement in the grinding errors within n = 10 succeeding iterations. With this procedure, the optimized wheel's location and orientation, the generated flute parameters and grinding errors could be obtained. ``` Input: Desired flute \(\left\{r_{T},\lambda,r_{c0},\gamma_{0},\phi_{0}\right\}\) and wheel parameters \(\left\{R,H,\alpha\right\}\) Output: initial points (pop) for \(\beta\) & \(\theta_{C}\)
1.\(pop=\left\{\varphi\right\}\). 2.whilen < N do
3.\(\beta=\mathrm{random}(0,\pi/2)\) and \(\theta_{C}=\mathrm{random}(0,\pi)\). 4. Calculate \(r_{c}(\theta_{C},\beta)\) and \(\theta_{s}\) in the projection model (see Appendix A)
5. If satisfy the constraints for Equation (16) and Equation (17). 6.\(pop=pop\cup\left\{\beta,\theta_{C}\right\}\)
7. else
8. go to line 3
9.endif
10.return pop

## 4 Numerical Simulation

To test the accuracy and efficiency of the presented model, the numerical simulation was conducted with various sizes of flutes. Three types of grinding wheels were provided in Table 1. The designed flutes were divided into three groups according to their size: small (\(r_{T}\leq 1\) mm), medium (\(1\) mm \(\leq r_{T}\leq 20\) mm), large (\(r_{T}\geq 20\) mm). To grind those flutes, the wheel's location and orientation

Figure 6: Flow chart of the improved genetic algorithm (IGA) and improved particle swarm optimization (IPSO) with the projection model. in CNC operations were determined with the proposed improved GA and PSO (IGA, IPSO), and also compared with the traditional GA and PSO. For each instance, the optimization was run 10 times and the average results and deviation were recorded. The optimization program was implemented in MATLAB 2010 on a computer with Intel Core i5, 2.39 GHz, 4 GB RAM. The parameters of the GA and PSO were set in Table 2. The desired flutes parameters are listed in Table 3. The helix angle for those flutes was set as 30 degrees. The simulation results with various algorithms are given in Table 3. It can be concluded that the integrated method, i.e., IGA and IPSO, had wider applicability and higher accuracy than the traditional GA and PSO. Especially for IGA, it could be used to solve the very small size flute-grinding problem. For further study, the grinding errors \(\xi\) (calculated by Equation (14)) between the grinding flute parameters and the designed flute parameters were calculated as shown in Figure 7a. It can be seen that the integrated method superior to the traditional in accuracy and stability. The accuracy of flute parameters with IGA and IPSO could achieve \(1\times 10^{-4}\). It was also noted that the grinding errors with IGA and IPSO were less for the medium size flutes, while larger for the small and large size flutes.