Springback Optimization for CNC Tube Bending Machine Based on an Artificial Neural Networks (ANNs)

Predicting the springback angle has become the major production problem among tube benders. Springback is where the tube on a mandrel-less rotary draw bending tends to bounce back after being bent when the clamps are released. Accurately predicting the springback angle is crucial for effective tube bending. Machine learning (ML), a popular prediction approach, was applied to functions such as prediction or function approximation, pattern classification, clustering


INTRODUCTION
Tubing and pipes have been constructed historically using materials such as bamboo, clay, lead, and other materials appropriate for transporting water, gas, and liquid waste [1]. Currently, pipes and tubes are constructed from polyurethane or metal strips, sheets, or solid rods. Bending, welding, and butt fitting of joints are common processes for preparing metal tubes and pipes for use. Using mandrel-less rotary draw bending (MLRDB), machines is now a common practice. However, when the parts that are clamped for bending are retracted, the tube recovers, and springback occurs, causing the actual shapes to change from the designed shape. This affects the machining accuracy as well as the quality of the tube metal. Therefore, accurate prediction of the springback angle is vital for controlling and compensating for the springback. Many experts and researchers have analyzed the springback factor and the mechanisms of springback, and rules for predicting springback have been suggested [2]. However, springback remains a significant problem in pipe bending, especially in small production segments or when the geometric and mechanical properties of the raw materials are not constant [3]. The rotary draw tube bender is illustrated in Figure 1. To know the compensation value of the springback, it is necessary to know the value of the springback angle after bending. The factors that affect springback include tube diameter, bending radius, bending angle, and yield stress of the tube material [4].
Machine learning (ML) is a field of study based on mathematical and statistical methods to create a predictive model based on historical data. ML is a part of Artificial Intelligence (AI), with neural networks (NNs) being applied for ML purposes [6]. Artificial neural networks (ANNs) can perform various functions, such as prediction or function approximation, pattern classification, clustering, and forecasting [7].
Many researchers have researched the variables that affect tube bending springback to find the optimum values for machine setup that achieve a reduction in machine setup time, reduce the number of experimental materials, and reduce the problem of waste in the experimental process. Oliveira, D. A. and Worswick, M. J. [8] studied the effects of tube bending and hydroforming processes on the appearance of the aluminum alloy S-rail structure by using a full-function tube bending machine and mandrel with a hydroforming press of 1,000 tons, to determine the effect of bending severity on the thickness and stress distribution within the tube. They used Finite Element Method (FEM) to simulate tube bending and hydroforming processes. Daxin E and Yafei Liu [9] studied time-dependent springback when bending 1Cr18Ni9Ti stainless steel tubes by operating a tube bender and observing the time-dependent springback. They found that the timedependent springback tended to increase with increasing R/d and noted that the time-dependent spring-back of stainless-steel tubes resulted from strain hardening. Jing Liu et al. [10] used FEM modeling to study the prediction effect of thick-walled titanium alloy tubes on rotary draw bending (RDB) based on strength effects. Tae-Wan Ku et al. [11] conducted a numerical verification and experimental study on the U-bending process for the heat transfer tube production of SUS304L-grade stainless steel tubes. Song Feifei et al. [12] studied springback prediction for a 9.525 mm Ti-3Al-2.5V tube with 0.508 mm wall thickness. Jui Chang Lin and Kingsun Lee [13] applied the Taguchi method and FEM from the ABAQUS 6.12 program to study the variables in the bending process for seamless tubes, using the variables of tube wall thickness, tubing material, and bending radius. Mehmet AlperSofuoglu et al. [14] used numerical modeling to study springback behavior in AA6082T6 tubes with three-point bending. They compared their calculated results with their experimental results to validate the model. Xin Xue et al. [15] proposed a torsional springback control strategy for aluminum alloy thin-walled tubes under RDB bending using a mandrel. Two types of process control, involving nose mandrel placement and an axial compression aid, were used to assess control performance. Linda Borchmann et al. [16] investigated the influence of machine axis friction on wrinkling during RDB bending by FEM simulations, considering the friction of each machine axis. The results showed the influence of the axial stiffness of the Bend Die, Wiper Die, Pressure Die, and Mandrel on the inner bend wrinkling. Yusen Li et al. [17] used FEM methods for springback prediction of AL6061 tube in the free bending process by building a FEM model of the bending process and observing the influence of process variables such as friction, gap, and shape of moving mold parts on springback. BikramjitPodder et al. [18] did forward and reverse modeling of flow forming of H30 grade annealed aluminum tube by conducting 136 experiments to identify the influence of feed speed ratio, roller infeed, and axial stagger on the internal diameter, springback, and ovality of the aluminum tubes. They used three neural network approaches: Back propagation neural network, limited memory BFGS Network, and genetic neural system, comparing the performance of the 3 neural networks by regression analysis. Huifang Zhou et al. [2] applied the Taguchi method to study the springback prediction effect of a 6060-T6 aluminum tube by considering the cross-sectional effect of using a mandrel on an RDB, by distinguishing variables that affect springback, such as bending angle, bending radius, tube wall thickness, friction between bending die and tube, the gap between the bending die and the tube, friction between the wiper die and the tube, the gap between the pressure die and the tube, the friction between the wiper die and the tube, the gap between the wiper die and the tube, and boosting velocity. Huifang Zhou et al. also used FEM simulation and ANOVA to identify the variables affecting the springback and tube cross-section and trained3 types of neural networks to compare the mean absolute percentage error(MAPE). R Vimal Sam Singh et al. [19] used an ANNspredictive model for drilling glass-hemp-flax fiber composites.
The application of artificial intelligence to predict the springback angle in tube bending is a commonly used approach. The successful application of artificial intelligence, machine learning, or deep learning to the manufacturing process will be most beneficial to the production process in the future.

