Influence of the Tool Cutting Edge Helix Angle on the Surface Roughness after Finish Milling of Magnesium Alloys

This paper shows the surface quality results after finishing milling of AZ91D and AZ31 magnesium alloys. The study was performed for variable technological parameters: cutting speed, feed per tooth, axial depth of cut and radial depth of cut. The tools used in the study were two carbide cutters with a different tool cutting edge helix angle. The measurement of the research results presented the surface roughness parameters was made on the lateral faces and the end faces of the specimens. Statistical analysis and simulations using artificial neural networks were carried out with the Statistica software. The normality of the distribution was examined, and the hypotheses of the equality of mean values and variance were verified. For the AZ91D magnesium alloy on the lateral and the end faces (Ra, Rz parameters), simulations were carried out. Two types of ANN were used: MLP (Multi-layered perceptron) and RBF (Radial Basis Function). To increase the machining stability and to obtain a high surface finish, the more suitable tool for finishing milling is the tool with a helix angle of λs = 20°. Artificial neural networks have been shown to be a good tool for predicting surface roughness parameters of magnesium alloys after finishing milling.


Introduction
In finish machining, the standard and final requirement is the production of parts with a precise shape, specific dimensions and high-quality surface. The ultimate objective is to make milling the final machining operation, thus eliminating, e.g., the process of finish grinding that generates harmful grinding dust. The geometric structure created in this way is defined as the overall surface condition and is the final stage of the process of machining a given part.
The surface analysis is carried out by researchers around the world sometimes these studies concern analysis in terms of tribological properties and tribological wear [1] (through, inter alia, the application of protective layers [2]), or the analysis of the suitable tuning of the local composition and atomic arrangement to obtain excellent mechanical properties [3]. Another area of research related to surface analysis relates to the geometric structure of the surface, which consists of waviness, roughness, shape errors and structure directionality, whereas the surface quality includes the following, roughness, waviness and surface defects. It should be noted that the considered surface should be analysed, taking into account its functional and strength characteristics. Whereas the geometrical structure of the surface and the physical properties of the surface layer (including its structure, hardness and internal stress) constitute the so-called technical quality of the product [4,5].
One of the most frequently analysed and well-known surface roughness parameters (despite there being more than 30 of them) is the Ra parameter. Nevertheless, it does not provide information on the shape of the profile and individual peaks that only slightly  [29] turning ANN-GA Ra Ti-6Al-4 V 2015 [26] milling ANFIS Ra AA6061, AA2024, AA7075 2019 [37] milling ANN Ra Ti-6Al-4 V 2016 [38] milling ANN Ra S45C steel 2019 [41] milling ANN Ra AA6061 2021 [35] milling ANN Ra, Rz, RSm AZ91D 2021 [30] milling ANN Ra Ti-6Al-4 V 2019 [39] milling ANN Ra, Rz Inconel 718 2020 [20] milling ANN-GA Ra P1.2738 2020 [42] milling ANN-GA Ra AISI D3 2019 [36] milling ANN-GA Ra AZ91D 2018 [31] Low-speed turning ANN Ra AISI316 2015 [33] dry turning ANN Ra, Rz, Rt AISI 420 2019 [28] dry milling ANN Ra Co-28Cr-6Mo, Co-20Cr-15W-10Ni 2021 [40] AWJM ANN Ra, Rz, RSm AZ91D 2018 [32] AWJM ANN-GA Ra Al 6060 2016 [34] Based on the comparison of modelling methods using ANNs for the surface roughness parameter, it is clearly seen that researchers in the field of turning and milling primarily deal with modelling only one surface roughness parameter, which is the Ra parameter. It seems that such a narrow scope of research is insufficient to carry out a detailed analysis of surface conditions, as mentioned above. Few researchers have attempted to model more than one parameter. One of such works is the study by Zerti et al. [28], who performed dry turning simulations and extended their analyses with the Rz and Rt parameters. Moreover, the authors of this study [30] performed surface roughness tests (Ra, Rz, RSm) after milling AZ91D magnesium alloy using PCD inserts.
Based on the analysis of the literature on the machinability of magnesium alloys and the possibility of modelling roughness parameters, it can be concluded that: thanks to excellent properties and good machinability, the use of magnesium alloys is constantly expanded, especially where high mechanical strength and low specific weight are needed, -it is justified to extend the research to expand the range of the technological parameters; however, one should take into account the tendency of magnesium alloys to spontaneous combust with a sudden increase in temperature, -surface roughness is estimated using a small number of parameters, usually Ra and Rz-there is no wider analysis of a larger group of surface roughness parameters, including a more detailed analysis of the features and operational properties of the machined surface, -the research works conducted so far have referred only to roughing.
Therefore, the aim of this study is to determine the 2D surface roughness for AZ91D and AZ31 magnesium alloys after finish milling. The influence of the change of machining parameters and the change of the helix angle was analysed. The fact that there is no publication on the finish machining of magnesium alloys, which would constitute a significant supplement to the previous research works usually focused on the conditions of high-speed, effective roughing, can be considered a novelty.

Testing Methodology
The object of the research was two magnesium alloys: AZ91D and AZ31. Milling was carried out in three sets of cutting parameters for both the lateral face and the end face of the tested samples, in the following ranges: cutting speed v c = 400-1200 m/min, feed per tooth f z = 0.05-0.3 mm/tooth, axial depth of cut a p = 0.1-0.5 mm and radial depth of cut a e = 0.5-3.5 mm. The surface roughness parameters analysed were: Ra, Rz, RSm, Rsk and Rku. Two carbide cutters were applied in the research: -triple-edge milling cutter: Ø16 mm, tool cutting edge helix angle λ s = 20 • , tool rake angle γ = 12 • , tool clearance angle α = 8 • , -triple-edge milling cutter: Ø16 mm, tool cutting edge helix angle λ s = 50 • , tool rake angle γ = 15 • , tool clearance angle α = 8 • .
The choice of tools was determined by verifying the influence of the tool cutting edge helix angle (inclination angle) on the surface roughness. The research schematic diagram of the test set-up is given in Figure 1. performed dry turning simulations and extended their analyses with the Rz and Rt parameters. Moreover, the authors of this study [30] performed surface roughness tests (Ra, Rz, RSm) after milling AZ91D magnesium alloy using PCD inserts. Based on the analysis of the literature on the machinability of magnesium alloys and the possibility of modelling roughness parameters, it can be concluded that: thanks to excellent properties and good machinability, the use of magnesium alloys is constantly expanded, especially where high mechanical strength and low specific weight are needed, -it is justified to extend the research to expand the range of the technological parameters; however, one should take into account the tendency of magnesium alloys to spontaneous combust with a sudden increase in temperature, -surface roughness is estimated using a small number of parameters, usually Ra and Rz-there is no wider analysis of a larger group of surface roughness parameters, including a more detailed analysis of the features and operational properties of the machined surface, -the research works conducted so far have referred only to roughing.
Therefore, the aim of this study is to determine the 2D surface roughness for AZ91D and AZ31 magnesium alloys after finish milling. The influence of the change of machining parameters and the change of the helix angle was analysed. The fact that there is no publication on the finish machining of magnesium alloys, which would constitute a significant supplement to the previous research works usually focused on the conditions of highspeed, effective roughing, can be considered a novelty.

