Skip to main content
Advertisement
Browse Subject Areas
?

Click through the PLOS taxonomy to find articles in your field.

For more information about PLOS Subject Areas, click here.

  • Loading metrics

Optimization of surface roughness for titanium alloy based on multi-strategy fusion snake algorithm

  • Nanqi Li,

    Roles Conceptualization, Data curation, Software, Validation, Visualization, Writing – original draft

    Affiliation School of Mechanical Engineering, Liaoning Technical University, Fuxin, China

  • ZuEn Shang ,

    Roles Funding acquisition, Project administration, Resources

    shangzuen@126.com

    Affiliation School of Mechanical Engineering, Liaoning Technical University, Fuxin, China

  • Yang Zhao,

    Roles Conceptualization, Software, Validation

    Affiliation School of Electronic and Information, Liaoning Technical University, Fuxin, China

  • Hui Wang,

    Roles Conceptualization, Supervision

    Affiliation School of Mechanical Engineering, Liaoning Technical University, Fuxin, China

  • Qiyuan Min

    Roles Conceptualization, Data curation, Investigation, Software

    Affiliation School of Mechanical Engineering, Liaoning Technical University, Fuxin, China

Abstract

Titanium alloy is known for its low thermal conductivity, small elastic modulus, and propensity for work hardening, posing challenges in predicting surface quality post high-speed milling. Since surface quality significantly influences wear resistance, fatigue strength, and corrosion resistance of parts, optimizing milling parameters becomes crucial for enhancing service performance. This paper proposes a milling parameter optimization method utilizing the snake algorithm with multi-strategy fusion to improve surface quality. The optimization objective is surface roughness. Initially, a prediction model for titanium alloy milling surface roughness is established using the response surface method to ensure continuous prediction. Subsequently, the snake algorithm with multi-strategy fusion is introduced. Population initialization employs an orthogonal matrix strategy, enhancing population diversity and distribution. A dynamic adaptive mechanism replaces the original static mechanism for optimizing food quantity and temperature, accelerating convergence. Joint reverse strategy aids in selecting and generating individuals with higher fitness, fortifying the algorithm against local optima. Experimental results across five benchmarks employing various optimization algorithms demonstrate the superiority of the MSSO algorithm in convergence speed and accuracy. Finally, the multi-strategy snake algorithm optimizes the objective equation, with milling parameter experiments revealing a 55.7 percent increase in surface roughness of Ti64 compared to pre-optimization levels. This highlights the effectiveness of the proposed method in enhancing surface quality.

1 Introduction

In recent years, to meet the service requirements of high-end equipment under extreme working conditions, titanium alloy is used in the selection of a large number of structural parts [1]. Because titanium alloy has low density, high-temperature resistance, wear resistance, corrosion resistance, impact resistance, and other excellent mechanical properties, it is widely used in aerospace, deep sea exploration, biomedical, and other fields [2]. Surface finish plays a crucial role in the service life of parts, which ensures the reliability of sensitive aerospace and other fields. However, the difficult machining characteristics of titanium alloy limit its further application and the improvement of processing efficiency. The low thermal conductivity of titanium alloy makes the cutting zone temperature rise faster, and it is easy to produce chip welding and cutting shock. Therefore, academia and industry are committed to optimizing titanium alloy milling parameters to improve processing efficiency and processing quality. According to the research of Veiga, C [3], the difficult machining characteristics of titanium alloy are mainly reflected in the following aspects. First of all, due to the high chemical activity of titanium alloy, it is easy to chemically react with cutting tools, resulting in serious wear of cutting tools. The limits the improvement of cutting speed and cutting depth and reduces the processing efficiency and quality. This view is also supported by the research of Liu, H [4], who found that the chemical reaction between the cutting tool and the titanium alloy is one of the main reasons leading to the difficulty of the cutting process. Secondly, titanium alloy has a low thermal conductivity, which leads to the heat generated during the machining process not easy to dissipate quickly, thus heating the workpiece and the tool. This will cause cutting deformation, tool wear, and other problems, the machining accuracy and tool life have an adverse effect. In the study of Gupta, M [5], they pointed out that the low thermal conductivity of titanium alloy limited the thermal control of the cutting process, thus making the machining process more complicated and difficult. In addition, titanium alloys also exhibit strong solid solution curing. According to the research of A. Srivastava and M. Sharma [6], in the cutting process, titanium alloy is easy to form solid solution and solid solution compounds, so that the cutting material and the workpiece produce strong adhesion and welding. This can lead to serious tool wear and surface quality degradation. Therefore, in the titanium alloy cutting process, it is necessary to adopt the appropriate cutting parameters and tool structure to reduce the cutting force and improve the cutting surface quality.

With the development of computer technology, more and more work can be replaced by PC [7], and the optimization of cutting parameters is no exception. Many results show that the computing power of PC coupled with appropriate code can easily get the required results. Li, W et al. (2014) proposed a model based on deep reinforcement learning to optimize process parameters and machine tool energy consumption [8]. Taking the machining center as an example, the aluminum alloy workpiece is milled. Compared with the classical optimization algorithm, this method can save 95% of the optimization calculation time, and ensure that the average machining cost after optimization is close to the minimum machining cost obtained by the classical optimization algorithm. Through experimental verification, they proved the accuracy and reliability of the model. Chen, Y et al. (2018) studied the prediction and analysis of cutting forces during the high-speed milling of titanium alloys [9]. They adopted a hybrid method-based model to predict the magnitude of cutting force by inputting cutting parameters and material properties. Their results show that the model can accurately predict the cutting force and provide a way to guide the high-speed milling process. Prakash, C et al. (2015) reviewed the machining of titanium alloys and proposed a model based on a genetic algorithm to optimize cutting parameters [10]. Their research shows that the surface quality of titanium alloy cutting can be improved by selecting appropriate parameters such as cutting speed, feed speed and cutting depth.

