# Uncertainty Analysis of Spherical Joint Three-Dimensional Rotation Angle Measurement
## 2 Principle and Experiment
### Generalized Regression Neural Network Data Processing  
Our previous study found that the general regression neural network (GRNN) showed better training performance. Therefore, the GRNN algorithm was used to process the data; then, a neural network measurement model of eddy current-rotation angle was established. The measurement model uses the value output from the eddy current sensor as the input and the standard angle provided by the three-dimensional rotary table as the output. A total of 21 \(\times\) 21 \(\times\) 121 groups of sensor data are collected and used to train the neural networks. The data group is divided into four regions due to the large amount of data. The dataset includes 21 \(\times\) 21 \(\times\) 121 = 53,361 sets of an input vector of size 4 \(\times\) 1 and an output vector of size 3 \(\times\) 1. According to the measurement range \(\alpha\) and \(\beta\), the overall amount of data is evenly distributed into four quadrants.  
The structure of the GRNN is shown in Figure 4. In the network model, the voltage value as the input matrix of the network is \([\mathrm{U_{1}},\mathrm{U_{2}},\mathrm{U_{3}},\mathrm{U_{4}}]^{\mathrm{T}}\), and the angle as the output matrix is \([\alpha,\beta,\gamma]^{\mathrm{T}}\). The number of neurons in the pattern layer is the same as the number of trained datasets. Its neuron transfer function can be expressed as:  
\[\mathrm{R_{i}}=\exp[-\frac{\left\|\mathrm{V-V_{i}}\right\|^{2}}{2\sigma_{i}^{ 2}}]\,\mathrm{i}=1,2,\mathrm{L,n} \tag{1}\]  
Figure 4: Generalized regression neural network.  
Figure 3: (**a**) The position of the eddy current sensor array; (**b**) the range of the eddy current sensor.  
There are two types of neurons in the summation layer of GRNN. In the first type, the output of neurons in the pattern layer is directly summed, and the connection weight with neurons in the pattern layer is 1. The output \(\rm{S_{D}}\) is expressed as:  
\[\rm{S_{D}}=\sum_{i=1}^{n}\rm{exp}[-\frac{{{\rm{(V-V_{i})}^{T}(V-V_{i})}}}{{2 \sigma^{2}}}] \tag{2}\]  
The second type is a weighted summation of the output of the pattern layer neuron. The neuron output has the same dimension as the sample output, and each neuron represents a certain dimension of the output. The connection weight of neurons in the pattern layer is the output value of this dimension of all samples. It can be expressed \(\rm{S_{Nj}}\) as:  
\[\rm{S_{Nj}}=\sum_{i=1}^{n}\rm{y_{ij}}\rm{exp}[-\frac{{{\rm{(V-V_{i})}^{T}(V-V_{ i})}}}{{2\sigma^{2}}}]\quad j=1,2,L,k \tag{3}\]  
In the output layer, the neuron number is equal to the output vector dimensions, and each neuron output is as follows:  
\[\rm{y_{j}}=\frac{{S_{Nj}}}{{S_{D}}}\quad j=1,2,\ldots,k \tag{4}\]  
Taking the data of the third quadrant \(10^{\circ}\leq\alpha\leq 0\) and \(-10\leq\beta\leq 0\) as examples, to better observe the actual measurement results of the three axes, three-dimensional rotation angle measurement results of the spherical joint are drawn, respectively, based on the GRNN neural network model. As shown in Figure 5 below, when the horizontal and vertical coordinates are the standard angle, the vertical coordinate is the actual measured value of this dimension. Figure 5a shows the specific test values of \(\alpha\) angle when the measuring range is \(0^{\circ}\leq\gamma\leq 120^{\circ}\) and \(-10^{\circ}\leq\beta\leq 0^{\circ}\). The values on the axis represent the standard angular rotation values provided, and the actual values are the neural network test values. Figure 5b shows the specific test values of the \(\beta\) angle, and Figure 5c shows the specific test values of the \(\gamma\) angle. All experimental data were processed. The result of \(\alpha\), \(\beta\), and \(\gamma\) of the mean square error of measurement were respectively \(11^{\prime}55^{\prime\prime}\), \(10^{\prime}18^{\prime\prime}\), and \(37^{\prime}44^{\prime\prime}\).