Mathematical modeling and optimization of surface roughness in turning of polyamide based on artificial neural network

Straipsnyje pristatoma tekinamo poliamido pavirsiaus siurkstumo matematinio modeliavimo metodologija, paremta dirbtinio neuroninio tinklo naudojimu. Pavirsiaus siurkstumo modelis yra sukurtas naudojant pagrindinius pjovimo parametrus: pastūmos greitį, pjovimo greitį, pjovimo gylį ir įrankio virsūnės suapvalinimo spindulį. Modeliavimo duomenys buvo parinkti eksperimentiskai, naudojant „Taguchi L 27 “ ortogonaliąją tvarką. Papildant modeliavimą, taikytas simpleksinis optimizavimo metodas ir nustatyti optimalūs pjovimo parametrai, minimizuojantys pavirsiaus siurkstumą. Is modelio analizės, atliktos naudojant 3D charakteristikų grafikus, buvo padarytos isvados. Pastūmos greitis yra pagrindinis veiksnys, lemiantis pavirsiaus siurkstumą, po įrankio virsūnės spindulio ir pjovimo gylio. Pjovimo greicio efektas yra labai nedidelis. Minimalus pavirsiaus siurkstumas gaunamas derinant nedidelį pastūmos greitį, nedidelį pjovimo greitį ir didelį įrankio virsūnės spindulį. DOI: http://dx.doi.org/10.5755/j01.mech.18.5.2701


Introduction
The polyamides have attracted a great deal of interest over the last few years due to superior properties such as high specific strength and stiffness, wear resistance, dimensional stability, low weight, and directional properties compared to conventional metallic materials [1].As a result, there is an increasing usage of these thermoplastic polymer composites in many fields of engineering.
The polyamides require machining operations at the final assembly stage in order to get the finished components, even though they are produced as near net shapes [2].Nevertheless, the knowledge regarding the machining of polymers is limited.The machining of polymers often presents challenges to engineers [3], therefore, there is a need to understand the machining of polymers [1][2][3][4].Until now, there is a limited number of papers dealing with modeling the relationships among the process parameters and their effects on machinability aspects (cutting forces, tool wear, surface roughness, power, etc.) of polymers.
Gaitonde et al. [1] analyzed the effects of process parameters (work material, type of cutting tool, cutting speed, and feed rate) on machinability characteristics (machining force, power and specific cutting force) during turning of unreinforced polyamide (PA6), and reinforced polyamide with 30% of glass fibers (PA66 GF30) through artificial neural network (ANN) modeling.Dhokia et al. [3] developed a surface roughness predictive model based on ANN for slot milling of polypropylene.In their study, extensive experimental work on different ANN architectures and training algorithms was performed to predict the behavior of the surface roughness considering spindle speed, feed rate, and the depth of cut as ANN inputs.The predictive model was aimed to provide accurate machining parameters to obtain optimized surface finishes.Gaitonde et al. [4] developed RSM based second-order mathematical models for analyzing the influence of cutting speed and feed rate on machining force, cutting power, and specific cutting pressure during turning of unreinforced polyamide (PA6), and reinforced polyamide with 30% of glass fibers (PA66 GF30).Farahnakian et al. [5] investigated the influence of cutting parameters (spindle speed and feed rate) and nanoclay (NC) content on machinability (cutting force and surface roughness) in milling of polyamide-6/nanoclay (PA-6/NC) nanocomposites.Cutting force and surface roughness are separately modeled by using a particle swarm optimization (PSO)-based ANN.
The selection of cutting tool and process parameters is very much essential in machining of polyamides [1].Therefore, once the input-output relationship model is de-veloped, one needs to determine optimal or near-optimal cutting conditions using an optimization technique.
Dhokia et al. [6] developed a predictive model using the design of experiments (DOE) method to obtain optimized machining parameters, by utilizing genetic algorithm (GA), for a specific surface roughness in ball-end machining of polypropylene.Yilmaz et al. [7] applied the ANN approach to predict the surface roughness in milling of PA6G polyamide.The spindle speed and feed rate were the cutting parameters used as ANN inputs.By simulating the trained ANN for many input combinations, the response surface of the surface roughness was obtained from which the optimal cutting parameters were identified.Gaitonde et al. [2] applied Taguchi's quality loss function approach for simultaneously minimizing the power and specific cutting force during turning of both PA6 and PA66 GF30 polyamides.Taguchi's optimization was performed with tool material, feed rate and cutting speed as the process parameters.
To the authors' knowledge, little work has been reported in the literature on developing mathematical models for surface roughness in turning of polyamide PA6 based on ANN.ANNs are currently one of the most powerful modeling techniques, based on the statistical approach, increasingly applied in modeling of machining processes.The ability of ANN to capture any complex input-output relationships from the limited data set, especially in the machining processes, where a huge experimental data set for the process modeling is difficult and expensive to obtain [1], was the main reason for using ANN to develop a mathematical model for surface roughness.In addition, ANNs do not require a prior assumption of the functional form of the relationship between cutting and process parameters, but are in turn, after successful training, able to provide exact relationship between parameters that can be represented by mathematical equation.To obtain data for ANN training, the turning experiments were conducted according to Taguchi's L 27 orthogonal array (OA) experimental layout plan.
Therefore, this paper aims at modeling of relationships among the cutting parameters (cutting speed, feed rate, depth of cut and tool nose radius) and surface roughness in turning of polyamide PA6 using ANN.In addition to modeling, the surface roughness mathematical model was optimized.To find the optimum cutting parameter setting one may apply a large number of techniques.In recent years, among the traditional optimization methods, such as linear programming [8,9] or response surface methodology [10][11][12], the application of metaheuristic optimization algorithms is increasing.The successful applica-tion of GAs, PSO and simulated annealing for optimization was reported in references [5,6,13,14].Although many methods can achieve acceptable results, the simplex optimization algorithm was selected because of its simplicity and efficiency.

