Path Trajectory Prediction of Rapidly Rotated Ping Pong Ball after Hitting under Different Algorithms

The path trajectory prediction of rapidly rotated ping pong ball after hitting plays a great role in the training of athletes and even in the competition. It can improve the level and efficiency of training. Therefore, it is necessary to optimize the parameters of ping pong ball such as position, angle and speed after hitting to complete data collection. This study established a prediction model of the path trajectory of rapidly rotated ping pong ball after hitting and predicted the path trajectory using extreme learning machine (ELM) algorithm and back propagation (BP) neural network. The results were compared to find out the better algorithm. Moreover, the two algorithms were improved. The result demonstrated that the improved EML algorithm could realize minimum error.


INTRODUCTION
With the development of society, the technical level of modern table tennis is also improving, and the requirements on table tennis players also become higher. Although the technology of Chinese table tennis players is at the leading level in the world, the basic state of training still needs to be kept, and the maintenance of the highest efficiency of technology can be achieved through man-machine fight. Ping pang ball robot is a kind of robot that can fight with human and help human to train table tennis, but most of the current ping pang ball robots cannot judge the movement state of ping pang ball, resulting in single return strategy and general adaptability. The movement state of ping pong ball includes position, speed and speed of rotation. The motion state of ping pang ball refers to the speed of flight and the speed of rotation [1]. The path of ping pang ball can be predicted through studying its movement state. Mizuuchi et al. [2] studied the trajectory of ping pang ball. They used an ultra-high-speed camera and tens of thousands of frames per second in the prediction of path trajectory, derived the equation of motion of a rotating ball considering forces to the ball from the air, and predicted the movement track according to the equation of motion. Moreover, the predicted trajectory was compared with the actual trajectory, and the prediction method was evaluated. Tamaki and Saito [3] developed a three-dimensional trajectory reconstruction method for ping pong ball which solves the problems existing in the conventional analysis. Maeda and Peters [4] constructed a new planning algorithm which did not involve fixed hitting plane using free time optimal control method. The resulting trajectories had lower accelerations, while the joint constraints were enforced at all times. Asano et al. [5] calculated rotation matrix of ping pang ball through calculating the three-dimensional position of a marker and based on the 3-D marker positions of successive camera frames, calculated the rotation parameters, roll, pitch, and yaw from the rotation matrix, and finally calculated the three-dimensional trajectory of the ball center using the stereo method. Elsaadany et al. [6] put forward a full six degree-offreedom nonlinear model for accurately predicting short-and long-range trajectories of high and low spin stabilized projectiles. Trajectory prediction is not only the key problem in table tennis [7], but also has great value in fields such as industry [8], aviation [9] and military [10]. However, the current trajectory prediction accuracy of table tennis is not high enough, which needs further research. In this study, the track motion of ping pang ball was analyzed firstly, then extreme learning machine (ELM) algorithm and back propagation (BP) neural network algorithm were used to predict the track of ping pang ball, and experiments were carried out to compare different algorithms, in order to find a better way to predict the track of fast rotated ping pang ball after hitting, in order to find a more excellent trajectory prediction method for fast rotated ping pang ball. This work makes a contribution to improving the accuracy of trajectory prediction and promoting the further development ping pang ball robots.

The background and Assumed Conditions of Modeling
According to the rules of the International Table Tennis Federation, the standard table tennis  table size is 2.74 m*1.525 m*0.76 m, the height of the tennis net is 15.25 cm, the diameter of ping pong ball is 40 mm, and the quality of ping pong ball is 2.7 g. In order to meet international standards, world championship three-star ping pong ball produced by Shanghai Double Happiness Sports Co., Ltd., China was used. V-989 table tennis robot which was installed with a servo motor at the serve month which can control the flight and rotation speed of ping pong ball. The table tennis robot was controlled to serve balls which rotate horizontally or vertically through adjusting speed difference and angle of inclination. The speed of rotation of ping pong ball could be 40 turn per second, and the highest speed of ping pong ball could be 15 m per second.
Arms and waist need to be fixed by the lower limbs when playing table tennis; therefore, the flight path of ping pong ball needs to be predicted. The establishment of the flight and collision model of ping pong ball is the basis, and its preciseness directly determines whether the designated action during hitting can be completed. A complete trajectory of ping pong ball includes returning, landing, colliding and rebounding; in that process, instructions are programmed to make ping pong ball reach the predicted hitting point at a speed. The prediction of position and speed of hitting point mainly relies on the motion and collision model of ping pong ball. As the whole motion process can be affected by multiple factors such as air resistance, the final rendering result is a non-idealized full elastic collision model. Establishing the flight and collision model of ping pong ball and realizing online precise trajectory prediction based on the model is one of the difficult points.

