# Optimization of Machining Parameters for Corner Accuracy Improvement for WEDM Processing
## 4 Human-Machine Interface  
Figure 9 shows the prediction and optimization algorithm. Firstly, the original machining parameters were brought into the regression Equations (3)-(6) to calculate and predict the corner error for 30, 60, 90 degree corners and machining speed. For the optimization, the parameters ranges of ON, OFF, OV, SV, WT, and WA were brought into the regression Equations (3)-(5) to obtain all the corner error values. Furthermore, we used the permutation and combination method, combined with the experimental response  
Figure 8: The optimization plot for (**a**) \(30^{\circ}\), (**b**) \(60^{\circ}\), (**c**) \(90^{\circ}\), and (**d**) machining speed.  
Figure 7: 2D contour and 3D surface plots for machining speed.  
surface corner error value data, to select a set of parameters with the corner error that meets the user's desirable error value. Subsequently, we brought these parameters into the regression Equation (6) to perform a comparison and search for the optimum parameter combination for the fastest machining speed, and then determined these parameters as the best parameter combination for the smallest corner error and fastest machining speed.  
The human-machine interface (HMI) was designed according to the developed algorithm and became the corner error and machining speed prediction and optimization system. The system can predict the corner error and machining speed value according to the original input parameter setting code, and then optimize the machining parameter setting code for smallest corner error for 30, 60, and 90 degree corners and for the fastest machining speed according to the user's desirable corner error. The C# programming language was used to develop the HMI as shown in Figure 10. Through this friendly HMI, the user can smoothly complete the HMI operation. The step by step HMI operation was designed as follows:  
1. Input the machining parameters code (shown at area 1 in Figure 10), then choose the predict button. The system will calculate the corner error value for 30\({}^{\circ}\), 60\({}^{\circ}\), 90\({}^{\circ}\) corners and the machining speed (shown at area 2 in Figure 10) based on regression Equations (3)-(6). The system also calculates and displays the smallest corner error values. (Area 3 in Figure 10.)  
Figure 9: Algorithm of prediction and optimization for corner error and machining speed.  
Check whether the predicted error value is within the allowable error range. If the predicted error value is larger than the tolerance error, optimization process will be executed.
3. Input the desirable corner error value or use the smallest corner error value calculated by the system (shown at area 3 in Figure 10) into the required accuracy (shown at area 4 in Figure 10) and choose the optimization button.
4. For corner optimization, the system will extract the value in the required accuracy textbox and store it in another variable. Furthermore, use \"For Loop\" to bring all the parameter ranges into the regression Equations (3)-(5) to calculate all parameter sets, and then store the calculation results in the temporary array matrix 1. Subsequently, use \"Foreach\" statement to compare the stored calculation results in the temporary array matrix 1 one by one to search for the parameters set that meets the desirable corner error value, and store these parameters in the array matrix 2.
5. Afterward, the parameters in the array matrix 2 are brought into the machining time regression equation (Equation (6)), and the system calculates the machining time and searches the parameters set for the fastest machining time, and then displays them on the optimized parameters (shown at area 4 in Figure 10).
6. Finally, the best parameters can be stored in a CSV format.