# A Divide-and-Conquer Bat Algorithm with Direction of Mean Best Position for Optimization of Cutting Parameters in CNC Turnings

Authors: Xingwang Huang; Zongbao He; Yong Chen; Shutong Xie
Journal: Computational Intelligence and Neuroscience
 (2022)

---

## Abstract

Optimization of machining parameters is an important problem in the modern manufacturing world due to production efficiency and economics. This problem is well known to be complex and is regarded as a strongly nondeterministic polynomial (NP)-hard problem. To reduce the production cost of work-pieces in computer numerical control (CNC) machining, a novel optimization algorithm based on a combination of the bat algorithm and a divide-and-conquer strategy is proposed. First, the basic bat algorithm (BA) is modified with the aim to avoid finding the local optimal solution. In addition, a Gaussian quantum bat algorithm with direction of mean best position is developed. Second, in order to reduce the complexity of the optimization problem, the whole optimization problem is divided into several subproblems by using a divide-and-conquer strategy according to the characteristic of multipass turning operations. Finally, under a large number of machining constraints, the cutting parameters of the two stages of roughing and finishing are simultaneously optimized. Simulation results show that the proposed algorithm can find better combinations of the machining parameters than other algorithms proposed previously to further reduce the production cost. In addition, the outcome of our work presents a novel way to solve the complex optimization problem of machining parameters with a combination of traditional mathematical methods and swarm intelligence algorithms.


---

## Body

## 1. Introduction

In the manufacturing field, computer numerical control (CNC) machining refers to the computerized digital control of automated machine tools used to process rough material into semifinished or finished parts; it is one of the most common technologies. The main purpose of CNC machining is to save machining costs and improve machining efficiency and machining quality. Machining costs can be saved by selecting reasonable machining parameters, which introduces an optimization problem, i.e., selecting the optimal machining parameters to achieve the goal of reducing machining costs under the given machining constraints. Earlier research on the optimization of machining parameters mainly used traditional mathematical processing methods such as dynamic programming, sequential unconstrained minimization technique (SUMT), and linear or nonlinear programming. However, in general, the optimization problems of machining parameters are nonlinear and complicated problems with multiple constraints. Therefore, it is difficult to obtain satisfactory optimization solutions using traditional methods [1, 2]. In recent years, many scholars have applied swarm intelligence algorithms to the optimization problems of machining parameters in the field of computer integrated manufacturing. By using swarm intelligence algorithms to search for approximate optimal solutions of the problem, some research results have been achieved [3–16].However, most previous studies were devoted to combining swarm intelligence algorithms with various local improvement algorithms [3–11, 17] (e.g., population diversification, local greedy search, and the use of heuristics as local search) in the hope of obtaining better results. However, because they did not fully consider the characteristics of the turning problem with multiple machining processes, the results obtained by the algorithms were similar, and it was difficult to significantly reduce the machining cost. To address this bottleneck, this paper proposes a novel optimization algorithm by fully considering the characteristics of the turning problem while effectively exploiting the global optimization performance of the swarm intelligence algorithm. By combining the improved bat algorithm with the divide-and-conquer strategy, the performance of the optimization algorithm is substantially improved. The final optimization algorithm is able to find better results.The rest of this paper is organized as follows. Section2 represents the related works, especially the intelligent algorithms for optimization problems in CNC turning. Section 3 describes the mathematical model for the optimization of machining parameters in CNC turnings. Section 4 first introduces the bat algorithm, then proposes the Gaussian quantum bat algorithm with direction of mean best position (GQMBA), and finally elaborates on the idea of the combination of GQMBA and the divide-and-conquer strategy for solving the machining parameter optimization problems. In Section 5, simulation experiments are conducted, and different algorithms are compared. Finally, the concluding comments and some future research directions are presented in the last section.


## 2. Related Works

