Implementation of neural network for monitoring and prediction of surface roughness in a virtual end milling process of a CNC vertical milling machine

This paper presents a real time simulation for virtual end milling process. Alyuda NeuroIntelligence was used to design and implement an artificial neural network. Artificial neural networks (ANN’s) is an approach to evolve an efficient model for estimation of surface roughness, based on a set of input cutting conditions. Neural network algorithms are developed for use as a direct modeling method, to predict surface roughness for end milling operations. Prediction of surface roughness in end milling is often needed in order to establish automation or optimization of the machining processes. Supervised neural networks are used to successfully estimate the cutting forces developed during end milling processes. The training of the networks is preformed with experimental machining data. The neural network is used to predict surface roughness of the virtual milling machine to analyze and preprocess pre measured test data. The simulation for the geometrical modeling of end milling process and analytical modeling of machining parameters was developed based on real data from experiments carried out using Prolight2000 (CNC) milling machine. This application can simulate the virtual end milling process and surface roughness Ra (μm) prediction graphs against cutting conditions simultaneously. The user can also analyze parameters that influenced the machining process such as cutting speed, feed rate of worktable.


INTRODUCTION
Milling process is classified as material removal process.This process and its machine tools are capable of producing complex shapes with the use of multi-tooth, cutting tools.In the milling process, a multi-tooth cutter rotates along various axes with respect to the work piece.Applications of the end milling process can be found in almost every industry ranging from large aerospace industry to small tool and die makers.One reason for the popularity of the end milling process is that it can be used for both rough and finish machining of components.The major problem, which may result from the end milling process, is the generation of a finished part surface which *Corresponding author.E-mail: h.m.abdel-rahman@hotmail.comdoes not satisfy product design specifications.A finished part surface might be too rough or poor dimension accuracy.An undesirable part surface may require additional machining, thus lowering productivity and increasing the cost of the production.In order to produce parts, which conform to design specifications, proper machining conditions (spindle speed, feed rate, depth of cut, cutter diameter, number of cutting flutes, and tool geometry), must be selected (Boothroyd, and Knight, 1989).
Machining processes such as turning, milling, drilling and grinding can be visualized using Virtual Reality (VR).VR technology can also be used to evaluate the feasibility of a design, selection of process equipment and to allow a user to study the factors affecting the quality, machining time and costs.It is important to note that a virtual reality system is essentially an interactive simulation that can represent a real or abstract system.The simulation is a representative computer based model, which provides appropriate data for visualization or representation of the system.The virtual environment can take many forms and for example, it could be a realistic representation of a physical system (Schofield, 1995).Some of the machine operator using 'trial and error' method to set-up milling machine cutting conditions.This method is not effective or efficient and the achievement of a desirable value is a repetitive and empirical process that can be very time consuming thus, a mathematical model using statistical method provides a better solution.Multiple regression analysis is suitable to find the best combination of independent variables, which is spindle speed, feed rate, and the depth of cut in order to achieve desired surface roughness.Unfortunately, multiple regression model is obtained from a statistical analysis which requires large sample data.The advantages of ANN-based prediction systems are as follows: (i) ANN is faster than other algorithms because of their parallel structure.(ii) ANN does not require solution of any mathematical model.(iii) ANN is not dependent on the parameters, so the parameter variations do not affect the result.
Instead of attempting to find analytical relationships between machining parameters by the use of statistics, machine learning is used.In the present paper, a different approach that is based on advanced artificial intelligence techniques is implemented and tested.More specifically neural networks are used to predict the surface roughness developed during end milling.The advantages of proposed system over the traditional estimation methods are: simple complementing of the model by new input parameters without modifying the existing model structure, automatic searching for the nonlinear connection between the inputs and outputs.
According to the comparisons on the testing results, it has been shown that the neural network approach is more accurate and faster than the other methods.Compared to traditional computing methods, the ANNs are robust and global.ANNs have the characteristics of universal approximation; parallel distributed processing, hardware implementation, learning and adaptation.Because of this, ANNs are widely used for system modeling function optimizing and intelligent control.ANNs give an implicit relationship between the input(s) and output(s) by learning from a data set that represents the behavior of a system.Tandon and Mounayri (2001) also proposes a back propagation (BP) ANN for on-line modeling of forces in end milling.In (Zuperl and Cus, 2003), a more efficient model is created using BP ANN (using Levenberg-Marquardt approach).This approach has the disadvantage of requiring too many experiments to train the ANN.This, in terms of industrial usability, is unattractive and expensive.Researchers (Lee and Lin, 2000), in their ANN implementations, evolve knowledge of the machining environment by training these networks on run-time data.Researches (Szecsi, 1999) also propose a modified back propagation ANN which adjusts its learning rate and adds a dynamic factor in the learning process for the on-line modeling of the milling system.The learning rate is adjusted by the divided method and a dynamic factor is used during the learning process so as to develop the convergence speed of the back propagation ANN.A much larger set of input machining parameters is considered than in other work reported so far.
In this paper the Multi-Layer back propagation (BP) network is a supervised, continuous valued, multi-input and single-output feed forward multi-layer network that follows a gradient descent method interfaced with the virtual environment to predict surface roughness in the end milling process.ANN based model is developed with using the optimized network for this particular case (100 networks are tested) that the most accurate model will be suggested for in-process part surface roughness prediction.Computer numerical control or better known as CNC has been used as a model for the virtual end milling process simulation.The application will simulate an end milling process as well as perform analytical modeling of machining parameters such as surface roughness on machined work piece.Real time graphs of the surface roughness Ra (µm) against cutting conditions will be displayed simultaneously during the simulation of the end milling process.The mechanism behind the formation of surface roughness in CNC milling process is very dynamic, complicated, and process dependent.Several factors will influence the final surface roughness in a CNC milling operations such as controllable factors (spindle speed, feed rate and depth of cut) and uncontrollable factors (tool geometry and material properties of both tool and work piece).