At the same time, to optimize the milling parameters of titanium alloy, an advanced artificial intelligence algorithm, snake optimization algorithm in the swarm intelligence algorithm is adopted in this paper. Snake Optimization (SO) in swarm intelligence algorithm [11] is a new meta-heuristic algorithm proposed by Fatma A., Hashim et al. It has more abundant optimization methods in the iterative process and fewer adjustment parameters, but SO algorithm has a slow convergence speed in the early stage and poor global search ability. It is easy to converge to the local optimal solution, etc.

As technology continues to advance, optimisation problems in engineering design are becoming more and more complex, especially in fields such as aerospace, mechanical design, and structural engineering [12]. Multi-objective optimisation problems in these fields require multiple performance metrics to be satisfied while taking into account various factors such as cost, efficiency, and safety. Traditional optimisation methods are often difficult to handle these complex requirements simultaneously, and metaheuristic algorithms, with their global search capability and flexibility, show great potential in solving such problems [13,14]. These studies are of great importance in the field of engineering design.

Aiming at the existing problems of the SO algorithm, the relevant improvement research is carried out according to the existing literature. The improved algorithm in [1517] uses levy flight strategy to increase the diversity of particles in the later iteration period, effectively improving the optimization ability of the algorithm. The improved algorithm in [18,19] uses the dynamic reverse strategy to solve the problem of premature convergence and convergence to the local optimal. A population initialization method based on orthogonal array is proposed to speed up the early convergence of the algorithm [20]. A quasi-physical strategy-based PSO algorithm (QPS-PSO) is proposed [21], which improves the optimization model of the PSO algorithm, and triggers the specified convergence model according to fitness, and solves the problem of premature convergence and convergence to local optimal in solving multi-modal global optimization problems.

To sum up, to solve the difficult machining characteristics of titanium alloy mainly includes high chemical activity, low thermal conductivity and strong solid solution curing effect makes it difficult to obtain good surface roughness, scholars have proposed a variety of methods to improve the machining performance of titanium alloy, including a reasonable selection of cutting parameters, the use of advanced processing technology, the selection of appropriate tool materials and coatings and other measures. In addition, optimization of cutting parameters, the use of internal cooling tools and coolants and other measures can effectively control the temperature during titanium alloy processing, improve the processing effect, and reduce thermal damage. These studies provide an important theoretical and practical basis for the development of titanium alloy processing technology. These studies provide effective methods and guidance for parameter optimization in titanium alloy cutting process. The optimization of the titanium alloy cutting algorithm is studied deeply, and a series of improvement methods are put forward from many angles. Reasonable selection and optimization of cutting parameters can significantly improve surface roughness, extend tool life, improve cutting efficiency and machining quality. These research results provide important theoretical and practical guidance for titanium alloy cutting.

In this study, an optimization method of milling process parameters based on improved snake algorithm was proposed, and a prediction model of milling surface roughness of titanium alloy was established based on the response surface method considering different milling parameters. At the same time, an improved snake algorithm (MSSO) based on multi-strategy mixing was proposed. Firstly, the orthogonal array was introduced to initialize the population, which enlarges the global exploration space of the initial population and increases the diversity of the initial population, thus improving the convergence speed and precision of the algorithm. Secondly, the exploration stage and development stage were dynamically selected according to the fitness of the algorithm in the optimization process, to effectively reduce the unnecessary time of exploration or developmentstage and accelerate the convergence speed, Finally, the joint reverse selection strategy was used to replace the population renewal method of the original algorithm. The new update strategy ensures the population diversity of the development stage enhances the global nature of the algorithm, and improves the ability of the algorithm to find the best solution. The method was applied to the optimization of milling parameters to improve the surface roughness of titanium alloy. The experimental results show that the roughness optimization speed is faster for improving the surface roughness of titanium alloy.

2 Prediction model of titanium alloy surface roughness based on response surface method

2.1 High-speed milling experimental platform

The test specimen is an aviation casting titanium alloy TI64 used for the tail fin of an aircraft with a length of 100mm and a width of 60mm.The chemical composition of Ti64 is roughly:Aluminium (Al): 6.20% Vanadium (V): 3.82% Iron (Fe): 0.043% Carbon (C): 0.010% Nitrogen (N): 0.016% Hydrogen (H): 0.0002% Oxygen (O): 0.10%.These chemical compositions together determine the excellent properties of the Ti-6Al-4V alloy. The specimen is fixed on the workbench by special tooling, and the cutter ran along one end of the specimen according to the designed milling parameters [22]. The high-speed milling experiment site and surface quality test platform are shown in Fig 1.

The specific implementation conditions of the experiment are: high-speed vertical machining center (VMC2100-B), Mitsubishi high-speed coated doubleedged square pointed blade (APMT1604PDER-h2). The milling methods are face milling, up and down milling.The Keyence 5000 ultra depth of field 3D micro system is used to test the milled surface of the specimen. The experiments in this paper used an oil-based coolant.Because there were multiple measurable points during the experiments it was not necessary to repeat the experiments multiple times, each experiment was repeated once, and in order to minimise the effects of tool wear the blades were replaced with new ones before the start of each set of experiments.