Optimization of turning parameters is an important issue in the manufacturing field. Early studies used traditional mathematical methods to find optimized machining parameters. Metaheuristic algorithms are also used to solve optimization problems of machining parameters. Chen and Tsai first proposed a mathematical model for the optimization problem of machining parameters in turnings and then combined Hooke-Jeeves pattern search (PS) into the simulated annealing (SA) algorithm to form a hybrid optimization algorithm (SA/PS) to solve the optimization problem [3]. Onwubolu and Kumalo [4] proposed a genetic algorithm (GA) to optimize the machining parameters in turnings but did not consider the constraint that the number of rough passes must be an integer. Chen and Chen [5] pointed out this shortcoming in the research of Onwubolu and Kumalo [4]. However, the optimization results obtained by the GA corrected by Chen and Chen were not better than those obtained by SA/PS. Additionally, based on a GA, Sankar [6] used a modified genetic algorithm (MGA) to search for optimized cutting parameters in turnings. The improved MGA used a specific crossover operator and three different mutation operators to enhance the diversity of the population and prevent the algorithm from converging to a local optimal solution. In addition to SA and GA, some studies applied other intelligent algorithms to the optimization problem of machining parameters. Vijayakumar [7], Wang [8], and Xie and Guo [16] developed new heuristic algorithms to overcome optimization problems based on the ant colony optimization (ACO) algorithm. In addition, the particle swarm optimization algorithm (PSO) is also one of the most widely used swarm intelligence methods [18]. Srinivas et al. proposed a PSO algorithm where the inertia coefficient decreased linearly with every iteration to solve the cutting parameter optimization problem [9]. Yildiz [10] and Costa et al. [12] also contributed different solutions based on the PSO algorithm to the problem. After comprehensive analysis of the previous research methods and results, Raja and Baskar [11] applied three optimization algorithms (SA, GA, and PSO) to three different machining parameter optimization models (single-pass turning, multipass turning, and surface grinding) to conduct experiments and compare the results of various types of intelligent optimization algorithms to the machining parameter optimization problem. The results showed that the optimization effect and computational efficiency of PSO are better than those of SA and GA. Scatter search (SS) is one of the optimization algorithms developed in the field of metaheuristics. Chen [19] focused on the application of the scatter search method in solving the optimization problem in turnings. By comparing it with other algorithms, the experimental results showed that the SS obtained superior machining parameters than some of the metaheuristic methods.In recent years, in addition to the abovementioned classical intelligent algorithms, some new swarm intelligent algorithms have been proposed by researchers. Xu et al. proposed an improved flower pollination algorithm (FPA) and compared the obtained results with those of related studies [20]. Mellal and Williams used the cuckoo optimization algorithm (COA), one of the advanced bioinspired optimization algorithms, to minimize the unit production cost [21]. The experimental results showed that the COA algorithm is very competitive compared with other algorithms. Due to the successful application of swarm intelligence algorithms for optimization problems, Sofuoğlu et al. used three heuristic algorithms, GA, PSO and COA, to solve three different problems, which were more efficient and effective than other algorithms [22]. Similarly, Yildiz developed a new hybrid optimization algorithm to minimize the production cost by adding the Taguchi method that actively acted on the differential evolution algorithm to form a hybrid Taguchi-differential evolution algorithm (HRDE) [23]. The results showed that the hybrid algorithm was more effective than evolutionary algorithms presented in many related studies. In another work by Yildiz, he proposed a similar hybrid optimization method to determine the optimal machining parameters [24]. This method combined the differential evolution algorithm and receptor editing algorithm (DERE). The goal of the mathematical model was to determine the optimal machining parameters to reduce the unit production cost. The method has been experimentally proven to be an effective technique for optimizing machining parameters. Furthermore, in 2013, Yildiz proposed a parameter optimization method based on the artificial bee colony (ABC) algorithm [25] and a hybrid robust teaching-learning-based optimization algorithm (HRTLBO) based on the combination of guided learning optimization and the Taguchi method [26]. Compared with other methods, these proposed algorithms perform well, and better solutions can be found with them. Belloufi et al. provided specific application examples to illustrate the effectiveness of the proposed firefly algorithm (FA) for parameter optimization in multipass turnings [27].


## 3. Mathematical Model for Optimizing Machining Parameters in CNC Turnings

To optimize the machining parameters in multipass turnings, the mathematical model proposed in the literature [3, 20] takes a large number of actual machining constraints into account and is closer to real-world machining. Since the model has been cited in many studies, the optimization model is used in this paper. The cutting parameters to be optimized include rough cutting speed Vr, rough feeding rate fr, rough depth of cut dr, the number of rough cuts n, finish cutting speed Vs, finish feeding rate fs, and finish depth of cut ds. The unit production cost (UC) consists of the following four components:(1)
Machining cost during real cutting timeCM(2)
Machine idle cost for setup operations and tool idling motionCI(3)
Cost of tool replacementCR(4)
Tool costCTThus, the UC can be expressed as follows:(1)UC=CM+CI+CR+CT,=πDL1000Vrfrdt−dsdr+πDL1000Vsfsk0,+tc+h1L+h2dt−dsdr+1k0,+πDL1000Vrfrdt−dsdr+πDL1000VsfsteTpk0,+πDL1000Vrfrdt−dsdr+πDL1000VsfsktTp.where k0 is the sum of worker cost and management cost per unit time ($/min). D and L are the diameter and length of the work-piece (mm), respectively. dt is the depth of material to be removed (mm). h1, h2 are the constants related to tool idle time and tool-in/out time, respectively. tc, te are the preparation time for loading and unloading time (min) and time required to exchange a tool (min), respectively. Tp is the tool life (min). kt is the cutting edge cost ($/edge).The number of the rough cut is as follows:(2)n=dt−dsdr,n∈z+.The objective of the model is to minimize the UC (Vr, Vs, fr, fs, dr, ds, n) under many machining constraints on rough and finish turnings. The constraints are summarized as follows [3–8]:(1)
The upper and lower constraints ofVr, Vs, fr, fs, dr, and ds(2)
Tool life constraints(3)
Cutting force, cutting power, and surface roughness constraint(4)
Stable cutting region constraint; chip-tool interface temperature constraint(5)
Constraints on the interconnection between roughing and finishing parameters


## 4. Optimization Algorithm Based on the Bat Algorithm and the Divide-and-Conquer Strategy

### 4.1. Overview of the Bat Algorithm

The bat algorithm (BA) [28] is a swarm intelligence search algorithm proposed to simulate the echolocation mechanism of bats when foraging. It achieves the localization of search targets by continuously adjusting the frequency and loudness of sound waves. It uses frequency tuning to increase the population diversity and uses automatic scaling to maintain a balance between global and local searches. The frequency, velocity, and position of the i-th bat in the bat population are represented as follows:(3)fi=fmin+fmax−fminβ,vit=vit−1+vit−gbtfi,xit=xit−1+vit.Here,fi denotes the ultrasound frequency emitted by the i-th bat. fmax and fmin denote the upper and lower bounds of ultrasound frequency, respectively. β denotes a random number generated by a uniform distribution within the range of [0,1]. vtt and vtt−1 denote the velocity of the i-th bat during the t-th and (t−1)-th iterations, respectively. xit and xit−1 denote the position value of the i-th bat during the t-th and (t−1)-th iterations, respectively. The above expressions ensure the global search capability of the algorithm.In the local search phase, BA uses a random walk strategy to generate feasible solutions at candidate locations. This strategy can be given by the following equation:(4)xnew=xold+εA¯t.where ε is the random number generated by the uniform distribution on the range [−1, 1] that determines the direction of the new candidate feasible solution and ‾At denotes the average acoustic loudness of all bats in the t-th iteration.During the foraging process, as the bat approaches the foraging target, the bat will gradually adjust the loudnessA and emission rate r of the ultrasound, making the loudness gradually decrease and the emission rate gradually increase to achieve more accurate positioning. The process is shown in the following equations:(5)Ait=αAit−1.(6)rit=ri01−exp−γt.In formula (6),ri0 denotes the initial pulse emission rate of the i-th bat, and both α and γ are constants between (0, 1).