PROBLEM DESCRIPTION
Many researchers have studied the relationship between the various factors that affect the value of the springback angle and have shown the need to prepare allowances for bending in different degrees to achieve the best return springback angle. The factors affecting the return springback angle identified in past research include tube diameter, tube material, tube wall thickness, bending angle, bending radius, bending speed, friction of the bending part and tube, clearance of bending part and tube, relative boosting velocity, and mandrel position. These input variables strongly influence springback and require further research to compute correctly.
The current research was conducted to predict the effect of the springback angle in bending ASTM A-210 Gr. A1 low and medium-pressure steam tubes based on an artificial neural network by collecting experimental data. Based on the L27(3 4 ) orthogonal array experimental plan, the input factors were wall thickness, bending radial, dwell time, and bending angle. The output factor is the springback angle. The neural network is used for predictive analysis of the springback angle value. As indicated in references to prior research, NNs are well-accepted and widely used techniques, and so were applied in the current research to predict the springback angle. This is a novel approach to comparing the different types of activation functions for predicting the springback angle of the tube, calculating the optimum adjustment of parameters for bending metal tubes, shortening the time to carry out the procedure, and calculating the number of specimens required for adjusting parameters on RDB. The results of this research are most beneficial for works that include metal pipes with pipe-bending requirements.

EXPERIMENTAL DESIGN
The study was divided into 2 parts: metal tube bending experiments applying Artificial Neural Networks (ANNs) models and subsequent comparison of the performance of each model.

