Application of neural network in determination of parameters for milling AZ91HP magnesium alloy with surface roughness constraint

This paper presents the model for milling AZ91HP magnesium alloy with TiAlN coated carbide end mill. The model was developed on the basis of experimental data from the neural network training data set. The milling process was conducted at constant parameters of tool geometry, workpiece strength properties, technological machine properties, radial and axial depth of cut. The range of changeable machining parameters specified in this study included cutting speed, feed per tooth, and the output variable: the arithmetical mean roughness parameter (Ra). The process was modelled by means of MatLab software and its Neural Network Toolbox. The developed model was implemented in the algorithm designed to determine optimal milling conditions, exploring the space of acceptable parameters in search of those which would meet the specified roughness parameter at maximum efficiency.


Introduction
Machine cutting is widely employed in production of machines and appliances. Its approx. 50% share in machining applications in the machinery industry makes it a leading method, which is expected to maintain its strong position in years to come. There are several fundamental factors responsible for the popularity of milling, such as: increasing capabilities of the method, high efficiency and effectiveness of the method, good dimensional/geometrical accuracy, low surface roughness. In magnesium alloy machining it is machine cutting and plastic working that are the most widely employed processes [1] in treatment of both pressuredie-cast and plastic-worked semi-finished products [2]. Modern aircraft elements are predominantly made of light alloys and tend to be manufactured as monostructures. These elements, often referred to as pocketstructures, are produced by subtracting up to 95% of material from monolith blocks. Removing such substantial amounts of material will essentially involve elongated machining. Material removal rate is an important aspect determining efficiency of machining, which may be increased by implementation of highspeed machining methods like HSM, HPC or HSC [3,4]. Efficient milling is capable of producing surface quality similar to that which is obtained in abrasive machining. It is for these reasons that milling is becoming increasingly widespread in both roughing and finishing applications.