Testing Methodology
The object of the research was two magnesium alloys: AZ91D and AZ31. Milling was carried out in three sets of cutting parameters for both the lateral face and the end face of the tested samples, in the following ranges: cutting speed vc = 400-1200 m/min, feed per tooth fz = 0.05-0.3 mm/tooth, axial depth of cut ap = 0.1-0.5 mm and radial depth of cut ae = 0.5-3.5 mm. The surface roughness parameters analysed were: Ra, Rz, RSm, Rsk and Rku. Two carbide cutters were applied in the research: -triple-edge milling cutter: Ø16 mm, tool cutting edge helix angle λs = 20°, tool rake angle γ = 12°, tool clearance angle α = 8°, -triple-edge milling cutter: Ø16 mm, tool cutting edge helix angle λs = 50°, tool rake angle γ = 15°, tool clearance angle α = 8°.
The choice of tools was determined by verifying the influence of the tool cutting edge helix angle (inclination angle) on the surface roughness. The research schematic diagram of the test set-up is given in Figure 1.   The cutters were mounted into a CELSIO HSK-A63 16 × 95 tool holder from SCHUNK (Lauffen am Neckar, Germany) using an ISG 2200 shrink fit tool holder machine from H. Diebold GmbH & CO (Jungingen, Germany). The tool with the holder was balanced dynamically by a CIMAT RT 610 balancing machine (Bydgoszcz, Poland), according to ISO 21940-11:2016 balancing class G 2.5. The measured value of the residual unbalance was 0.25 gmm. Milling was performed on an AVIA VMC 800 HS-type vertical machining centre, equipped with the Heidenhain iTNC 530 control system, with a maximum spindle speed of 24,000 rpm. The schematic diagram of the test stand is given in Figure 2. Figure 2a presents the object of the study. Figure 2b shows the visualisation with the roughness measurement model. The quality of the end face and the lateral face of the AZ31 and AZ91D magnesium alloys specimens was described using 2D roughness parameters. The cutters were mounted into a CELSIO HSK-A63 16 × 95 tool holder from SCHUNK (Lauffen am Neckar, Germany) using an ISG 2200 shrink fit tool holder machine from H. Diebold GmbH & CO (Jungingen, Germany). The tool with the holder was balanced dynamically by a CIMAT RT 610 balancing machine (Bydgoszcz, Poland), according to ISO 21940-11:2016 balancing class G 2.5. The measured value of the residual unbalance was 0.25 gmm. Milling was performed on an AVIA VMC 800 HS-type vertical machining centre, equipped with the Heidenhain iTNC 530 control system, with a maximum spindle speed of 24,000 rpm. The schematic diagram of the test stand is given in Figure 2. Figure 2a presents the object of the study. Figure 2b shows the visualisation with the roughness measurement model. The quality of the end face and the lateral face of the AZ31 and AZ91D magnesium alloys specimens was described using 2D roughness parameters.  The surface roughness measurements were carried out using a HOMMEL TESTER T1000 contact profilometer from ITA K Pollak M Wieczorowski Sp. J. (Poznań, Poland). The measurement parameters were: traverse length lt = 4.8 mm, sampling length lr = 0.8 mm, scanning rate v t = 0.5 mm/s and measuring range/resolution M = ±320 µm/0.04 µm. Each measurement was repeated five times on each surface towards the assessment of the mean values and standard deviation.

Statistical Analysis Methodology
The data obtained from the roughness measurements were subjected to statistical verification. The output data obtained in the study were treated as independent, quantitative variables. The significance level of α = 0.05 was assumed. The normality of distribution was examined, and the hypotheses of the equality of mean values and variance were verified. The fulfilment of specified assumptions regarding the data was the basis for the decision to select the test [43]. In selecting the appropriate statistical test to assess the truth of the hypothesis, a simplified scheme was used, which is given in Figure 3. All statistical tests were performed using the Statistica 13.3 software (TIBCO Software Inc., Palo Alto, CA, USA). The surface roughness measurements were carried out using a HOMMEL TESTER T1000 contact profilometer from ITA K Pollak M Wieczorowski Sp. J. (Poznań, Poland). The measurement parameters were: traverse length lt = 4.8 mm, sampling length lr = 0.8 mm, scanning rate vt = 0.5 mm/s and measuring range/resolution M = ±320 µm/0.04 µm. Each measurement was repeated five times on each surface towards the assessment of the mean values and standard deviation.

