EXPERIMENTAL INVESTIGATION AND MODELLING OF RESIDUAL STRESSES IN FACE MILLING OF AL-6061-T3 USING NEURAL NETWORK

Milling process is a common machining operation that is used in the manufacturing of complex surfaces. Machining-induced residual stresses (RS) have a great impact on the performance of machined components and the surface quality in face milling operations with parameter cutting. The properties of engineering material as well as structural components, specifically fatigue life, deformation, impact resistance, corrosion resistance, and brittle fracture, can all be significantly influenced by residual stresses. Accordingly, controlling the distribution of resi dual stresses is indeed important to protect the piece and avoid failure. Most of the previous works inspected the material properties, tool parameters, or cutting parameters, but few of them provided the distribution of RS in a direct and singular way. This work focuses on studying and optimizing the effect of cutting speed, feed rate, and depth of cut for 6061-T3 aluminum alloy on the RS of the surface. The optimum values of geometry parameters have been found by using the L27 orthogonal array. Analysis and simulation of RS by using an artificial neural network (ANN) were carried out to predict the RS behavior due to changing machining process parameters. Using ANN to predict the behavior of RS due to changing machining process parameters is presented as a promising method. The milling process produces more RS at high cutting speed, roughly intermediate feed rate, and deeper cut, according to the results. The best residual stress obtained from ANN is –135.204 N/mm 2 at a cutting depth of 5 mm, feed rate of 0.25 mm/rev and cutting speed of 1,000 rpm. ANN can be considered a powerful tool for estimating residual stress


Introduction
Many materials are subjected to different machining processes like face milling to obtain a smoother surface with a high quality of objects. Therefore, these processes need a treatment procedure. The most prominent problems that are manifested during the machining process are mechanical and thermal stresses that cause surface damage or deformation, which leads to changes in the mechanical properties of materials. Furthermore, the machined workpiece instigates residual stresses [1]. Residual stresses (RS) as a form of deformation can be measured in different ways (qualitatively and quantitatively). It can assess the machining process's delicate pointer for various machining boundaries and apparatus properties [2]. So, when the RS of a machined component are elevated, the item's life cycle is reduced. Therefore, to avoid any failure in a machine part, it is very significant to dominate the entity of residual stresses. RS are dominantly affected by machining parameters, cutting speed, feed rate, and depth of cut. That need to be controlled. Generally, tensile residual stress increases when cutting speed increases. However, the cutting feed and depth of cut have displayed opposite effects. In addition, residual stresses are found to be less sensitive to the tool rake angle variations. Therefore, many researchers discuss this problem. In recent years, significant advancements in predictive and optimization model types have been reported. This survey has been categorized into three clusters depending on the types of material used, techniques for optimizing the machining process, and the area of residual stress predictions.
Primarily, a lot of previous studies investigated various aluminum alloys. The applications of aluminum alloys are vast in different domains, for example, electric module packing, electronic technology, automobile frame structure, turbine, and solar energy management. They have a low density and high strength to weight ratio, so they are used frequently. 6061-T3 aluminum alloy is one of the most famous aluminum alloys for general application, it is a precipitation solidifying aluminum alloy with major alloying components of magnesium and silicon. It has excellent mechanical qualities as well as excellent weldability. Some of the works are presented in the literature review, and others focused on 7075-T7451 aluminum alloy. Another group correlated the relationship between the phenomena of mechanical and thermal properties with the residual stresses for this alloy, and inspected corrosion on the residual stress surfaces [3,4]. In addition, the milling deformation of the Al alloy using the quasi-symmetrical machining method was investigated in other works [5,6].
Secondly, various studies examined the impact of some geometries like tools on the RS allocation in the same metal during machining. They discovered that the compressive subsurface RS is produced during the final grinding process and the solid end mill's nose radius, rake/relief angle, and diameter had a significant impact on the RS profile. Many efforts have been presented for finding the redistribution and generation of RS under the influence of machining [7,8].
Thirdly, many researchers investigated the characteristics of RS by tracking the process of various machining, and determining the influence of process parameters on RS. They used different techniques for optimizing the machining process such as genetic algorithm, Taguchi design method, finite elements, fuzzy networks, and others used artificial neural networks (ANNs) [9,10].
To sum up, research on the experimental investigation and modeling of residual stresses in the face milling of Al-6061-T3 is important to avoid failures.

