Precision prediction model in FDM by the combination of genetic algorithm and BP neural network algorithm

The accuracy of fused deposition modeling (FDM) prototype is affected by many factors, which process parameters are the most important factor. It is difficult to establish mathematical model accurately; the reason is that process parameters in FDM are coupled and the forming process is nonlinear. In order to define the effect of various process parameters on the forming precision and improve the precision of FDM printing, this paper established the precision prediction model based on process parameters by genetic algorithm optimizing the BP neural network’s weight and threshold. Compared with BP prediction model, the result has shown that the precision of the prediction model is better than those of BP prediction model.


Introduction
Addictive manufacturing technology is the advanced manufacturing technology which is the multidiscipline combination of manufacturing technology, information technology and new materials technology in recent 20 years [1].The parts are produced by accumulating material layer by layer relatively to the traditional material removal (cutting machining) method.FDM is one of the most mature addictive manufacturing technology which was put forward by Scott Crump in 1988.It has been successfully applied in many fields in the conceptual model.As shown in Fig. 1, FDM rapid prototyping machine mainly consists of nozzle device, feeding device and workbench, et al.The nozzle is moved in horizontal and planes, the workbench moves vertically along the direction.The layers are formed by extrusion of a plastic filament (ABS, PLA) that is melted in the heating device.FDM in rapid prototyping technology is widely applied in industry because of its simple molding equipment, low expense of equipment and high reliability, but FDM prototype parts' precision is low and its surface has the obvious texture, which has seriously restricted and hindered the further application of FDM [2].In process, the precision of prototype parts is affected by multiple process parameters which are chosen based on experience and experiment.So, it is unfavorable to FDM users.Therefore, how to choose the process parameters scientifically and reasonably to improve the precision becomes an urgent demand to solve.

Literature review
Some experiments have been made to improve dimensional accuracy of FDM parts by optimizing process parameters.Zou et al. [3] measured the various characteristics of FDM prototype parts by coordinate measuring machine and the surface roughness, then they get the relationship between the prototype parts quality and the process parameters by MATLAB.Luo et al. [4].studied the important process parameters in FDM process.They discussed the effect of the FDM process control technology on the optimum choice of the process parameters, which provide rational selection for users.
The above literature review proved that the quality of FDM mechanical parts can be improved by the proper choice of optimum process parameters.However, it is difficult to establish functional relationship between process parameters and dimensional accuracy by the traditional method.In recent years, it has got a good predictive effect by combining the artificial neural network (ANN) with wavelet transform, fuzzy theory, simulated annealing algorithm and support vector machine method [5].Gao et al. [6] diagnosed the degree of damage within a certain range of train speed wheel, which combined genetic algorithm with wavelet neural network, the results show that the algorithm is highly accurate and valid.Mei et al. [7] improved the function of the learning and inference of expert system through the sample analysis of the artificial neural network, the learning and reasoning functionalizes are enhanced and proved effective in terms of fault diagnosis on multilevel planetary gear increasers and reducers.D. Bellante et al. [8] developed forecasting model based on the design characteristics of homemade parts, they combined it with the neural network optimization algorithm, which determined the CAD model with the optimal value.Ji et al. [9] studied the wavelet neural network prediction model of product precision, which was built by using the MATLAB software.Simulation results indicate that the prediction model has sufficient accuracy.Based on the above research, this paper established a hybrid prediction precision algorithm, which is GA-BP model by combining genetic algorithm with BP neural network.

Methodology
In this paper, five process parameters (cable width offset, layer thickness, filling speed, extrusion speed and the fallback speed) are discussed.Table 1 shows the five process parameters and their levels, other FDM parameters are controlled at their fixed level.

Acquisition of experimental samples
In order to assess the dimensional precision of parts produced by FDM printing machine, according to the research of H. S. Cho [10], this paper select the standard parts "letter-H" geometry.The shape of the "letter-H" is so sample that it can be easily measured and analyzed.It can be used to reflect on the material contraction error but also reflect on the warp deformation error.For the standard part, five dimensional parameters are required to measure, as shown in Fig. 2. Dimensional parameters , and , are correspond to the and directions respectively, and dimension is corresponding to the direction.For the sake of improving the accuracy and efficiency of the experiment, this paper got 24 sets of process parameters with orthogonal test firstly, and then an additional 8 sets of data were obtained using the interpolation method.Finally, the parts were manufactured by the FDM printing machine based on above 32 sets of process parameters.To get a set of experimental samples, this article measures the standard parts one by one [11].This experiment chooses the corexy structure machine of DIY 3D printer, as shown in Fig. 3. PLA is selected as experimental material.In this experiment, the temperature of extruder nozzle is kept at 210 degrees Celsius, the temperature of hot bed reaches 50 degrees Celsius and the environmental temperature is set to 25 degrees Celsius.The material of extruder nozzle is brass, and the inner diameter is 0.4 mm.The dimensional parameters of standard part can be measured with micrometer.For the dimension, each value should be measured by three times.Dimension errors can be obtained by calculating the difference between the actual size and the theoretical size, which are expressed as ∆ , ∆ , ∆ , ∆ , ∆ .The final experimental samples can be seen in Table 2, 6 groups experimental data (No.4,7,11,15,20,31) are chosen as test samples from 32 groups experimental data, others are established as the training samples.