Trajectory Prediction
The ultimate goal of modeling and motion state estimation of rotated ping pong ball is to predict the motion state after the rotated ping pong ball is hit. The trajectory of rotated ping pong ball generally will not change. The accuracy of trajectory prediction is an objective criterion for measuring the accuracy and effectiveness of the model and state estimation method. The simulation diagram of trajectory change is shown in Figure 1. Ping pong ball is affected by gravity , air resistance and magnus force produced because of rotation, and the corresponding calculation formulas are: where stands for the mass of ping pong ball, stands for gravitational acceleration, stands for air resistance coefficient, stands for air density, stands for the cross sectional area of ping pong ball, = � , , � stands for the spatial movement velocity of ping pong ball, stands for air lift coefficient, stands for diameter of ping pong ball, and stands for rotation speed of ping pong ball. . The kinematic model of ping pong ball can be expressed as:

INTRODUCTION FOR THE FORMULA OF MODEL ALGORITHM
3.1. ELM algorithm ELM algorithm was a rapid single hidden layer neural network training algorithm which was proposed by Huang et al. [11][12][13][14][15], and its network structure and working principle is shown below.
The weight value between the n-th hidden layer and network output is connected by parameters of hidden node and . For addition-type hidden nodes, the hidden node output of the n-th hidden layer corresponding to sample x is ( , , ), and its expression is: In the activation function g: R→R, *X refers to the inner product of sample x and inner weight vector in . The expression of radial basis function (RBF) hidden node ( , , ) is: where and stand for the influence factor and center of the i-th RBF node respectively, >0. The N diverse sample data were approached with zero error through the single-hidden layer neural network which contains M hidden layer neurons, and the N diverse data samples

The improved ELM algorithm
In the case of more hidden-layer neurons, many hidden-layer neurons do not have or have a small number in the constructed single hidden-layer network. According to the previous experimental results, ELM algorithm had a low precision in data environment because of deficiency of data amount. Hidden-layer network parameter with a good result was found out through considering reserving loop algorithm, and the algorithm was improved by saving the network parameter. The training sample set is given, the hidden layer output function is set as ( , , ), the number of the hidden layer nodes is set as , the weight function matrix is ( ) = � ( , 1 ), ⋯ , ( , )�, and the parameter of the hidden layer nodes is randomly set as ( , ), = 1,2, ⋯ . Then the hidden layer output matrix is calculated, and is determined as column full rank; otherwise the parameter of the hidden layer nodes is reset. Then ( ) = ( ) is calculated. Finally network optimal external weight ( ) = [ ( ) ] −1 ( ) is output.