Material and machining conditions
The work material used in the study was unreinforced polyamide PA-6 (commercially DOCAMID 6E) produced by Quattroplast Ltd. (Hungary).The mechanical and thermal properties of the work material are given in Table 1.The longitudinal turning experiment was carried out in 100 mm length and 92 mm diameter workpiece on the universal lathe machine "Potisje PA-C30" with a 11 kW power, speed range n = 20 ÷ 2000 rpm, and longitudinal feed rate range f = 0.04 ÷ 9.16 mm/rev.Cutting tool was SANDVIK Coromant tool holder SVJBR 3225P 16 with inserts VCGX 16 04 04-AL (H10) and VCGX 16 04 08-AL (H10).The tool geometry was: rake angle γ = 7º, clearance angle α = 7º, cutting edge angle χ = 93º, and cutting edge inclination angle λ = 0º.
In the study, the average surface roughness (R a ) was considered.Mathematically, R a is the arithmetic value of the departure of profile from the centerline along sampling length.
The machined surface was measured at three equally spaced positions around the circumference of the workpiece using the surface profilometer Surftest Mitutoyo SJ-301.

Plan of experiment
To develop mathematical model based on ANN that relates the cutting parameters and average surface roughness (R a ), a plan of experiment is needed.The classical DOE methods are sometimes too complex and require a large number of trials especially in situations when the number of selected process parameters increases.Taguchi method [15] uses a special design of OA to study the entire parameter space with minimum experiments [2].
In the present study, four cutting parameters, namely, cutting speed (V c ), feed rate (f), depth of cut (a p ), and tool nose radius (r) were considered.The cutting parameters and their levels are given in Table 2.The cutting parameter ranges were selected based on machining guidelines provided by Quattroplast Ltd. and previous researches [4].
The cutting parameters were arranged in standard Taguchi's L 27 (3 13 ) OA. Cutting parameters V c , f and a p were assigned to columns 1, 2 and 5, respectively.This allowed two-level interactions of these parameters to be studied.Cutting parameter r was assigned to column 12.As it had only two levels, the dummy-level technique [15] was used to reassign level 1 to level 3.The plan of experiment layout to obtain average surface roughness (R a ) is shown in Table 3. Experiment trials were performed at random order to avoid systematic errors.

