# Optimizing Cutting Conditions and Prediction of Surface Roughness in Face Milling of AZ61 Using Regression Analysis and Artificial Neural Network

Authors: Nabeel H. Alharthi; Sedat Bingol; Adel T. Abbas; Adham E. Ragab; Ehab A. El-Danaf; Hamad F. Alharbi
Journal: Advances in Materials Science and Engineering
 (2017)

---

## Abstract

In this paper artificial neural network (ANN) and regression analysis were used for the prediction of surface roughness. Five models of neural network were developed and the model that showed best fit with experimental results was with 6 neurons in the hidden layer. Regression analysis was also used to build a mathematical model representing the surface roughness as a function of the process parameters. The coefficient of determination was found to be 94.93% and 93.63%, for the best neural network model and regression analysis, respectively, from the comparison of the models with thirteen validation experimental tests. Optical microscopy was conducted on two machined surfaces with two different values of feed rates while maintaining the spindle speed and depth of cut at the same values. Examining the surface topology and surface roughness profile for the two surfaces revealed that higher feed rate results in relatively thick roughness markings that are distantly spaced, whereas low values of feed rate result in thin surface roughness markings that are closely spaced giving better surface finish.


---

## Body

## 1. Introduction

Surface roughness is often taken as an important indicator of the quality of machined parts. The roughness influences the performance greatly in terms of mechanical parts as well as production cost. It is worth mentioning that surface roughness also influenced the mechanical properties such as corrosion resistance, creep life, and fatigue behavior. Extensive previous work [1–4] has been done on investigating the effect of the following parameters: cutting depth, feed rate, cutting speed, tool nose radius, lubrication condition, and cutting tool material, on the following response variables: tool wear, surface roughness, cutting forces, production time, and cost. These studies were conducted using different routes; analysis of variance, neural networking coupled with genetic algorithm, and neural networking coupled with electromagnetism optimization [5–10].Magnesium, with a density of 1.8 g/cm3, is considered to be the lightest structural metal. It is also one of the easiest metals to machine. Magnesium is often chosen because of its light weight. Its excellent machinability is a valuable advantage when a large amount of machining must be done. Less power is required for removing a given volume of magnesium by machining than for any other commonly machined metal. Heavy cuts can be taken at high speeds and feeds which can reduce machining time. Thus fewer machines, less capital investment, and less floor space and overhead costs are associated with machining magnesium and its alloys [5].Chen et al. [6] applied the Taguchi methodology to investigate the effect of lubrication on turning TC11, feed and cutting depth, and velocity. The process response variables studied are cutting forces, surface roughness (Ra), and temperature on cutting zones. The results showed that for orthogonal cutting the cutting depth is major parameter distressing cutting force and temperature, while the feed rate has major influence on the roughness. It was also reported that the cutting temperature, force, and surface roughness of diamond layered inserted tools were higher than uncoated, mainly with minimum quantity lubrication technology.Azam et al. [7] investigated surface roughness (Ra) for turning high strength low-alloy steel (AISI 4340) using multilayer coated carbide tools. Response surface methodology (RSM) was utilized to improve the correlation between Ra and machining constraints (i.e., depth, speed, and feed). It was observed that the feed rate is the main constraint that affects surface roughness. The efficacy of the proposed model is confirmed through validation data with average estimate error of 3.38%.Manivel and Gandhinathan [8] employed the Taguchi method to optimize the machining parameters (cutting speed, feed rate, depth of cut, and nose radius) in turning under dry condition using carbide inserts CVD coated with AL2O3/MT TICN. The analysis of variance (ANOVA) along with the signal to noise ratio were used to optimize the cutting parameters to minimize surface roughness and tool wear. It was reported that cutting speed is the most dominant factor affecting the response variables.Raja et al. [9] implemented the Taguchi technique to analyze the results of turning AISI 316 and AISI 410 stainless steels. The process variables examined were feed rate, cutting speed, and depth of cut. Linear feed rate followed by quadratic feed rate were the most significant factors affecting surface roughness. Optimum cutting conditions for minimum surface roughness were identified for different cutting tool materials. The TiAlN composition coated insets gave the best performance.Zhang et al. [10] investigated the finish turning of AISI 52100 bearing steel with low carbide born nitride (CBN) tools through an optimization process that applies Mixed Integer Evolutionary Algorithm (MIEA). Process parameters including tool geometry, cutting forces, and temperature were considered to minimize surface roughness and tool wear under practical constraints. The optimal design outcomes were validated against experimental and analytical work. The work showed that the proposed optimization technique had excellent search capability and computational efficiency for this mixed integer, constrained, highly nonlinear, nonexplicit, and not analytically differential optimization problem.Jafarian et al. [11] predicted tool wear, cutting forces, and surface roughness using three artificial neural networks (ANN). An innovative process for training the ANNs using evolutionary algorithms rather than conventional systems that uses back-propagation was proposed. The optimization was carried to minimize surface roughness and cutting forces and maximize tool life in turning process. Genetic algorithm (GA) and particle swarm optimization (PSO) were employed to improve each output while keeping the rest of the outputs in the appropriate range. The acquired outcomes revealed that trained neural networks with genetic GA as an optimization objective functions present a potent tool to scrutinize the effect of each constraint on the output model with high accuracy level.Mokhtari Homami et al. [12] employed a full factorial design complemented with artificial neural network (ANN) and subsequently optimization by genetic algorithm (GA) to study the main effects and interactions that minimize surface roughness and flank wear. It was reported that feed rate, nose radius, and approach angle had a significant effect on the flank wear and the surface roughness, but the cutting velocity had the most significant effect on the flank wear alone.Jafarian et al. [13] applied neural networking and modified Nondominated Sorting Genetic Algorithm to optimize tool life and surface roughness in turning of Inconel 718 Super alloy. The work provided a strategy to give an efficient approach for tool life estimation in machining processes. It was reported that increasing the cutting speed and decreasing depth of cut and feed rate resulted in a better surface quality. Multiobjective optimization was implemented and the optimal conditions for maximizing tool life and minimizing surface roughness were identified.Vaxevanidis et al. [14] investigated the machining of Ti-6Al-4V alloy, where spindle speed, feed rate, and depth of cut were taken as the process variables and the response variables were the main cutting force (Fz) and the average surface roughness (Ra). They reported that the application of this alloy is limited by tool wear and chattering. The results of 27 runs were analyzed using analysis of variance and showed strong interactions between process parameters. A feed forward back-propagation neural network was, also, developed to simulate the data. It was indicated that this approach can be utilized to predict and optimize Fz and Ra.Senthil Babu and Vinayagam [15] have reviewed different methodologies for calculating surface roughness from machining constraints like depth, feed rate, and cutting speed. It has been reported (REF) that the electromagnetism (EM) algorithm coupled with back-propagation neural network is competent and specific system in attaining the lower surface roughness. However, a feed forward neural network model using Adaptive Particle Swarm Optimization (APSO) algorithm which has proven to be a very efficient process was proposed.The objective of this paper is to compare the predicting capability of artificial neural network and regression analysis for surface roughness generated by different cutting conditions of spindle speed (rpm), feed rate (mm/min), and depth of cut (mm). In this paper, analysis of experimental data from Face Milling of AZ61 alloy will be conducted using five different ANN models and the results will be compared to the experimental results to select the model with the highest accuracy. The results from the best ANN model will then be compared to the results from a regression mathematical model.