The 3D surface topography measurements mentioned in this paper were made using a PS50 3D surface topographer, which uses a white light confocal technique for the measurements. In 3D measurements, a commonly used parameter is Sa (Arithmetic Mean Height), which is similar to Ra (Arithmetic Mean Roughness), but Sa is a parameter for 3D surface measurements, whereas Ra is usually used for 2D measurements.Sa is calculated by summing up the absolute value of the deviation of the heights of all the measured points from their mean heights and dividing by the absolute value of the deviation of the heights of all the measured points from their mean heights. Sa is calculated by summing the absolute value of the deviation of the heights of all the measured points from their average height and dividing by the total number of measured points.Sa provides an overall measure of the surface roughness, including both height and magnitude information.

We used advanced measurement techniques to evaluate the surface roughness of titanium alloy materials after high-speed milling. Specifically, a PS50 3D surface profiler was used to perform precision surface roughness measurements. This device is based on white light confocal technology, which emits a specific wavelength of light and receives the reflected light back through the probe. By calculating the distance between the probe and the surface, the device is able to accurately acquire the 3D coordinates of the surface.The collected data is analysed in detail using the NANOVIA 3D software to obtain surface roughness measurements from the nanometre to the millimetre scale. The advantages of this measurement method are its high accuracy, fast measurement and good repeatability, providing us with reliable surface roughness data. In addition, in order to further observe the macroscopic morphology of the machined surface, we also used a Japanese Keens VHX-5000 super depth-of-field microscope. This microscope provides a clear image of the surface, helping us to understand the distribution of surface roughness and morphological details more intuitively.By combining these two measurement techniques, we are not only able to obtain quantitative data on surface roughness, but also to conduct in-depth analysis of its micro and macro features, which is of great significance for optimising milling process parameters and improving machining quality.

2.2 Experimental test based on response surface method

In order to explore the influence law of high-speed milling parameters and their interaction effects on the surface roughness of aero-cast titanium alloy TI64 and seek the best parameter matching, the experiments were designed based on Response Surface Methodology (RSM). RSM is a nonlinear modeling analysis method based on experimental conditions. In this experiment, the milling surface roughness of aero-cast titanium alloy TI64 specimen was taken as the evaluation index, and the Box-Behnken design experimental design method in RSM was selected to arrange the high-speed milling experimental scheme. The four-factor and three-level coding table of milling parameters is shown in Table 1, and the experimental results of RSM are shown in Table 2.

thumbnail
Table 1. Horizontal coding of milling parameters.

https://doi.org/10.1371/journal.pone.0310365.t001

thumbnail
Table 2. Experimental program and test results.

https://doi.org/10.1371/journal.pone.0310365.t002

2.3 Determination of response surface analysis model

Design-Expert provides a variety of analysis models between variance and determination coefficient to determine the degree of fitting between regression coefficient and experimental regression model. This paper obtains the ANOVA relationship between milling parameters and surface roughness and the analysis relationship of multiple prediction coefficients of response value through experiments, as shown in Tables 35.

thumbnail
Table 5. Analysis model of determinable coefficient.

https://doi.org/10.1371/journal.pone.0310365.t005

According to the variance and determination coefficient analysis in Tables 35, in the quadratic model of surface roughness as response value, R2 and adjusted R2 are close to 0.9, which proves that the correlation between the model and the experiment is high and the model is relatively accurate. The predicted R2 is close to 0.8, and the predicted residual sum of squares is the smallest, which proves that the prediction and universality of the model are strong, which indicates that the quadratic model is highly reliable when analyzing the surface roughness. Therefore, the quadratic model is chosen as the analysis model of surface roughness.

The linear mode has an F-value of 35.62 and a P-value of 0.0001, which is much less than 0.05, indicating that at least one of the milling parameters in the model has a significant main effect on Ra. Also spindle speed (X1), width of cut (X2), depth of cut (X3) and feed per tooth (X4) as components of the linear model have a direct effect on Ra. Since the p-values are not given, we cannot determine the specific significance of each parameter, but the significance of the overall linear model suggests that these parameters, at least in general, have a significant effect on Ra. From the interaction effect analysis, the F-value regarding the quadratic model was 16.63 with a P-value of 0.0001, indicating that the interaction effect between the milling parameters also had a significant effect on Ra. This may include interactions between parameters such as X1X2, X1X3, X1X4, X2X3, X2X4 and X3X4.The contribution can be assessed by the R2 value of the model, which indicates the amount of variance explained by the model. Comparing the results of similar studies in the literature can help us understand the milling characteristics of the titanium alloy Ti64. Other studies may have reported Ra values for different materials or different cutting conditions, and these data can be used to compare and validate the findings of this study. The effect of milling parameters on Ra, from the machinability point of view, the milling parameters listed as cutting speed, feed rate and depth of cut directly affect the material removal rate and heat generation, which in turn affects the surface roughness. Higher cutting speeds may lead to higher cutting temperatures, which in turn affects the plastic deformation of the material and Ra. It is also recognised that statistical methods, although capable of revealing the effect of milling parameters on Ra, may not be able to fully account for all the observed phenomena. Factors such as the microstructure of the material, tool wear, and the cooling effect of the cutting fluid may have an important effect on Ra, but these factors may not be adequately represented in the statistical models. Regarding additional contributions in order to provide deeper insights, studies could combine experimental results and theoretical analyses to explore how milling parameters can change Ra by affecting the material removal mechanism.

2.4 Regression model