Literature review and problem statement
The study of residual stress characteristics is an important research area for determining the influence of process parameters on RS to obtain a smoother surface and high quality. The purpose of this part is to provide a snapshot of previous works that progress in this field and still face major challenges, and are related to current research developments. Therefore, the subject flows into three branches depending on the study.
Essentially, many previous works focused on the types of material used. In [11], the parameters of 7055-T77 aluminum alloy were studied, and it was concluded that the maximum residual compressive stress and the depth of the residual stress layer are significantly increased, and the residual stress and hardening distribution are very good after shot peening of this alloy.
Also, the study [12] showed that the shrinkage overlap coefficient K was affected by echo or residual stress distribution in Al 2024-T3, and the effect of deformation was reduced, which was inevitably accompanied by a decrease in the material removal rate. In addition, the work [13] measuring the effect of residual stress on the surface using the X-ray diffraction process was presented, while twenty-five points were required for each piece in order to be measured. The results for 2219 aluminum showed that depth of cut was the largest and most important factor affecting RS. If the depth of cut in the axial direction is shallow, it produces compressive RS. On the other hand, the feed rate per tooth and the spindle speed showed little impact on the distribution of residual stress.
The study [14] investigated the effect of cutting speed on a face-milled 7050-T7451 aluminum workpiece. Three levels of cutting speed were used (200, 800, 1400 m/min) for milling the workpiece under the effect of a dry state. The rest of the factors are constant, the depth of cut is 1 mm and the feed rate is 0.20 mm/tooth. The results of this work showed that RS magnitude and altered layer thickness were sensitive to cutting speed, whereas surface roughness and microstructural defects showed large variations in the conditions tested.
Besides that, other researchers studied different techniques for optimizing the machining process. For example, in [15], finite element analysis for machining AISI 1045 steel was used in order to determine how different cutting parameters would affect the surface and subsurface of residual stresses.
Then, based on the material removal method, [16,17] employed finite element calculations based on strain relaxation data to estimate RS, while Afazov devised a mathematical algorithm to translate RS profiles into finite element (FE) models at a large scale. The profile of RS was calculated using the FE approach and used as an input in the mapping function.
Also, in [18], a mathematical model was developed to estimate the presence of RS on the 2014-T6 alloy surface. Cutting speed, feed rate, and depth of cut are just a few of the variables that were used in this study to determine the most important factor influencing RS. These mathematical models were constructed using the response surface methodology (RSM), which reduces the number of experiments. The Taguchi method was used to develop these experiments. The outcomes demonstrate that the tool geometry has the biggest impact on RS. Additionally, a strong connection between the mathematical and experimental results was discovered, which was very beneficial for determining the best cutting parameter for the 2014-T6 alloy.
As mentioned in [19], a mathematical model of residual stress generation in complex surface machining was presented. Geometric transformation of nickel aluminum bronze (NAB) in the workpiece and contact mechanics were used to determine the mechanical stress caused by milling. An elastic-plastic model and a relaxation procedure were used to estimate the residual stress.
Furthermore, the work [20] investigated the relationship between the end milling parameters of the 7050-T7451 aluminum alloy and the machined-induced residual stresses. Four parameters were used (cutting speed, feed rate, depth of cut and cutting width). The results show that the lower limit cutting speed caused the chips to generate the least amount of heat (Al 7050-T7451), which reduced the amount of RS. An increase in the feed rate increased compressive RS. The observed trends in RS transformation are described by an analysis of the machining forces and thermal effects. Next, [21] introduced a more thorough experimental model of brass, steel, stainless steel, steel-37, 7001, and 2024 alloys. It not only predicts surface and subsurface residual stress profiles in turning operations of five different materials, but also shows the effect of machining parameters on the maximum residual stress and identifies both the location and depth of the maximum residual stress.
Moreover, the paper [22] investigated surface residual stress in 45CrNiMoVA and 22SiMn2TiB under different cutting conditions and machining properties. A new approach was proposed based on the Gaussian process regression for predicting surface residual stress due to machining. This was confirmed through comparison with other machine learning techniques.