## 2. Material and Methods

Chemical composition of Magnesium Alloy AZ 61, used in this study, is shown in Table1.Table 1
Chemical composition of magnesium AZ 61 alloy.
Element
% by mass
Aluminum
5.9
Zinc
0.9
Copper
<0.03
Silicon
<0.01
Iron
<0.01
Nickel
<0.005
Magnesium
BalanceThe machining of specimens was carried out on Emco-Mill Concept 45 CNC vertical milling machine. The machine was equipped with Sinumeric 840-D. The specimen surface area and height are 40 × 100 mm and 60 mm. The diameter of the cutter is 63 mm with 5 edges. To remove the high metal and quality surface finish, cutting tool with carbide inserts model face mill holder and Sandvik carbide coated inserts were used (i.e., Sandvik R245-063Q22-12M and Sandvik R245-12 T3M-PM4240). The cutter is of 5 edges with 63 mm diameter. The milling cutter was developed for heavy metal removal and mirror finishing. Furthermore, it is also fabricated with improved corners to reduce burr formation and dissipating of the component. The developed cutter is appropriate for face milling applications in diverse materials (i.e., stainless steel, steel, cast iron, aluminum, and titanium alloys) Figure1 displays the test rig for machining workpieces. The test design was executed through 64 runs through a 43 full factorial design. The runs were divided into 16 classes and each four classes were subjected to one common spindle speed (500, 1000, 1500, and 2000 rpm). All the classes were machined by four cutting depth levels (0.50, 1.0, 1.5, and 2.0 mm) and each depth was treated by feed rate having four levels (50, 100, 150, and 200 mm/min). Figure 2 demonstrated the model TESA Rugosurf 90-G, which is used to measure the surface roughness and ultimately surface topography. The list of samples and their surface roughness measurements are detailed in Table 4.Figure 1
Test rig for machining workpieces.Figure 2
Test rig for measuring surface roughness Ra (µm).