Statistical Analysis Methodology
The data obtained from the roughness measurements were subjected to statistical verification. The output data obtained in the study were treated as independent, quantitative variables. The significance level of α = 0.05 was assumed. The normality of distribution was examined, and the hypotheses of the equality of mean values and variance were verified. The fulfilment of specified assumptions regarding the data was the basis for the decision to select the test [43]. In selecting the appropriate statistical test to assess the truth of the hypothesis, a simplified scheme was used, which is given in Figure 3. All statistical tests were performed using the Statistica 13.3 software (TIBCO Software Inc., Palo Alto, CA, USA). Firstly, the Shapiro-Wilk test was performed to examine the normality of the distribution [43]. The null hypothesis and the alternative hypothesis were as follows: Firstly, the Shapiro-Wilk test was performed to examine the normality of the distribution [43]. The null hypothesis and the alternative hypothesis were as follows: When the normality condition was not met, the Mann-Whitney U test was employed for further verification. The Mann-Whitney U test is used to check the equality of the medians [43]. The null hypothesis and the alternative hypothesis were as follows: If the case with normal distribution was confirmed, the hypothesis of equality of variances was checked by Levene's test and the Brown-Forsythe test [36]. The null hypothesis and the alternative hypothesis were as follows: In two cases, the hypothesis about the equality of mean values was verified. In the absence of grounds for rejecting the null hypothesis, Student's t-test was used to verify the hypothesis of the equality of mean values. If the condition of homogeneity of variance had not been met, the Cochran's Q test would have been used to verify the hypothesis of the equality of mean values [43]. The null hypothesis and the alternative hypothesis were as follows:

Artificial Neural Network Methodology
For the AZ91D magnesium alloy on the lateral and the end faces (Ra, Rz parameters), simulations were carried out using artificial neural networks. The scheme of the artificial neural networks is shown in Figure 4, where R in the output denotes the corresponding surface roughness parameter: a p axial or a e radial depth of cut [30].  The number of random samples was as follows: 75% training, 25% validation and testing was overlooked due to the small amount of all data sets [44].
Moreover, the following parameters were experimentally determined: the number of hidden neurons (2-10) and the number of epochs (150-300). The assessment of individual networks was executed on the basis of a comparison of the training quality, the quality of validation and the learning error determined by the least-squares method [45].

Objective of Research and Novelties
The presented work presents an analysis of the surface roughness after finish milling.
The analysis of the literature shows that the vast majority of scientific publications concern The input layer consists of input neurons that are equal to the number of input data: cutting speed v c , feed per tooth f z and axial depth of cut a p for data obtained from the surface roughness measurements on the end face of the tested sample. For the lateral surface, the variable factors were cutting speed v c , feed per tooth f z and radial depth of cut a e .
Two types of ANN were used: MLP (Multi-layered perceptron) and RBF (Radial Basis Function). The possible activation functions used in the MLP model are as follows: linear, logistic, tanh, exponential, sine. The MLP model was trained using the BFGS learning algorithm. The RBF network model was trained with the RBFT algorithm and included the following activation functions: hidden neurons-Gaussian distribution, output neuronslinear function.
The number of random samples was as follows: 75% training, 25% validation and testing was overlooked due to the small amount of all data sets [44].
Moreover, the following parameters were experimentally determined: the number of hidden neurons (2-10) and the number of epochs (150-300). The assessment of individual networks was executed on the basis of a comparison of the training quality, the quality of validation and the learning error determined by the least-squares method [45].

Objective of Research and Novelties
The presented work presents an analysis of the surface roughness after finish milling.
The analysis of the literature shows that the vast majority of scientific publications concern the rough milling of magnesium alloys. Thus, the proposed research topic is innovative and new in the sense of originality of the scientific goal. One machinability factor is analysed in this work, namely the roughness of the 2D surface. This indicator is particularly important in the production processes of workpieces, both for scientific and cognitive reasons, as well as the possibility of implementing the presented research results (ranges of machining parameters) in industrial plants dealing with the subject of magnesium alloys machining. Moreover, after the analysis of the literature, it can be concluded that many researchers were mainly concerned with the analysis of the basic parameters of surface roughness, both 2D and 3D, ignoring the aspect of maintenance features of the treated surface. This state of affairs is definitely insufficient, hence the proposal to analyse additional roughness parameters, such as RSm, Rsk and Rku. It is a challenge of some kind to be able to predict specific performance properties of the parts produced on the basis of the roughness parameters correlated with the functional properties of the surface. Apart from the main goal (defining the influence of cutting parameters on the change of roughness parameters), the modelling of selected surface roughness parameters (Ra, Rz) can be presented as an additional goal in order to forecast these parameters.
Modelling the roughness parameters after milling can be the basis for creating tools helpful in the work of the technologist for determining the conditions of the machining process in order to obtain the assumed surface roughness. Thus far, no such works have been carried out after the finish milling of magnesium alloys. In addition, the use of, inter alia, artificial neural networks can contribute to the reduction of the number of research trials necessary for the selection and optimisation of the parameters of the technological process. Additionally, the conducted analysis may be interesting due to the universality and availability of both the tools (end mills) and the presented magnesium alloys.

Surface Roughness
The surface roughness of AZ91D and AZ31 magnesium alloys after milling was analysed depending on the changes in technological parameter values and tools with different tool cutting edge helix angles. Figure 5 shows the influence of the cutting speed on the roughness parameters for the AZ91D magnesium alloy.
The diagrams presented in Figure 5a,b prove that regardless of the tool used, an increase in cutting speed v c resulted in decreasing Ra and Rz values, especially in the cutting speed range 600-1200 m/min. The lowest value for the parameters Ra = 0.235 µm and Rz = 1.37 µm was obtained for the λ s = 50 • tool, with v c = 1200 m/min on the lateral face of the workpiece. The highest value of the parameters Ra = 4.941 µm and Rz = 16.95 µm was observed at v c = 600 m/min for the λ s = 50 • tool on the end face of the workpiece.

