1 Introduction

Machining processes are used to shape plastics in the case of accurate shapes, complex parts, or for small production volumes, where extrusion and molding are not cost-effective, or for a product that needs a costly dimensional accuracy, such as polymer lenses [1, 3]. Turning, milling and grinding are the conventional machining processes and the cutting mechanism is mainly shearing of the material ahead of the cutting wedge, resulting in chip formation [2]. One of the factors that influence the quality of a machined component is associated with the tool design and machining conditions such as rake angle, tip radius, depth of cut and cutting speed [3, 4]. Surface finish is an important parameter in the machining process. In machining of parts, surface quality is one of the most specified customer requirements. Major indication of surface quality on machined parts is surface roughness. It has formed an important design feature in many situations such as parts subjected to fatigue loads, precision fits, fastener holes, and aesthetic requirements. In addition to tolerance, surface roughness imposes one of the most critical constraints for the selection of machines and cutting parameters in the process planning [5]. So, surface roughness is an important measure of the technological quality of a product and a factor that greatly influences manufacturing cost [2, 3].

Cast polyamides serve as a replacement for bronze, brass, aluminum or steel parts, including rollers and guides, bushings and bearings, gears and sprockets, sheaves and idlers due to dry-sliding properties. They cover a wide range of properties and applications due to flexible formulation, shaping and processing [6].

Neural networks (NN) are computational intelligent methods, which could establish a mapping through the numerical inputs and outputs. The NN extract a sensitive, exact and realistic relation from some experimental input–output data, called training set. In this way, they could interpolate synthetic data which estimate the results of the experiments that have not been established, and predict optimum reasonable processing conditions [7].

Caydas and Hascalik [9] developed a NN and regression model to predict surface roughness in an abrasive water jet machining process. They machined AA 7075 aluminum alloy [9]. Dhokia et al. [10] paid attention to a little research that is evident in the literature on the analysis of optimal machining parameters for machining materials such as polypropylene. They developed a performance predictive NN model based on surface roughness for polypropylene machining. In their study, extensive experimental work on different network topologies and training algorithms has been performed to predict the behavior of the surface roughness for machined polypropylene products [10]. Basheer et al. [11] proposed an experimental work on the analysis of machined surface quality on Al/SiCp composites leading to an ANN (artificial neural network) model to estimate surface roughness whose results were found to be in a very good agreement with the unexposed experimental data set [11]. Arafeh and Singh [12] announced the requirement of new and powerful paradigms such as NN, fuzzy and neuro-fuzzy approaches on material processing.

Surface roughness depends on different machining parameters and its prediction and control is a challenge to the research. Owing to advances in computing power, there is an increase in the demand for the use of the intelligent techniques. Recent researches are directed toward hybridization of intelligent techniques to make best out of each method. For example Jesuthanam et al. [13] proposed a hybrid NN trained with Genetic Algorithm (GA) and Particles Swarm Optimization (PSO) for the prediction of surface roughness [13].

This paper is about predicting the surface roughness with neural network approach method on machining of an engineering plastic material. The spindle speed and feed rate were the cutting parameters and the quality of the cutting surfaces was controlled with surface roughness. In this study, a feed-forward NN, which includes two hidden layers were used. Gradient Descent method was applied to optimize the weight parameters of neuron connections.

2 Experimental study

The work material was an extruded PA6G cast polyamide for the machining tests. The mechanical and thermal properties of the material are given in Table 1. The milling experimentations were carried out in 80 mm width and 400 mm length work-pieces using a high-speed-steel (HSS) four-flute end-milling cutter with a diameter of 12 mm, and the cutting length was 80 mm. Dry-cutting conditions are maintained for all milling experimentations. Two cutting parameters were spindle speed (100, 125, 160, 200, 315, 500, 630, 800, 1,000, 1,250, 1,600, 2,000 rpm) and feed rate (12.5, 25, 40, 50, 80, 100, 125, 200, 315, 400 cm/min) where depth of cut was fixed to 2 mm. The surface roughnesses were measured on each milled surfaces at the fixed positions with Mitutoyo SJ-301 profilometer and the average surface roughness (Ra) was taken.

Table 1 Mechanical- and thermal-properties of cast polyamide

3 Neural networks model

Predictive models can provide a predictive control by enabling us to anticipate how process will respond to changing variables. Dhokia et al. [10] developed a NN model, which mainly hinges three independent variables namely spindle speed, feed rate and dept of cut [10].

In this study, NN was used as an input–output fitter which predicts the relative surface between inputs and output, by means of calculating the interpolation coefficients, called weights.

These weights constitute a parameter matrix that maps an equation vector, for example, outputs to a state vector and inputs in Fig. 1, where SS, FR and Ra are spindle speed, feed rate and average surface roughness, respectively.

Fig. 1
figure 1

Structure of the feed forward NN used for roughness estimation

Weights that were given in Fig. 1 are updated according to the back propagation method which is an adaptation of gradient descent method to neural networks. The gradient descent method minimizes error cost function given in Eq. 1 (Moon and Stirling 1999).

$$ C = \frac{1}{2}\sum\limits_{i = 1}^{{n_{k + 1} }} {(d_{i} - y_{i} )^{2} } $$
(1)