BP Neural Network
BP algorithm emerged in the middle stage of 1980s [16][17][18]. The neural network must be trained in both fuzzy recognition and function approximation, and it is constantly adjusted and weighted in training until every sample in the training center satisfies the expected output.
The network structure of BP neural network is shown in Figure 2. There are not only the input-layer and output-layer nodes but also one or more hidden-layer nodes. Neurons in the adjacent layers are fully connected, neurons at the same layer are not connected, and there is no feedback between the input and output. The algorithm of BP neural network is as follows. The network was initialized. The value of each neuron threshold in the hidden layer and output layer and the link weight value of the node were assigned, and the interval was [0,1]. Then a training sample was selected from the training set as network input and corresponding expected output. The net input vector of the neuron of the output or hidden layer corresponding to the previous hidden layer i was calculated based on the known input data. A continuous differentiable function was selected as transfer function. Neuron forward output vector was mapped to [0, 1]: Then the sum squared error (SSE) and the error vector of the backward neuron n of the output layer were calculated.
The weight and threshold value in the network were adjusted. Learning coefficient was expressed as δ, 0<δ<1.
The training sample was repeatedly provided until the output error decreased to the acceptable level or the preset learning times was reached. On such a basis, a group of optimal weight values, i.e., parameter values of network prediction model, was obtained. The trajectory of ping pong ball was predicted using the network model.

The Experimental Process of the Model Algorithm
When ELM algorithm was used, the given training sample set was input. Then the function of the number of hidden nodes L were output from the hidden layer. The hidden-layer output matrix was calculated after the random generation of parameters of hidden nodes. Finally, the optimal external weight was obtained, =^.
Suppose there is a time sequence. , +1 , + were given data. + + (e<0) was the time needed to be predicted. Actually, it was a process of predicting unknown data + + based on the current data , +1 , + . There is a nonlinear function relationship between them: When data were predicted using neural network, our main work was to transfer a group of given data , +1 , . . . + , fit neural network method, and predict + + after obtaining the expected data. Prediction methods include single-step prediction, multi-step prediction and rolling prediction. Here multi-step prediction was used.
When e >1, i.e., network input a group of data, m predictive values, +1 , +2 , ... + +1 , were output. Multiple times of experiment suggested that the predicted trajectory deviation of ping pong ball was large when multi-step prediction method was used, which might be because of the iterative accumulation of prediction error when neural network readjusted weight and threshold value.
The state of the artificial neural network was approximate to a small ball, and the error function of the network was approximate to a hyperplane. If instability factors were increased when the small ball reached the local minimum value, i.e., adding an impulse to the small ball, the global minimum value would be achieved when the small ball went over the vertex, and at that moment the network would converge to the global minimum point.

Comparison Results of Algorithmic Models
The class test results are shown in Table 1. It could be noted from Table 1 that the training time shortened from 6 s to 0.1 s, i.e., two orders of magnitude, and the testing time shortened from 0.02 s to 0.006 s, i.e., one order of magnitude on the basis that ELM algorithm satisfied certain accuracy. Compared to ELM algorithm, BP neural network had a higher precision, but needed more time to react. The improved ELM algorithm could completely satisfy the requirement on prediction of tactics of table tennis robot. Compared to BP neural network, it was more suitable for predicting the trajectory of ping pong ball. It could be noted from Figure 3 that the study on the resolution of the experimental data further verified the effectiveness of EML algorithm, especially its adaption to the significant changes of the spring back trajectory and speed of ping pong ball. In the aspect of overall performance, BP neural network always kept at 97.6 % and ELM was always changing and not as stable as BP neural network, but ELM could basically satisfy requirements.

Comparison Results of the Improved Classifier
Training samples were input into MATLAB R2013b for network training. The time of BP neural network and ELM algorithm on x, y and z axis could be obtained through the aforementioned algorithms. The real motion trajectory on the x, y and z axis was different from the ideal simulated trajectory, and the corresponding time was recorded. The comparison of the training time and testing time after improvement is shown in Table 2. The training time of EML algorithm was about 20 s, and the time on z axis was even 7 s, which was an order of magnitude faster than the BP neural network (about 200 s). The testing time of ELM algorithm was about 0.05 s, which was two orders of magnitude faster than BP neural network.
Taking x axis as an example, the comparison of the predicted value of the improved ELM algorithm and the measured value is shown in Figure 4. It was found from Figure 4 that the difference between the predicted value and actual value was very small, which showed that the accuracy of the ELM algorithm was high, i.e., it could carry out more accurate simulation, meet the accuracy requirements of the trajectory prediction, and satisfy the requirements of ping pong ball robot hitting.