The aim and objectives of the study
The aim of the study is to examine the effect of milling parameters (cutting speed, feed rate, depth of cut) on the surface of 6061-T3 aluminum alloy by the face milling operation method in order to preserve the milled part, reduce residual stresses on the surface of the workpiece, and extend the life of the equipment used in milling.
To achieve this aim, the following objectives are accomplished: -to develop an L27 orthogonal array (OA) by using X-ray diffraction equipment to perform measurements; -to propose an approach of experimental analysis and simulation of RS in the face milling of 6061-T3 aluminum alloy using the ANN; -to improve the prediction of the process parameters by comparing mathematical model simulations to the experimental method.

1. Object and hypothesis of the study
The paper discusses the surface milling process on AA6061-T3 aluminum alloy, where the first step of the experimental work deals with material selection and preparation using important mechanical tests.
The surface milling process, in which a series of experiments are applied to the metal plate, is the next major step. Surface milling variables that can be controlled include cutting speed, feed rate, and depth of cut, with maximum residual stress being the parameter studied for tolerance. Both of these outcomes are compared and validated using ANN. This study work plan is condensed in the diagram shown in Fig. 1.

2. Material and Method of the Experimental Work
In this work, 6061-T3 aluminum alloy plates with approximate dimensions of 50×45×30 mm commonly used in aluminum structures were applied. The chemical compositions of 6061-T3 aluminum alloy are attached below in Table 1. Furthermore, Table 2 shows typical mechanical properties of wrought aluminum 6061-T3.  (1): When considering strains in terms of inter-planar layout, it is possible to calculate the stresses as shown in (2) [25] below: Therefore, using this formula made it possible to perform two measurements in the path of stress and determine the level normal to the surface. The sin 2 ψ method is the strongest method for determining RS.

3. Face Milling
Basically, all surfaces are washed to remove oxides, dirt, and rust. A 25×20×15 mm rectangle pocket of the experimental specimen is machined using an end mill tool [26].
27 specimens are tested under a variety of parametric conditions to implement the face milling of 6061-T3 aluminum alloy, and the experiments proceed within the process's required range. Turret Milling Machine (Model: MDM 4VS/4HS/4S) is used to mill dry faces. An uncoated tungsten carbide with 5 flutes and 5 mm diameter is used as a cutting tool to improve surface quality and material removal rate as shown in Fig. 2.

Fig. 2. Experimental setup for the milling operation
Through the factorial design L27 experimentations, the input parameters (cutting speed (rpm), feed rate (mm/rev), and depth of cut (mm)) are employed in the calculation of the RS value after face milling from multi-input variables as shown in Table 3. The experiment design is regarded as a technique to analyze and model a system reaction. So, the full factorial design (FFD) is used in the current work to investigate the impact of system input parameters (depth of cut (mm), feed rate (mm/rev), and cutting speed (rpm)). The experimental data are performed by changing one of the parameters with the others fixed to obtain the values of RS.

Evaluation of residual stress
After the face milling operation, RS have been evaluated by the X-350A X-ray diffraction stress analyzer. The milled surface is tested at four various angles along with a measurement device called DX-2700BH multipurpose X-ray diffractometer. The residual stresses are detected using the X-ray diffraction technique with angles of 0°, 15°, 30°, and 45°. In addition, the average RS value is calculated in MPa as shown in Fig. 3, and the RS in the original blanks is -1.519 MPa.
At various psi tilts, a variety of XRD measurement data are acquired. An inter-planar spacing or 2-theta upper position is evaluated and shown above in Fig. 3.

5. Artificial Intelligence (AI)
Predictive and optimal models are among the most important aspects of AI, and they're used in a variety of fields, including manufacturing. Predictive models can be useful in machining operations when the effect of input parameters on process outputs needs to be examined. Optimization algorithms, a subset of intelligent methods, are also utilized to identify the best machining conditions. ANNs are one of the most well-known predictive models, capable of estimating machining operation output(s) in a range of input parameters [27].
ANNs are mathematical simulations of the functioning of the human brain. The neuron is the «brain» of a neural network. Synapses are a series of connections that hold neurons together, and each one is identified by a synaptic weight.
In this work, a network architecture is proposed as shown in Fig. 4 by utilizing the ANN to get the RS first. Since the response of the parameters is non-linear with multi-level variables. As a result, for each parameter, three-level tests are assumed.