where d i are desired output values of Ra given in the training data and y i are the actual ANN output estimations about Ra given in Fig. 1.

Weights are updated according to Eq. 2.

$$ \Updelta w = - \alpha \;\nabla_{w} \;C $$
(2)

where w symbolizes the connection weight and ∇ w means, partial derivation of a function according to parameter w. The weight update equation will be:

$$ w_{ij}^{\ell + 1} = w_{ij}^{\ell } + \Updelta w_{ij}^{\ell } $$
(3)

Layers are shown in Fig. 1. i symbolizes the ith neuron in an antecedent layer where j symbolizes the jth neighbor neuron of the successor layer. w ij is connection weight between these neurons.

Training, testing and graphing programs of the neural networks mentioned above was written in Matlab’s programming language [8]. The programs are described with algorithms in “Appendix”.

3.1 Training process

The network has two inputs called spindle speed (SS) (rpm) and feed rate (FR) (cm/min). Output of the network is surface roughness (Ra) (μm). The Input Layer Neurons acts as buffers, which transfers the inputs to their outputs, without any change. The following layers and their parameters are given in Table 2.

Table 2 Parameters of the network used for roughness estimation

Number and type of the neurons in the hidden layers as well as the number of hidden layers are determined after several tries and faults.

Experimental data obtained from the machining process are shared into two sections; for training the network and then testing it by means of a data set which is unknown for the trained network (see Figs. 5, 6, 7 in "Appendix").

As an example, first 8 of the 36 training inputs–output couples are given in Table 3.

Table 3 Training data

However, since the neural network could not estimate instantaneous changes in the raw data given in the training and the testing sets, both data sets are scaled due to logarithms of the inputs–output couples. Following the logarithmic scaling, training and testing; stages are processed. Then, the results of the network are rescaled by means of calculating their exponential values.

3.2 Testing process and relation surfaces

Relation surfaces are three dimensional graphs which illustrate the relation between inputs and outputs of a model. Changes of roughness (Ra) due to the current SS and FR are shown in Fig. 2. The surface in the figure shows the testing responses of the trained Neural Networks to several input combinations; that is, 5,929 iterative simulations (tests) have done to get this response surface.

Fig. 2
figure 2

The relative surface of roughness due to SS and FR

As seen in the Fig. 2, the relation between the inputs and the output has a very nonlinear and complex behavior. This is originated from nature of the machining process, such as melting of the material over some speed. However, the surface reasonably proves both training and testing data. This means, the trained network could not only be used for estimations of roughness in several processing situations, but also to predict the optimum roughness condition or conditions.

Several reasonable roughness conditions are determined and their corresponding minimum roughness values are emphasized with arrows in Fig. 3. The white curve shows the region of minima in the surface (Fig. 3a).

Fig. 3
figure 3

The relative surface and reasonable roughness conditions from different perspectives

The optimum working region clearly seen in Fig. 3 gives the best surface roughness. The minimum Ra is obtained for 400 rpm and 251 cm/min as 0.8371 μm.

3.3 Training performance of the neural network used in surface roughness

Least mean square (LMS) algorithm is used to compute the training performance of the neural networks [16]. Cost function as shown in Fig. 4 which is a root mean square of neural network output errors, is forced to minimize. The algorithm uses the steepest descent method for minimizing the function [15]. The method iterates in such a way that \( f(x^{[n + 1]} ) < f(x^{[n]} ) \) unless \( f(x^{[n + 1]} ) = f(x^{[n]} ) \) in which case a minimum point is reached. One general framework for accomplishing this is to update the point x [n] by \( x^{{\left[ {n + 1} \right]}} = x + \alpha_{n} .p_{n} \) where α n is a scalar, which denotes a step size and p n is a direction of motion selected so that the successive steps decrease f. In our study, although the performance goal is not met (see Table 2) the trained NN has reached to a very small RMS value that is 0.00122102.

Fig. 4
figure 4

Illustrative graphics of testing and estimated data comparison

4 Results and discussion

The data which will be tested are directly given for comparison with the data estimated by the NN.

To test adequacy of a model several input values should be selected from the input–output data and applied to the model [12]. Comparison of the actual outputs and results of the model are given in Table 4. No gives the case number where Output and Network Output gives the outputs of actual and neural networks approximations.

Table 4 Comparison of testing data and the data estimated by the trained NN

Figure 4 illustrates these comparison results. The results seem to be reasonable, except for Case 4 and Case 15.

In the future works, computational speed and efficiency over the NN models are going to have an important role on predicting of surface roughness and to obtain higher machining productivity levels. Furthermore in the machining of metal, a new NN model would be proposed to predict surface roughness and tool wear over the machining time for a variety of cutting conditions in finish hard turnings [14].

5 Conclusions

Surface roughness is an important outcome to attain higher productivity levels in the machining process. In this study, a neural network based estimation model is developed in order to predict the surface roughness appeared in the machining process of cast polyamide material. Training performance of the model reached to RMS value of 0.00122102.

Estimated data of the model are obtained similar to the test data. Due to the roughness surface created by the model, optimum Ra value is reached to 0.8371 μm at 400 rpm and 251 cm/min.