### 4.2. Overview of the Quantum-Behaved Bat Algorithm with Mean Best Position Directed

Due to the lack of population diversity in the original BA, there is the problem of falling into local optima during the search. By analyzing the flight trajectory of bats, Zhu et al. proposed the quantum-behaved bat algorithm with mean best position directed (QMBA) [29]. The quantum computing mutation operator introduced by the algorithm can enhance population diversity and avoid premature convergence. At the same time, its average optimal position introduced in the local search phase can improve the convergence speed in the later stage of the search. The QMBA still retains the main body of the BA, which controls the global search and local search based on the ultrasonic loudness and the sending rate. The difference lies in its improved position update formula and local search strategy.The position update formula in QMBA introduces a mechanism for adaptively adjusting the step size according to the distance. Its strategy for updating the position is expressed as follows:(7)xidt=xidt−1+gbd−xidt−1η,δd>THxidt−1+ϵ,δd≤TH,where η is the random number generated through the uniform distribution probability function between [0,1]. δd represents the distance between the d-th dimensional value of the current global optimum position and the d-th dimensional value of the i-th bat, which is mathematically expressed as follows:(8)δd=gbd−xidt−1.Whenδd is less than a given threshold TH, the i-th bat can fly for food at will; when the value of δd is greater than a given threshold TH, the i-th bat flies toward the current global optimal position. This strategy ensures the global search ability of the bat population to fly toward food.In the local search process, QMBA no longer uses the random walk search strategy but decides the selection of the mutation strategy based on the mutation probabilitypm.The first mutation strategy is to use the quantum computing mutation operator, which is expressed as follows:(9)xidt=gbdt+μ×mbestd−xidt×ln1/U,rand<0.5gbdt−μ×mbestd−xidt×ln1/U,rand≥0.5,where both U and rand are the random numbers generated by the uniform distribution probability function between [0,1]. μ is an adaptive linearly decreasing weighting factor that can be expressed as follows:(10)μ=μmax−tμmax−μmintmax.where μmax and μmin denote the initial and final values of μ, respectively.mbest represents the average of the current optimal position of all bats during the t-th iteration, i.e., the average optimal position, which can be obtained from the following equation:(11)mbest=1M∑i=1MPi1t,∑i=1MPi2t,⋯,∑i=1MPiDt,where Pit denotes the current optimal position of the i-th bat, M denotes the population size, and D denotes the dimension of the problem.The second mutation strategy, which also introduces the average optimal position into the mutation operator, is expressed as follows:(12)xit=xit−1+mbest−xit−1ϕ,where ϕ denotes the random number generated by a uniform distribution between [0,1].Both mutation strategies introduce the average optimal position to guide the local search, which can improve the accuracy of the search and speed up the convergence of the algorithm due to the use of statistical information of bat positions.


### 4.3. Gaussian Quantum Bat Algorithm with Direction of Mean Best Position

The QMBA algorithm improves the global search capability and accuracy of the algorithm by introducing the mechanism of the distance adaptive adjustment step, quantum computing mutation operator, and average optimal position-oriented mechanism on the basis of BA. However, the probability density functions used to generate the random numbers in QMBA are all uniformly distributed. Several works [30, 31] have shown that long-tailed distributions such as Gaussian distributions are able to perform more accurate searches in the region near the previous generation of individuals, improving the local search capability while providing larger search steps and random walk distances. Expanding the search space can improve the ability of the algorithm to jump out of the local optimum. Based on the above findings, this paper proposes the Gaussian quantum bat algorithm with direction of mean best position (GQMBA) for quantum behavior bats using a Gaussian distribution [32].In GQMBA, random numbers are no longer generated by the uniformly distributed probability density function. To meet the requirements of the quantum computing mutation operator for random numbers in QMBA, we use the absolute value of the Gaussian distribution probability density function, in which the mean is zero and the variance is one instead (i.e., normal distribution). The one-dimensional probability density function of abs(N(0, 1)) is expressed as follows:(13)qx=22πexp−x22,x≥0,GQMBA modifies the three formulas in QMBA accordingly. First, the parameterη in (14) is changed to be generated with a Gaussian distribution, and (7) is modified in GQMBA as follows:(14)xidt=xidt−1+gbd−xidt−1G,δd>THxidt−1+ϵ,δd≤TH,where G = abs(N(0,1)).Similarly, substituting for the parameterU in (9), the modified quantum computing mutation operator is expressed as follows:(15)xidt=gbdt+μ×mbestd−xidt×ln1/G,rand<0.5gbdt−μ×mbestd−xidt×ln1/G,rand≥0.5.Sinceq(0) = 0, G = abs(N(0,1)) satisfies the domain of definition of the function ln().Finally, the random numberϕ in (12) is replaced with (16) as follows:(16)xit=xit−1+mbest−xit−1G.The pseudocode of GQMBA is given by Figure1, in which Np denotes the total number of bats.Figure 1
Pseudocode of GQMBA.Our first significant contribution is that the Gaussian distribution is introduced in QMBA to generate random numbers. The theoretical analysis above shows that the strategy can enhance the ability of the algorithm to jump out of the local optimum and avoid premature convergence. Therefore, it is applied to the optimization problem of the cutting parameter in this paper.