Response surface method is a combination of mathematical methods and statistical methods, using regression method as a equation estimation tool, the relationship between the factors in the multi-factor test and the test results (response value) is approximated by polynomial, the relationship between the factors and the test results is equationally analyzed quantitatively the influence of each factor and their interaction on the response value, the ultimate goal is to optimize the response value. Its second-order polynomial model is as follows: (1)

Where: u is the number of design variables, x is the s and d design variables, β0βsβssβsd are regression coefficients, which can be determined by regression analysis.

The influence of milling parameters on surface roughness is not only single factor, the interaction of two factors on optimization can not be ignored, considering the interaction effect and secondary effect between the factors, the four-factor second-order regression model expression is as follows: (2)

Considering the interactive and secondary effects of milling parameters, the coefficient terms of the regression equation are solved according to the coded data in the table, and the coded terms can be centralized processed by Eq (3): (3)

Then the coefficient of the constant term in the regression equation can be expressed as: (4)

The other coefficients are: (5)

According to Eqs 15 and the data in the table, the RSM prediction model of the milling surface roughness of aerospace titanium alloy TI64 specimen can be obtained as follows: (6)

Where: Ra is the milling surface roughness of Ti64 specimen, μm; X1, X2, X3 and X4 are respectively the spindle speed, cutting width, cutting depth and feed per tooth.

In order to verify the accuracy of the roughness prediction model, milling experiments were carried out on the experimental platform in the second part by selecting three groups of different milling parameters in Table 6.

Fig 2 shows the comparison between the predicted values of the model and the actual values. Each scatter point is approximately distributed near the same line, which proves that the established regression model has a high significance level and accurate prediction results.

thumbnail
Fig 2. Comparison of predicted values with actual values.

https://doi.org/10.1371/journal.pone.0310365.g002

As shown in Table 7, comparing the milling surface roughness experimental value and the model predicted value, we can see that the relative error of the experimental value and the model predicted value is less than 3.5%, the maximum error is only 0.9%, and the average error is 0.7%. The verification results show that the regression model can accurately predict the milling surface roughness of the specimen.

3 Snake algorithm

The SO algorithm implements global optimization of the optimization algorithm by simulating the fighting mode and mating mode of snakes, in which each male fights to get the best female and each female tries to choose the best male. In mating mode, mating takes place between males and females with a availability coefficient relative to the amount of food available. If the mating process occurs within the search phase, the female snake is likely to lay eggs, hatching new offspring.

3.1 Initialization

SO first generates an evenly distributed random population, and assumes that the proportion of females and males in the snake population is 50%, and the population is divided into male and female populations.

3.2 The algorithm is divided into stages

SO algorithm optimization process is divided into exploration stage and development stage. The exploration stage simulates the behavior pattern of snakes in the absence of food, and the development stage simulates the behavior pattern of snakes in the presence of food. The behavior pattern of snakes is controlled by the total amount of material Q and the temperature Temp [23].

  1. The exploration stage
    If Q < ThresholdQ(0.25), snakes find food by selecting any random location and updating their location. The equation for location update is as follows: (7)
    Where Xi,m represents the position of the i male, Xrand,m represents the position of the random male, Am represents the predatory ability of the individual male snake, rand∈(0, 1), C2 = 0.05.
  2. Development stage

When Q < ThresholdQ, if Temp > ThresholdTemp (0.6), the snake will only move towards the food, and the movement equation for the individual snake is as follows: (8)

Where Xi, j is the position of individual i(male or female), Xfood is the position of the best individual, and C1 is constant and equal to 2.

If Temp<ThresholdTemp (0.6), the snake will be in battle mode or mating mode, and the equation for the movement of an individual snake in battle mode is as follows: (9)

Where Xi,m is the position of male individual i, Xfood is the best position in the female group, and FM is the male combat effectiveness.

When Temp<ThresholdTemp (0.6), the equation for the movement of an individual snake in mating mode is as follows: (10)

Where Xi, f is the position of individual i in the female group, Xi¸f is the position of individual i in the male group, and Mm is the mating ability of the male.

4 Improve the snake algorithm

4.1 Improvements to initialize the population

In order to increase the diversity of the initial population of the algorithm and reduce the overall and local density of the initial population as much as possible, the initial solution should be uniformly generated so that the algorithm can evenly explore the entire search space [24]. Orthogonal array can provide a uniform distribution of position combinations, using this property of the orthogonal table to construct the initial solution, the orthogonal matrix is expressed as LQ (NM), the size of the matrix is Q×M, which contains M factors, each factor is divided into N levels. In this paper, the orthogonal matrix LQ (NM) is constructed by using the method proposed in the above paper, where N is an odd integer, Q = NI, and the way I is selected satisfies the equation: (11)

The orthogonal table A is constructed according to the following steps

Step 1: Calculate the base elements of A: (12) (13)

Step 2: Calculate the non-basic elements of A: (14) (15)

Step 3: Remove the last (M-D) column of A so that the matrix is controlled in column D.

Step 4: Randomly delete rows (N-Q) of A so that the matrix control is in row Q.

Calculate to get the matrix and generate the initial solution using the following equation: (16)

When the dimension of the solution space is 2, lb = [1.0, 1.0], ub = [7.0, 9.0], and the factor is 5. The 25 individuals obtained by orthogonal initialization are shown in Fig 3.

4.2 Analysis and improvement of food quantity and temperature mechanism