Fig. 4. Proposed Network Architecture
The proposed network (Fig. 4) architecture involves the input, hidden, as well as output layers, as shown below: 1. The input layer is the first one. The non-processed data that entered the network are represented by the behavior of input units; neurons at that layer do not perform any computations. The current work has 3 parameters as input layers: cutting speed (rpm), feed rate (mm/rev) and depth of cut (mm) as shown in Table 4. 2. The input layer is followed by the hidden layers, and each hidden unit's activity is governed by the activity of the input units, as well as the weights at the input-hidden unit connections. The network has a number of hidden or visible layers, and their purpose is to enhance the network performance. As even the amount of input neural activity increases, the presence of these network layers becomes more important. The recent work had 10 hidden layers.
3. The last layer is the output layer. Residual stresses in the current research are the last layer.
The model structure of the designed three-layer backpropagation (BP) network is shown in Fig. 5.

Fig. 5. Final neural network architecture
The structure of the given ANN model is shown in Fig. 5, where W represents weights and b indicates bias. Neurons are arranged in layers, and the neurons for every layer act in parallel, as seen above. a b Fig. 3. Residual stress equipment: a -device used to measure and analyze residual stress; b -X-ray diffraction by a crystal lattice

1. Orthogonal Array
An orthogonal array (OA) was created as L27 by using X-ray diffraction equipment to perform measurements. The number of experiments to conduct the investigation is calculated according to the level output of each variable. Each variable consists of three levels 1, 2, and 3, resulting in 3*3 and 27 experiments to be investigated (Table 4). Surface milling process variables were used to explore the effect of changing operating parameters on the maximum residual stress.  Table 4 shows the experimental data for the parameters of aluminum alloy (6061-T3) from the L27 orthogonal array. The experimental data of RS are determined depending on changes in one of the parameters with the others fixed. Fig. 6 shows the relationship between the cutting speed (revolutions per minute) and the residual stress measured in units (newtons per square millimeter) according to the parameters that were previously selected in the face milling process.
Therefore, Fig. 6 shows an increase in RS during the milling process at high cutting speed, roughly intermediate feed rate, and deeper cut.

2. Neural Network Training
The goal of training algorithms is to select neural network's weights, which have to be set in order to predict the values and minimize error. The weight values were automatically configured according to the previous circumstances to assess changes in weights as below in (3):

3. Modelling of Residual Stress Error
An error function is used to combine the differences, resulting in the network error. Typically, the network's mean where i = 1, 2,… n, l = 3. The network was trained using 27 experiments to develop the presented ANN model. Table 5 shows the residual stress values predicted by the ANN and the percentage of error. Table 5 shows that the highest error calculated in the ANN is 0.287. It also demonstrates that the lowest error value of the ANN is -0.008. It can be deduced from the MSE and errors investigated that such ANN. The model now creates higher accuracy compared to the value of errors in previous works, which determined more significant errors [28].
Various BP network training algorithms were tested for the prediction of residual stress throughout end milling in this study. Three variables with tree levels, rotational speed, feed rate and cutting depth were used as inputs. The network output is residual stress. The BP network was a feed-forward network that is tested with different numbers of neurons ten hidden layers, and the results were quite satisfactory. By analyzing the experimental data and ANN data, the following was noted: 1. Whenever the depth of cut was 5 mm, again the feed rate seemed to be 0.35mm/rev, and also the cutting speed would have been 600 rpm, the minimum RS in the experimental data is -75.076 (N/mm 2 ).
2. The best value of RS as determined by the ANN simulation is -135.204 (N/mm 2 ), at a feed rate of 0.25 mm/rev, cutting speed of 1,000 rpm and depth of cut of 4 mm. In comparison with related works [29], this is a good indication of ANN effectiveness.
Additionally, all the best residual stress values were determined in experiments and ANN have a common characteristic occurring at a high cutting speed of 1,000 rpm (between the suggested ones). The lowest and medium values of the feed rate (0.25 mm/rev and 0.3 mm/rev), respectively, are within the range. The depth of cut in both best cases is 4mm; this value is the greatest of the suggested depth of cut values.
Throughout the training procedure, the majority of the predicted and measured values excellently correlate on the linear regression, attempting to reach R = 0.955 in training value systems as shown in Fig. 7. Regression has been discovered to be comparable with other works for both validation and testing, with regression being 0.97393 in overall value achievement, which is an excellent result compared to related works [30].
The occurrence of some genuine amounts that are not particularly consistent with the predicted values can generally be attributed to a variety of factors. This could be the result of errors in experimental findings brought by the environment, tools, and observations. A model of neural networks will not produce a coincidence between actual and predicted values if the residuals really aren't both negative and positive (Fig. 8).  8 depicts the quality of the displayed network as a result of the total for the square error with relation to the enhanced amount of epochs, with very good training and the highest accuracy performance of 0.005313 at period number 7. In fact, this performance could be enhanced by some choices like altering the adaptation, learning, training functions, even changing the ANN design and the number of its layers can affect the network performance. In addition, the increment in training data can work well. The training state for the current case is shown in Fig. 9. A comparison of experimental RS values and estimated neural network values (throughout training and test sets) is presented in Fig. 10.
The training/testing failures of networks are not always minor, but also close to each other as shown above in Fig. 10. As a result, neural networks have already been trained exceptionally well.

