Abstract
To build a synchronization error prediction model for the machine tool efficiently, a robust whale optimization algorithm (RWOA) method proposed in this study is applied to the hyperparameter optimization of its model. The proposed RWOA method integrated a non-linear time-invariant inertia weighting (NTIW) method and a Taguchi-based adaptive parameter exploration (ATPE) to improve the performance of WOA and promote robustness. The NTIW method can improve the performance of other algorithms, so this study used the NTIW method in the WOA. In addition, the Taguchi method can get an excellent combination of variables with optimal values and stable performance, making the WOA robust. First, to verify the validity of the proposed RWOA method, 13 benchmark functions were used in this study. The results of the benchmark function tests include the mean, standard deviation, and
Keywords
Introduction
Currently, Taiwan is actively promoting smart machinery, and the machine tool development industry is a vital focus. 1 In the application of machine tools, the high-speed tapping process is one of the main evolutions. Whether in the 3C electronic or mold industries, internal threads are processed by a rigid tapping process using machine tools. This process is expected to be carried out with high speed and accuracy, and the synchronization error is the quality observation index. If an effective synchronization error model can be constructed for rigid tapping, quality and accuracy can be improved; through the resulting model, an effective prediction model can be established, and parameters can be adjusted through this secondary model. The parameters that affect the synchronization error include the time constant for acceleration and deceleration of rigid tap, the proportional gain of the rigid tapping speed ring, the motor excitation delay time, the rigid tapping speed loop integral gain, the position feedforward coefficient, and the tapping axis position gain. At present, however, most of these parameters are adjusted based on the experience of human engineers or industry specialists. The results may not always be satisfactory. If the parameters or factors that affect the synchronization error can be effectively explored, the quality of rigid tapping (synchronization error) can be improved, and it is clear that parameter adjustment technology is a core issue that is crucial to upgrading the tooling industry. One of the most critical aspects of parameter tuning is creating a valid and suitable model. By using the model, the target value can be effectively understood without costing material.
In addition, because of the high cost of materials and tools in the machine tools industry, a model can be built at a lower cost if the data is appropriately collected. Therefore, in order to construct an effective quality prediction model for a machine tool, this study used experimental design methodology to collect representative machine process data. In this study, the Yeong Chin Machinery Industries Co. Ltd. NDV series machine tool 2 and the FANUC 31iMA controller were used to collecting the modeling data. Artificial neural networks were used to construct the model effectively. In most cases, when building a model, the hyperparameters are always tuned by trial-and-error or randomization. However, trial-and-error or randomization is not a systematic approach, so it often takes a lot of time to try or many attempts and experiences to obtain a suitable set of hyperparameters. Therefore, to systematize and automatize the process of tuning hyperparameters, this study proposes a robust whale optimization algorithm (RWOA) to optimize parameters in order to explore suitable hyperparameters for neural network models. The proposed RWOA is a systematic and effective parameter optimization method suitable for optimal hyperparameter exploration and meets the requirements of hyperparameter tuning techniques. Therefore, the proposed RWOA as developed in this study is used to optimize the model’s hyperparameters for the high-speed tapping process.
Swarm intelligence optimization (SIO) techniques are used to simulate organisms’ food exploration or foraging behavior to optimize parameters or variables; common approaches include particle swarm optimizer (PSO),3–6 glowworm swarm optimization,7,8 ant colony optimization, 9 bee colony algorithm, 10 group search optimizer, 11 grey wolf optimization algorithm, 12 and whale optimization algorithm (WOA). 13 In SIO, every individual has a location; the updated location should have more food for the individual, so that the swarm can find such a location. Different SIO techniques adapt or explore the environment through different group interactions. Because of their simplicity and intuitiveness, SIO techniques have long attracted researchers’ attention internationally in many related fields. Over the years, academic papers on SIO techniques have been published with increasing frequency, and the industry has often applied SIO techniques in parameter optimization. 14 Ding et al. 15 used a support vector machine (SVM) and PSO algorithm to model the prediction of the output voltage for supercapacitors. Kulkarni and Ghawghawe 16 exploited the dragonfly algorithm (DA) and PSO to build a hybridized model for the power system’s thyristor-controlled series compensator configuration. Tsai et al. 17 proposed an adaptive network-based fuzzy inference system and a sliding-level particle swarm optimization to optimize the parameters for a chemical-mechanical process for polishing a color filter. Jawad et al. 18 integrated exponential and polynomial functions into PSO for a path-loss model in agriculture. Zhao et al. 19 proposed a Q-learning-based cooperative meta-heuristic algorithm to solve the energy-efficient distributed no-wait flow-shop scheduling problem with sequence-dependent setup time to minimize makespan and total energy consumption. Pan et al. 20 proposed a knowledge-based two-population optimization algorithm based on NSGA-II and DE to solve the distributed energy-efficient parallel machines scheduling problem and simultaneously minimize total tardiness and energy consumption. Wang and Wang 21 proposed a mathematical formulation and a cooperative memetic algorithm with feedback to solve the energy-aware distributed flow-shop with a flexible assembly scheduling problem, simultaneously minimizing total tardiness and energy consumption. Zhao et al., 22 Zhao et al., 23 and Zhao et al. 24 used different SIO methods to flow-shop scheduling problem. Specifically, the WOA explores the solution space’s optimal parameter values by simulating humpback whales’ foraging behavior to explore the optimal parameters of the solution space by humpback whale encircling prey, exploitation, and exploration. Zhao et al. 25 have introduced inertial weights into the WOA so that the current or randomly selected search whale positions are not fully learned but still retain some influence. Yang et al. 26 introduced a nonlinear time-varying inertia weight method into the fractional-order particle swarm optimizer and showed that it could effectively improve its performance. Therefore, this study’s first improvement is introducing the nonlinear time-varying inertia weight (NTIW) method into the WOA. In addition, as the whales enter the latter-search period, they gather in a particular solution space. Therefore, to effectively explore the optimal value in the latter-search stage, the whales are first updated through the encircling prey and exploration phases. Then, these two updated whale locations are used to figure out the best solution using the adaptive Taguchi-based parameter exploration (ATPE) method. Tsai et al.17,27 and Chou et al. 28 introduced the Taguchi method into a genetic algorithm (GA) and PSO, proposing Hybrid Taguchi GA (HTGA), and Hybrid Taguchi PSO (HTPSO), respectively. From their results, the Taguchi method can assist with obtaining optimal performance in both GA and PSO. To find the most suitable model for the synchronization error of the tool machine, this study first collected data on the synchronization error of rigid tapping in the tool machine and then used the proposed RWOA to explore the model’s hyperparameters. Based on the experimental results, the proposed RWOA can be used to search for an effective model.
This paper is arranged as follows. The next section describes the problem. The third section describes the proposed method of this study. The fourth section presents the experimental results, while the conclusion is presented in Section 5.
Problem description
Machine tools are used as power devices to assist in processing workpieces. From 3C electronics to the mold industry, machine tools are required to assist in the machining of internal threads, and doing so effectively is a critical process for manufacturing mechanical parts. Since threaded holes are generally made in the latter stages of manufacturing processes, the quality and performance of the machine seriously affect the product quality and performance of the part, so equipment manufacturers in related industries require fast and reliable manufacturing of internally threaded holes. Generally speaking, tapping is used to produce internally threaded holes, and can be divided into flex tapping and rigid tapping. The difference between the two forms of tapping lies in the different clamping tooling devices used; therefore, the synchronization requirements between the spindle and tapping axis are different.
Rigid tapping is the primary processing method because the tapping position does not change when tapping is repeated, making it difficult to produce a messy tooth. At the same time, the tapping speed can be taken into account so that the processing time can be significantly reduced. However, because the tool is fixed, the synchronization between the spindle and the tapping axis is more stringent to avoid the tool breaking if care is not taken. If internal threads are made by rigid tapping, it is necessary to pay attention to the synchronization error between the tapping axis and the spindle movement.
In the rigid tapping process, the spindle speed and the tapping axis feed speed need to be regulated and maintained in a specific ratio according to the required intercept distance. In this study, the Yeong Chin Machinery Industries Co. Ltd. NDV series machine tool and the FANUC 31iMA controller are used as the experimental machine (shown in Figure 1). The FANUC controller controls the tapping axis by following the spindle so that the synchronization error of the spindle and the tapping axis can be observed. The phenomenon of the tapping axis following the spindle is well understood; the larger the synchronization error, the higher the risk of machining accuracy, chipping, or tool breakage. Factors that affect the synchronization error include the time constant for acceleration and deceleration in rigid tap, the proportional gain of the rigid tapping speed ring, the motor excitation delay time, the rigid tapping speed loop integral gain, the position feedforward coefficient, and the tapping axis position gain. If these factors can be effectively adjusted, this can improve the quality of rigid tapping by reducing the synchronization error. Therefore, the parameter adjustment technology is crucial, and can enhance the machine tool technology in order to improve the added value of the machine tool industry and help lift the overall technology level of the industry. Therefore, a suitable model is needed to assist before exploring the parameters of the machine tool. If a suitable model can be found beforehand, it can effectively reduce the waste of consumables, so this study will explore this model using artificial neural networks. To find the hyperparameters of the neural-like network so that the model can fit the actual machine, this study will use the proposed RWOA to explore it.