State of knowledge
Magnesium alloys exhibit good workability in subtractive processes, which makes them highly suitable for manufacturing applications, as they may be processed faster and more economically than other materials. These alloys may be machined up to four times as fast as aluminium [5].
Machining at high speed, feed and depth parameters is highly effective. Even at high speeds the tool wear is insignificant. Low heat capacity of the process prevents the workpiece from abrupt over-heating, hence enabling dry machining, which is of positive impact on the tool wear. The lifespan of cutting tools involved in highspeed machining may be even ten times longer than in the case of aluminium cutting applications [4]. Characteristically for machining magnesium, it involves low cutting forces, which reduce the energy requirements of the process to minimum [6]. Moreover, with good surface quality, the machined workpieces will frequently need no further finishing. Regarding chip formation, in milling of magnesium alloys, the chip takes the segmental or elemental form, which facilitates their removal from the cutting zone. Nevertheless, one of the key negative factors behind milling magnesium is the relatively high risk of chip ignition, which is however generally limited to dust and swarf.
Among the properties defining the machinability of metal alloys, this is the quality of the machined surface which is widely regarded to be the major considered characteristic. Surface quality embraces roughness, waviness and surface defects. In practice, it is predominantly described by surface and area roughness parameters (e.g. Ra -arithmetical mean height of the profile, Rz -maximum height of the profile, or Saarithmetical mean height of the surface), which constitute fundamental characteristics of machinability of materials [4,7]. There are numerous factors affecting surface quality, the knowledge of which allows engineers to design a suitable technological process for a given application. Authors of [8] determine the total of 32 factors relevant to surface quality, which were classified into 5 groups. Group one involves the cutting tool, group two -the machine tool (i.e. selection of proper machining parameters), group three -workpiece material, group four describes different phenomena occurring during machining, such as vibration, chip formation, minimum axial depth of cut, etc., whereas the last group concerns the human factor -that is all mistakes or imprecision shown by personnel responsible for a given technological process. Nineteen of these factors are known prior to machining, whereas the remaining ones must be controlled during milling.
Therefore, surface roughness obtained in milling depends on such factors as type of the cutting tool material and tool geometry. In the study of dry milling with PCD tools [3] it was the feed rate that had the biggest impact on Ra. In the analysed case, the Ra parameter value increased (nearly linear relationship) with increasing feed per tooth. Changes in the cutting velocity or axial depth of cut did not show any consistent effect on the quality of workpiece surface. Milling with fluid (oil mist) with a PCD tool the surface roughness parameters were as follows [9]: Rz (4÷12) μm, Ra<2μm, at the feed per tooth range of (0.1÷0.6) mm/tooth. Analysis of milling of AZ31B alloy [10] with compressed air cooling showed that the surface roughness increases with the increase in feed rate and the number of cutting inserts (teeth), while it shows no dependence on the speed range vc (116÷311) m/min. It is therefore advised to reduce the number of teeth to minimum. In the case of AZ31 and AZ91HP alloys the highest-impact parameter was feed, whereas the cutting speed exhibited little effect on the quality of machined surfaces [4]. Authors noted that the best surface quality is obtained after milling with PCD tools, and what is more the uncoated tools -of sharper geometry -tend to produce smoother surfaces In analysis of the rake angle impact it was observed [11] that AZ91HP alloy machined with γ=5° and γ=30° carbide tools showed considerable disparity in surface quality. The study in question was conducted at changeable parameters, such as vc up to 1200m/min. It was observed that the tool rake angle γ=5° produces higher quality surface. For the sake of effectiveness of the process it is advisable that milling is conducted at high speeds, as the most beneficial surface roughness was obtained at the highest milling speed: Ra approx. 0.3 µm on the side surface and approx. 0.5 µm on the face surface of the test sample.
The study of AZ31B alloy has confirmed the relationship between the number of teeth and surface roughness. The optimal surface roughness was obtained in the process carried out with one cutting insert, implementing a three-teethed cutter led to the rapid increase in the surface roughness, and further rise in the value of Ra was observed when milling was performed with a cutting tool with six inserts, where the Ra was four times higher than in the case of the initial set-up, amounting to 0.47 µm. The negative impact of the number of cutting teeth was compensated by implementation of compressed air cooling technology, which proved particularly beneficial at increased feed: the surface roughness parameter Ra = 0.1÷0.16 μm [10]. Another study [12] attempted to establish optimal combination of milling parameters that would ensure low roughness of the AM60 magnesium alloy surface after dry milling with TiN coated carbide end mill. It has shown that the increase in feed and cutting speed result in increase in surface roughness, whereas at higher rotational speeds (ergo higher vc) surface roughness tends to decrease. Milling with the rotational speed of 2000 rev./min, at feed of 0.1 mm/rev. and axial depth of cut of 1.0 mm proved to provide the most advantageous conditions for machining magnesium, as the surface roughness parameter Ra amounted to approx. 0.3 μm.
Milling of magnesium alloy AZ61 with coated carbide end mill [13] at the rotational speed range of 500÷2000 rev./min (i.e. 400 m/min) produced the surface characterised by Ra surface roughness in the range of approx. 0.1÷0.4 μm. The change of feed rate did not significantly affect the roughness, which remained remarkably low throughout the tested range of speeds. The results prove that it is therefore possible to perform highefficiency machining not compromising the quality of the surface. Another study [14] showed that implementing HSM milling head to machine AZ91D alloy at the feed of 0.03÷0.09 mm/tooth and axial depth of cut 0.2÷0.3 mm produces remarkably low surface roughness, Ra = 0.06÷0.13μm. The study showed that the optimal conditions for milling the alloy in question are provided with the lowest tested cutting speed vc = 900 m/min. The final quality of the surface is satisfactory, which eliminates the need for additional finishing operations, such as grinding or polishing. Similar conclusions are formulated in another work [15], focused on comparing results of surface roughness measurements after machining AZ91HP alloy. The process was carried out with an abrasive cloth, an abrasive fabric, and a carbide end mill to determine which technology would produce the optimal surface texture. The workpiece surface after milling was characterised by the lowest surface roughness parameters Ra = 0.124 μm and Rz = 0.952 μm. The highest values of area roughness parameters Sa, Sz and Sq were measured on the workpiece subjected to machining with the abrasive fabric, and the lowest roughness characterised the workpiece surface polished with the abrasive cloth.
In order for the surface texture to exhibit expected quality, we may employ different models to predict the roughness of surfaces subjected to milling. Paper [16] shows models for the prediction of Ra surface roughness parameter after milling, which could be applied to facilitate the selection of machining parameters with a view to producing surface of expected roughness characteristics. In such predictions the models that are most frequently employed are those describing the representation of the cutting tool profile on the workpiece surface from the perspective of stereometry and kinematics. In the model in the work in question, surface roughness showed strong dependence on the tool corner geometry and feed per tooth. The drawback of these models, however, consists in their being inaccurate owing to a series of simplifying assumptions implemented. As a result, the surface roughness predicted by means of these models may be lowered from 1.5 to 5 times compared to measurements. Another work [17] established a mathematical model to simulate the 3D surface topography after a helical milling. The model considered the tool eccentricity, the secondary cutting, and the size effect. Urbikain [18] presented a geometrical model for the prediction of the surface topography in flank-milling operations using circle-segment end mills. His timedomain model included key mechanical and kinematical parameters of cutting: the tool geometry, feed rate, radial immersion, and tool run-out. Another model, developed by authors of [19], included the influence of cutting parameters, the tool static run-out and dynamic phenomena related to instantaneous tool deflections. The modelling procedure consisted of two parts. In the first stage, tool working part instantaneous displacements were estimated using an analytical model which considered tool dynamic deflections and static errors of the machinetool-holder -tool system. The obtained height of the tool displacement envelope was then applied in the second stage to the calculation of surface roughness parameters. What ought to be remembered is that these models may not be fully accurate with the actual performance, due to the high complexity of machining and involvement of random factors in the process.
The drawbacks of the presented models have spurred the researches to develop new models of machining processes that implement artificial intelligence techniques [20] based on experimental models, which provide a more accurate representation of the machining process and its characteristics. The authors of work [21] described an intelligent computer application, which was developed and tested with the aim of increasing the mean productivity of the milling process in relation to tool wear. The optimisation algorithm employs the multidimensional model of milling generated in the neural network. Neural networks also modelled the cutting force components [22] or chatter during milling [23]. The scientific literature in the field employs solutions based on the Taguchi design of experiment method by means of artificial neural networks (ANNs) trained with the Levenberg-Marquardt algorithm, as in Benardos and Vośniakos [24] or Karabulut [25], where the authors introduce neural network modeling for the prediction of surface roughness. On the other hand, work [26] presents an approach for determining the optimal machining parameters ensuring minimum surface roughness by integrating ANNs and Genetic Algorithm (GA).
The results of such simulations, however, seldom have a direct bearing on the actual selecting machining parameters; they are rather employed by experienced technologists as auxiliary measures to setting up the machining with a view to producing desired workpiece geometry. In the majority of instances, the solution is not optimal from the viewpoint of efficiency.