### 2.1. Development of the ANN Model

Artificial Neural Network (ANN) is a calculation method which is inspired from the behavior of human brain and neural system. ANN can recognize the complex relation between input and output data and then estimate the new results on the basis of experiences [16]. ANN is accepted for solution of the complex engineering systems efficiently. In this study, the usability of the ANN was examined to predict the surface Ra (µm) by the developed ANN models. The three parameters which are spindle speed (rpm), depth of cut (mm), and table feed (mm/min) were taken as input parameters to develop ANN models. The structure of the ANN used in this study with three inputs and one output is shown in the Figure 3. The used data for the developed ANN model is obtained from the performed experiments of this study. Different learning rules and structures can be used for an ANN. The common used ANN models are feed forward, multilayer perceptions trained by back-propagation based on gradient descent method. This algorithm can solve a continuous function approximately and shortly. The various ANN structures are established with the proper combinations of the input data to find the best model. In this study, 80% (51 experimental runs) of the total data was used to train the network while the rest of data, 20% (13 experimental runs), was used to test and validate the network. The validation test data was not used in the stage of training of the network, and this is a good indicator to test the accuracy of the developed ANN models. In addition, the best ANN model was developed among all tried models by changing the number of neurons on the hidden layer and using different transfer functions to estimate surface Ra (µm) successfully. The different variations of the neural structures have been employed to obtain convergence. Back-propagation algorithms and the feed forward neural networks composed multilayer detection have been conducted in this study.Figure 3
Neural network structures to predict of the surface Ra (µm).


### 2.2. Development of Regression Model

Multivariable regression analysis was used to build a mathematical model relating the process outcome (surface roughness Ra) with the three studied input parameters (spindle speed, depth of cut, and feed rate). The same 51 experiments used for training the ANN were used for the regression analysis. The remaining 13 experimental runs were used in testing both the regression and ANN models.Regression was conducted using Minitab 17 software with stepwise technique to eliminate the insignificant terms from the model. The model was fitted in the form given by [2](1)Ra=βo+∑i=1kβiXi+∑i=1kβiiXi2+∑∑i<jβijXiXj+∑∑i<j<kβijkXiXjXk+∑∑i≠jβiijXi2Xj+ϵi,where βo is the constant term, βi represents the linear effects, βii represents the pure quadratic effects, βij represents the second level interaction effects, βijk represents the third level interaction effects, βiij represents the effect of interaction between linear and quadratic terms, and ϵi represents the error in predicting experimental surface roughness.Material removal rate (MRR) was calculated using (2) for each run. Desirability function approach was used to maximize MRR maintaining Ra below 0.4 µm as a maximum limit for the surface roughness value.(2)MRR=DOC∗Fr∗w,where MRR is volume removed per unit time (mm3/min.), DOC is depth of cut (mm), Fr is the feed rate (mm/min.), and w is the width of cut (mm).


## 2.1. Development of the ANN Model

