Research on Position Error Prediction and Compensation of Direct Drive Turntable Based on WOABP Network

A method to identify the position error of direct drive numerical control turntable by measuring current and eccentric load is proposed, and the position error model of direct drive numerical control turntable based on whale Optimized BP (WOABP) neural network is established. The test-bed is built to measure the current, eccentric load and position error. The measured current and eccentric load are trained by WOABP neural network, and the position error of direct drive numerical control turntable is obtained. By comparing the original error, the error obtained by BP neural network and the error obtained by WOABP neural network, the effectiveness of WOABP neural network model is verified. The position error of direct drive numerical control turntable is compensated by the error obtained by the model.


Introduction
Direct drive numerical control turntable is a key component of numerical control machine tool.It plays an important role in the fields of precision machining, precision measurement and aviation technology [1][2].Due to the existence of component size error, installation eccentric error, inclination rotation error and other factors in the turntable, the positioning accuracy of the turntable is inevitably affected [3].The requirement of turntable positioning accuracy keeps improving with the development of machining technology.It is necessary to predict and compensate the positioning error of the turntable in order to obtain higher positioning accuracy without changing the structure of the turntable.Wu proposed an analytical model to predict and compensate the nonlinear error of traditional turntable in real time, which select the adjacent points in the tool position file as the tool position for establishing the model, and then establish the nonlinear error model of harmonic function analysis according to the error distribution in classical post-processing [4].Huang proposed a traditional turntable error prediction model with support vector machine (SVM) as the core algorithm, which uses fish swarm algorithm and wolf swarm algorithm to optimize the core parameters of support vector machine in the early and later stages [5].Shu studied a calculation method of harmonic error function in order to ensure the accuracy of harmonic compensation of traditional turntable positioning error [6].There has been a lot of research on error compensation for traditional machine tool turntable, but there is little research on position error prediction and compensation of direct drive numerical control turntable, In order to better study the turntable error, this paper establishes a neural network optimized by whale algorithm, and uses this method to predict the relationship between the position error of the direct drive numerical control turntable and the input current and eccentric torque, and uses the input current and eccentric torque to predict the position error of the direct drive numerical control turntable.
Through the prediction data, the position error of direct drive numerical control turntable is compensated.

Neural Network Model based on Whale Optimization
BP neural network is a kind of network training, using the back propagation of error to continuously adjust its own weight and threshold, so as to reduce the error, and realize the nonlinear mapping and data association function of complex variables.The standard BP neural network not only has slow convergence speed, but also is very sensitive to the selection of initial weight.The selection of the number of hidden layer nodes is blind, so it has some problems, such as low accuracy and easy to fall into local minimum.
Whale optimization algorithm (WOA) is a new heuristic optimization algorithm proposed by imitating the hunting behaviour of humpback whales [7,8].This method divides the hunting activity area of whales into three aspects: enclosure prey, bubble net predation and random swimming predation.The detailed process is shown in Reference [9,10].
In view of the BP neural network generates the original weight and threshold of each calculation through random numbers in the iterative process, and the value of these random numbers will have influence on the relative structure of the whole network and the correctness of the iterative results.The whale optimization algorithm is used to improve the BP neural network to solve the above problems.
The main optimization idea of this paper is to use the initial weight and threshold of the BP neural network as the input of the whale optimization algorithm, and obtain more suitable weight and threshold parameters through the optimization algorithm.Then the optimized parameters are used to initialize the BP neural network and train the BP neural network.The specific optimization method is as follows: 1) Initialize the weight and threshold of BP neural network; 2) The length of decision variables of whale optimization algorithm is calculated, and the mean square error is selected as the objective function of optimization; 3) Set the criterion of the algorithm, and the weights and threshold parameters of the neural network are adjusted by the whale optimization algorithm; 4) The optimized weight and threshold parameters are assigned to BP neural network; 5) The optimized BP neural network training and comparison results are compared with the error calculation and accuracy of the BP neural network before improvement.
The overall optimization idea is shown in figure 1,  The experiments carried out in this paper mainly collect three kinds of data in the process of motor operation: torque, current and position error.DYN-200 torque sensor is adopted as the torque sensor; The data acquisition card uses the USB5935 data acquisition card of Beijing Altai company; The position error data comes from the motor encoder and is collected through the motion control card.
The maximum number of training times is set to 1000, the iteration rate is 0.01, and the minimum error of iteration is 0.00001.The number of initial population is set to 30, and the maximum number of iterations is 50.Through repeated iterative calculation, the initial weights and thresholds of BP neural network are replaced by the values after iteration, and the optimized network is optimized again.The input layer of the network is set to two parameters, namely current and eccentric torque, and the output layer is set to one parameter: position error.
According to the training results, the optimal network structure is obtained, as shown in figure 3. The evolution curve can be obtained by importing the data into the network, as shown in figure 4.  Compare the error of ordinary BP network with that of WOABP, as shown in figure 6.It can be seen from figure 6 that the average absolute error of WOABP prediction model is 2.9899% and the root mean square error is 0.0028491, which is much lower than the traditional BP prediction model.It shows that this prediction model can be well applied to the prediction of turntable position error and provides a new method and way for error prediction.

Compensation through Prediction Model
Using the direct drive numerical control turntable position error measurement test bench described in section 3, the position command obtained through WOABP prediction error is used to conduct the position error measurement test of direct drive numerical control turntable under rotor eccentricity and varying external load to ensure that the loading torque and current are the same.The comparison between the collected test position error data and the test position error data collected in section 3 is shown in figure 7.In figure 7, the curve represented by 'original' is the test position error data, and the curve represented by 'compensate' is the position error data under the new position command.The position error after compensation is obviously less than that before compensation.The test results show that using WOABP network to predict the position error of direct drive numerical control turntable, the predicted data and the new position command obtained from the original position command can effectively reduce the position error and achieve good error compensation effect.

Conclusion
This paper presents a method to optimize BP network by whale optimization algorithm and predict the position error of direct drive numerical control turntable through the optimized network.This method not only has the advantages of BP neural network, which can well obtain the nonlinear relationship, but also uses the algorithm to solve the problem that the initial weight and threshold in the training process of BP neural network are generated by random numbers.The whale optimization algorithm is used to optimize the selection process of weight and threshold, and a more stable WOABP neural network model is obtained.Experiments show that this new prediction method can well predict the position error of direct drive numerical control turntable.And through the prediction data to compensate the error, we can know that the data obtained by this prediction method can well compensate the position error of direct drive numerical control turntable.