ANN basics
ANNs are massive parallel systems made up of numerous simple processing units called neurons.An ANN is a multilayered architecture where neurons are grouped into input, hidden, and output layers.The neurons between adjacent layers are connected with weights that have to be determined during ANN training process.ANNs are characterized by their architecture, weights and adjoined biases, and activation (transfer) functions that are used in hidden and output layers [16].Direct ANNs with supervised training and backpropagation (BP) are often used for solving most practical problems.
The general architecture of three-layer BP ANN is illustrated in Fig. 1.

Fig. 1 The general architecture of three-layer BP ANN
The input neurons are used to feed the ANN with the input data.Through neuron interconnections each input data is processed with weights to be used in the hidden layer.As illustrated in Fig. 1, j-th hidden neuron receives an activation signal which is the weighted sum from the neurons in the input layer where w ji are the weights between input to hidden neurons, b j are biases (thresholds) of hidden neurons, and i and j are the number of input and hidden neurons, respectively.This sum is then passed through an activation function (f) to produce the neurons output (H j ).The activation function in the hidden layer most commonly is a sigmoid function whose general form is given as Finally, the output neurons receive the following signals from the hidden neurons where w kj are the weights of the connection between hidden and output neurons, and b k biases of output neurons.These activation signals can be transformed again, using the sigmoid transfer function to give the outputs of the ANN.However, for prediction, it is sufficient to use the linear activation function (identity) for output neurons.The ANN output is then as in Eq. ( 3) which is predicted values for the given inputs.
Accordingly, the functioning of a three-layer feed-forward ANN, as the one in Fig. 1, can be expressed as where ) (X y ˆis the computed ANN output (prediction) for the input X = x 1 ,...,x i .

Data for ANN training and testing
In order to determine ANN weights, a set of input-output data, obtained by the experiment, simulation or some other way, is needed.The training and testing data in this study was created using Taguchi's L 27 OA (Table 3).As Taguchi's OA is used to study the entire experimental space, defined by cutting parameters, it is suitable for ANN training.
Most researchers consider that the total set of available data (N) should be divided into two different subsets: for the training of ANN (N tr ≈ (3/42/3) N) and for the ANN testing (N ts ≈ (1/41/3) N).In this case, the 54 experimental data (input/target pairs) were randomly divided into a data subset for training (N tr = 40), and data subset for testing the ANN (N ts = 14).
In order to stabilize and enhance ANN training the input and output data was normalized between -1 and 1 using the following equation where p norm and p i represent the normalized and original (raw) data, and p min and p max are minimum and maximum values of the original data.

ANN architecture
Specifying ANN architecture requires determining the number of neurons in input, output, and hidden layers, and the choice of activation functions in hidden and output layers.
Since ANN was aimed at estimating the average surface roughness (R a ) in terms of cutting speed (V c ), feed rate (f), depth of cut (a p ), and tool nose radius (r), there are four neurons in input layer, and one neuron in output layer.
It has been widely reported that ANN with a single hidden layer are able to approximate any arbitrary function to a given accuracy.Therefore, the choice of ANN architecture can be reduced to the selection of the "optimal" number of hidden neurons.The number of hidden neurons is data dependent.The number of weights is equal to the sum of the product between the number of neurons in each layer.Therefore, the upper limit of the number of hidden neurons is restricted by the number of available data for training.It is easy to calculate that for four inputs and one output, and 40 training data, the maximum number of hidden neurons is eight.Various architectures were developed, and the developed (4 [4] 1 ) ANN architecture (Fig. 2) turned out to be the optimal solution (after trade-off).
Linear transfer function (purelin * ) and hyperbolic tangent sigmoid activation function (tansig * ) were used in the output and hidden layer, respectively.Note that the tansig in MATLAB is calculated as follows [17]   Training is a continuous process, which is repeated until the ANN is stabilized or overall error is reduced below a previously defined threshold.Gradient descent with momentum method updates weights so as to minimize the mean square error (MSE) between the ANN predicted and desired (target) values where E is the MSE, and t, η, and µ denote the iteration number, learning rate, and momentum, respectively.In each iteration, the weights are updated by the partial derivative of the total error with respect to a given weight through a learning rate η and the variation of the same weight during the previous iteration by momentum µ.Learning rate and momentum µ control the speed and stability of the training process, and usually take values between 0 and 1 [18].On the basis of preliminary experimentation with different combinations of η and µ, considering that η + µ ≈ 1 [19], η and µ were set to 0.66 and 0.33, respectively.
The ANN training process performance was followed according to the MSE, and was stopped after 5000 iterations since no further improvement in ANN performance was achieved.Fig. 3 shows the variation of MSE as function of the number of iterations.Once the weights are adjusted the performance of the trained ANN should be tested.The trained ANN was tested for generalization using 14 experimental data (7 trials (bolded rows) in Table 3) which were not used in ANN training process.
There is a variety of statistical performance measures employed to evaluate the ANN performance.The statistical methods of root mean square error (RMSE), absolute fraction of variance (r 2 ) and mean absolute percent error (MAPE) have been used for estimating the prediction errors.These values are mathematically defined by the following equations where t is the target (experimental) value, o is the ANN predicted value and N is the number of data.The performance of the developed ANN is given in Table 4.As a part of these analyses, the performance of the ANN for prediction of average surface roughness using the entire data set, in the form of regression is shown in Fig. 4. With this analysis it is possible to determine the response of the ANN model with respect to the experimental values.The results from Table 4 and Fig. 4 indicate that ANN predictions are in good agreement with the experimental results.

Mathematical equation
The biggest criticism regarding the application of ANN is that all the perceived relationships between inputs and outputs by ANN model cannot be represented by a mathematical equation.However, the mathematical equation based on ANN can be obtained using the general functional form of a single hidden layer feedforward ANN given in Eq. ( 4).Once the ANN is trained, the unknown input to hidden neurons weights (w ji ) and hidden and output neurons weights (w kj ), as well as hidden neurons biases (b j ) and output neurons biases (b k ) are determined.The weights and the biases of the trained ANN are presented in Table 5.

Weights w ji
Weights 0.7108 -0.8342 -1.3879 1.6211 -0.0462 -1.1989 0.9546 0.1381 0.8405 0.1893 0.9261 1.5009 -1.7475 --0.8113 -0.8322 -1.0085 0.5217 -0.0381 -0.7722 --0.3297 1.5591 0.1288 -1.2761 0.4420 -1.5139 -Regarding the architecture of the developed ANN, the used activation functions (Eq.( 6)), and by using the weights and biases from Table 5, the exact mathematical relationship between average surface roughness and cutting parameters can be expressed by the following equation where X is the column vector which contains normalized values of V c , f, a p , and r, and is the normalized value for the average surface roughness (R a ).In order to obtain the actual values for the average surface roughness (R a ), one needs to perform denormalization by the following equation In that way, by using Eqs.(11) and ( 12) it is possible to calculate average surface roughness (R a ) for the given cutting conditions.

Optimization
An appropriate selection of cutting parameters would increase the product quality by minimizing the surface roughness (R a ) as the main indicator of surface quality.In order to get the optimal cutting parameters, i.e. the combination of cutting parameters that gives the minimal value of the average surface roughness (R a ), the optimization using simplex optimization algorithm was conducted.For turning of polyamide PA-6, the optimization problem was defined as below: For calculating average surface roughness (R a ), the mathematical function based on the developed ANN (Eq.( 11)) was used.All calculations are based on the optimization package MATLAB.
As a result of optimization, the minimum value of R a = 0.6507 μm was obtained with the following cutting parameter values: V c = 65.03m/min, f = 0.049 mm/rev, a p = 1 mm, and r = 0.8 mm.
To verify the optimization result, one needs to perform the experiment under the optimal cutting conditions.Since the optimal combination of cutting parameters was not included in the OA (Table 3), the verification test was conducted.The comparison of optimal values obtained by simplex optimization algorithm with experimental measurements is given in Table 6.From Table 6, one can see that obtaining high quality surfaces of low R a in turning of polyamide PA6 is possible when cutting parameters V c , f, and a p are set at the low levels and r at the higher level.

Analysis and discussion
The developed ANN to predict the average surface roughness based on the cutting parameters showed high degree of accuracy within the scope of cutting conditions investigated in the study.Thus, the effect of cutting parameters on the average surface roughness can be studied using Eqs.(11) and (12).
The influence of cutting parameters on surface roughness can be analyzed by using 3D response graphs.Figs. 5, a-d show the 3D response graphs for average surface roughness.The response surface graphs are drawn by varying feed rate and depth of cut while keeping the cutting speed and tool nose radius at all combinations of low and high levels.
The functional dependence of R a on the depth of cut and feed rate at constant cutting speed of v = 65.03m/min can be seen in Figs. 5, a and b.
It can also be seen that the increase in depth of cut and feed rate results in deterioration of the machined surface.The increase in feed rate produces a nonlinear increase in R a , whereas the dependence between R a and depth of the cut is linear.
Similar conclusions can be made based on Figs. 5, c and d  The following can be also concluded: (a) the increase in feed rate, depth of cut and cutting speed results in the increase of R a , whereas the influence of tool nose radius must be considered through the interaction with feed rate; (b) feed rate has maximum influence on the R a followed by tool nose radius, depth of cut and cutting speed.

Conclusion
In this paper, an ANN based mathematical model is developed in order to relate the cutting parameters (cutting speed, feed rate, depth of cut and tool nose radius) and surface roughness in turning of polyamide material.Experiments were performed according to Taguchi's method and the obtained data was used for ANN training.After successful training, the developed ANN was successfully validated on testing data using three statistical performance measures.Considering the ANN architecture, the used activation functions, and weights and biases of the trained ANN, the mathematical model for surface roughness was developed.
By applying the simplex optimization method on the developed surface roughness model, the optimal cutting parameter setting, minimizing surface roughness, was determined.The optimization results were then experimentally verified.
The results of the performed analysis show that both feed rate and tool nose radius are the most influential factors on surface roughness.The depth of cut and cutting speed have a negligible influence on the surface roughness.

MATHEMATICAL MODELING AND OPTIMIZATION OF SURFACE ROUGHNESS IN TURNING OF POLYAMIDE BASED ON ARTIFICIAL NEURAL NETWORK S u m m a r y
This paper presents the methodology of mathematical modeling of surface roughness in turning of polyamide based on artificial neural network.The surface roughness model was developed in terms of the main cutting parameters such as feed rate, cutting speed, depth of cut, and tool nose radius.The data for modeling were collected through experiment based on Taguchi L 27 orthogonal array.
In addition to modeling, by applying the simplex optimization method, the optimal cutting parameter setting minimizing surface roughness, was determined.
From the model analysis performed by generating 3D response graphs the following conclusions are drawn.
Feed rate is the dominant factor affecting surface roughness, followed by tool nose radius and depth of cut.As for cutting speed, its effect is not very important.
The minimal surface roughness results with the combination of low feed rate, low depth of cut, low cutting speed and high tool nose radius.

Fig. 2
Fig. 2 ANN for modeling the surface roughness 3.4.ANN training The ANN training belongs to one of the most important parts of the ANN design process.The ANN training represents a process of adjusting weights and adjoined biases between neurons on the basis of comparing the output values with the desired (target) ones for the same input * MATLAB command for the corresponding function

Fig. 3
Fig. 3 MSE during the training phase vs. the number of iterations 3.5.ANN testing

Fig. 4
Fig. 4 The prediction performance of the 4 [4] 1 ANN using entire data

Fig. 5
Fig. 5 The influence of feed rate and depth of cut at various combinations of cutting speed and tool nose radius: a) V c = 65.03m/min, r = 0.4 mm; b) V c = 65.03m/min, r = 0.8 mm; c) V c = 213.88m/min, r = 0.4 mm; d) V c = 213.88m/min, r = 0.8 mm

Table 2
Cutting parameters and their levels

Table 3
The plan of experiment layout and experimental results