Training and simulation
For BP neural network, a set of weights are selected randomly, the given target output can be established as linear equation algebra directly and then come to power [12].In the actual neural network, BP neural network and its various forms of transform occupy 80-90 % of the artificial neural network, but BP neural network also has many shortcomings, including slow convergence rate, low learning rate and easy to fall into local minima, etc.The genetic algorithm (GA) is a kind of natural selection and population genetics random optimization algorithm [13].BP neural network's weights and thresholds are random numbers within the range of -0.5-0.5.The initialization of these parameters has great influence on the network training, but they can't be obtained accurately.Therefore, it is necessary to optimize the weights and thresholds by the combination of genetic algorithms and BP neural network to improve the prediction precision [14].In this study, the hierarchy of chosen neural network is made up of input layer, hidden layer and output layer, as shown in Fig. 4.These dimensional errors (∆ , ∆ , ∆ ) are chosen as simulation samples.Therefore, there are three input parameters and three output parameters in this prediction precision model.The number of nodes in the hidden layer is related to the network learning time and the size of the error, thus, the selection of the number of hidden neurons has a great influence on the prediction of the whole neural network.According to the study of Shen et al. [15], the optimal number of hidden neurons is (refer to Eq. ( 1)): where is the number of output neurons, is the number of input neurons, and a is a constant between 1 and 10.Thus, the number of optimal hidden neurons should be between 4 and 13, The training error is shown in Table 3, This paper chooses the number of hidden neurons that minimize the training error (the value is 10), therefore, a 3-10-3 neural network is built in this model.The training of neural network is a process of optimizing the weights and thresholds which can make the network output errors small constantly.The BP neural network's training function is "trainlm", which use Levenberg-Marquardt to train network.The error of proposed network target is 0.00001, the choice of function for hidden layer and output layer has large effect on the prediction accuracy of BP neural network.In this simulation, the transfer functions of hidden layer neuron and output layer neuron are "logsig" and "purelin" respectively.The crossover probability and mutation probability of genetic algorithm paper are set 0.9 and 0.1 respectively [16], then the network can be trained after the determination of the network structure and corresponding parameters.6(c) is the dimensional error of ∆ .Among them, the black lines are the actual dimension errors, the blue lines are the predictive error of BP model and the red lines are predictive error of GA-BP model.In addition to a few cases, the figures show that the precision of GA-BP model is considerably higher than the prediction precision of the BP model.The combination of genetic algorithm with neural network can significantly reduce the possibility of local optimum.This is because the genetic algorithm can optimize the weight and threshold individually, which can reduce the possibility of BP neural network's divergence and vibration.In short, the intrinsic mechanism of GA-BP model determines all kinds of training and prediction performance, which indicates that the method is feasible and valid in the evaluation of prediction precision and adaptive ability.7 shows the dimension errors in the , and directions.The red line is the actual dimension error ∆ , for which the absolute average error is 0.165 mm.The blue lines are the actual dimension errors ∆ , for which the absolute average error is 0.149 mm.And the green line is the actual dimension error ∆ , for which the absolute average error is 0.072 mm.In this figure, in most cases, the error in direction is less than errors in and direction.It is concerned with the principle of FDM, which is accumulating layer by layer.Therefore, the deformation is focused on the and directions.Besides, the dimension error in direction is less than the error in direction.The error is largely due to scan of machine, the gliding in the direction is in single guideway while the gliding in the direction is in double guideway, as shown in Fig. 8. Therefore, the motion of nozzle in direction is smoother than the motion in the direction which causes the error in the direction less than the error in the direction.

Conclusions
This study has proposed an effective prediction method of FDM process parameters by using GA-BP model.The work presented the successful application of GA-BP model in FDM process parameter prediction method and solved the difficult problem (It is difficult to build accurate mathematical model).By the comparison on the same test data, this algorithm has a higher prediction accuracy than the BP neural network algorithm, which indicates that the GA-BP model is feasible and valid in the evaluation of prediction precision and adaptive ability.
Based on the data comparison of different direction and the same size, the error in direction is less than the error in and directions.This is concerned with the principle of FDM, which is accumulating layer by layer.The dimension error of direction is less than the error in direction.The error is largely due to scan of machine, the gliding in the direction is in single guideway while the gliding in the direction is in double guideway, which causes the motion of nozzle in direction is smoother than the motion in the direction.

Fig. 2 .Fig. 3 .
Fig. 2. FDM standard parts 127.PRECISION PREDICTION MODEL IN FDM BY THE COMBINATION OF GENETIC ALGORITHM AND BP NEURAL NETWORK ALGORITHM.HUA DONG YANG, SEN ZHANG 138 JOURNAL OF MEASUREMENTS IN ENGINEERING.SEPTEMBER 2017, VOLUME 5, ISSUE 3

6 .
Fig.7shows the dimension errors in the , and directions.The red line is the actual dimension error ∆ , for which the absolute average error is 0.165 mm.The blue lines are the actual dimension errors ∆ , for which the absolute average error is 0.149 mm.And the green line is the actual dimension error ∆ , for which the absolute average error is 0.072 mm.In this figure, in most cases, the error in direction is less than errors in and direction.It is concerned with the principle of FDM, which is accumulating layer by layer.Therefore, the deformation is focused on the and directions.Besides, the dimension error in direction is less than the error in direction.The error is largely due to scan of machine, the gliding in the direction is in single guideway while the gliding in the direction is in double guideway, as shown in Fig.8.Therefore,

Fig. 7 .
Fig. 7.The contrast figure in the , and directions

Fig. 8 .
Fig. 8.The figure of guideway: 1 -The guideway of direction, 2 -The left guideway of direction, 3 -The right guideway of direction

Table 1 .
Process parameters and their levels

Table 3 .
The training error of different number of hidden neurons