# Sensorless Posture Detection of Reluctance Spherical Motor Based on Mutual Inductance Voltage
## 3 Particle Swarm Optimization Algorithm for 3-DoF Attitude Recognition
### Identification Principle
The specific operations are as follows: According to the relationship between the mutual inductance voltage of the stator coil and the included angle between stator and rotor, the particle swarm optimization algorithm is used to identify the three Euler angles \(\left[\alpha^{*},\beta^{*},\gamma^{*}\right]^{T}\) of the rotor. The three-DoF rotation angle \(\left[\alpha,\beta,\gamma\right]^{T}\) of the rotor is taken as the optimization variable, and the error between the measured value \(U^{*}=\left[u_{i}^{*}\right]^{T}\),\(i=1\sim 12\) and the theoretical value \(U=\left[u_{i}\right]^{T}\) of the mutual inductance voltage of the 12 sets of stator coils is taken as the fitness function \(fitness(\alpha,\beta,\gamma)\), and the minimum fitness function \(min[f(\alpha,\beta,\gamma)]\) is taken as the optimization objective. There are two data preparations that should be made upfront:  
(1) According to the method introduced in Section 2.2, the mutual inductance voltage values \(u_{java}=f\left(\theta_{spin}\right)\) and \(u_{pitch}=f\left(\theta_{pitch}\right)\), corresponding to the rotor yaw and pitch motion within 0\({}^{\circ}\)-30\({}^{\circ}\) for each group of coils, are measured in advance as the interpolation  
Figure 10: Distribution of the detectable range of each group of coils. basis for calculating the theoretical value of the mutual inductance voltage. Among them, \(i\) is the number of 12 groups of stator coils; \(\theta_{ijuav}\), \(\theta_{ipitch}\in\left(0^{\lx@math@degree}\sim 30^{\lx@math@degree}\right)\), \(u_{ijuav}\), and \(u_{ipitch}\) are the mutual inductance voltages measured by coil i during rotor yaw and pitch, respectively. (2) According to the basic attributes of the ellipse, calculate the spherical longitude and latitude \((X_{ci1},Y_{ci1})\),\((X_{ci2},Y_{ci2})\) with \(i=1\sim 12\) of the contour line of the mutual inductance voltage of each coil, and the spherical latitude and longitude of the two focal points of the ellipse. When on-line identification of the three-DoF angle is carried out, firstly, the actual mutual inductance voltage numerical vector \([\alpha^{*},\beta^{*},\gamma^{*}]^{T}\) of each group of coils is obtained by test in the state of ball machine to be measured \(U^{*}=\left[u_{i}^{*}\right]^{T}\),\(i=1\sim 12\). After that, the initial solution set of the particle swarm optimization algorithm is adopted and iterated according to the fitness value. The specific fitness calculation process is as follows. Step 1: According to the input three angles \([\alpha,\beta,\gamma]^{T}\), the spherical longitude and latitude positions \([X_{ti},Y_{ti}]^{T}\), \((i=1\sim 6)\) of the six rotor teeth in this state are calculated by using the three-dimensional space geometric relationship. Step 2: It is believed that the mutual inductance of a group of coils is mainly determined by the pair of rotor teeth closest to the pair of coils. Therefore, for 12 coils in the Eastern Hemisphere stator, according to the properties of the ellipse, the sum \(\left[d_{cifi}\right]^{T}\),\(i=1\sim 12,j=1\sim 6\) of the distances between the six rotor teeth and the two focal points of the ellipse of the mutual inductance voltage contour line of each coil is calculated, the minimum value \(a_{i}=\min\left[d_{cifi}\right]\) is taken, and the mutual inductance voltage of the coil is determined by this distance. Step 3: Calculate the length \(a_{i}\) of the short axis according to half of the long axis of the ellipse corresponding to \(2c_{i}=Y_{ci1}-Y_{ci2}\) the mutual inductance voltage contour line and the focal length of the ellipse \(b_{i}=\sqrt{a_{i}^{2}+c_{i}^{2}}\). Use \(a_{i}\) in \(u_{ispin}\) and \(b_{i}\) in \(u_{ipitch}\) test data interpolated and averaged as the theoretical value \(u_{i}\) of the mutual inductance voltage to be generated by this coil.