Machine tool equipment used in this study.
Hyperparameter optimization for machine tool model using the proposed WOA
In order to collect data effectively and systematically on the synchronization error of machine tool rigid tapping, a uniform design29–31 was used for data collection. The data collected from the rigid tapping is not time-series, so the model is built using an artificial neural network. For efficient, systematic exploration of hyperparameter combinations for the model, this study will use the proposed RWOA for finding.
WOA was proposed by Mirjalili and Lewis 13 to explore optimal solution combinations in the solution space by mimicking humpback whale predation behavior. Each humpback whale, considered as a search agent, explores the optimal solution using three phases: the encircling prey phase, the exploitation phase (or bubble-net attacking method), and the exploration phase (or search for prey). One improvement in this paper is introducing a nonlinear time-varying inertia weight (NTIW) method so that the update is not fully learned but still retains some influence. The NTIW method updates weights according to the following equation:
where
Since the NTIW method has been introduced, the update functions of the prey-encircling, exploitation, and exploration phases are modified as shown in equations (2)–(4):
where
where
When the whales enter the latter-search period, they gather in a particular solution space. In order to improve stability and accelerate the optimum finding, the other improvement in this study is to adopt adaptive Taguchi-based parameter exploration (ATPE). The ATPE method selects the whales obtained by the encircling prey phase as in equation (2) and obtained by the exploration phase, per equation (4), as the first and second levels in the orthogonal table (OT) constructed to explore the best solution for the combination, with the first-level (
This study uses the two-level OT
(1) Initialization: set the stop condition, the number of whales, the dimension, the boundary of each parameter, the activation point of the ATPE method, and the initial whales’ generation.
(2) Fitness calculation based according to the whales’ parameters.
(3) Activate the ATPE method if it reaches the activation point, that is, the latter-search stage start point; it can assume that 70%, 75%, 80%, 85%, 90%, and 95% of the maximum of the function calls.
(4) If the ATPE method doesn’t activate, then according to p and |A|, whales’ position update based on equations (2), (3), or (4).
(5) If the ATPE activates, a two-level OT is selected, and the parameters are put into this OT based on equations (8) and (9).
(6) Based on Steps (4) or (5), a current best whale is obtained.
(7) If the stop condition is not reached, go to Step (2).
An orthogonal table of

The flowchart of the proposed RWOA.
This study develops a synchronization error model of rigid tapping for a machine tool, applying the proposed RWOA to explore the best combination of hyperparameters for the model via the following steps:
(1) Before experimenting, adjust the tool machine to ensure the dynamic response is good.
(2) Determine the tapping process factors and plan the experiment for data collection. It is known that the time constant for acceleration and deceleration in rigid tap (
(3) Use the artificial neural network to construct the model: The structure of the model defined in this study is shown in Figure 3. It consists of one input layer, two hidden layers (each hidden layer including batch normalization, activation function, and dropout), and one output layer. The explorable hyperparameters include the number of neurons in the hidden layer, the batch size, the maximum number of iterations, the dropout rate, and the learning rate.
(4) Use the proposed RWOA in this study to explore the optimal combination of hyperparameters of the model: The model structure described in Step 3 is used to model the simultaneous errors of rigid tapping, while the robust whale optimization algorithm is used to search for the optimal combination of hyperparameters.

Structure diagram of model constructed with artificial neural network.
Experimental results
Benchmark functions
For initial verification of the effectiveness of the proposed RWOA, the benchmark functions were tested; the functions used are shown in Table 2, where
Benchmark functions tested in this study.
The experimental results for the unimodal, multimodal, and fixed-dimensional multimodal benchmark functions are shown in Tables 3 to 5, respectively. Table 3 shows that the ATPE method does not need to be enabled at
Result of unimodal benchmark functions obtained by the proposed RWOA with different latter-search stage start point.
Result of multimodal benchmark functions obtained by the proposed RWOA with different latter-search stage start point.
Result of fixed-dimensional multimodal benchmark functions obtained by the proposed RWOA with different latter-search stage start point.
Comparison between the best value obtained by the proposed RWOA and the results obtained by WOA in unimodal benchmark functions.
Comparison between the best value obtained by the proposed RWOA and the results obtained by WOA in multimodal benchmark functions.
Comparison between the best value obtained by the proposed RWOA and the results obtained by WOA in fixed-dimensional multimodal benchmark functions.
Table 6 shows that regarding the
Hyperparameter optimization of synchronization error model for machine tool rigid tapping using the proposed RWOA
To construct an effective synchronization error model for the machine tool, this study used the uniform design29–31 to arrange and collect training and testing data; the collected contents were extracted, as shown in Tables 9 and 10.
Training data obtained by the
Testing data obtained by the
Tables 9 and 10 were generated from
In order to build a practical model, an artificial neural network (ANN) was then used to construct the model. The neural layers are defined first for effective exploration of each hyperparameter. The architecture framework of ANN is shown in Figure 3, including an input layer, two hidden layers, and an output layer, where the activation function is the sigmoid function, and the optimizer is Adam; in addition, the hyperparameter that must be tuned includes the number of neurons in the first hidden layer (the range is 10–100), the number of neurons in the second one (half of the first ones), the batch size (2, 4, 8, 16, and 32), the iterations (100–500), the dropout ratio (0–0.9), and the learning ratio (10−4–0.1). Because multiple attempts can obtain the hyperparameter combination, this study used the proposed RWOA to search for the best combination and figure out the best model. The parameters of the proposed RWOA are set as follows: the number of whales is 15, and the maximum function call value is 300.
From the hyperparameters explored by the proposed RWOA, the hyperparameter combination for the model is (35, 16, 141, 0.3, and 0.0788). The training data’s average MAPE (mean absolute percentage error) is 6.2454% with an SD of 0.5283%. The average MAPE of the testing data is 9.3501% with an SD of 0.9253% for the 30 times of modeling using this hyperparameter. For the best model from the 30 times, the MAPEs for training and testing data were 6.8384% and 6.7372%, respectively. To understand the difference between the model and practical machine tools, this study used
Validation results between predictive model and the machine tool by using the
Conclusion
This paper used the proposed RWOA method to explore the hyperparameters combination for machine tool synchronization error. Compared to WOA, the proposed RWOA has two improved strategies. The first improvement is integrating the NTIW method into the proposed RWOA by retaining the influence of the current or randomly selected whale appropriately without thoroughly learning them. Since the WOA concentrates on a specific solution space in the latter-search stage of the algorithm process, this study proposed the second improvement by using the ATPE method in the latter-search stage of the algorithm’s strategy to explore the suitable solution effectively. In the latter-search stage, the ATPE method can accelerate to search for the solution by using the Taguchi method. From the result of the benchmark functions, the performance obtained by the proposed RWOA is significantly improved than WOA. From the t-distribution test, the benchmark functions tested in this study, the results obtained by the proposed RWOA in most of them have significant performance, receive better fitness values, and are robust. To model for synchronization error of the machine tool rigid tapping, the results of the best hyperparameter combination show that the proposed RWOA method is more effective and systematic than the randomized exploration (manual adjustment) method and could obtain excellent model results. Based on the best hyperparameter combination for the model, the MAPEs in the training and testing data were 6.8384% and 6.7372%, respectively, indicating an excellent hyperparameter combination for the model obtained by the proposed RWOA. In addition, to verify the model’s practicality, this study compared the predicted value obtained by the model to the data obtained from the machine tool, and the MAPE is 6.1723%. Thus, it can be seen that the model built by this study can predict synchronization errors effectively. However, this study only discussed a synchronization error model for machine tools, but the machining time is also one of the critical observations. If the machining time can be considered and modeled simultaneously, the cost of processing can be estimated effectively and efficiently. The above discussion shows that the proposed RWOA method can improve performance and search for solutions effectively and efficiently.
Footnotes
Handling Editor: Chenhui Liang
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported in part by the Ministry of Science and Technology, Taiwan, R.O.C., under Grant Numbers MOST 110-2221-E-153-010 and MOST 111-2221-E-153-006.