Experimental method
In bending, a CNC tube bending machine, Herber 76 CNC TB, shown in Figure 2, was used without using a mandrel; the workpiece material is a steel tube with an outer diameter of 44.45 mm, grade ASTM A-210 Gr.
A1. An orthogonal array type L27 experimental plan (3 4 ), with a total number of 27 bending experiments, was performed. Input factors included wall thickness, bending radius, dwell time, and bending angle, with the output factor of the springback angle [21]. The level of influence of each factor in the tube bending process is illustrated in Table 1. The springback angle measurement was examined by the Mitutoyo CMM model Beyond Apex 707, which is illustrated in Figure 3. The angle ∆θ was calculated using equation (1) where Δθ is the springback angle, θ b is the targeted bending angle, and θ a is the actual angle.  . shows the process of bending tubes and sizes for use in angle measurements for the Herber 76 CNC TB, including general pipe bending machines that have similar characteristics. The process consists of 3 steps, see Table 1: Step 1: With the bending die set at normal degrees, the tube is fed into a position ready for clamping, and the tube is clamped against the bending die using a pressure die and die clamp.
Step 2:The bending die and clamp die guide the tube end into an arc with the targeted bending angle (θ b ) while the pressure die guides the other tube along a straight line to bring the tube to be bent to the desired degree.
Step 3: The clamp die is moved in a straight line to unlock the tube workpiece. The tube will springback to the actual angle (θ a ) as calculated by Equation (1).

Artificial neural networks (ANNs)
ANNs were applied in this research. The regressionsupervised learning group consisted of 2 groups that utilized the sample dataset. First, a training group (train set) using a training subset of the original dataset and a test group (test set) also using a subset of the original dataset. That dataset consisted of processing units called neurons that are connected in a net architecture. This is divided into one or more hidden layers, and each neuron has a weight and a bias, both of which can be adjusted appropriately. The data were analyzed using the program Spyder 5.1.5, which was developed with Python. The working process is as follows: 1. Prepare the training and testing data in the neural network, utilizing the resultant data from the tube bending experiments on the springback angle value.
2. Divide the data randomly into the training set and the testing set. A total of 27 data elements were divided into 2 groups of experimental data as the training set, which included 21 data points for testing, 80% of the tube bending experiments data, and 6 data points as the testing dataset); 20% of the tube bending experiments data.
3. Design the neural network architecture and calculate the number of neurons in each layer. This research was performed with 1 hidden layer to find the number of neurons and determine the appropriate architecture of the neural network, then compared with 4 activation functions. 4. Randomly determine the optimum weights and initial bias using the Limited-memory Broyden-Fletcher-Goldfarb-Shanno algorithm (L-BFGS), which is suitable for small datasets. This algorithm works better than other methods, especially in saving memory [18]. 5. Set the value of the learning rate to 0.001 and the number of iteration cycles set to 50000, and apply the Sigmoid Function (Logistic Function), ReLU Function, TanH Function, and Identity Function to compare these variables.
6. Feed-forward learning by calculating the sum of the weights from the values at the output in each layer, then adjusting the weights and bias reverse by Back-Propagation (BP) from the output layer. The weight values submitted for each unit are calculated with the sum function.
7. Calculate the actual result value obtained from the activation function and the target result.
8. Calculate the MSE. Check the training stop condition where the MSE is the lowest value, or the specified iteration cycle is completed. If the condition is not met, adjust the weights and bias until the lowest MSE value is obtained. 9. When the lowest MSE value is obtained, the weight and bias are recorded, and the resulting mathematical equation model is saved to predict the springback angle from other activation functions. 10. Complete the operation.
This research studied a mathematical model using an artificial neural network method. The 4 activation functions, Sigmoid Function (Logistic Function), ReLU Function, Tanh Function, and Identity Function, were compared to identify which model gives better prediction results. The criteria for measuring the performance of the mathematical model were divided into 2 criteria as follows.
1. MSE is a measure of the accuracy of a model to compare the data results obtained from the network and the actual results obtained from the experimental results. Equation (2) was used to determine how close the predicted value is to the true value.
2. R 2 is a measure of the predicted results from the various activation functions by comparing the data results obtained from the different activation function networks against the actual results obtained from different activation function networks. The experimental results can be calculated from equation (3).
where y i is the actual result of the experiment, f(x i ) is the predicted result value, y is the mean of the actual results from the experiment, and n is the total number of data items.