According to Chapter 3, SO algorithm is divided into exploration stage and development stage. Fig 4A shows the two-dimensional space movement trajectory of the snake individual in an iteration in the exploration stage. Fig 4B–4D represent the two-dimensional space motion trajectories corresponding to Eqs (2)–(4) of individual snake in the development stage, respectively. It can be seen from Fig 4A that the position of the individual snake after updating is basically the same as that before updating, indicating that when SO algorithm is in the exploration stage, the individual snake moves in its own small range. It can be seen from Fig 2B that in order to find food, the individual snake will move closer to the food, and the food represents the position of the best individual. As can be seen from Fig 4C, in order to obtain sufficient food when entering the fighting mode, individual snakes will seek the strongest opposite sex. As can be seen from Fig 4D, when entering the mating mode, individual snakes will change their movement rules and get closer to the opposite sex. It can be seen that in terms of the underlying structure of the model of the snake algorithm, the exploration stage is used for global optimization, and the development stage is used for local optimization and jumping out of local optimal solutions. The design architecture of the algorithm is relatively complete, but the phase transformation cannot be carried out because the food quantity and temperature do not exceed the threshold value, making the interaction between the stages too rigid (Fig 4).

thumbnail
Fig 4. Snake optimizer individual movement trajectory map.

(a) Eq (1) individual motion trajectory. (b) Eq (2) individual motion trajectory. (c) Eq (3) individual motion trajectory. (d) Eq (4) individual motion trajectory.

https://doi.org/10.1371/journal.pone.0310365.g004

Food quantity Q is a key parameter to balance the proportion of SO in the exploration stage and the development stage. The description of Q in SO is from the minimum value to the maximum value, and SO switches from the exploration stage to the development stage when it drops to a certain threshold. This way of switching may result in too long a time in the exploration phase, leaving insufficient time for the development phase, and the temperature threshold of the control phase switching may be different for different problems. In order to make the design of Q more flexible and reduce the proportion of SO in the exploration stage, the fitness equation is used to replace the simple assignment of food quantity in the original algorithm to ensure the dynamic change of food quantity, so as to achieve the effect of balancing the proportion in the algorithm stage. The expression is shown as follows.

(17)

The equation of temperature Temp is to switch the position update method of snake individuals according to the current number of iterations, and restart the population to a certain extent to ensure that the algorithm does not converge prematurely. According to the following equation, the change strategy of Temp is optimized, and the conditions of the algorithm to restart the population are optimized.

(18)

Where Temp represents the mean variance of each individual in the population in each dimension, k is the constant threshold, n0 is the number of individuals in the population. The Eq (18) determines the degree of aggregation of individuals, and calculates the result of each individual to determine whether the variance is less than k. If the conditions are met, it means that most particle search results are similar, indicating that the iterative results are convergent, SO you can directly switch to the development stage to speed up the convergence, and then switch to the search stage when the above equation is not established.

4.3 Joint reverse selection

Combined with the advantages of selective dominant opposition and dynamic opposition [24], joint reverse selection enhances the exploration and development ability of the algorithm, enhances the global distribution of snake individuals, and improves the optimization ability of the algorithm.

4.3.1 Selective dominant opposition.

SLO [25] (Selective Leading Opposition, SLO), developed from Selective Opposition, calculates the difference distance in each dimension between the current solution and the optimal solution and compares it to the threshold, Dimensions greater than the threshold are the distance dimensions (df), and those less than the threshold are the proximity dimensions (dc). At the same time, it is also necessary to calculate the Spearman phase relation value between the current solution and the optimal solution, and execute the SLO strategy for the position where the correlation is less than 0. The SLO policy is calculated by the following equation.

(19)(20)

Where is the approach dimension of the ith solution and is the opposite solution of the approach dimension. src is the Spearman rank phase relation value. Size (dc) is the number of proximity dimensions of the currentc solution. Size (df) is the number of distant dimensions of the currentf solution. Calculate the difference distance of each dimension between the current solution and the optimal solution by Eq (21). The dimension where the difference is less than the threshold is dc, and the opposite dimensionc is df, and the threshold is calculated by Eq (22).

(21)(22)

4.3.2 Dynamic opposition.

Dynamic opposite (DO) combines the ideas of quasi-opposition [26] and quasireflection [27]. It has the advantage that it can search the space dynamically, move asymmetrically in the search space, and help the algorithm escape from the local optimal solution, the calculation equation is as follows.

(23)(24)(25)

Where, is the inverse solution of Xi Xi is the ith solution. Xr is the random opposite solution. Xr is the opposite solution of dynamic is the jump rate, which is the probability of performing a dynamic opposition. Ref. [28] states that a value of 0.25 works best.

4.4 Improve the logical flow of the algorithm

Step 1: initialization, maximum number of iterations T, population individual N, objective equation dimension D, boundary lb, ub.

Step 2: Use the Eq (16) for orthogonal population initialization to generate N snake individuals X = [Xi1,Xi2,…, XiD]. Where XiD represents the position of the i snake in D dimension; Male and female populations are divided, and individual fitness and optimal fitness of male and female populations are calculated.

Step 3: Update the positions of all individuals through the selective dominant opposition strategy. If Eq (17) is not true, enter the exploration mode, otherwise enter the development mode.

Step 4: In the development mode, Temp>k, update the position of snake individual according to Eq (8). If Temp<k, the individual snake will fight or mate.

Step 5: When the individual snake is in battle mode, it updates its position by Eq (9), and when it is in mating mode, it updates its position by Eq (16).

Step 6: When individual snakes mate and produce offspring, all individual snakes restart through Eq (25).

Step 7: Update individual positions, calculate the current fitness values of all individuals, update the current male and female population and the global optimal fitness. If the maximum number of iterations T is reached, go to step 8. Otherwise, go to step 3.

Step 8: Output the optimal fitness and position Xbest.

4.5 Experiment and experimental analysis

