# Separation Method for Installation Eccentricity Error of Workpiece
## 3 Separation Method of Workpiece Installation Eccentricity Error
To determine the value of the phase angle, a particle swarm optimization (PSO) search method was developed to obtain the optimal value of the phase angle \(\gamma^{l}\) (\(l=1,2,...,J_{l}\)). Next, we assume the residual error vector of Equation (14) is  
\[\mathbf{v}=\mathbf{C}\mathbf{\chi}-\mathbf{h} \tag{17}\]The optimization process is to find the parameters \(\gamma^{l}\) (\(l=1,2,\ldots,J_{l}\)) that minimize the value of the following objective function:  
\[f\Big{(}\gamma^{1},\gamma^{2},\cdots,\gamma^{l}\Big{)}=\mathbf{v}^{\mathsf{T}}\mathbf{v} \tag{18}\]  
The computational procedure of the PSO search method is shown below:  
Step 1: Particle swarm initialized, including population size \(M\), maximum iteration times \(l_{\text{max}}\), position \(u_{j}\), and velocity \(v_{j}\) of each particle. The random number function _rand_ within the phase angle interval \(\left[\gamma^{l}_{L},\gamma^{l}_{U}\right]\) is applied to generate \(N\) sets of particle positions, where the position \(u_{j}\) of each particle represents the phase angle \(\gamma^{l}\), that is:  
\[u_{j}=\gamma^{l}_{L}+\left(\gamma^{l}_{U}-\gamma^{l}_{L}\right)\cdot\text{rand }\quad l=1,2,\ldots,J_{l};j=1,2,\ldots,M. \tag{19}\]  
At this point, a combination of \(M\) sets of parameters \((\gamma^{1},\gamma^{2},\ldots,\gamma^{l_{l}})\) can be obtained. Step 2: Substituting the spindle speed \(\Omega^{l}\) and \(M\) groups of particles into Equation (18) to obtain vector \(\mathbf{C}\) and then calculating the initial objective function value based on Equations (16)-(18). The function value of each particle can be expressed as  
\[p_{j}=f\Big{(}\gamma^{1}_{j},\gamma^{2}_{j},\ldots,\gamma^{l_{l}}_{j}\Big{)} \quad j=1,2,\ldots,M. \tag{20}\]  
where the parameters \(f^{*}\) are denoted by \(\gamma^{1*}_{k},\gamma^{2*}_{k},\cdots,\gamma^{M*}_{k}\), respectively. Step 3: The individual extremum \(p^{\text{best}}_{j}\) and global extremum \(g^{\text{best}}\) are updated. Compare the current objective function value \(p_{j}\) of each particle with its individual optimal value. If the current function value is better than the individual optimal value, replace the individual optimal value with the current function value of the particle. The individual optimal value in the \(k\)-th iteration can be expressed as  
\[p^{\text{best}}_{j}= \begin{cases}p_{j}&k=1\\ \min\Big{(}p^{\text{best}}_{j},p_{j}\Big{)}&1<k\leq I_{\text{max}}\end{cases}  j=1,2,\ldots,M. \tag{21}\]  
Next, compare the current function value \(p_{j}\) of the particle with the global optimal value \(g^{\text{best}}\). If the current function value is better than the global optimal value, replace the global optimal value with the current function value of the particle. The global optimal value of the entire particle swarm can be expressed as  
\[g^{\text{best}}=\min\Big{(}p^{\text{best}}_{1},p^{\text{best}}_{2},\ldots,p^ {\text{best}}_{M}\Big{)} \tag{22}\]  
where the corresponding parameters of \(g^{\text{best}}\) are represented by \((\gamma^{1*},\gamma^{2*},\ldots,\gamma^{l*})\). Step 4: The velocity \(v_{j}\) and position \(u_{j}\) of the particles are updated. The update formula for speed \(v_{j}\) can be expressed as [31; 32]:  
\[v^{k+1}_{j}=w\cdot v^{k}_{j}+c_{1}\cdot r_{1}\cdot\Big{(}p^{\text{best}}_{j}- u^{k}_{j}\Big{)}+c_{2}\cdot r_{2}\cdot\Big{(}g^{\text{best}}_{j}-u^{k}_{j} \Big{)}\quad j=1,2,\ldots,M. \tag{23}\]  
where \(w\) is the inertia weight, typically set as 0.5; \(c_{1}\) and \(c_{2}\) are acceleration constants, commonly set to 2.0; \(r_{1}\) and \(r_{2}\) are randomly generated random numbers uniformly distributed within \([0,1]\) in each iteration. The update formula for position \(u_{j}\) can be written as  
\[u^{k+1}_{j}=u^{k}_{j}+v^{k+1}_{j}\quad j=1,2,\ldots,M. \tag{24}\]Step 5: Equation (25) is the condition for determining whether the search program has ended. If the termination condition is met, terminate the calculation and output the optimal phase angle combination. Otherwise, return to Step 2 to proceed to the next iteration.