### 4.4. Divide-and-Conquer Strategy for the Optimization Problem in Multipass Turnings

To improve the performance of the algorithm, the idea of the divide-and-conquer strategy is used to decompose the original problem into several subproblems, which can reduce the complexity of the original optimization problem. For each subproblem, the number of rough cuts is a fixed value. By conquering the subproblems one by one, the whole optimization problem can be solved. In addition, we calculate the theoretical lower bound on UC for each subproblem. Modified BA is first used to search for the optimal solution in the case of the minimum theoretical lower bound on UC, thus hopefully reducing the enumeration of the subproblems. The divide-and-conquer strategy is depicted in Figure2 and described as follows:(1)
Divide the optimization problem intom subproblems based on the number of possible combinations of rough cuts.(2)
Calculate the theoretical lower bound on UC for each subproblemUCiL.(3)
Sort theoretical lower boundUCiL for all subproblems in ascending order. UC1L ≤ UC2L, ..., ≤ UCmL are called the first theoretical lower bound, the second theoretical lower bound ..., the m-th theoretical lower bound, and the corresponding numbers of rough cuts N1, N2, …, Nm (Ni is the number of rough cuts corresponding to UCiL) [16].(4)
Starting from subproblemi, BA is used to solve subproblem i, and the optimal solution, UCiO, is obtained.(5)
If all subproblems are enumerated or theUCiO found is less than the theoretical lower bound of subsequent subproblems UC(i  + 1)L, the method terminates and the optimal solution is output.Figure 2
Flow chart of the divide-and-conquer strategy.


### 4.5. The Framework of the Proposed Algorithm Based on GQMBA and the Divide-and-Conquer Strategy

By dividing the complicated multipass turning optimization problem into simple subproblems, the optimization problem can be solved by solving these subproblems one by one. The framework of the optimization algorithm based on GQMBA and the divide-and-conquer strategy (referred to as the GQMBA-DC algorithm) is shown in Figure3, and the main steps are as follows:(1)
Divide the optimization problem inton subproblems based on the number of possible combinations of rough cuts.(2)
Leti = i + 1; set the number of rough cuts n = Ni; and start the search in the i-th subproblem.(3)
Initialize the population, develop appropriate encoding and decoding strategies for each subproblem for GQMBA, and set the current iteration numbert = 1.(4)
Initialize the parameters and set the ultrasonic frequencyfi, ultrasonic emission rate ri, and ultrasonic loudness Ai.(5)
The global search and local search are controlled by continuously adjusting the acoustic frequency and loudness to update the speed and position to generate new solutions. For the GQMBA-DC, the main body of the BA is retained, but the position update formula and the local search strategy are different. The position update formula introduces a mechanism for adaptively adjusting the step size according to the distance, while the local search strategy also introduces the average optimal position to guide the local search.(6)
IfAi is greater than the random value rand and the current solution is the optimal solution, perform the next step; otherwise, return to step (5).(7)
Accepting the new solution increasesri and decreases Ai (as a bat gets closer to the target, the two values change to achieve more accurate localization).(8)
Repeat the above steps until the maximum number of iterations is reached, and the GQMBA stops.(9)
At present, the optimal solution of thei-th subproblem is obtained.(10)
IfMin(UC1O..., UCiO) ≤ U(i+1)L or i = m, then execute the next step. Otherwise, return to step (2) to start the process of solving the next subproblem.(11)
Select the minimum solution, which is the best optimal solution, from the obtained optimized solutions. Finally, output the global optimal solutionUCo = Min(UC1O.…, UCiO), and terminate the algorithm.Figure 3
The framework of the proposed algorithm (GQMBA-DC) based on GQMBA with a divide-and-conquer strategy.


### 4.6. Handling of Constraints

The processing of constraints is very important for the swarm intelligence optimization algorithm; constraint processing by adding a penalty function is one of the common methods in optimization algorithms. The penalty function is a kind of constraint function. In the process of finding the optimal solution of the algorithm, the objective function is calculated by combining the penalty function, which can gradually eliminate solutions that do not satisfy the constraints and retain solutions that satisfy the constraints.For the handling of constraints in the optimization algorithm, the bats (individuals) that violate the constraints are penalized using a penalty function to reduce the value of the objective. Different levels of penalties are imposed for different constraint violations. The more constraints that are violated, the heavier the penalty will be. Thus, by using a reasonable penalty function, the objective function value can converge to the direction of the optimal solution. The penalty function is expressed as(17)penaltyX=∑i=1kai+hi,whereai=0,satisfy constraints1,violate constraints,where k is the number of constraints and hi is a nondimensional constraint violation.


## 4.1. Overview of the Bat Algorithm