4.5.1 Benchmark test equation and experimental environment.

In order to verify the correct line selection of MSSO algorithm optimization strategy, 10 classic single-peak and multi-peak benchmark test equations were selected to evaluate the performance of MSSO. The experiment was carried out in Windows10, Inter Core i5-12490F environment, and the programming language is MATLAB2020b. The parameters of the test algorithm are shown in Table 8 and the test results are shown in Table 9.

4.5.2 Comparison of MSSO algorithm with other intelligent algorithms.

In order to test the performance of MSSO, it is compared with snake algorithm SO [11], whale algorithm WOA [29], sine-cosine algorithm SCA [30], grey wolf algorithm GWO [31], linear decreasing inertia weight particle swarm algorithm LDWPSO [32], improved particle swarm algorithm MPSO [33], and the iteration number T is set to 500 times. The population size N is 50. The mean and standard deviation (STD) obtained by 30 independent execution of the above selected algorithm were compared. The parameter configuration of the selected algorithm is shown in Table 10, the operation results and comprehensive ranking are shown in Table 10, and the best fitness curve of each algorithm is shown in Fig 5.

thumbnail
Fig 5. Convergence curve of benchmark equation F1-F10.

(a) F1. (b) F2. (c) F3. (d) F4. (e) F5. (f) F6. (g) F7. (h) F8. (i) F9. (k) F10.

https://doi.org/10.1371/journal.pone.0310365.g005

thumbnail
Table 10. Optimum fitness of the test equationTest sequence number.

https://doi.org/10.1371/journal.pone.0310365.t010

4.5.3 Effectiveness analysis of the improvement strategy.

In order to further verify the effectiveness of the three improved strategies, the test equation in Table 8 is used to test the standard SO, only SO (OSO) initialized by orthogonal matrix, SO (DQSO) with dynamic adaptive parameters, and SO (JOSO) and MSSO with joint reverse selection under the conditions of 10, 50 and 100 dimensions respectively [34]. Considering the length factor, 3 unimodal equations and 2 multi-modal equations are selected from Table 8 for testing. The parameter Settings of each algorithm are consistent with SO, and the results of each algorithm after running independently for 30 times are shown in Table 11.

thumbnail
Table 11. Optimization results of different improvement strategies in different dimensions.

https://doi.org/10.1371/journal.pone.0310365.t011

As can be seen from Table 11, from the perspective of optimal and average values, MSSO can find the theoretical optimal value when solving F1, F5, and F6 in the three dimensions. Although the theoretical optimal value is not found, their convergence accuracy is more than ten orders of magnitude better than SO. For the function F4, the accuracy of MSSO solution results is optimal in 10 dimensions, and the optimization accuracy of DQSO and MSSO in 50 and 100 dimensions is of the same order of magnitude and superior to the comparison model, indicating that the convergence accuracy of the algorithm is improved by introducing dynamic parameters Q and Temp. For the function F7, the optimization accuracy of JOSO and MSSO is relatively high, indicating that the introduction of joint reverse selection can increase the optimization ability of the algorithm, and improve the anti-stagnation and global exploration ability of the algorithm. Secondly, from the perspective of standard deviation, the standard deviation of MSSO, OSO, DQSO, and JOSO are all smaller than SO when solving the 5 test equation, and the standard deviation of MSSO when solving F1, F5, and F6 is 0, indicating that each improvement strategy has different degrees of improvement on the stability of the algorithm. However, under a single improvement strategy, the optimization effect of the SO algorithm on different test equations is not stable enough, and the improvement accuracy of some test equations is limited, indicating that the introduction of only a single improvement strategy cannot meet the requirements of high optimization accuracy and strong robustness of the algorithm. However, MSSO with three improved strategies can improve the optimization accuracy and robustness significantly under different test equations and different dimensions.

4.5.4 Analysis of MSSO population diversity.

To verify the influence of the improved strategy on the population diversity and the convergence of the improved algorithm during iteration, the function F1 test was used to conduct optimization experiments, and the problem dimension D = 3 [35]. The population distribution after MSSO initialization is shown in Fig 6A. The distribution map of snake individuals after 10 and 50 iterations of MSSO is drawn and compared with the position of population individuals after SO initialization and 10 and 50 iterations.

thumbnail
Fig 6. Population distribution map of MSSO and SO.

https://doi.org/10.1371/journal.pone.0310365.g006

As can be seen from Fig 6A and 6D, MSSO uses the initialization strategy of the orthogonal matrix to avoid the problem of low population diversity and uneven distribution caused by the SO algorithm adopting random distribution for the initial population. From Fig 6A–6C, it can be seen that snake individuals gather to the optimal value at a faster speed with the iteration of MSSO, and the distribution of population individuals can still maintain a good uniformity after iteration. Compared with Fig 6C and 6E, it can be seen that the population individuals have been distributed in the optimal solution position after 50 iterations of MSSO. However, the SO population has not completed convergence, indicating that the improvement strategy effectively improves the diversity of the initial population and the convergence speed of the algorithm.

5 Experimental verification

The improved algorithm was used to optimize the prediction model of milling surface roughness of titanium alloy, and minRa = 0.105, X1 = 3018rpm, X2 = 2mm, X4 = 0.3mm, X = 0.02mm were obtained.

To verify the feasibility and effectiveness of the optimization of milling parameters by the MSSO algorithm, comparative experiments were carried out between the parameters used before optimization and the milling parameters optimized by the MSSO algorithm on the platform established above [36]. The TI64 machined surfaces were tested and analyzed, and the comparative results are shown in Figs 7 and 8 and Table 12.

