Modelling and Prediction of Surface Roughness in CNC Turning Process using Neural Networks

: The paper presents an approach to solving the problem of modelling and prediction of surface roughness in CNC turning process. In order to solve this problem an experiment was designed. Samples for experimental part of investigation were of dimensions  30 × 350 mm, and the sample material was GJS 500 - 7. Six cutting inserts were used for the designed experiment as well as variations of cutting speed, feed and depth of cut on CNC lathe DMG Moriseiki-CTX 310 Ecoline. After the conducted experiment, surface roughness of each sample was measured and a data set of 750 instances was formed. For data analysis, the Back-Propagation Neural Network (BPNN) algorithm was used. In modelling different BPNN architectures with characteristic features the results of RMS (Root Mean Square) error were controlled. Specially analysed were the RMS errors realised by different number of neurons in hidden layers. For the BPNN architecture with one hidden layer the architecture (4 – 8 - 1) was adopted with RMS error of 3,37%. In modelling the BPNN architecture with two hidden layers, a considerable amount of architectures was investigated. The adopted architecture with two hidden layers (4 - 2 - 10 - 1) generated the RMS error of 2,26%. The investigation was also directed at the size of the data set and controlling the level of RMS error.


INTRODUCTION
At the present time of the fourth industrial revolution contemporary manufacturing processes integrate methods of artificial intelligence. The methods of artificial intelligence are the tools that enable intelligent production i.e. they make it possible for technologists to plan technological processes quicker and more efficiently. As every technological process is planned among others also according to the requirements of quality, the quality of machined surface (surface roughness) needs to be also pointed out. The quality of machined surface is directly correlated with the manufacturing process which usually contains various influencing parameters (variables). The manufacturing processes being multivariable, they are usually hard to be modelled as optimal. While modelling and investigating the surface roughness dependence on the parameters of a manufacturing process, the investigators designed various models. In paper [1] authors investigated the surface roughness prediction for turning operations using computer vision and artificial neural networks (ANN) with evolutionary algorithm. For the purposes of investigation, they designed a model in which the surface roughness was the output parameter while the model input parameters were: cutting speed, feed, depth of cut and average grey level of the surface image of the workpiece (acquired by computer vision). Computer vision and soft computing approach were also used in paper [2] as the methodology for recognizing the errors of surface roughness in the CNC turning process. For the purposes of investigation a model was designed which contained the following input parameters: feed, depth of cut, cutting speed, frequency range, grey scale value. Based on the given model, training and implementation of neural networks, an efficient methodology was obtained for discovering the error rate of surface roughness in the CNC turning process. A predictive model for various kinds of materials (austenitic, martensitic and duplex stainless steels) in CNC turning process was designed in paper [3] for investigation with the following input parameters: cutting speeds (120, 150, 180 and 210 m/min), feed (0,1 mm/rev) and depth of cut (1 mm) and using coated cemented carbide tools. The following parameters were defined as the model output parameters: cutting forces and surface roughness. Based on the proposed model and the parameters obtained during experimental work these were used in the process of the application of ANNs and for the comparison of obtained results.
In modelling and optimization of the machining parameters in the turning process, the authors of paper [4] proposed a model with the following input parameters: tangential cutting force, cutting power and the material removal rate, and with surface roughness as the output parameter. In experimental part of collecting data during the turning process, coated and uncoated silicon nitride ceramic tools were used while for the process of prediction the approach using neural networks and response surface methodology (RSM) was applied. In the process of optimization genetic algorithm (GA) was used. It was proven that a coated ceramic tool provides better surface quality and minimal cutting force in comparison with those obtained with an uncoated ceramic tool. Authors [5] use ANNs in estimating surface roughness by forming a model in which the machining parameters, cutting forces, sound and vibrations of the turning process were used as input parameters. Regression models were used for comparison. It was proven that neural networks estimated the state of surface roughness with more than 98% accuracy in relation to the formed regression models with more than 90% accuracy.
Comparison of three machine learning methods was suggested by authors [6] for prediction of output parameters of high speed turning process. The analysed output parameters were surface roughness (Ra), cutting force (Fc), and tool life (T). Different methods of machine learning were used for the process modelling: Support Vector Regression (SVR), polynomial (quadratic) regression, and ANNs. The best results in predicting F c and Ra were obtained by polynomial regression while in predicting T the best results were obtained by ANN. The investigation presented in [7] dealt with the obtaining of surface roughness by the use of fuzzy inference system (FIS) and comparing the results, among others, with the results derived by ANNs. Modelling and prediction of surface roughness and cutting forces in the process of finish turning with mixed ceramic tool using ANNs was suggested by authors [8]. For this research, a model with the following input parameters was used: cutting speed, depth of cut, feed and tool nose radius. During experiments authors used different materials. In paper [9] machining of aluminium alloy is suggested as well as modelling and prediction of the turning process using ANNs. For experimental part the following parameters were selected for the model: surface roughness, cutting forces, cutting temperature, material removal rate, cutting power, and specific cutting pressure. After the performed experimental work and collected data a neural network was modelled that estimated the process cutting performance with high precision.
By using the models, different parameters were investigated that influenced output parameters of the model. Among them surface roughness was certainly an important parameter. The various demonstrated models confirmed the problem complexity. Some authors [10,11] use these models to demonstrate the problem of tool wear. In addition to the quoted papers in the field of turning, ANNs are used in combination with other methods (classification and regression tree, support vector machine models, GA, adaptive particle swarm optimization algorithm) for modelling and prediction of surface roughness [12,13]. A special accent is given to the neural networks Back-Propagation (BPNN) algorithm for prediction of surface roughness [14], estimation of machining time [15], optimization of cutting parameters in combination with genetic algorithm [16] and prediction of cutting forces [17]. Investigation of various algorithms of neural networks (Back-Propagation Neural Network, Modular Neural Network and Radial Basis Function Neural Network) connected with the problem of surface roughness prediction was conducted by authors in paper [18]. Paper [19] describes the development of a model for surface quality prediction based on Radial Basis Function Neural Network (RBFNN). The RBFNN model results were compared with the BPNN model in view of the computing speed and accuracy. Authors in [20] use RBFNN for surface roughness prediction in hard turning process. Modelled RBFNNs showed the capability to foresee surface roughness in an exact, precise and accessible way. In paper [21] authors proposed to apply hybrid evolutionary neural-fusion system for evaluation of surface roughness. The proposed system also included, among others, prediction of surface roughness by cutting parameters and control of obtained or needed surface roughness by means of the characteristics quantified from the digital image of the observed machined surface. Authors [22,23] use various algorithms of neural networks for investigation of manufacturing problems.
In all of these papers conclusions in most cases provide justification for the application of neural networks in investigating and designing models for prediction of surface roughness.
The present paper deals with modelling and predicting surface roughness in CNC turning process using the designed model and experimental results of different architectures and properties of neural networks based on the Back-Propagation algorithm.