The bat algorithm (BA) [28] is a swarm intelligence search algorithm proposed to simulate the echolocation mechanism of bats when foraging. It achieves the localization of search targets by continuously adjusting the frequency and loudness of sound waves. It uses frequency tuning to increase the population diversity and uses automatic scaling to maintain a balance between global and local searches. The frequency, velocity, and position of the i-th bat in the bat population are represented as follows:(3)fi=fmin+fmax−fminβ,vit=vit−1+vit−gbtfi,xit=xit−1+vit.Here,fi denotes the ultrasound frequency emitted by the i-th bat. fmax and fmin denote the upper and lower bounds of ultrasound frequency, respectively. β denotes a random number generated by a uniform distribution within the range of [0,1]. vtt and vtt−1 denote the velocity of the i-th bat during the t-th and (t−1)-th iterations, respectively. xit and xit−1 denote the position value of the i-th bat during the t-th and (t−1)-th iterations, respectively. The above expressions ensure the global search capability of the algorithm.In the local search phase, BA uses a random walk strategy to generate feasible solutions at candidate locations. This strategy can be given by the following equation:(4)xnew=xold+εA¯t.where ε is the random number generated by the uniform distribution on the range [−1, 1] that determines the direction of the new candidate feasible solution and ‾At denotes the average acoustic loudness of all bats in the t-th iteration.During the foraging process, as the bat approaches the foraging target, the bat will gradually adjust the loudnessA and emission rate r of the ultrasound, making the loudness gradually decrease and the emission rate gradually increase to achieve more accurate positioning. The process is shown in the following equations:(5)Ait=αAit−1.(6)rit=ri01−exp−γt.In formula (6),ri0 denotes the initial pulse emission rate of the i-th bat, and both α and γ are constants between (0, 1).


## 4.2. Overview of the Quantum-Behaved Bat Algorithm with Mean Best Position Directed

Due to the lack of population diversity in the original BA, there is the problem of falling into local optima during the search. By analyzing the flight trajectory of bats, Zhu et al. proposed the quantum-behaved bat algorithm with mean best position directed (QMBA) [29]. The quantum computing mutation operator introduced by the algorithm can enhance population diversity and avoid premature convergence. At the same time, its average optimal position introduced in the local search phase can improve the convergence speed in the later stage of the search. The QMBA still retains the main body of the BA, which controls the global search and local search based on the ultrasonic loudness and the sending rate. The difference lies in its improved position update formula and local search strategy.The position update formula in QMBA introduces a mechanism for adaptively adjusting the step size according to the distance. Its strategy for updating the position is expressed as follows:(7)xidt=xidt−1+gbd−xidt−1η,δd>THxidt−1+ϵ,δd≤TH,where η is the random number generated through the uniform distribution probability function between [0,1]. δd represents the distance between the d-th dimensional value of the current global optimum position and the d-th dimensional value of the i-th bat, which is mathematically expressed as follows:(8)δd=gbd−xidt−1.Whenδd is less than a given threshold TH, the i-th bat can fly for food at will; when the value of δd is greater than a given threshold TH, the i-th bat flies toward the current global optimal position. This strategy ensures the global search ability of the bat population to fly toward food.In the local search process, QMBA no longer uses the random walk search strategy but decides the selection of the mutation strategy based on the mutation probabilitypm.The first mutation strategy is to use the quantum computing mutation operator, which is expressed as follows:(9)xidt=gbdt+μ×mbestd−xidt×ln1/U,rand<0.5gbdt−μ×mbestd−xidt×ln1/U,rand≥0.5,where both U and rand are the random numbers generated by the uniform distribution probability function between [0,1]. μ is an adaptive linearly decreasing weighting factor that can be expressed as follows:(10)μ=μmax−tμmax−μmintmax.where μmax and μmin denote the initial and final values of μ, respectively.mbest represents the average of the current optimal position of all bats during the t-th iteration, i.e., the average optimal position, which can be obtained from the following equation:(11)mbest=1M∑i=1MPi1t,∑i=1MPi2t,⋯,∑i=1MPiDt,where Pit denotes the current optimal position of the i-th bat, M denotes the population size, and D denotes the dimension of the problem.The second mutation strategy, which also introduces the average optimal position into the mutation operator, is expressed as follows:(12)xit=xit−1+mbest−xit−1ϕ,where ϕ denotes the random number generated by a uniform distribution between [0,1].Both mutation strategies introduce the average optimal position to guide the local search, which can improve the accuracy of the search and speed up the convergence of the algorithm due to the use of statistical information of bat positions.


## 4.3. Gaussian Quantum Bat Algorithm with Direction of Mean Best Position

The QMBA algorithm improves the global search capability and accuracy of the algorithm by introducing the mechanism of the distance adaptive adjustment step, quantum computing mutation operator, and average optimal position-oriented mechanism on the basis of BA. However, the probability density functions used to generate the random numbers in QMBA are all uniformly distributed. Several works [30, 31] have shown that long-tailed distributions such as Gaussian distributions are able to perform more accurate searches in the region near the previous generation of individuals, improving the local search capability while providing larger search steps and random walk distances. Expanding the search space can improve the ability of the algorithm to jump out of the local optimum. Based on the above findings, this paper proposes the Gaussian quantum bat algorithm with direction of mean best position (GQMBA) for quantum behavior bats using a Gaussian distribution [32].In GQMBA, random numbers are no longer generated by the uniformly distributed probability density function. To meet the requirements of the quantum computing mutation operator for random numbers in QMBA, we use the absolute value of the Gaussian distribution probability density function, in which the mean is zero and the variance is one instead (i.e., normal distribution). The one-dimensional probability density function of abs(N(0, 1)) is expressed as follows:(13)qx=22πexp−x22,x≥0,GQMBA modifies the three formulas in QMBA accordingly. First, the parameterη in (14) is changed to be generated with a Gaussian distribution, and (7) is modified in GQMBA as follows:(14)xidt=xidt−1+gbd−xidt−1G,δd>THxidt−1+ϵ,δd≤TH,where G = abs(N(0,1)).Similarly, substituting for the parameterU in (9), the modified quantum computing mutation operator is expressed as follows:(15)xidt=gbdt+μ×mbestd−xidt×ln1/G,rand<0.5gbdt−μ×mbestd−xidt×ln1/G,rand≥0.5.Sinceq(0) = 0, G = abs(N(0,1)) satisfies the domain of definition of the function ln().Finally, the random numberϕ in (12) is replaced with (16) as follows:(16)xit=xit−1+mbest−xit−1G.The pseudocode of GQMBA is given by Figure1, in which Np denotes the total number of bats.Figure 1
Pseudocode of GQMBA.Our first significant contribution is that the Gaussian distribution is introduced in QMBA to generate random numbers. The theoretical analysis above shows that the strategy can enhance the ability of the algorithm to jump out of the local optimum and avoid premature convergence. Therefore, it is applied to the optimization problem of the cutting parameter in this paper.