thumbnail
Fig 8. Compares the cloud image of surface topography before MSSO optimization and optimization.

https://doi.org/10.1371/journal.pone.0310365.g008

thumbnail
Table 12. Before and after optimization design variables.

https://doi.org/10.1371/journal.pone.0310365.t012

Comparing the MSSO algorithm with the data of the pre-optimization variables and the objective function, it can be seen that the spindle speed is increased by 518rpm, the cutting width is reduced by 2mm, the cutting depth is increased by 0.1mm. The feed per tooth is reduced by 0.04mm, with the increase of cutting speed in high-speed cutting, the shear angle of the material in the cutting area increases, the cutting deformation coefficient decreases. The material is not deformed at high speed. The friction coefficient between the tool and the chip decreases. The actual heat generated during the cutting process decreases, and most of the heat is taken away by the chip. The temperature on the workpiece rises more slowly or even the temperature begins to decrease to reduce the work hardening of the contact surface between the tool and the titanium alloy, so the roughness of the machined surface of the titanium alloy is reduced by 55.7% compared with before optimization. It can be seen that the MSSO algorithm is used to optimize and reduce the surface roughness of titanium alloy significantly, and the MSSO algorithm optimization is reasonable and effective.

6 Conclusions

To obtain the better surface quality, the RSM method was used to design the TI64 milling experiment, and the regression model indicating roughness was fitted. The results of ANOVA shows that the quadratic multiple fitting coefficient (R2) and the corrected multiple fitting coefficient (R2) were close to 0.9, and the predicted multiple fitting coefficient (R2) was close to 0.8. Therefore, the quadratic model was chosen as the analysis model of surface roughness. The relative error between the experimental value and the model predicted value is less than 3.5%, the maximum error is only 0.9%, and the average error is 0.7%, which proves that there is no significant difference between the prediction results and the experimental results.

The optimization performance of SO was improved, and the snake algorithm was optimized by orthogonal matrix initialization, adaptive parameters, and joint reverse selection strategy. The convergence, robustness, and local optimum of the MSSO algorithm were verified by the test function. In addition, the comparative optimization experiment results show that the MSSO strategies complement each other in the stage, and the algorithm is optimized from initialization to optimization and then to individual update and the defects of each stage have been significantly improved compared with the original SO.

The improved multi-strategy snake algorithm was used to optimize the milling parameters. The optimized parameters are as follows: spindle speed 3108rpm, axial cutting depth 2mm, radial cutting depth 0.3mm, feed rate 0.2mm per tooth, roughness reduction 55.7%. Compared with the surface morphology of the specimen before and after optimization, it can be seen that the optimized surface cutter row spacing is smaller, the surface height is more average, and the texture is more delicate.