Discussion of the Neural Network Results
First, the XRD test gives good results, as shown in Table 4, where all experimental results with various selected parameters are recognized by the artificial neural network.
At the end of this stage, each experimental test was optimized.
In fact, successful face milling of a part requires establishing a plane that is exactly perpendicular to the machine tool's spindle, from which the exact slots to each other can be established. Also, within specified tolerances, the XRD technique measures internal stresses to guide the correct phase and identify correct input data to the neural network, ensuring good network performance. Second, the proposed ANN offers a simple, flexible, efficient, and economical method, along with the ability to learn, improve, and enhance, especially when compared to other control methods. By using this artificial intelligence method, the maximum residual stress reaches -135.204 N/mm 2 , and the minimum RS reaches -75.076 N/mm 2 as shown in Table 5. This explains the good behavior of the proposed ANN that processes RS to achieve a minimum value, and controls it in addition to improving the system life as a result of reduced cutting speed.
A comparison of the performance based on the MSE (mean squared error) was obtained by the backpropagation neural network, which was obtained in this work with previous related studies in [31]. The average percentage of accuracy in the last reference reached 81.71 %, while in this study the average percentage of accuracy preserved is 97.393 %.
Some limitations have been found, such as operators of milling machines. They need proper training for different tasks like design and programming time and experience in selecting optimal parameters for the milling machine. This can be overcome by developing the skills of employees to deal with different types of CNC machines and allowing arbitrary values for parameters.
As a development of this study, other milling parameters (cutting tool, squeeze time, width of cut, metal plate thickness, etc.) could be investigated to observe the behavior of other properties. It is possible to add other mechanical tests (surface roughness, hardness, etc.), items that require the use of different testing machines for metals. More research cases are more reliable and provide a better database of ANN models. Also, using different AI methods or combining them like CNN gives better results. Nonetheless, modern CNC (Convolutional Neural Network) machines are perfect for solving computer vision-related problems. Milling can open the door to easily studying new parameters and performance efficiencies of milling. These machines have cost and proficiency barriers.

Conclusions
1. In the presented development of orthogonal arrays, L27 is developed using an X-ray diffractometer. The X-ray diffraction method is employed to measure the distribution of RS on the surface. Experimental investigations are conducted to determine the effects of process parameters such as depth of cut, feed rate, and cutting speed on residual stress. The highest value of RS = -135.217 MPa with an input vector depth of cut = 4 mm, feed rate = 0.25 mm/rev, and cutting speed = 1,000 rpm was found.
2. The highest RS predicted in the ANN program is -135.204 MPa. This is a considerable improvement in the life and performance of the component, furthermore, it reduces errors. On the other hand, the least RS indicated by the ANN would be less than the least experimental results (-75.009 MPa vs. -75.076 MPa) as shown above in Table 5. These results are obtained with the depth of cut = 5 mm, feed rate = 0.35 mm/rev, and cutting speed = 600 rpm. This means that ANN provides optimum machining conditions and minimizes RS.
3. The results of the work show that ANN is capable of predicting the RS of the milling process for selected specimens, which can be generalized to other materials. The results show that the proposed model is highly accurate, with a prediction error of -0.008 to 0.287. It offers fundamental information for machining thin-walled aluminum alloy workpieces, which seems to have important potential application. In the future, in order to increase the generality of the prediction model, we will add more variables affecting the RS brought on by grinding, and also employ additional forecasting techniques like the Taguchi method or fuzzy logic.

Conflict of interest
The authors declare that they have no conflict of interest in relation to this research, whether financial, personal, authorship or otherwise, that could affect the research and its results presented in this paper.

Financing
The study was performed without financial support.

Data availability
The manuscript has no associated data.