## 4.4. Divide-and-Conquer Strategy for the Optimization Problem in Multipass Turnings

To improve the performance of the algorithm, the idea of the divide-and-conquer strategy is used to decompose the original problem into several subproblems, which can reduce the complexity of the original optimization problem. For each subproblem, the number of rough cuts is a fixed value. By conquering the subproblems one by one, the whole optimization problem can be solved. In addition, we calculate the theoretical lower bound on UC for each subproblem. Modified BA is first used to search for the optimal solution in the case of the minimum theoretical lower bound on UC, thus hopefully reducing the enumeration of the subproblems. The divide-and-conquer strategy is depicted in Figure2 and described as follows:(1)
Divide the optimization problem intom subproblems based on the number of possible combinations of rough cuts.(2)
Calculate the theoretical lower bound on UC for each subproblemUCiL.(3)
Sort theoretical lower boundUCiL for all subproblems in ascending order. UC1L ≤ UC2L, ..., ≤ UCmL are called the first theoretical lower bound, the second theoretical lower bound ..., the m-th theoretical lower bound, and the corresponding numbers of rough cuts N1, N2, …, Nm (Ni is the number of rough cuts corresponding to UCiL) [16].(4)
Starting from subproblemi, BA is used to solve subproblem i, and the optimal solution, UCiO, is obtained.(5)
If all subproblems are enumerated or theUCiO found is less than the theoretical lower bound of subsequent subproblems UC(i  + 1)L, the method terminates and the optimal solution is output.Figure 2
Flow chart of the divide-and-conquer strategy.


## 4.5. The Framework of the Proposed Algorithm Based on GQMBA and the Divide-and-Conquer Strategy

By dividing the complicated multipass turning optimization problem into simple subproblems, the optimization problem can be solved by solving these subproblems one by one. The framework of the optimization algorithm based on GQMBA and the divide-and-conquer strategy (referred to as the GQMBA-DC algorithm) is shown in Figure3, and the main steps are as follows:(1)
Divide the optimization problem inton subproblems based on the number of possible combinations of rough cuts.(2)
Leti = i + 1; set the number of rough cuts n = Ni; and start the search in the i-th subproblem.(3)
Initialize the population, develop appropriate encoding and decoding strategies for each subproblem for GQMBA, and set the current iteration numbert = 1.(4)
Initialize the parameters and set the ultrasonic frequencyfi, ultrasonic emission rate ri, and ultrasonic loudness Ai.(5)
The global search and local search are controlled by continuously adjusting the acoustic frequency and loudness to update the speed and position to generate new solutions. For the GQMBA-DC, the main body of the BA is retained, but the position update formula and the local search strategy are different. The position update formula introduces a mechanism for adaptively adjusting the step size according to the distance, while the local search strategy also introduces the average optimal position to guide the local search.(6)
IfAi is greater than the random value rand and the current solution is the optimal solution, perform the next step; otherwise, return to step (5).(7)
Accepting the new solution increasesri and decreases Ai (as a bat gets closer to the target, the two values change to achieve more accurate localization).(8)
Repeat the above steps until the maximum number of iterations is reached, and the GQMBA stops.(9)
At present, the optimal solution of thei-th subproblem is obtained.(10)
IfMin(UC1O..., UCiO) ≤ U(i+1)L or i = m, then execute the next step. Otherwise, return to step (2) to start the process of solving the next subproblem.(11)
Select the minimum solution, which is the best optimal solution, from the obtained optimized solutions. Finally, output the global optimal solutionUCo = Min(UC1O.…, UCiO), and terminate the algorithm.Figure 3
The framework of the proposed algorithm (GQMBA-DC) based on GQMBA with a divide-and-conquer strategy.


## 4.6. Handling of Constraints

The processing of constraints is very important for the swarm intelligence optimization algorithm; constraint processing by adding a penalty function is one of the common methods in optimization algorithms. The penalty function is a kind of constraint function. In the process of finding the optimal solution of the algorithm, the objective function is calculated by combining the penalty function, which can gradually eliminate solutions that do not satisfy the constraints and retain solutions that satisfy the constraints.For the handling of constraints in the optimization algorithm, the bats (individuals) that violate the constraints are penalized using a penalty function to reduce the value of the objective. Different levels of penalties are imposed for different constraint violations. The more constraints that are violated, the heavier the penalty will be. Thus, by using a reasonable penalty function, the objective function value can converge to the direction of the optimal solution. The penalty function is expressed as(17)penaltyX=∑i=1kai+hi,whereai=0,satisfy constraints1,violate constraints,where k is the number of constraints and hi is a nondimensional constraint violation.


## 5. Simulation Experiments