METHODOLOGY AND AIM OF INVESTIGATION
The aim of every manufacturing process is to achieve the required (demanded) quality of a product with acceptable characteristics of the process, such as: production costs, terms of delivery, machines and available tools. The quality of a product is defined, among others, also by the surface roughness which is required for the product to be functional. During chip-forming machining surface roughness is in the function of machining parameters. Technologists in production firms use various approaches to obtain the required surface roughness choosing optimal parameters and satisfying all the earlier mentioned characteristics. Different approaches to modelling process characteristics in the function of surface roughness are given in the literature review.
For the research presented in this paper a model is proposed with the following input parameters (variables): vector Xi = {cutting speed v c (m/min), feed f (mm/rev), depth of cut a p (mm) and different cutting inserts}, and the following output parameter (variable): vector Yi = {mean arithmetic deviation of profile Ra}.
If the middle line system is taken as the referent system that is used to evaluate the profile and if the middle line m is taken as the referent line, the middle line m divides the profile so that within the referent line l the sum of squares of all the profile y deviations from this line is the smallest. According to the defined system ( Fig. 1) two magnitudes are defined: Ra -Mean arithmetic deviation of the profile and Rq -Mean square deviation of the profile.
Rq -The mean square deviation of the profile is the profile mean square value within the borders of the referent line l, and is given by the Eq. (2).

Design of Experiment and the Experimental Work
Designed experiment for the present research was performed with six cutting inserts. Three cutting inserts were standard ones and three were of Wiper geometry (their geometry was identical to the standard ones-condition for comparison). During the experiment, input variables were acquiring different levels: -Cutting speed -v c : 200; 225; 250; 275 and 300 m/min -Feed -f: 0,1; 0,2; 0,3; 0,4 and 0,5 mm/rev -Depth of cut -a p : 0,5; 1; 1,5; 2 and 2,5 mm.
Samples for analysis of the suggested model were machined on CNC lathe (DMG Moriseiki-CTX 310 Ecoline) in the process of longitudinal external turning. Dimensions of samples were 30 × 350 mm, and the sample material was GJS 500 -7.
Based on thus defined design of experiment 125 experiments (5 × 5 × 5) were conducted with the corresponding measurement Ra for every cutting insert. As six cutting inserts were defined in the design of experiment, the total base was composed of 750 instances (each instance is a combination of the levels of the input variables with the corresponding measurement Ra). Tab. 1 displays a part of the data set.