Results of the experiment
A total of 27 experimental results were obtained from the experiments based on the L27(3 4 ) orthogonal array experimental scheme [21]. The springback angles for bending the low and medium-pressure steam tubes of the ASTM A-210 Gr. A1. are shown in Table 2 and Figure 5. The analysis of variance (ANOVA), at the significance level of 0.05, showed that the main factors were tube wall thickness, bending radius, dwell time, and bending angle, at p< 0.05(see Figure 3). It was shown that these four main factors significantly influenced the Step 1 Step 2 Step 3 springback angle in the tube bending process. In addition, the reliability of the data is R 2 = 82.32%, R 2 (adj) = 79.11%, so R 2 > 80%. Therefore, the values obtained are reliable for use in further research.

Design results of artificial neural networks (ANNs) architecture.
The springback data shown in Table 2, consisting of initial variables (x) and response variables (y) from 27 runs, were randomly split for training and testing the network using the train_test_split () function of the Scikit-learn library by setting random_state = 5. The result of this function divided the data into 4 groups: x_train, x_test, y_train, and y_test. The result of data splitting from this function defines the architecture design of the experimental neural network with 1 hidden layer from the function MLPRegressor, define hidden_layer_sizes. Initialize weights and bias by random method, set solver L-BFGS, set learning_rate_init=0.001 (Initial learning rate used), set number of max_iter = 50000 (max iteration), activation function performs comparison 4 functions include Sigmoid Function (Logistic Function), ReLU Function, TanH Function, and Identity Function.
The Spyder 5.1.5 software was used to analyze the data. The function sklearn.neural_network imports the MLPRegressor model for the Multilayer Perceptron with Regression to find the MSE based on equation (1). The stop condition is either when the MSE is lowest or when the iteration cycle is completed. If the stop condition is not met, the weights and biases are adjusted until the lowest MSE value is obtained.
By basing the experimental design on the architecture of the artificial neural network, using the Sigmoid or Logistic activation function, the optimal architecture of 4-98-1 was found, which consisted of 4 neurons in the input layer, 98 neurons in the hidden layer and 1 neuron in the output layer, with the MSE = 0.001892. The results of the experiment to determine the optimal number of neurons using the Sigmoid activation function are shown in Figure 6.
Using the ReLU activation function, it was found that the optimal architecture was 4-64-1, meaning that the network consisted of 4 input layer neurons, with 64 neurons in the hidden layer and 1 neuron in the output layer, with the MSE = 0.001758. The experiment's results to determine the optimal number of neurons using the ReLU activation function are shown in Fig. 7.
Using the TanH activation function for the experimental design of the architecture of the artificial neural network, it was found that the optimal architecture was 4-87-1 meaning that the network consisted of 4 input layer neurons, 87 neurons in the hidden layer, and 1 neuron in the output layer, with the MSE = 0.002035. The results of the experiment to determine the optimal number of neurons using the TanH activation function are shown in Figure 8.
When the Identity activation function was used, the optimal architecture calculated was 4-65-1, with 4 input layer neurons, 65 neurons in the hidden layer, and 1 neuron in the output layer, with the MSE = 0.115551. The results are shown in Figure 9.
These test results from using each of the 4 activation functions, Sigmoid, ReLU, TanH, and Identity, showed that the optimal neural network architecture is 4-98-1, being comprised of 4 input layer neurons, 1 output layer neuron, and 1 hidden layer. The number of neurons in the hidden layer was tested with 1 to 100 neurons to find the lowest MSE numbers of neurons. The number of neurons of the Sigmoid activation function was 98 neurons and the lowest MSE value = 0.001892; the ReLU activation function is 64 neurons with the lowest MSE value = 0.001758; the TanH activation function is 87 neurons with the lowest MSE value = 0.002035, and Identity activation function is 65 neurons with the lowest MSE value = 0.115551, as shown in Table 4. Applying the 4 activation functions, 1 hidden layer was identified, and the architecture of the artificial neural network and the best mathematical model were experimentally identified. A regression equation to predict the springback angle by comparing the springback angle from the experiment and the prediction results from the regression equation was used, and all. comparisons showing the prediction results of the springback angle are shown in Figure 10.  From Figure 11, it can be observed that the Sigmoid activation function or Logistic function gave a prediction value that was closest to the experimental springback angle with R 2 = 99.42% based on equation (2). The ReLU activation function gave an R 2 = 98.99%, and the TanH activation function gave an R 2 = 98.53%. The Identity function gave the lowest R 2 = 79.53%.
Another observation was that the prediction of the springback angle using the regression equation gave a higher R 2 than the prediction using the 65 neutral in 1 hidden layer by a neural network with the Identity activation function, which had an R 2 = 79.53%, but the prediction using the regression equation [21] had an R 2 = 82.32%, which was 2.79% higher.
Comparisons of the given R 2 suggest that the appropriate 4-98-1 architecture should be chosen, consisting of 4 neurons in the input layer, 98 neurons in the hidden layer (1 hidden layer), 1 neuron in the output layer, and that mathematical model derived from the Sigmoid activation function should be used, with an R 2 = 99.42% for predicting the springback angle. To obtain the most accurate prediction of the springback angle for bending metal tubes, Figure 11 shows the relationship between the target result and the comparative prediction result from each type of activation function of the springback angle value. 2. The Sigmoid activation function or Logistic function gives a prediction value that is close to the experimental springback angle. The best activation function gave R 2 = 99.42%, followed by the ReLU activation function with R 2 = 98.99%, and the third was the TanH activation function, with R 2 = 98.53%. The Identity activation function gave the lowest R 2 = 79.53%.
3. The best prediction of the springback angle using the best regression equation, with R 2 = 82.32%, was better than the prediction using the 65 neutral in 1 hidden layer by a neural network with the Identity activation function, which gave R 2 = 79.53%, a 2.79% difference in favor of the regression equation.
4. The prediction of the springback angle using the neural network was more accurate than the prediction value calculated by the regression equations. Consideration should also be given to selecting the appropriate activation function.
5. When considering the structural design of a neural network for springback angle prediction, assigning only 1 hidden layer and experimentally determining the number of neurons less than 100 neurons may not be the most accurate prediction value. If deep learning is introduced with an increase in the number of hidden layers or the number of neurons, it may yield higher predictive accuracy. 6. A good understanding of computer programming is now critical for artificial intelligence, machine learning, and deep learning applications. Researchers now need up-to-date knowledge of computer programming and appropriate languages and software packages.