RELATED WORKS
Manufacturing industries have gained benefit from VR applications in several ways.The use of VR to build prototypes will reduce the costs of finished products, changes in the physical product can be costly but modifications can be made in the virtual prototypes inexpensively.
Virtual reality has been applied to many areas of manufacturing.It provides 3D visualization of manufacturing environment and has great potential in manufacturing applications to solve problems and help in important decision-making.
A desktop virtual shop floor containing a 3-axis numerical control milling machine and a 5-axis robot for painting has been developed.The user can mount a work piece on the milling machine, choose a tool and perform direct machining operations, such as axial movements or predefined sequences (Bayliss et al., 1994).Java, Virtual Reality Modeling Language (VRML) and the External Authoring Interface (EAI) have been employed to perform Numerical Control (NC) machining simulation in a networked VR environment (Qiu et al., 2001).
The geometry of the work piece being cut will be updated dynamically A number of applications of VRML exist on the Web in various areas.One of them is a method for simulating basic manufacturing operations such as unload, load, process, move and store in a 3D virtual environment.The virtual environment provides a framework for representing a facility layout in 3D that consists of the static and dynamic behavior of the manufacturing system (Chawla and Banerjee, 2001).
Another VR application is a virtual machining laboratory for knowledge learning and skill training in an interactive environment.This virtual laboratory is specifically designed for helping students to virtually operate a lathe or set machining parameters and input CNC G-code program to turn the work piece automatically (Fang et al., 1998).Yuzhong and Altintas (2007) have developed an integrated model of the spindle bearing and machine tool system, consisting of a rotating shaft, tool holder, angular contact ball bearings, housing, and the machine tool mounting.The model allows virtual cutting of a work material with the numerical model of the spindle during the design stage.The proposed model predicts bearing stiffness, mode shapes, frequency response function (FRF), static and dynamic deflections along the cutter and spindle shaft, as well as contact forces on the bearings with simulated cutting forces before physically building and testing the spindles.
Delmia's Virtual NC is also an interactive 3D simulation environment for visualizing and analyzing the functionality of an NC machine tool, its CNC controller and the material removal process (Delmia, 2001).
A prototype of 3D virtual environment which is based on the standalone concept has been developed using AutoCAD 2002, VRML Out, VRML Pad, JavaScript andJava (CUS et al., 2003).AutoCAD 2002 was used to model the 3D objects and then the models were transformed into VRML format using VRML Out.Java, JavaScript and VRML were used to develop the animation of end milling process simulation and machining parameters simulation such as the flank wear on cutting tools.The simulation for the geometrical modeling of end milling process and analytical modeling of machining parameters was developed based on real data from some experiments using Computer Numerical Control (CNC) milling machine (Haslina and Zainal, 2008).
An Adaptive neuro-fuzzy inference system (ANFIS) to predict the surface roughness in the end milling process has been developed (Haslina and Zainal, 2008).Surface roughness was used as dependant variable while cutting speed, feed rate and depth of were used as predictor variables.Normal and feed forces were used as predictor variables to verify the ANFIS model.Different membership functions were adopted during the training process of ANFIS.Surface roughness was measured in an off line manner.The normal and feed forces were measured in an on-line manner using two components dynamometer (Soltan et al., 2007).