Preparation of Data for Experimental Work with Neural Networks
Data set of 750 instances for experimental work with different algorithms of neural networks is based on experimental data obtained by the designed experiment. The data set was randomized and divided in three subsets according to the output variable by applying the principle: 60% for training, 20% for testing and 20% instances for validation (Fig. 2).

Back-Propagation Neural Network-General Approach
The Back-Propagation Neural Network (BPNN) is one of the most often used neural networks in investigations. In the basic architecture a neural network always has an input layer, an output layer and at least one hidden layer. There is no theoretical limit to the number of hidden layers, but the usual number is one or two. The analysed literature makes it clear that maximally four layers (three hidden and one output layer) are necessary for solving the arbitrarily complex problems of the classification of samples. In architecture, every layer is usually completely connected with the next layer. Fig. 3 displays the usual common structure of a neural network with one hidden layer. The arrows mark the information flow during passage through the network. By passing through the network, the computed output values are compared with the real ones and an error is being computed. The computed error is propagated back through the network. By this procedure the weights of the connections between the neurons are being changed, and the process of changing the connections' weights makes the training process of a neural network possible.

Figure 3 Typical Back-Propagation Neural Network
Basic element of a neural network is the neuron. A biological neuron is modelled and as it can be seen from Fig. 4 the neuron body takes the role of a summation function while the inputs into the summation function take the role of dendrites. The level of activation sensitivity of the biological neuron is taken over by transfer function which defines the moment of sending (firing) the impulse to the neuron output. The transfer function can be linear or non-linear. With linear transfer functions the output from the summation function is multiplied with some factor and the obtained sum is transferred to the neuron output. With non-linear functions the summation function outputs are changed in accordance with various forms of functions, and the neuron outputs can assume different values depending on transfer function. The information flow through neural network being usually completely connected, clear marking is necessary due to the training rules' description. In the exponent a layer of network is usually marked in which the training process is computed. The marking is given as follows:  A Back-Propagation element therefore transfers its inputs as follows: where f is usually a Sigmoid transfer function but can be any differentiable function. The Sigmoid transfer function is defined by Eq. (5). In the present research the Sigmoid transfer function for the BPNN modelling is adopted.

EXPERIMENTAL WORK AND ACHIEVED RESULTS
Experimental work on modelling and researching acceptable architecture of a neural network was carried out on adopted data set and selected Sigmoid transfer function. The reason for adopting the Sigmoid function was the data modelling and the results achieved in previous investigations. The following learning rules (algorithms) were adopted for modelling the neural networks architectures: Delta, Delta-Bar-Delta (DBD), Ext. Delta-Bar-Delta (Ext. DBD) and Normalized Cumulative Delta (Norm. Cum. Delta). Then the modelling and defining the properties of architecture of a neural network with one hidden layer was carried out. Tab. 2 and Fig. 5 display the achieved results with the level of RMS error in relation to the number of neurons in the hidden layer. It can be seen from Tab. 2 that the lowest level is the one of RMS error with eight neurons in the hidden layer and it is 3,37%. The other rules (algorithms) of training were also investigated based on the adopted architecture. The achieved results are as follows: -Delta training rule RMS = 4,82% -Delta-Bar-Delta training rule RMS = 4,73% -Norm. Cum. Delta training rule RMS = 4,80%.    Analysing the data sample (Fig. 2) and the amount of data, in the continuation of experimental work the impact of the amount of data (instances) on the level of RMS error will be investigated. The investigation is designed in two steps. In the first step, the data sample is halved and two data sets, identical by the amount of data, are designed. Each data sethad 225 instances in the training phase, while for the testing, 75 instances. For validation purposes, two data sets of 75 instanceseach were also designed. The division of the data sample was made according to the stochastic principle.
For the accepted architecture (4 -8 -1) and the realised BPNN characteristics the network was trained again with new data sets, in two steps. In the first step, the training was realised with the first data set (training, testing and validation) and after that with the second data set (division scheme was 225 -75 -75 instances). The BPNN network was trained for each data set and the level of RMS error (%)was controlled. The results realised in the training phase in the first step were: -The first data set RMSI = 4,32% -The second data set RMS II = 5,78%.
In the second step, the datasample was divided in three data sets using the previously described principle. Each data set was modelled according to the established principle: training, testing and validation with the following subset scheme: 150 -50 -50 instances. For each data set the BPNN network training process was separately conducted and the level of RMS (%) error was controlled. The results realised in the training phase (second step) were the following: -The first data set RMSI = 7,09% -The second data set RMS II = 6,71% -The third data set RMS III = 6,25%.
Range of RMS error "min tomax" is 0,84%. From this modelling and researchingof RMS error in the function of the amount of data, for investigated and accepted BPNN architecture (4 -8 -1) it can be concluded that reducing the amount of data in the training phase results in increasing the RMS error.
The remaining experimental work is aimed at modelling a larger number of BPNN architectures with two hidden layers in the form (4 -x -x -1). The BPNN architecture with adopted and accepted features in previous phases will be investigated. In the results of earlier investigations [23] the architectures with two or three hidden layers did not prove more successful than those with one hidden layer. It has been proven by investigations that nonlinear problems can be very well approximated with one hidden layer.
Tab. 3 shows the realised results of modelling different BPNN architectures in the training process with a whole (complete) data sample of 450 instances and 150 instances in the testing phase.  From the results shown in Tab. 3 it can be concluded that in accordance with the least realised RMS error the BPNN architecture (4 -2 -10 -1) is selected with two hidden layers and RMS error of 2,26% in the training phase (Fig.  8). This BPNN architecture is adopted as the architecture proposed for solving the suggested problem. The process of validation was conducted on the adopted BPNN architecture. The process of validation is conducted on the new data sample which neural network did not have a chance to use in the training phase and which is an integral part of the results achieved during conducting the experiment (Fig. 2).
In the process of validation the RMS error of 4,24% was realised. Display of the achieved results in the training phase is given in Fig. 9, and the results achieved in the validation phase are given in Fig. 10.