Simulation of AZ91HP magnesium alloy milling
The condition of machining process and its final effect for the specified milling conditions (type of machining, type and parameters of the machine -tool-holder -tool system), is for the most part determined by the controllable milling parameters. In the case of the presented process the crucial parameters are feed per tooth fz and cutting speed vc. The output parameter, defined in the technological documentation for the product, is the surface roughness Ra, whose value is selected by the technologist. It is possible to obtain the surface with lower than specified Ra parameter, however, this will be at the expense of efficiency of the process. From the viewpoint of economics of manufacturing, the optimal solution is to produce surface of desired roughness at maximum efficiency. The milling conditions were specified according to the desired surface roughness for the AZ91HP magnesium alloy. Simulation data were obtained from experimental tests carried out with Avia VMC800HS vertical machining centre equipped with Heidenhain iTNC 530 CNC control (maximum spindle speed n=24000 rev./min, maximum feed 40 m/min). Milling was carried out with a two blade TiAlN coated carbide end mill with cylindrical grip, tool dimensions: 16x25x100 mm, W-Z2, λs=30°. The tests were run at axial depth of cut ap=6 mm and radial depth of cut ae=14 mm, and changing parameters: cutting speed vc=500-1200 m/min and feed per tooth fz=0.05-0.3 mm/tooth. Surface roughness was measured by means of a Taylor-Hobson Surtronic3+ surface analyser in 5 repetitions of each measurement. Surtronnic3+ device measures the Ra surface roughness parameter with the resolution of 0.02 μm. The technological parameters implemented in the tests were specified according to the manufacturer's recommendation [26] and capabilities of the machine tool.
The relationship between the parameters of machining process (vc and fz) and the predicted surface roughness was studied by means of the artificial neural network, set up with the data obtained in the abovementioned tests. The surface roughness parameter Ra measured in the tests defines a point in the space of potential milling conditions. If trained properly, the neural network exhibits a highly desired capability for generalisation. This feature allows for a certain error in producing a non-linear model of a process functioning in the virtual memory of the computer.
Milling AZ91HP magnesium alloy was modelled by means of the Neural Network library in MatLab software. The network architecture is shown in Fig. 1. The network contains two input vectors -cutting speed and feed per tooth, one output vector -Ra, and three hidden neurons.
The conducted visualisation of the model is presented in (Fig. 2). The 3D graph shows the relationship between the cutting speed vc and feed per tooth fz and prediction of Ra. It can be seen that the function is of a non-linear character: The accuracy of the surface roughness prediction was evaluated by comparing the predicted and actual values, which indicated discrepancies in the range of ± 0.3 µm. It ought to be noted, however, that the model is accurate for the range of parameters used in neural network training.