DEVELOPMENT OF THE SIMULATION ENVIRONMENT
In developing the application, there are some important stages and these are clearly illustrated by Figure 1.These stages will begin with static object (machine parts), which covered the authoring of the 3D model up to the creation of virtual environment.Details of the processes are explained in 3D world in solid works (static objects) part of the work.In the next stage, assembly of dynamic objects is constructed and their coordinates or positions are generated accordingly.Details of the interfacing activities are explained in 3D world in solid works (static objects) as part of this research.

3D World in solid works (static objects)
Initially, this paper reports the research surrounding the development of a virtual machine tool designed to simulate a typical actual machine implemented to predict several parameters in the virtual environment.The actual machine tool details were not developed in complete structure of a typical CNC machine within this paper; however, the major constituents of the machine were reconstructed to a point where it could be implemented and become the subject of research in the virtual environment.Only selected parts of the CNC machine that are involved in the end milling process are created instead of developing a complete structure of a typical CNC machine.The machine linear bearings are subject, typically due to the actual traversals, also the same friction and mass is generally found in actual slides.The three dimensional model for the static objects (machine parts) was first created using Solid works 2008 to form a 3D world of end milling process.

Construction of the virtual machine
Design requirements demanded the use of commercially available cutters to produce the same actual work pieces.Spindle speeds (revolutions per minute) rpm and drive system specifically for use with the same actual materials.
The saddle engages the linear rods that are attached to the base of the machine.A ball screw moves the saddle along the Y axis.The linear rods running through the top of the saddle engage the cross slide.Another ball screw moves the cross slide along the X and Z axis (Figure 1).The spindle motor on the movable machine head is a 1hp DC permanent magnet motor (regarding to the machine power requirements).The spindle motor drives the spindle shaft with a timing belt.The axis drive belts are located between the motors and balls crews on each axis.The developed virtual machine has the following major specifications: Steeples 0 to 5,000 rpm spindle speed range, X Travel: 12", Y Travel: 6", Z Travel: 8", Motor: 1 hp.Table: 25 1/2" x 6 1/4" and Power: 230 volt, single phase.The three dimensional model of CNC milling machine has been drawn in a wire frame form before the solid model of the machine is displayed as shown in Figure 2. When this stage is completed, the translation process begins where a group of few objects representing the components of the machine is being exported to the solid works animator tools.For example, the detailed worktable would be exported as one group.This procedure is repeated with the other groups (column, bed, head, etc) until the entire model has been translated into the solid works animator.The entire translation process as shown in Figure 3 was released by Solidworks2008 to allow the exporting of any 3D solid model to be animated.Finally, all the groups of file are gathered once again with solid works animation editor, to form a complete animated model as previously seen in the Solidworks2008 drawing.Now, the virtual end milling process world is completed and ready to be explored through the Vericut browser and to be equipped with the control panel CNC part program inputs.In this application, programming is to transform the final model of extension (.sld.) to typical file extension: (.mch.)It is an ASCII file that contains data describing the construction, kinematics, and other properties of an NC machine tool.Machine file can be loaded into VERICUT via the Configuration menu > Machine > Open function.NC machine configurations are changed via other "Machine" functions in the Configuration menu.Save the new file via Configuration menu >Machine > Save as.

MACHINING TESTS
All the machining tests were carried out on the Prolight 2000 CNC milling machine as shown in Figure 4.The work piece tested is 60/40 Brass (80 mm × 40 mm × 40 mm).The end milling and four flutes high speed steel is chosen as the machining operation and cutting tool.The diameter of the tool is D=7/16 inch (11 mm.).End milling experiment were performed under dry machining condition.Seventy-five readings were used as training data set and thirty two readings were used as testing data set.The range selected of speed is 750, 1000, 1250, 1500 and 1750 rpm, for feed rate is 50, 100, 150, 200 and 250 mm/min, and for depth of cut is 0.3, 0.5 and 0.7 mm.Every test was repeated three times, measurements were taking the average value for the roughness parameter Ra, as shown in Tables 1 and 2. Surface Roughness Ra, was observed and measured by using a stylus-based profile-meter (Surtronic 3+, accuracy of 99%) (Figure 5).The direction of measurement of the surface roughness is perpendicular to the direction of the lay.The measurement length of each specimen equals to 12.5 mm divided into five cuts; of length; 2.5 mm each.