Surface Roughness
The surface roughness of AZ91D and AZ31 magnesium alloys after milling was analysed depending on the changes in technological parameter values and tools with different tool cutting edge helix angles. Figure 5 shows the influence of the cutting speed on the roughness parameters for the AZ91D magnesium alloy. The diagrams presented in Figure 5a,b prove that regardless of the tool used, an increase in cutting speed vc resulted in decreasing Ra and Rz values, especially in the cutting speed range 600-1200 m/min. The lowest value for the parameters Ra = 0.235 µm and Rz = 1.37 µm was obtained for the λs = 50° tool, with vc = 1200 m/min on the lateral face of the workpiece. The highest value of the parameters Ra = 4.941 µm and Rz = 16.95 µm was observed at vc = 600 m/min for the λs = 50° tool on the end face of the workpiece. For the λ s = 50 • tool, the value of the RSm parameter on the lateral face at v c = 1000 m/min was 0.006 mm, which was much lower than the other values on the end face and for the λ s = 20 • tool, which ranged between 0.12 and 0.409 mm (Figure 5c). The value of the Rsk (skewness) below 0 is characterised by a higher frequency of deep valleys on the surface, which was obtained at higher cutting speeds: v c = 1000, 1200 m/min for the λ s = 20 • tool on the end face of the specimens and for the λ s = 50 • tool on the lateral face at v c = 600 m/min ( Figure 5d). The distribution of profile roughness was close enough to the Gaussian distribution at the cutting speed v c = 600 m/min on the lateral face of the workpiece for the λ s = 50 • tool (Rku = 2.976) and for the λ s = 20 • tool (Rku = 3.007) and on the end face at v c = 800 m/min, the value of Rku was 2.991 (λ s = 20 • ) ( Figure 5e). Figure 6 shows the effect of the feed per tooth change on the surface roughness for the AZ91D magnesium alloy. In the range of feed per tooth f z = 0.05-0.3 mm/tooth, lower Ra and Rz values were obtained on the lateral face, and their increase was not as pronounced as on the end face of the workpiece. The highest values of Ra = 2.924 µm and Rz = 12.9 µm were observed on the end face of the specimens for the λ s = 50 • tool at f z = 0.3 mm/tooth. On the lateral face, the cutting-edge helix angle of the tool did not have a significant influence on the Ra and the Rz values, which were similar and in the range of Ra = 0.259-0.578 µm and Rz = 1.36-3.23 µm. However, the lowest values of the Ra and Rz parameters were obtained at f z = 0.05 mm/tooth for the λ s = 50 • tool (Figure 6a,b). The values of the RSm parameter on the lateral face were in the range of 0.196-0.285 mm and showed insignificant change with increasing feed per tooth. On the end face of the workpiece (λ s = 50 • tool), a radical increase in RSm (by 0.223 mm) was observed with the change from f z = 0.05 to 0.1 mm/tooth (Figure 6c). On the lateral face, Rsk (skewness) had positive and negative values. The symmetric profile distribution is expressed as Rsk = 0. Positive values of the Rsk coefficient were obtained on the end faces. These surfaces are marked by good resistance to adhesion (Figure 6d). The values of the Rku coefficient showed insignificant change with the increase of the feed per tooth. Kurtosis values below 3 were obtained on the end face of the specimens. These surfaces were characterised by greatly rounded peaks and valleys, which resulted in an increase in the friction coefficient ( Figure 6e). Figure 7 shows the effect of increasing the axial depth of cut a p on the roughness parameters for the AZ91D magnesium alloy. Similar values of the Ra parameter were obtained in the entire range of the axial depth of cut for the λ s = 20 • tool, which ranged from 1.453 to 1.687 µm. The axial depth of cut change also did not have a significant impact on the Rz parameter value (7.55-9.51 µm). With the range a p = 0.2-0.5 mm, for the λ s = 50 • tool, higher values of the mentioned parameters were obtained, which were in the following ranges: Ra = 1.402-2.987 µm and Rz = 6.96-11.6 µm (Figure 7a Figure 7 shows the effect of increasing the axial depth of cut ap on the roughness parameters for the AZ91D magnesium alloy. Similar values of the Ra parameter were obtained in the entire range of the axial depth of cut for the λs = 20° tool, which ranged from 1.453 to 1.687 μm. The axial depth of cut change also did not have a significant impact on the Rz parameter value (7.55-9.51 μm). With the range ap = 0.2-0.5 mm, for the λs = 50° tool, higher values of the mentioned parameters were obtained, which were in the following ranges: Ra = 1.402-2.987 μm and Rz = 6.96-11.6 μm (Figure 7a,b).  The increase in the axial depth of cut did not show a dramatic change in the values of the RSm parameter. For the λ s = 20 • tool, the RSm values ranged between 0.155 and 0.198 mm and were lower compared to the λ s = 50 • tool (0.189-0.303 mm). The differences in the values of the RSm parameter depending on the tool used were especially prevalent at a p = 0.2-05 mm (Figure 7c). In the entire range of the axial depth of cut, the Rsk (skewness) values are small, close to the symmetric distribution of the profile. Rsk was only higher compared to the others for the λ s = 20 • tool with a p = 0.3 mm; the discussed values do not exceed 0.8 (Figure 7d). Kurtosis values below 3 (Rku < 3) were obtained for almost the entire range of the axial depth of cut. The Rku value was only greater than 3 for the λ s = 20 • tool at a p = 0.3 mm (Figure 7e). Figure 8 shows the influence of the increasing radial depth of cut a e on the roughness parameters for the AZ91D magnesium alloy. The research showed an insignificant effect of the increase in the radial depth of cut on the roughness parameters: Ra = 0.431-0.589 µm and Rz = 2.28-3.14 µm for the λ s = 20 • tool. On the other hand, for the λ = 50 • tool, a dramatic increase in the Ra (by 2.151 µm) and Rz parameters (by 12.99 µm) was observed with the change of the radial depth of cut from a e = 1.5 to 2.5 mm. When increasing to a e = 3.5 mm, the parameter values did not change significantly (Figure 8a dramatic increase in the Ra (by 2.151 μm) and Rz parameters (by 12.99 μm) was observed with the change of the radial depth of cut from ae = 1.5 to 2.5 mm. When increasing to ae = 3.5 mm, the parameter values did not change significantly (Figure 8a,b). For the λs = 20° tool, it was shown that the change in the radial depth of cut had a negligible effect on the RSm parameter values, which were in the range 0.208-0.268 mm. The values of the RSm parameter after milling with the λs = 50° tool with ae = 2.5-3.5 mm were several times lower than those obtained with smaller values of ae. (Figure 8c). Positive values of Rsk (skewness) were observed in the entire range of the radial depth of cut (Figure 8d). The kurtosis (Rku) values oscillated around 3 for both tools in the entire range of the radial depth of cut, which means that the distribution of the roughness profile corresponded to the Gaussian distribution (Rku = 2.381-3.633) (Figure 8e).  Figure 9 shows the influence of the cutting speed on the roughness parameters for the AZ31 magnesium alloy. For this alloy, the surface roughness was analysed with the extreme values of the cutting parameters.    Figure 9 shows the influence of the cutting speed on the roughness parameters for the AZ31 magnesium alloy. For this alloy, the surface roughness was analysed with the extreme values of the cutting parameters. When analysing the effect of cutting speed vc, lower values were clearly observed at vc = 1200 m/min on the lateral and end faces for both tools. The greatest influence of the cutting speed increase on the values of the Ra and Rz parameters was apparent for the λs = 50° tool. With the cutting speed vc = 400 m/min, the highest values were obtained on the end face (Ra = 2.764 µm, Rz = 13.32 µm). With the increase of the cutting speed to vc = 1200 m/min, the Ra parameter value decreased by 2.647 µm and the Rz parameter value decreased by 12.61 µm (Figure 9a,b). At the cutting speed vc = 400 m/min, the RSm parameter values were in the range of 0.117-0.428 mm. With the cutting speed vc = 1200 m/min for the λs = 50° tool on the end face, a radical decrease in the value of the RSm parameter was achieved to 0.008 mm, which was several times lower compared to the other values. In addition, a greater dispersion of the results in the series of measurements after milling with the λs = 50° tool was noticed, especially for the surface roughness parameters on the lateral face of the workpiece (Figure 9c).
The Rsk (skewness) values on the end face were small, close to the symmetric distribution of the profile roughness. On the lateral face, lower Rsk values were obtained at a higher cutting speed (vc = 1200 m/min). The values for both the lateral and the end faces did not exceed 0.8 (Figure 9d). The values of the Rku (kurtosis) after milling with the λs = 20° tool ranged from 2.272 to 2.879. On the other hand, for the λs = 50° tool, lower values of the coefficient (Rku < 3) were noticed on the end face. Rku (kurtosis) values greater than 3 were obtained on the lateral face at vc = 400 m/min (4.068) and at vc = 1200 m/min (5.133), which is characteristic for surfaces with sharp peaks and valleys (Figure 9e). Figure 10 shows the effect of the feed per tooth change on the surface roughness for the AZ31 magnesium alloy. In the research, increasing the feed per tooth fz increased the values of the Ra and the Rz parameters; it was especially visible on the end face for the λs = 20° tool, where the value of the Ra parameter increased from 0.919 to 1.6 µm and the value of the Rz parameter from 4.37 to 8.09 µm. The lowest values of the Ra and the Rz parameters were observed on the end face for the λs = 50° tool at fz = 0.05 mm/tooth (Figure   (Figure 10d). The values of the Rku coefficient oscillated around 3, which shows that the profile distribution corresponded to the Gaussian distribution. Only the value of the Rku coefficient on the end face of the workpiece after milling with the λ s = 50 • tool at a feed per tooth f z = 0.05 mm/tooth was 4.796 (Figure 10e). Figure 11 shows the effect of increasing the axial depth of cut a p on the roughness parameters for the AZ31 magnesium alloy. For the λ s = 20 • tool, the influence of the increase in the axial depth of cut a p on the values of the Ra and Rz parameters was negligible; the values were in the following ranges: Ra = 1.721-1.844 µm and Rz = 8.53-9.07 µm. In the case of the λ s = 50 • tool, higher values of the discussed parameters were obtained with a p = 0.5 mm. The value of the Ra parameter increased by 0.386 µm, and the Rz parameter increased by 1.35 µm (Figure 11a,b). It was also shown that the change in the axial depth of cut a p for both tools had an insignificant effect on the values of the RSm parameter. For the λ s = 20 • tool, the RSm parameter value decreased by 0.006 mm, and for the λ s = 50 • tool, it increased by 0.146 mm (Figure 11c). Regardless of the increase in the axial depth of cut a p and tool cutting edge helix angle (λ s = 20 • , λ s = 50 • ), positive values of the Rsk coefficient were obtained (Rsk = 0.314-0.585) (Figure 11d). The values of the Rku coefficient were in the range: 2.296-2.969 (Figure 11e). value of the RSm parameter. The greatest difference was noted on the end face of the workpiece for the λs = 50° tool, where the RSm value increased from 0.037 to 0.221 mm (Figure 10c). The values of the Rsk coefficient with the feed per tooth fz = 0.05 mm/tooth oscillated around 0. With the feed per tooth fz = 0.3 mm/tooth, positive values of the Rsk coefficient were obtained for the two tools (Figure 10d). The values of the Rku coefficient oscillated around 3, which shows that the profile distribution corresponded to the Gaussian distribution. Only the value of the Rku coefficient on the end face of the workpiece after milling with the λs = 50° tool at a feed per tooth fz = 0.05 mm/tooth was 4.796 ( Figure  10e).  Figure 11 shows the effect of increasing the axial depth of cut ap on the roughness parameters for the AZ31 magnesium alloy. For the λs = 20° tool, the influence of the increase in the axial depth of cut ap on the values of the Ra and Rz parameters was negligible; the values were in the following ranges: Ra = 1.721-1.844 µm and Rz = 8.53-9.07 µm. In  Figure 12 shows the influence of increasing the radial depth of cut a e on the roughness parameters for the AZ31 magnesium alloy. The effect of increasing the radial depth of cut a e was negligible for the Ra and the Rz parameters; the values were similar regardless of the tool helix angle. The Ra parameter values were in the range from 0.455 to 0.565 µm. The Rz parameter values were in the range of 1.98-2.66 µm (Figure 12a,b). In the case of the RSm parameter, it was also shown that the change in radial depth of cut a e had an insignificant effect. The parameter values ranged from 0.285 to 0.306 mm (Figure 12c). With a variable radial depth of cut, the Rsk (skewness) values were positive. The change of the radial depth of cut from a e = 0.5 to 3.5 mm resulted in an increase in the Rsk coefficient value by 0.684 for the λ s = 20 • tool. For the λ s = 50 • tool, despite the increase in the radial depth of cut, the values of the Rsk coefficient were small, close to the symmetrical distribution of the profile and ranged between 0.228 and 0.315 (Figure 12d). The Rku (kurtosis) values were in the range of 2.446-3.258, which means that the roughness profile distributions were similar to the Gaussian distribution (Figure 12e). the case of the λs = 50° tool, higher values of the discussed parameters were obtained with ap = 0.5 mm. The value of the Ra parameter increased by 0.386 µm, and the Rz parameter increased by 1.35 µm (Figure 11a,b). It was also shown that the change in the axial depth of cut ap for both tools had an insignificant effect on the values of the RSm parameter. For the λs = 20° tool, the RSm parameter value decreased by 0.006 mm, and for the λs = 50° tool, it increased by 0.146 mm (Figure 11c). Regardless of the increase in the axial depth of cut ap and tool cutting edge helix angle (λs = 20°, λs = 50°), positive values of the Rsk coefficient were obtained (Rsk = 0.314-0.585) (Figure 11d). The values of the Rku coefficient were in the range: 2.296-2.969 (Figure 11e).  Figure 12 shows the influence of increasing the radial depth of cut ae on the roughness parameters for the AZ31 magnesium alloy. The effect of increasing the radial depth of cut ae was negligible for the Ra and the Rz parameters; the values were similar regardless of the tool helix angle. The Ra parameter values were in the range from 0.455 to 0.565 µm. The Rz parameter values were in the range of 1.98-2.66 µm (Figure 12a,b). In the case of the RSm parameter, it was also shown that the change in radial depth of cut ae had an

Statistical Analysis
One of the conditions for using the test to check the equality of two means is the normality of the distribution, so firstly, the Shapiro-Wilk test was performed. Figure 13 shows the normal probability plot for selected machining conditions. Furthermore, Tables 1-4 present a summary of the performed statistical test for the data obtained as a result of the studies carried out.
With a variable radial depth of cut, the Rsk (skewness) values were positive. The change of the radial depth of cut from ae = 0.5 to 3.5 mm resulted in an increase in the Rsk coefficient value by 0.684 for the λs = 20° tool. For the λs = 50° tool, despite the increase in the radial depth of cut, the values of the Rsk coefficient were small, close to the symmetrical distribution of the profile and ranged between 0.228 and 0.315 (Figure 12d). The Rku (kurtosis) values were in the range of 2.446-3.258, which means that the roughness profile distributions were similar to the Gaussian distribution (Figure 12e).

Statistical Analysis
One of the conditions for using the test to check the equality of two means is the normality of the distribution, so firstly, the Shapiro-Wilk test was performed. Figure 13 shows the normal probability plot for selected machining conditions. Furthermore, Tables 1-4 present a summary of the performed statistical test for the data obtained as a result of the studies carried out.      Table 3. Results of the Shapiro-Wilk test for the roughness parameters after milling the AZ91D magnesium alloy, λs = 50° tool.  In the case of the p-value below 0.05, the distributions are different from the normal distribution in a statistically significant way. The p-value is the lowest significance level that leads to the rejection of the null hypothesis [46]. A p-value below 0.05 was obtained for the following parameters ( Table 2):

Lateral Face of Workpiece End Face of Workpiece Comparison vc = 400 m/min vc = 1200 m/min vc = 400 m/min vc = 1200 m/min Test Result Test p-Value Test p-Value Test p-Value Test p-Value
• RSm for the variable v c in the case of the lateral face, • Rku for the variable f z for the end face.
In Table 3, on the lateral face of the AZ91D magnesium alloy (λ s = 50 • tool), the roughness parameters that obtained a p-value below 0.05 were as follows: Rz, RSm and Rku with the variable v c , and Ra and Rz with the variable f z . Further, on the end face: Ra, RSm and Rsk with the variable f z . In Table 4, for the λ s = 20 • tool on the end face of the AZ31 magnesium alloy, a p-value below 0.05 was only obtained for the Ra parameter for the variable f z .  Therefore, the non-parametric Mann-Whitney U test was used for further analysis. Table 6 shows the test results for the data obtained in the study. For the roughness parameters, which obtained p-values greater than 0.05 (in the Shapiro-Wilk test), the hypothesis of the equality of variances was tested for further statistical verification. On the AZ91D lateral face (λ s = 20 • tool), in the case of the RSm roughness parameter with the variable v c , the observed difference was statistically significant. This means that the above-mentioned parameter was influenced by the cutting speed (lower values of these parameters were obtained at v c = 1200 m/min). For the λ s = 50 • tool with the variable v c , the differences were statistically insignificant, although the registered p-value (p = 0.095238) for the Rz parameter was on the edge of statistical significance. However, with the variable f z for the parameters Ra and Rz, it was proven that the differences were statistically significant, which means that the increase in feed per tooth adversely affects the mentioned parameters. On the end face of the alloy AZ91D (λ s = 50 • tool), the differences in the roughness parameters (Ra, RSm) for variable f z were statistically significant.
For the λ s = 20 • tool on the end face of the AZ31 magnesium alloy, it was shown that an increase in feed per tooth from 0.05 to 0.3 mm tooth influenced the Ra parameter. For the λ s = 50 • tool on the lateral and end face of the AZ31 magnesium alloy, it was shown that the differences between the examined parameters were not statistically significant at the established significance level α = 0.05 (Table 6).
In order to further statistically verify the data for which the null hypothesis was not rejected (the distributions are not different from the normal distribution in a statistically significant way), it was necessary to check the equality of variances towards selecting the statistical test for checking the equality of the means [43].
Tables 7-14 present the results of: Cochran's Q test and Student's t-test verifying the hypothesis of the equality of means.     Table 7 shows the results for the λ s = 20 • tool on the lateral face of the AZ91D alloy. It was shown that for the variable cutting speed, the differences were statistically significant for the Ra, Rz and Rku parameters. The increase in the cutting speed from v c = 400 to 1200 m/min had a positive impact on the mean values of the mentioned parameters (the mean values of the Ra and Rz parameters were lower, at v c = 1200 m/min). When changing the feed per tooth f z , only the differences for the RSm parameter were statistically significant. However, there was a p-value at the edge of statistical significance for the Ra parameter.  For the λ s = 20 • tool on the face of the AZ91D magnesium alloy, it was shown that the differences were only statistically insignificant for variable cutting speed for the RSm, and Rku parameters. The change in cutting speed from v c = 400 to 1200 m/min had a positive effect on the mean values of the Ra, Rz and Rsk parameters. When changing the feed per tooth f z , it was shown that the mean values of the parameters Ra, Rz and RSm, were different in a statistically significant way. By increasing the feed per tooth from f z = 0.05 to 0.3 mm/tooth, higher values of these parameters were obtained. The observed differences were only statistically insignificant for the Rsk coefficient (Table 8). Table 9 shows the results of tests on the lateral face of the AZ91D alloy for the λ s = 50 • tool. The change in cutting speed v c did not influence the mean values of the roughness parameters Ra and Rsk. However, there was a p-value on the verge of statistical significance for the Ra parameter. The observed differences in the mean values of the RSm, Rsk and Rku parameters when changing the feed per tooth f z were not statistically significant. Nevertheless, it is worth highlighting the p-value (0.063011), which was on the edge of statistical significance for the Rsk coefficient.   Table 10 shows the results for the λ s = 50 • tool on the end face of the AZ91D alloy. The increase in the cutting speed from 400 to 1200 m/min had a positive effect on the values of the Ra, Rz and RSm parameters (the mean values of these parameters were lower, at v c = 1200 m/min). When changing the feed per tooth f z , the mean value of the Rz parameter was different in a statistically significant way. By increasing the feed per tooth from f z = 0.05 to 0.3 mm/tooth, a higher mean value of the parameter mentioned was obtained. Table 11 shows the results of tests on the lateral face of the AZ31 alloy for the λ s = 20 • tool. It was shown that the differences were statistically significant for the roughness parameters Ra, Rz, RSm and Rku at the cutting speed change v c . The increase in the cutting speed from v c = 400 to 1200 m/min had a positive influence on the mean values of the mentioned parameters. In the case of the Rsk coefficient, the differences were statistically insignificant at the established significance level. When changing the feed per tooth on the lateral face of the AZ31 alloy, it was shown that the observed differences were statistically significant. This means that the change of the feed per tooth f z from 0.05 to 0.3 mm/tooth affected the mean values of the mentioned parameters (higher mean values of the Ra, Rz and RSm parameters were received at f z = 0.3 mm/tooth). Table 12 shows the test results for the AZ31 alloy end face (λ s = 20 • tool). The differences were statistically significant at the cutting speed change for the parameters Ra, Rz and Rsk. The increase in cutting speed from 400 to 1200 m/min had a positive effect on the mean values of these parameters (lower values were obtained at v c = 1200 m/min). When changing feed per tooth f z , it was shown that the mean values of the Rz and RSm parameters were different in a statistically significant way. When increasing the feed per tooth from f z = 0.05 to 0.3 mm/tooth, higher values of the given parameters were obtained.
On the lateral face of the AZ31 alloy (λ s = 50 • tool), the differences in the roughness parameters Ra and Rz with the variable v c were statistically significant in favour of a higher cutting speed (lower values were obtained at v c = 1200 m/min). At the feed per tooth change, it was shown that the mean values of the parameters Ra, Rz, RSm and Rsk were statistically different. By increasing the feed per tooth from 0.05 to 0.3 mm/tooth, higher values of these parameters were obtained (Table 13).
For the λ s = 50 • tool on the end face of the AZ31 magnesium alloy, it was shown that the differences in the mean values of the parameters Ra and Rz at variable cutting speeds v c were statistically significant (lower roughness parameters were obtained at v c = 1200 m/min). Only for the Rku coefficient, the mean values did not differ in a statistically significant way. At the feed per tooth change, the mean values of the RSm parameter and the Rku coefficient proved to be statistically significant. The other parameters with an increase in the feed per tooth f z to 0.3 mm/tooth were not statistically different, although the p-value of 0.071161 received for Ra was at the edge of statistical significance (Table 15).

Artificial Neural Network
For the AZ91D magnesium alloy, simulations were carried out with the use of artificial neural networks in order to investigate the relationship between the technological parameters and the predicted surface roughness. The networks were created using 15 sets of technological parameters. For each input data, simulations were performed for 100 networks, while 10 networks were preserved for further analysis [45].
The network suitability was assessed by learning quality, validation quality, learning error and validation error. The simulations were carried out for the Ra and Rz parameters on the lateral and end faces of the workpiece. Table 14 shows the four different ANN models obtained. On the basis of the network quality indicators, it was shown that the best match for the Ra and Rz parameters on the lateral surface was obtained for the RBF 3-10-1 network (10 hidden neurons) while analysing the parameters on the end face of the AZ91D alloy showed that the MLP 3-2-1 network (2 hidden neurons) was optimal for the Rz parameter. However, for the Ra parameter, the RBF 3-9-1 network (9 hidden neurons) achieved a high quality of learning and validation in relation to its low error rate for learning and validation. For the MLP network, the best results were obtained for the exponential activation functions. The MLP 3-2-1 network for the Rz parameters on the end face of the AZ91D alloy was obtained after 9254 iterations.
The accuracy of the surface roughness prediction was assessed by comparing the predicted and experimental values. Figure 14 presents a visualisation of the accuracy of the prediction of the surface roughness parameters. models obtained. On the basis of the network quality indicators, it was shown that the best match for the Ra and Rz parameters on the lateral surface was obtained for the RBF 3-10-1 network (10 hidden neurons) while analysing the parameters on the end face of the AZ91D alloy showed that the MLP 3-2-1 network (2 hidden neurons) was optimal for the Rz parameter. However, for the Ra parameter, the RBF 3-9-1 network (9 hidden neurons) achieved a high quality of learning and validation in relation to its low error rate for learning and validation. For the MLP network, the best results were obtained for the exponential activation functions. The MLP 3-2-1 network for the Rz parameters on the end face of the AZ91D alloy was obtained after 9254 iterations.
The accuracy of the surface roughness prediction was assessed by comparing the predicted and experimental values. Figure 14 presents a visualisation of the accuracy of the prediction of the surface roughness parameters.  The simulation results for each network are shown in two diagrams, depending on the cutting speed and feed per tooth or cutting speed and axial/radial depth of cut. The results of the surface roughness parameters on the end face of the AZ91D magnesium alloy are shown in Figures 15 and 16 and on the lateral face in Figures 17 and 18.
In order to determine whether each technological parameter affects the roughness parameter, a sensitivity analysis was performed (Table 16). None of the analysed technological parameters obtained a sensitivity analysis value below 1, which means that each of them had a significant impact. If you remove one of the v c , f z , a p or a e parameters, the network quality may be degraded. The cutting speed v c was the parameter that had the strongest influence on the roughness parameters Ra and Rz on both the lateral and the end faces [47]. The simulation results for each network are shown in two diagrams, depending on the cutting speed and feed per tooth or cutting speed and axial/radial depth of cut. The results of the surface roughness parameters on the end face of the AZ91D magnesium alloy are shown in Figures 15 and 16 and on the lateral face in Figures 17 and 18.   The simulation results for each network are shown in two diagrams, depending on the cutting speed and feed per tooth or cutting speed and axial/radial depth of cut. The results of the surface roughness parameters on the end face of the AZ91D magnesium alloy are shown in Figures 15 and 16 and on the lateral face in Figures 17 and 18.  In order to determine whether each technological parameter affects the roughness parameter, a sensitivity analysis was performed (Table 16). None of the analysed technological parameters obtained a sensitivity analysis value below 1, which means that each of them had a significant impact. If you remove one of the vc, fz, ap or ae parameters, the network quality may be degraded. The cutting speed vc was the parameter that had the strongest influence on the roughness parameters Ra and Rz on both the lateral and the end faces [47]. In order to determine whether each technological parameter affects the roughness parameter, a sensitivity analysis was performed (Table 16). None of the analysed technological parameters obtained a sensitivity analysis value below 1, which means that each of them had a significant impact. If you remove one of the vc, fz, ap or ae parameters, the network quality may be degraded. The cutting speed vc was the parameter that had the strongest influence on the roughness parameters Ra and Rz on both the lateral and the end faces [47].  In summary, the relative error between the roughness parameter values from the ANN simulation and the experimental values did not exceed 15%. This means that the network quality was good enough to be used for simulation [37].

Conclusions
The conducted research and analyses allowed for the following conclusions: 1.
The increase in the cutting speed has the greatest influence on the surface roughness. For both tools (λ s = 20 • , λ s = 50 • ), a clear decrease in the roughness parameter values for both magnesium alloys AZ91D and AZ31 was observed.

2.
Increasing feed per tooth reduces the surface quality; for the AZ91D magnesium alloy, a radical increase in the roughness parameters values was observed after the increase from f z = 0.05 to 0.1 mm/tooth. Within the range of f z = 0.1-0.3 mm/tooth, no significant changes were observed. 3.
The differences in roughness parameters depending on the tool used were clearly noticed after changing the radial and axial depth of cut.

4.
Axial and radial depth of cut had a negligible influence on the values of the surface roughness parameters for the tool λ s = 20 • for both AZ31 and AZ91D alloys.

5.
For the tool λ s = 20 • , differences were observed in the roughness parameters between the AZ91D and AZ31 alloys after changes in the cutting speed and the feed rate per tooth (lower roughness parameter values were obtained for AZ31). 6.
Comparing the AZ91D and AZ31 alloy surface quality after milling using the tool λ s = 50 • , significant differences were found after changing the feed rate per tooth, the axial depth of cut (end face) and the radial depth of cut (lateral face). For the AZ31 magnesium alloy, lower parameter values were obtained, and less radical changes were observed from the increase in a given cutting parameter. 7.
The statistical analysis of the roughness parameters Ra and Rz confirmed the inequality of the mean values and medians when changing the cutting speed v c . The increase in the cutting speed from 400 to 1200 m/min had a positive impact on the mentioned parameters (lower values of the surface roughness parameters were observed at the cutting speed v c = 1200 m/min). 8.
The statistical analysis shows that for all cases, the change of the feed per tooth f z influenced the values of the Ra parameter. With the increase in the feed per tooth value from 0.05 to 0.3 mm/tooth, higher values of this parameter were obtained. 9.
Comparing the tools used in the research, it was noticed that for the λ s = 50 • tool, in a large number of cases, the normality of the distribution was not confirmed, which results from the number of Mann-Whitney U tests performed. 10. The RBF neural network turned out to be a better type of network than the MLP in most cases for modelling the Ra and Rz surface roughness parameters obtained after milling the AZ91D magnesium alloy. The networks obtained for the analysed parameters had from 2 to 10 neurons in the hidden layer. 11. The network obtained as a result of the surface roughness parameter modelling shows satisfactory predictive ability, as evidenced by the obtained values of the R 2 correlation coefficient for the appropriate training and validation data. For the training data, they are, respectively, Ra = 0.9758 (end face of workpiece), Ra = 0.9947 (lateral face of workpiece), Rz = 0.9604 (end face of workpiece) and Rz = 0.9951 (lateral face of workpiece), and for the validation data, Ra = 0.9773 (end face of workpiece), Ra = 0.9283 (lateral face of workpiece), Rz = 0.9864 (end face of workpiece) and Rz = 0.9804 (lateral face of workpiece). It can, therefore, be concluded that artificial neural networks are an effective tool that can be used to predict surface roughness parameters. 12. The trained networks show the relationships between the input data (v c , f z , a p and a e ) and the output data (Ra and Rz parameters), enabling the determination of the appropriate values of the analysed surface roughness parameters after entering the given processing parameters into the network.
In workshop practice, it may be most useful to determine the presented technological parameters of milling, under which machining can take place under conditions defined as safe, effective and efficient. Often, industrial manufacturers do not have the appropriate research equipment, and above all, the time needed to carry out research and the measurement, it is also impossible to withhold or suspend the production in progress. It should be emphasized that in industrial practice, low technological milling parameters are often used, justifying it with safety reasons. Hence, the presented research works may be valuable due to the possibility of implementing the presented scope of technological milling parameters in industrial applications.
In the broadly understood workshop practice, it may be most precious to define such machining parameters for which milling can be finish machining, and constitute a very effective, efficient and safe process (without risk of chip flammability and their ignition). Therefore, the presented research investigations may precious due to the possibility of their application in the industrial and manufacturing practice. Nomenclature v c cutting speed (m/min) f z feed per tooth (mm/tooth) a p axial depth of cut (mm) a e radial depth of cut (mm) λ s helix angle ( • ) γ tool rake angle ( • ) α tool clearance angle ( • ) or significance level (in statistical analysis) ANN artificial neural network MLP Multi-layered perceptron RBF Radial Basis Function