Optimisation of milling parameters
The application of the model for the prediction of surface roughness of a workpiece after milling is possible only if the machining parameters are known. In practice, however, it is the opposite problem which requires solving -to determine vc and fz for the desired surface roughness parameter Ra. In addition, it is required that the maximum efficiency constraint should be fulfilled. The solution to the problem was obtained according to the algorithm shown in Fig. 3. The efficiency indicator W was the product of fz and vc, since these two parameters are decisive to the time of machining. The model contained in the trained neural network is employed by the algorithm to search the space of acceptable parameters to find the solution that meets both the surface roughness and maximum efficiency conditions. The values of feed per tooth and cutting speed were calculated for the selected values of the predicted surface roughness parameter Ra. The test results of the milling parameter selection algorithm for the specified surface roughness and maximum efficiency are shown in Table  1.

Summary
Milling is a prospective machining method which may be found in a wide range of applications. Its constant development is propelled by a growing number of potential applications of the method and continuously upgraded cutting tools. Advances in manufacturing methods and capabilities of modern machine tools enable conducting machining with tremendous efficiency without compromising the great quality of produced pieces. Magnesium alloys find application as structural elements in manufacturing of machine parts and appliances, as well as in other industrial applications, e.g. as orthopaedic materials in medicine. The surface quality requirements are continually increasing, particularly with regard to mating elements. Therefore the need arises for explorations in the field of surface roughness and the impact of technological parameters on the condition of the surface in order to facilitate the work of technologists. The developed algorithm allows for accurate selection of milling parameters for a specified surface roughness range, which leads to increasing the effectiveness and efficiency of production. We have provided an important tool aiding the decision process of a technologist faced with specifying the technological parameters of machining. The major condition for obtaining accurate results is to build a test model based on verified data, which were then used to train the neural network.
Generate the space of condition points of model based on the trained neural network NET Search parameters, in the space of conditions generated by network NET which meet both conditions: 1-predicted surface roughness Ra_prog is between expected Ra and value minus tolerance T , 2-value of efficiency indicator W is maximum.
Are the conditions fulfilled?
It is impossible to obtain required surface roughness for these milling parameters NO Print determined parameters fz and vc , for which the value of W is maximum and the value of Ra is within the range.