Artificial Neural Network (ANN) is a calculation method which is inspired from the behavior of human brain and neural system. ANN can recognize the complex relation between input and output data and then estimate the new results on the basis of experiences [16]. ANN is accepted for solution of the complex engineering systems efficiently. In this study, the usability of the ANN was examined to predict the surface Ra (µm) by the developed ANN models. The three parameters which are spindle speed (rpm), depth of cut (mm), and table feed (mm/min) were taken as input parameters to develop ANN models. The structure of the ANN used in this study with three inputs and one output is shown in the Figure 3. The used data for the developed ANN model is obtained from the performed experiments of this study. Different learning rules and structures can be used for an ANN. The common used ANN models are feed forward, multilayer perceptions trained by back-propagation based on gradient descent method. This algorithm can solve a continuous function approximately and shortly. The various ANN structures are established with the proper combinations of the input data to find the best model. In this study, 80% (51 experimental runs) of the total data was used to train the network while the rest of data, 20% (13 experimental runs), was used to test and validate the network. The validation test data was not used in the stage of training of the network, and this is a good indicator to test the accuracy of the developed ANN models. In addition, the best ANN model was developed among all tried models by changing the number of neurons on the hidden layer and using different transfer functions to estimate surface Ra (µm) successfully. The different variations of the neural structures have been employed to obtain convergence. Back-propagation algorithms and the feed forward neural networks composed multilayer detection have been conducted in this study.Figure 3
Neural network structures to predict of the surface Ra (µm).


## 2.2. Development of Regression Model

Multivariable regression analysis was used to build a mathematical model relating the process outcome (surface roughness Ra) with the three studied input parameters (spindle speed, depth of cut, and feed rate). The same 51 experiments used for training the ANN were used for the regression analysis. The remaining 13 experimental runs were used in testing both the regression and ANN models.Regression was conducted using Minitab 17 software with stepwise technique to eliminate the insignificant terms from the model. The model was fitted in the form given by [2](1)Ra=βo+∑i=1kβiXi+∑i=1kβiiXi2+∑∑i<jβijXiXj+∑∑i<j<kβijkXiXjXk+∑∑i≠jβiijXi2Xj+ϵi,where βo is the constant term, βi represents the linear effects, βii represents the pure quadratic effects, βij represents the second level interaction effects, βijk represents the third level interaction effects, βiij represents the effect of interaction between linear and quadratic terms, and ϵi represents the error in predicting experimental surface roughness.Material removal rate (MRR) was calculated using (2) for each run. Desirability function approach was used to maximize MRR maintaining Ra below 0.4 µm as a maximum limit for the surface roughness value.(2)MRR=DOC∗Fr∗w,where MRR is volume removed per unit time (mm3/min.), DOC is depth of cut (mm), Fr is the feed rate (mm/min.), and w is the width of cut (mm).


## 3. Results and Discussions

