# Path Optimization of Two-Posture Manipulator of Apple Packing Robots
## 4 Results and Discussion
### Comparative Study of the Optimal Performance under Different Numbers of Grasping and Placing Points  
Tests under different numbers of randomly arranged grasping points and different types of apple trays with different specifications were conducted to test the optimal performance of the improved genetic algorithm fused with the optimal parameter selection algorithm under different working conditions. The results are shown in Table 2. The total time of the improved genetic algorithm fused with the optimal parameter selection algorithm was less than that of the traditional genetic algorithm. The average optimization amplitudes were 14.63%, 15.42%, 16.24%, and 13.82% for 9-groove, 12-groove, 14-groove, and 16-groove trays, respectively. As shown in Table 2, the optimization amplitude is larger when the number of grasping points is greater than four than that when the number of grasping points is less than four. Therefore, the proposed algorithm is effective when the number of grasping points is greater than four. The fluctuation in optimization amplitude is larger when the number of apple placing points is less than 12 than that when the number is larger than 12. The fluctuation in optimization amplitude is small when the number of apple placing points is greater than 14. The optimization amplitude is larger when the number of apple grasping points is constant and the number of apple placing points (i.e., the number of grooves of apple trays in different specifications) is 12 or 14. Considering the specific values of the optimization amplitude, the optimization amplitude reaches its minimum when the number of grasping points is two and the number of placing points is twelve. Under the condition where the number of placing points is constant, the value of optimization amplitude is basically the minimum when the number of grasping points is two. This finding is because the number of grasping points is extremely small, optional packing paths are few, and the optimal algorithms have few effects. On the contrary, excessive optional packing paths are found, and the optimized paths obtainedby the two algorithms are locally optimal when excessive grasping points are found. The situation is mostly the same when the number of placing points varies and the number of grasping points is constant. The optimization performance of the improved algorithm is optimal. The optimal optimization amplitude is 20.81% when the number of grasping points is 4 and the number of placing points is 12. The test results show that the optimization amplitude is 10.70%, which is smaller than most values when the numbers of grasping and placing points are 5 and 16, as shown in Table 2. This finding is possibly because the coordinates of the grasping and placing points only fit the principle of proximity when the traditional genetic algorithm is applied. The improved genetic algorithm fused with the optimal parameter selection algorithm is effective when the number of apple grasping points is greater than 4 and the number of placing points is 12 or 14. The packing path optimization algorithm of the mechanical arm of the apple packing robot designed in this study has the following advantages:  
1. A two-level coding genetic algorithm can solve the packing path optimization problem of a two-posture manipulator. 2. The traditional genetic algorithm was improved and a region crossover operator was designed. In contrast to traditional single-point crossover, multi-point crossover, dislocation crossover, and random crossover, the crossover operator is based on the region set by two chromosomes to cross each other, and further modifies the crossover result to eliminate the repeated coding. The crossover operator has the advantage of retaining excellent gene fragments and making the optimization process more stable. 3. Aiming at the problem that the traditional genetic algorithm is not well targeted based on empirical parameters, an optimal parameter-fitting exhaustive algorithm was designed.