References

  1. 1. Pushp P., Dasharath S. M., & Arati C. (2022). Classification and applications of titanium and its alloys.Materials Today: Proceedings,54, 537–542.
  2. 2. Hourmand M., Sarhan A. A., Sayuti M., & Hamdi M. (2021). A comprehensive review on machining of titanium alloys.Arabian Journal for Science and Engineering,46, 7087–7123.
  3. 3. Veiga C, Davim J. P., & Loureiro A. J. R. (2012). Properties and applications of titanium alloys: a brief review.Rev. Adv. Mater. Sci,32(2), 133–148.
  4. 4. Liu H., Ayed Y., Birembaux H., Rossi F., & Poulachon G. (2022). Impacts of flank wear and cooling strategies on evolutions of built-up edges, diffusion wear and cutting forces in Ti6Al4V machining. Tribology International,171, 107537.
  5. 5. Gupta M. K., Korkmaz M. E., Sarıkaya M., Krolczyk G. M., & Günay M. (2022). In-process detection of cutting forces and cutting temperature signals in cryogenic assisted turning of titanium alloys: An analytical approach and experimental study. Mechanical Systems and Signal Processing,169, 108772.
  6. 6. Chen G., Caudill J., Chen S., & Jawahir I. S. (2022). Machining-induced surface integrity in titanium alloy Ti-6Al-4V: An investigation of cutting edge radius and cooling/lubricating strategies.Journal of Manufacturing Processes,74, 353–364.
  7. 7. Nain G, Pattanaik K K, Sharma G K. (2022)Towards edge computing in intelligent manufacturing: Past, present and future[J]. Journal of Manufacturing Systems, 62: 588–611.
  8. 8. Li W., Li B., He S., Mao X., Qiu C., Qiu Y., et al. (2022). A novel milling parameter optimization method based on improved deep reinforcement learning considering machining cost. Journal of Manufacturing Processes, 84, 1362–1375.
  9. 9. Chen Y., Li H., & Wang J. (2018). Predictive modelling of cutting forces in end milling of titanium alloy Ti6Al4V. Proceedings of the Institution of Mechanical Engineers, Part B: Journal of Engineering Manufacture, 232(9), 1523–1534.
  10. 10. Prakash, C., Kansal, H. K., Pabla, B. S., & Puri, S. (2015, December). To optimize the surface roughness and microhardness of β-Ti alloy in PMEDM process using Non-dominated Sorting Genetic Algorithm-II. In 2015 2nd International Conference on Recent Advances in Engineering & Computational Sciences (RAECS) (pp. 1–6). IEEE.
  11. 11. Hashim F. A., & Hussien A. G. (2022). Snake Optimizer: A novel meta-heuristic optimization algorithm.Knowledge-Based Systems,242, 108320.
  12. 12. Aye C. M., Wansaseub K., Kumar S., Tejani G. G., Bureerat S., Yildiz A. R., et al. (2023). Airfoil Shape Optimisation Using a Multi-Fidelity Surrogate-Assisted Metaheuristic with a New Multi-Objective Infill Sampling Technique.CMES-Computer Modeling in Engineering & Sciences,137(3).
  13. 13. Yao L., Yuan P., Tsai C. Y., Zhang T., Lu Y., & Ding S. (2023). ESO: An enhanced snake optimizer for real-world engineering problems.Expert Systems with Applications,230, 120594.
  14. 14. Panagant N., Kumar S., Tejani G. G., Pholdee N., & Bureerat S. (2023). Many-objective meta-heuristic methods for solving constrained truss optimisation problems: A comparative analysis.MethodsX,10, 102181.
  15. 15. Zhang H, Xie J, Hu Q, Shao L, Chen T (2018) A hybrid dpso with Lévy flight for scheduling mimo radar tasks. Appl Soft Comput 71:242–254.
  16. 16. Tang W, Cha H, Wei M, Tian B (2019) Estimation of surface based duct parameters from automatic identification system using the Lévy flight quantum-behaved particle swarm optimization algorithm. J Electromagn Waves Appl, 1–11.
  17. 17. Abualigah L, Yousri D, Abd Elaziz M, et al. (2021). Aquila optimizer: a novel meta-heuristic optimization algorithm[J]. Computers & Industrial Engineering, 157: 107250.
  18. 18. Sahoo S K, Saha A K, Nama S, et al. (2022). An improved moth flame optimization algorithm based on modified dynamic opposite learning strategy[J]. Artificial Intelligence Review, 1–59.
  19. 19. Wen C, Jia H, Wu D, et al. (2022). Modified remora optimization algorithm with multistrategies for global optimization problem[J]. Mathematics, 10(19): 3604.
  20. 20. Kumar A, Biswas P P, Suganthan P N. (2022). Differential evolution with orthogonal array‐based initialization and a novel selection strategy[J]. Swarm and Evolutionary Computation, 68: 101010.
  21. 21. Mai G, Hong Y, Fu S, et al. (2020). Optimization of Lennard-Jones clusters by particle swarm optimization with quasi-physical strategy[J]. Swarm and Evolutionary Computation, 57: 100710.
  22. 22. Sur G., Motorcu A. R., & Nohutçu S. (2022). Single and multi-objective optimization for cutting force and surface roughness in peripheral milling of Ti6Al4V using fixed and variable helix angle tools.Journal of Manufacturing Processes,80, 529–545.
  23. 23. Xu Y., Yang Z., Li X., Kang H., Yang X. (2020). Dynamic opposite learning enhanced teaching–learning-based optimization. Knowl.Based Syst. 188, 104966.
  24. 24. Dhargupta S., Ghosh M., Mirjalili S., Sarkar R. (2020). Selective opposition based grey wolf optimization. Expert Syst. Appl. 151, 113389.
  25. 25. Mandal B., Roy P.K. (2013). Optimal reactive power dispatch using quasi-oppositional teaching learning based optimization. Int. J.Electr. Power. 53, 123–134.
  26. 26. Fan Q., Chen Z., Xia Z. (2022). A novel quasi-reflected Harris hawks optimization algorithm for global optimization problems. Soft Comput. 24, 14825–14843.
  27. 27. Arini F. Y., Chiewchanwattana S., Soomlek C., & Sunat K. (2022). Joint Opposite Selection (JOS): A premiere joint of selective leading opposition and dynamic opposite enhanced Harris’ hawks optimization for solving single-objective problems. Expert Systems with Applications, 188, 116001.
  28. 28. Luo J, Shi B. (2019). A hybrid whale optimization algorithm based on modified differential evolution for global optimization problems[J]. Applied Intelligence,49(5): 1982–2000.
  29. 29. Gupta S, Deep K. (2020). A novel hybrid sine cosine algorithm for global optimization and its application to train multilayer perceptrons[J]. Applied Intelligence, 50(4): 993–1026.
  30. 30. Mirjalili S, Mirjalili S M, Lewis A. (2014). Grey wolf optimizer[J]. Advances in engineering software, 69: 46–61.
  31. 31. Yan, C. M., Lu, G. Y., Liu, Y. T., & Deng, X. Y. (2017, July). A modified PSO algorithm with exponential decay weight. In 2017 13th International conference on natural computation, fuzzy systems and knowledge discovery (ICNC-FSKD) (pp. 239–242). IEEE.
  32. 32. Tian D., & Shi Z. (2018). MPSO: Modified particle swarm optimization and its applications. Swarm and evolutionary computation, 41, 49–68.
  33. 33. Zamfirache I. A., Precup R. E., Roman R. C., & Petriu E. M. (2022). Reinforcement Learning-based control using Q-learning and gravitational search algorithm with experimental validation on a nonlinear servo system. Information Sciences,583, 99–120.
  34. 34. Sang H., You Y., Sun X., Zhou Y., & Liu F. (2021). The hybrid path planning algorithm based on improved A* and artificial potential field for unmanned surface vehicle formations. Ocean Engineering,223, 108709.
  35. 35. Thepsonthi T., & Özel T. (2012). Multi-objective process optimization for micro-end milling of Ti-6Al-4V titanium alloy. The International Journal of Advanced Manufacturing Technology,63, 903–914.
  36. 36. Kumar S, Panagant N, Tejani G G, et al. A two-archive multi-objective multi-verse optimizer for truss design[J]. Knowledge-Based Systems, 2023, 270: 110529.