CONCLUSION
This research was conducted to study the optimization of the springback angle in bending ASTM A-210 Gr. A1 seamless tube with an outside diameter of 44.45 mm by using 4 input factors: Wall Thickness, Bending Radius, Dwell Time, and Bending Angle. The results showed that all factors significantly influence the springback angle in the tube bending process, different prediction methods, and comparing the results using different activation functions. The results showed that the optimal neural network architecture is 4-98-1, consisting of an input layer of 4 neurons, a hidden layer of 98 neurons, and an output layer of 1 neuron, as calculated using the Sigmoid activation function which gave the lowest MSE = 0.001892 and R 2 = 99.42%. The ReLU activation function gave the next best R 2 = 98.99%, with the TanH activation function giving R 2 = 98.53%, and the lowest R 2 = 79.53% given by the Identity activation function. It was also found that the best prediction of the springback angle using the best regression equation, with R 2 = 82.32%, was better than the prediction using the 65 neurons in 1 hidden layer by a neural network with the Identity activation function, which gave R 2 = 79.53%, a 2.79% difference in favor of the regression equation.
This research is limited to 1 hidden layer within the limits of 1-100 neurons. In future work, the thesis will be tested to ensure that a better effect is achievable if the number of hidden layers is added to deep learning or the number of neurons is greater than 100. Additionally, other appropriate components should also be selected, such as excitation function, number of hidden layers, neuron limitation, etc.