During the machining processes, a cut tool is used for both roughing cuts and finishing cuts. Due to different machining conditions, the tool wear rates for rough and finish turnings are usually different. The tool life equation can be expressed as follows:Tp = θTr + (1 − θ)Ts. Some studies use another tool life calculation formula: Tp = Tr + Ts. Therefore, this paper separately compares the performance of the algorithms under different tool life formulations. The algorithm in this paper is implemented in the MATLAB programming language. The parameters of the BA are set as follows:Population size: 200Maximum number of iterations: 400Initial loudness:A = u(0, 1)Initial pulse emission rate:r0 = 0.001Loudness update:α = 0.9Emission rate update:γ = 0.9Threshold:TH = 0.005Mutation probability:Pm = 0.01Machining examples from the literature [3–8] were used to test the performance of the optimization algorithm with the specific parameters shown in Table 1. Additionally, two different machining optimization problems with cutting depths of 6 mm and 8 mm were tested.Table 1
Condition parameters for turning examples.
D  = 50 mmL  = 300 mmdt  = 6 mmVrL  = 50 m/minfrL  = 0.1 mm/revdrL  = 1 mmVrU  = 500 m/minfrU  = 0.9 mm/revdrU  = 3 mmVsL  = 50 m/minfsL  = 0.1 mm/revdsL  = 1 mmVsU  = 500 m/minfsU  = 0.9 mm/revdsU  = 3 mmp  = 5q  = 1.75r  = 0.75μ  = 0.75ν  = 0.95η  = 0.85λ  = 2υ  = –1τ  = 0.4ϕ  = 0.2δ  = 0.105R  = 1.2 mmC0  = 6×1011TL  = 25 minTU  = 45 minFU  = 200 kgfPU  = 5 kWSC  = 140QU  = 1000 °CSRU  = 10 µmh1  = 7×10−4h2  = 0.3te  = 1.5 min/edgetc  = 0.75 min/piecekt  = 2.5 $/edgek0  = 0.5 $/mink1  = 108k2  = 132k3  = 1k4  = 2.5k5  = 1The algorithm was run 100 times independently on a Windows platform (CPU E3 3.5 GHz and 16 GB memory). The average value of UC was given and compared with the results obtained by previous algorithms, such as SA/PS [3], FE-GA [5], MGA [6], ACO [6], and PSO [9]. The average UC, standard deviation, number of search points, and running time for each algorithm are shown in Tables 2-5. The best results have been underlined and bolded in Tables 2-5.Table 2
Comparison of average UC among different algorithms (whenTp = Tr + Ts, dt = 6 mm).
AlgorithmAverage UC ($)Standard deviationSearch points (pcs)Running time (sec)PSO [9]>2.2721N/A2,000N/AGQMBA-DC1.95920.0000580,00028.4Table 3
Comparison of average UC among different algorithms (whenTp = Tr + Ts, dt = 8 mm).
AlgorithmAverage UC ($)Standard deviationSearch points (pcs)Running time (sec)PSO [9]>3.306N/A2,000N/AGQMBA-DC2.43930.0008480,00030.4Table 4
Comparison of average UC among different algorithms (whenTp = θTr+ (1-θ)Ts, dt = 6 mm).
AlgorithmAverage UC ($)Standard deviationSearch points (pcs)Running time (sec)SA/PS [3]2.29590.0162418,571 × 527.4FE-GA [5]2.3091N/A60,000N/AHC [6]2.3017N/A100,000N/ANM [6]2.2713N/A100,000N/AACO [6]2.2705N/A100,000N/AMGA [6]2.2538N/A100,000N/ADP-FS [33]2.29747.6 × 10−416074 × 919.3GQMBA-DC2.02800.0001580,00027.9Table 5
Comparison of average UC among different algorithms (whenTp = θTr+ (1-θ)Ts, dt = 8 mm).
AlgorithmAverage UC ($)Standard deviationSearch points (pcs)Running time (sec)GQMBA-DC2.54990.0004380,00029.2Tables2–4 show that the average UCs obtained by the proposed GQMBA-DC are smaller than those given by other algorithms. The standard deviations of the results are small, which in turn indicates that the algorithm is stable. The proposed algorithm can find the optimization results within 30 seconds for different tool life formulas and cutting depths, which shows that the proposed algorithm is an efficient algorithm. Specifically, as shown in Tables 2 and 3, the results of both cases of GQMBA-DC outperform PSO [9] when the tool life equation is Tp = Tr + Ts. As shown in Table 4, when the tool life equation is Tp = θTr + (1 − θ)Ts, the proposed GQMBA-DC can save 10% compared with the result given by the MGA [6]. Compared with other algorithms, such as SA/PS [3], FE-GA [5], HC [6], NM [6], ACO [6], and DP-FS [33], GQMBA-DC can further save production costs. Because the case of dt = 8 cm is not covered in previous literature, only the results of our algorithm are given in Table 5. Thus, the above experimental results show that the GQMBA-DC algorithm can effectively solve the optimization problem of cutting parameters to find optimal machining parameters, which, in turn, can further reduce the production cost.From the perspective of the optimal UC value, comparisons between the proposed GQMBA-DC and other algorithms were also conducted. The comparison of the optimal UC values in Tables6–9 shows that the optimal UC results obtained by the GQMBA-DC are almost always smaller than the optimal results of UC obtained by other algorithms without constraint violation. The best results have been underlined and bolded in Tables 6–9. Specifically, the results found by the proposed algorithm are comparable to those achieved by HPSO [12], FPA [20], and COA [21] for the tool life equation of Tp = Tr + Ts and dt = 6 mm, which is only one ten-thousandth of the difference, as shown in Table 6. The GQMBA-DC can further reduce the production cost compared with the other algorithms (i.e., HRDE [23], DERE [24], DE [24], and HRTLBO [26]), as shown in Table 6. A similar situation can also be found in Tables 7–9 in different test examples. In addition, the optimal combination of cutting parameters (Vr, Vs, fr, fs, dr, ds) for different cases is also given in Tables 6–9. The GQMBA-DC algorithm can find better results than the previously proposed algorithms in terms of both the average UC and the best UC. Thus, it is clear that the proposed GQMBA-DC can perform significantly better than other algorithms on solution quality in CNC turnings. Therefore, the algorithm combining the modified BA with the divide-and-conquer strategy is effective.Table 6
Comparison of different algorithms (whenTp = Tr + Ts, dt = 6 mm).
AlgorithmCutting speed (m/min)Feed rate (mm/rev)Depth of cut (mm)UC ($/piece)Constraint violationVrVsFrfsdrdsGQMBA-DC123.3360169.96970.56550.2262331.95920HPSO [12]123.3424169.97830.56550.2262331.95910FPA [20]123.3431169.97850.56550.2262331.95910COA [21]123.1462169.98760.56550.2262331.9590GA [4]1114.22164.3690.70.29782.97452.98631.78420.5148ACO [7]103.05162.020.90.24331.84500.5396PSO [9]106.69155.890.8970.28222.27210HRDE [23]––––––2.0461–AIA [23]––––––2.12–DERE [24]––––––2.046–ABC [24]––––––2.118–DE [24]––––––2.136–HABC [25]––––––2.046–HRTLBO [26]––––––2.046–FA [27]98.4102162.28820.820.2582331.824(24)Table 7
Comparison of different algorithms (whenTp = Tr + Ts, dt = 8 mm).
AlgorithmCutting speed (m/min)Feed rate (mm/rev)Depth of cut (mm)UC ($/piece)Constraint violationVrVsfrfsdrdsGQMBA-DC119.1460164.21660.65640.26252.66732.66132.43840HRDE [23]––––––2.4791–AIA [23]––––––2.51–DERE [24]––––––2.4793–HABC [25]––––––2.4790–ABC [24]––––––2.503–DE [24]––––––2.512–Table 8
Comparison of different algorithms (whenTp = θTr+ (1-θ)Ts, dt = 6 mm).
AlgorithmCutting speed (m/min)Feed rate (mm/rev)Depth of cut (mm)UC ($/piece)Constraint violationVrVsfrfsdrdsGQMBA-DC109.6727169.97560.56550.2262332.02780SA-PS [3]––––––2.31350.0667HPSO [9]109.6655169.97960.56550.2262332.03510FPA [20]109.6631169.97850.56550.2262332.03510COA [21]117.9322123.19930.56550.2262332.23900Table 9
Comparison of different algorithms (whenTp = θTr+ (1-θ)Ts, dt = 8 mm).
AlgorithmCutting speed (m/min)Feed rate (mm/rev)Depth of cut (mm)UC ($/piece)Constraint violationVrVsFrfsDrdsGQMBA-DC106.0251164.22380.65630.26242.66702.66602.54950SA-PS [3]––––––2.74110To overcome the different complex optimization problems in various fields, we need to carefully consider the characteristics of the specific problem and use the specific characteristics (domain knowledge) to design the optimization algorithm. In our work, for the optimization problem of machining parameters, since the machining process can be divided into different numbers of roughing cuts, we decompose the whole optimization problem of machining parameters into several simple subproblems according to the different numbers of roughing cuts. Each subproblem can be conquered individually, which greatly reduces the space of the problem solution. At the same time, to avoid enumerating all subproblems and save calculation time, we derived the theoretical lower bound on UC for each subproblem by using the characteristics of the subproblems. Then, the algorithm first searches the solution space from the subproblem with a smaller theoretical lower bound on UC. By following these steps, the algorithm can quickly find the optimal solution to the problem.On the other hand, the performance of the combination of traditional divide-and-conquer strategy and swarm intelligence algorithm is better than the algorithms that only use traditional mathematical methods or swarm intelligence algorithms, as proven by the simulation experiments.The convergence curves of GQMBA-DC for different mathematical models (tool life equation) and test cases are shown in Figures4–7. The proposed algorithm converges to the final solution after approximately 150 generations, which indicates that the algorithm converges quickly to find satisfactory results.Figure 4
Convergence curve of the proposed GQMBA-DC (whenTp = Tr + Ts, dt = 6 mm).Figure 5
Convergence curve of the proposed GQMBA-DC (Tp = Tr + Ts, dt = 8 mm).Figure 6
Convergence curve of the proposed GQMBA-DC (whenTp = θTr + (1-θ)Ts, dt = 6 mm).Figure 7
Convergence curve of the proposed GQMBA-DC (whenTp = θTr+ (1-θ)Ts, dt = 8 mm).


## 6. Conclusions and Future Work

To solve the nonlinear optimization problem of machining parameters in CNC turnings, this paper proposes an optimization algorithm combining the bat algorithm and the divide-and-conquer strategy. First, based on the classical BA, the Gaussian quantum bat algorithm with direction of mean best position (GQMBA) is proposed by using a Gaussian distribution to generate random numbers. Second, the divide-and-conquer strategy is used to divide the complicated optimization problem into several subproblems and conquer them one by one. The simulation results show that the GQMBA-DC algorithm proposed in this paper has a stronger search capability than previous algorithms. Specifically, the proposed algorithm can find a better cutting parameter set and further reduce the production cost.Future research can be considered from two aspects. From the algorithmic point of view, the emerging swarm intelligence algorithm can also be applied to the optimization problem, which may be able to find a better combination of machining parameters, thus reducing costs. In recent years, deep learning methods have been widely applied in various studies; deep learning methods may be considered to reconstruct mathematical models in the optimization of turning parameters [34]. On the other hand, from the perspective of new machining types, to improve the machining efficiency and quality, there are multiple tools to realize machining operations simultaneously in modern CNC turnings. Therefore, research on this type of machining optimization problem is also of great concern.



---

*Source: 4719266-2022-02-23.xml*