THE INTERFACE OF ARTIFICIAL NEUROINTELLIGENCE
Generally, the interface of NeuroIntelligence is optimized to solve forecasting, classification and function approximation problems.NeuroIntelligence is neural network software designed to assist experts in solving real-world problems.Aimed at solution of engineering problems, NeuroIntelligence features only proven algorithms and techniques, is fast and easy-to-use.NeuroIntelligence supports all stages of neural network application.It is used in this work to: 1. Analyze and preprocess the pre measured test results, 2. Find the best neural network architecture that represents the end milling process trend accurately, 3. Test and optimize the selected network, 4. Apply the optimum network to predict surface roughness (Ra) for the designed virtual CNC end milling process (Cus and Balic, 2000).The prediction is much faster with easy-to-use interface and unique time-saving features.All processes on the machine are automated and we can easily understand the underlying machine behavior with graphs, statistics and reports.Machining parameters are represented to be intelligible, comprehensive and accessible with the overall virtual environment as in Figure 6.

Predictive surface roughness modeling
Artificial neural networks are systems with inputs and outputs composed of many simple interconnected parallel processing elements, called neurons.These systems are inspired by the structure of the brain.Computing with neural networks is no algorithmic (Yang and Park, 1991) and they are trained through examples rather than programmed by software.Some of the key features of ANN's are their processing speed due to their massive parallelism, their proven ability to be trained, to produce instantaneous and correct responses from corrupted inputs once trained, and their ability to generalize information over a wide range.The Multi-Layer BP network is a supervised, continuous valued, multi-input and single-output feed forward multi-layer network that follows a gradient descent method.The gradient descent method alters the weight by an amount proportional to the partial derivative of the error with respect to the weight in question.The back propagation phase of the neural network alters the weights so that the error of the network is minimized.This is achieved by taking a pair of input/output vectors and feeding the input vector into the net which generates an output vector, which is compared to the output vector supplied, thus gaining an error value.The error is then passed back through the network (back propagation process), modifying the weights due to this error using the equations.Hence, if the same sets of input/output vectors are presented to the network, the error would be smaller than previously found.For modeling the surface roughness, three-layer feed-forward neural network was used as in Figure 7, because this type of neural network which was used gives the most accurate results.The detailed topology of the used ANN with optimal training parameters is shown on Figure 7.The ANN was trained with the following parameters: cutting speed (n rpm), feed (f mm/min), radial depth of cut (t mm), The first layer of processing elements is the input layer (buffer), where data are presented to the network (Feng and Menq, 1996).The last layer is the output layer (buffer) which holds the network response (surface roughness Ra).The layers between the input and output layers are called hidden layers.The activation of the multilayer feed forward network is obtained by feeding the external input to the first layer, using the corresponding input function to activate the neurons, and then applying the corresponding transfer function to the resulting activations.The vector output of this layer is then fed to the next layer, which is activated in the same way, and so on, until the output layer is activated, giving the network output vector.This is called the feed forward phase, because the activations propagate forward through the layers.

Developing the ANN predictor
To develop the optimal neural network predictor the following steps must be accomplished:

Details of neural network and its adaptation to surface roughness modeling problem
For the BP network, the choice of the training parameters is the most important criteria that determine the degree of success of a network used to perform the specific task.Even if a set of training parameters and a corresponding architecture have been selected and successfully implemented, the question of whether or not the selected   reported to be depended on application (El Mounayri et al., 1998).In researches three groups of simulations were executed to study systematically the individual influences of training parameters on the performance of back propagation networks used for predicting surface roughness in end milling.The individual effects of varying each of these parameters were kept at (or near) their optimum values (CUS et al., provide year).To evaluate the individual effects of training parameters on the performance of neural network 100 different networks were trained, tested and analyzed using actual machining data.From the results of all simulations the following conclusions can be drawn: (i) Learning rates below 0.3 give acceptable prediction errors while learning rates must be between 0.01 and 0.2 to minimize the number of training cycles and obtain low predictions errors.Therefore, learning rates that will give an overall optimum performance are any value between 0.01 and 0.2; (ii) To minimize the estimation errors, momentum rates between 0.001 and 0.005 are good.However, the momentum rate should not exceed 0.004 if the number of training cycles is also to be minimized; (iii) The optimum number of hidden layer nodes is 3 or 6.Networks with between 2 and 15 hidden layer nodes, other than 3 or 6, also performed fairly well but resulted in higher training cycles; (iv) Networks trained with the (tanh) transfer function in all their processing elements give the least prediction errors, while those employing sigmoid and sine give the highest and next highest prediction errors respectively; (v) Networks that employ the sine function require the lowest number of training cycles followed by the Arctangent, while those that employ the hyperbolic tangent require the highest number of training cycles; Figures 8 to 16 shows the network information details implemented in this paper.

DISCUSSION
The interface of this application is a page that briefly explains the project as shown in Figure 6 which has some description about the CNC milling machine and the milling process.The machining equipment menu will           as cutting speeds, radial depth of cut and the feed rate of worktable.Simulation of the virtual end milling process and surface roughness on machined work pieces are generated simultaneously.The predictive capability of using neural network approaches are compared using statistics, which showed that neural network predictions for surface roughness were for 1.8% closer to the experimental measurements, compared to 8% using analytical (depending on empirical equations) method.

CONCLUSIONS
Virtual Milling Process has been successfully developed.This application shows a simulation of the end milling process in the virtual reality environment and simulation of the machining parameters such as surface roughness on machined work pieces.It is developed with the purpose of providing useful information on the end milling process and the related parts of the CNC machine to the user.As a prototype, Real time simulation for virtual milling process is implemented using, Solidworks2008, Vericut6.2,and Alyuda NeuroIntelligance, are interfaced as the animation and prediction engine making the virtual milling machine controllable.This simulation software interface can be used in training students on operation of CNC milling machine and increase the understanding of the milling process.This will save money in purchasing the actual equipment and hence accidental damage on the actual machine due to programming errors or mishandling can be avoided.Supervised neural networks are used to successfully estimate the surface roughness developed during end milling process.It can be claimed that the results obtained from the neural model and of the experimental results confirms the efficiency and accuracy of the model for predicting the surface roughness.In testing the model, the surface roughness was predicted to an accuracy of ±1.8% (more accurate for this particular case compared with other techniques such as multiple regression or genetics).An effort is made to include as many different cutting conditions as possible that influence the surface roughness value extensive experimentation forms the basis of the model developed.
The procedure should be used for the fast approximate determination of optimum cutting conditions on the machine, when there is not enough time for deep analysis.Due to high speed of processing, low consumption of memory, great robustness, possibility of self-learning and simple incorporation into chips the approach ensures estimation of the surface roughness in real time.
1. Collecting the experimental data through the measurements of surface roughness.2. Preparation of data for training and testing of ANN is carried out as follows: Cutting conditions and measured surface roughness Ra are listed into a data matrix (text file or excel file), where cutting conditions as input vectors and roughness values as output vector.3. Optimization process: where the optimal network configuration is determined and training of parameters is done by simulations.4. Training and testing of ANN. 5. Putting the estimator into operation.Graphic representation of results and prediction of statistic are obtained.

Figure 6 .
Figure 6.Designed virtual environment of end milling process of the Prolight2000 CNC Vertical Milling Machine while ANN predict Ra.

Figure 9 .
Figure 9.Effect weights of cutting conditions.

Figure 10 .
Figure 10.Sensitivity of Surface Roughness (Ra) to cutting conditions.

Figure 11 .
Figure 11.Experimental spindle speeds trend introduced to network.

Figure 12 .
Figure 12.Experimental radial depth of cut trend introduced to network.

Figure 13 .
Figure 13.Experimental feed rates trend introduced to network.

Figure 16 .
Figure 16.Error distribution along input row values.

Figure 17 .
Figure 17.Optimized G& M Coding CNC Program as a Text Format.
table system that which Framework of Real Time Simulation for Virtual Milling Process.

Table 1 .
Measured Ra in microns (training data set).

Table 2 .
Measured Ra in microns (testing data set).