The developed neural network models and structures to estimate surface Ra (µm) are given in Table 2. Determination coefficient (R2), mean square error (MSE), and mean absolute error (MAE), from the comparison with the 13 validation experimental tests are used for the statistical verification to evaluate the results of the developed ANN models. From Table 2, it can be seen that model 4 among the developed models in this study is the best model in terms of higher R2 and lower MSE and MAE. The developed ANN models were also trained with the different neuron numbers to find ideal number in the hidden layer. The network optimization was started with four neurons in the hidden layer. Then, the number of neurons was increased from 4 to 12 to achieve the highest (R2). As a result, the optimal number of neurons was decided as 6 with Levenberg algorithm and TanhAxon function (Table 2).Table 2
Comparison of the developed different ANN structures for surface Ra (μm).
ANN model
Algorithm
Function
Neuron number
R
R
2
MAE
MSE
Model 1
Momentum
TanhAxon
4
0.9319
0.8684
0.023
0.0008
Model 2
Momentum
Sigmoid Axon
6
0.9074
0.8234
0.022
0.0006
Model 3
Levenberg
Sigmoid Axon
10
0.8695
0.7560
0.034
0.0017
Model 4
Levenberg
TanhAxon
6
0.9743
0.9493
0.015
0.0002
Model 5
Levenberg
TanhAxon
12
0.9701
0.9411
0.015
0.0003The regression fitted mathematical model is given by (3). Determination coefficient (R2), mean square error (MSE), and mean absolute error (MAE) were calculated to be 0.847, 0.0005, and 0.017, respectively, for the 51 experiment runs used in the regression analysis.(3)Ra=0.2733-0.000212SS-0.0645DOC+0.001059Fr+0.00000006SS∗SS+0.00004730SS∗DOC-0.00000026SS∗Fr.Predictability of both regression and ANN models was compared using the 13 experimental validation cases that were not included in the modeling phase. Table3 illustrates the results of this comparison. The ANN predictions are achieved using model 4 which exhibited the highest R2 value. Experimental versus predicted results obtained from both ANN and regression are shown in Figures 4 and 5, respectively. It is clearly seen that there is a good agreement between the experimental results and the predicted results by both models.Table 3
Comparison between regression model and ANN predictions.
Machining parameters
Measured Ra
Regression model
ANN
SS
DOC
Fr
Predicted Ra
Residual
Predicted Ra
Residual
500
0.5
150
0.332
0.301
0.031
0.316
0.016
500
1
200
0.37
0.327
0.043
0.356
0.014
500
2
50
0.164
0.147
0.017
0.149
0.015
1000
0.5
100
0.184
0.193
−0.009
0.158
0.026
1000
1
150
0.207
0.224
−0.017
0.208
−0.001
1000
1.5
200
0.258
0.255
0.003
0.272
−0.014
1500
0.5
50
0.115
0.127
−0.012
0.142
−0.027
1500
1
100
0.181
0.164
0.017
0.162
0.019
1500
1.5
150
0.217
0.200
0.017
0.199
0.018
1500
2
200
0.235
0.237
−0.002
0.218
0.017
2000
1
50
0.153
0.146
0.007
0.144
0.009
2000
1.5
100
0.155
0.188
−0.033
0.169
−0.014
2000
2
150
0.255
0.230
0.025
0.266
−0.011Table 4
Sample ID
Group
Spindle speed (rpm)
Depth of cut (mm)
Table feed (mm/min)
Surface Ra (μm)
Material removal rate (MRR) mm3/min
1
1
500
0.5
50
0.185
1000
2
500
0.5
100
0.226
2000
3
500
0.5
150
0.332
3000
4
500
0.5
200
0.403
4000
5
2
500
1
50
0.21
2000
6
500
1
100
0.225
4000
7
500
1
150
0.327
6000
8
500
1
200
0.37
8000
9
3
500
1.5
50
0.177
3000
10
500
1.5
100
0.217
6000
11
500
1.5
150
0.259
9000
12
500
1.5
200
0.313
12000
13
4
500
2
50
0.164
4000
14
500
2
100
0.174
8000
15
500
2
150
0.22
12000
16
500
2
200
0.248
16000
17
5
1000
0.5
50
0.133
1000
18
1000
0.5
100
0.184
2000
19
1000
0.5
150
0.197
3000
20
1000
0.5
200
0.245
4000
21
6
1000
1
50
0.14
2000
22
1000
1
100
0.189
4000
23
1000
1
150
0.207
6000
24
1000
1
200
0.228
8000
25
7
1000
1.5
50
0.154
3000
26
1000
1.5
100
0.19
6000
27
1000
1.5
150
0.202
9000
28
1000
1.5
200
0.258
12000
29
8
1000
2
50
0.135
4000
30
1000
2
100
0.2
8000
31
1000
2
150
0.238
12000
32
1000
2
200
0.274
16000
33
9
1500
0.5
50
0.115
1000
34
1500
0.5
100
0.185
2000
35
1500
0.5
150
0.215
3000
36
1500
0.5
200
0.242
4000
37
10
1500
1
50
0.156
2000
38
1500
1
100
0.181
4000
39
1500
1
150
0.185
6000
40
1500
1
200
0.224
8000
41
11
1500
1.5
50
0.137
3000
42
1500
1.5
100
0.149
6000
43
1500
1.5
150
0.217
9000
44
1500
1.5
200
0.24
12000
45
12
1500
2
50
0.12
4000
46
1500
2
100
0.149
8000
47
1500
2
150
0.191
12000
48
1500
2
200
0.235
16000
49
13
2000
0.5
50
0.136
1000
50
2000
0.5
100
0.153
2000
51
2000
0.5
150
0.187
3000
52
2000
0.5
200
0.228
4000
53
14
2000
1
50
0.153
2000
54
2000
1
100
0.163
4000
55
2000
1
150
0.213
6000
56
2000
1
200
0.22
8000
57
15
2000
1.5
50
0.14
3000
58
2000
1.5
100
0.155
6000
59
2000
1.5
150
0.217
9000
60
2000
1.5
200
0.228
12000
61
16
2000
2
50
0.18
4000
62
2000
2
100
0.225
8000
63
2000
2
150
0.255
12000
64
2000
2
200
0.268
16000Figure 4
Experimental and ANN predicted results in the test period.Figure 5
Experimental and regression predicted results.Desirability function approach was used to estimate the values of studied process parameters that maximize the MRR keeping the Ra at levels not exceeding a practical value of 0.4μm. The optimization plot, illustrated in Figure 6, shows that an optimum MRR of 13680 mm3/min with Ra = 0.283 μm is obtained at spindle speed 500 rpm, depth of cut 2 mm, and feed rate 200 mm/min.Figure 6
Optimization plot for Ra and MRR.Surface roughness in AZ61 alloy was found to increase with increasing feed rate and depth of cut which both result in bigger cut areas that are consequently associated with higher cutting forces and higher friction which lead to poor surface finish. It was noticed from the surface roughness profile that high feed rates were associated with larger roughness markings horizontal spacing. Also, the vertical spacing between peaks and troughs of the surface irregularities was larger. Thus, higher feed rates led to higher surface roughness. Figure7 represents an optical microscopy while Figure 8 represents the profile of surface roughness graph by surface roughness tester for the machined surface under spindle speed of 500 rpm, depth of cut of 0.5 mm, and table feed rate of 150 mm/min. Figure 9 represents an optical microscopy while Figure 10 represents the surface roughness profile by surface roughness tester for the following cutting conditions: spindle speed of 500 rpm, depth of cut of 0.5 mm, and table feed rate of 50 mm/min. The effect of feed rate is obvious, in a sense that low feed rate produced relatively thin surface roughness markings that are closely spaced, whereas high feed rate produced relatively thick roughness markings that are distantly spaced.Figure 7
Optical microscopy for machined surface with speed 500 rpm, depth of cut 0.5 mm, and feed rate 150 mm/min.Figure 8
Profile of surface roughness graph by surface roughness tester for machined surface with speed 500 rpm, depth of cut 0.5 mm, and feed rate 150 mm/min.Figure 9
Optical microscopy for machined surface with speed 500 rpm, depth of cut 0.5 mm, and feed rate 50 mm/min.Figure 10
Profile of surface roughness graph by surface roughness tester for machined surface with speed 500 rpm, depth of cut 0.5 mm, and feed rate 50 mm/min.


## 4. Conclusions

In this study, an ANN model and regression analysis were developed to predict the surface Ra (µm) for different spindle speed (rpm), depth of cut (mm), and table feed (mm/min), in face milling of AZ61 magnesium alloy. Both models were compared with validation experimental tests. The following results can be concluded:(i)
The developed ANN model and regression model can predict the surface Ra (µm) with high accuracy. The coefficients of determination were found to be about 95% and 94%, for the best neural network model and regression analysis, respectively, from the comparison of the models with thirteen new validation experimental tests that were not used in the modeling phase.(ii)
Maximizing the MRR while keeping the Ra at levels not exceeding a practical value of 0.4μm, through multivariable optimization, shows that an optimum MRR of 13680 mm3/min with Ra = 0.283 μm is obtained at spindle speed 500 rpm, depth of cut 2 mm, and feed rate 200 mm/min.(iii)
Optical microscopy was conducted on two machined surfaces to reveal the effect of feed rate while retaining the value of rpm and depth of cut constant. A hypothetical analysis for relating the higher surface roughness for the higher feed rate is reported.



---

*Source: 7560468-2017-05-30.xml*