CONCLUSIONS
The investigation carried out in the research of influencing parameters in chip-forming machining process at CNC turning is presented in the paper. In the analysis of the factors of influence on the machining process, cutting speed, feed and depth of cut were selected along with the selected cutting inserts of the tool. The design of experiment defined six cutting inserts and levels of cutting speed (200; 225; 250; 275 and 300 m/min), feed (0,1; 0,2; 0,3; 0,4 and 0,5 mm/rev) and depth of cut (0,5; 1; 1,5; 2 and 2,5 mm) on CNC lathe DMG Moriseiki-CTX 310 Ecoline. The experimental design defined the experimental work conducted on samples of dimension ø30 × 350 mm, and the sample material GJS 500 -7. In accordance with the experimental design, 125 samples were defined with the variations of cutting speed, feed and depth of cut. The complete conducted experimental work was composed of a set of 750 instances. Surface roughness Ra measurement was carried out on each sample. The unified data set formed the basis for continuation of experimental work with the BPNN algorithm. The data were prepared before the work on studying acceptable architecture of a neural network began. Various structures were modelled and the BPNN algorithm parameters varied. Particularly separated and presented were the results of the level of RMS error in the function of the hidden layer number of neurons. During the neural network training different training algorithms were also varied which along with the accepted Sigmoid transfer function gave the following results for RSM: the Delta rule algorithm 4,82%; the Delta-Bar-Delta rule algorithm 4,73%; the extended Delta-Bar-Delta rule algorithm 3,37% and the Norm. Cum. Delta rule algorithm 4,80%.
The accepted architecture was (4 -8 -1) with the Sigmoid transfer function and the algorithm of extended Delta-Bar-Delta rule of the neural network training. After ending and accepting the RMS error with one hidden layer, the investigation could continue into the influence of the data set size on RMS error. With the accepted BPNN architecture the network training was continued on different amounts of data in two steps. In the first step the data sample was divided in two data sets and the RMS errors of 4,32% and 5,78% were realised. In the second step the data sample was divided in three equal data sets. The realised levels of RMS error were 7,09%, 6,71% and 6,25%, which leads to the conclusion that by reducing the amount of data the RMS error increased for the given problem of investigation. In continued investigation different BPNN structures were modelled with two hidden layers which generated a smaller error than the structure with one hidden layer. The adopted architecture was the one with two hidden layers (4 -2 -10 -1) and RMS error of 2,26% in the training phase, i.e. 4,24% in the validation phase. The adopted BPNN architecture (4 -2 -10 -1) was suggested for solving the problem.
There is a plan for the future research to also investigate the other algorithms of neural networks which successfully solve the problems of prediction.