## 2 Methods  
### Error Similarity Analysis with TCP Calibration Uncertainties  
The Cartesian error similarity with respect to (w.r.t.) the joint space is analyzed in Ref. [29]. However, the uncertainties of TCP calibration are ignored and result in the limitation of applications with small variations of tool orientations. To find a compensation method that is suitable for large orientation variations of TCP, the uncertainties of TCP calibration must be taken into consideration. For this purpose, error similarity analysis with uncertainties of TCP calibration is carried out in this section. The KUKA KR500-2830 industrial robot is considered in this study. Its DH model [31] is shown in Figure 2, where \(O_{i}X_{i}Y_{i}Z_{i}\) represents the fixed frame attached to the \(i\)th link of the robot. In particular, \(O_{0}X_{0}Y_{0}Z_{0}\) represents the base frame of the robot and is denoted as \(\{B\}\); \(O_{6}X_{6}Y_{6}Z_{6}\) represents the wrist frame of the robot and is denoted as \(\{W\}\). In addition,  
Figure 1: Working scenarios of existing robotic drilling systems. (**a**) NUAA robotic drilling system (**b**) NUAA dual-robot cooperative drilling and riveeting system. \(O_{\rm T}X_{\rm T}Y_{\rm T}Z_{\rm T}\) represents the TCP frame of the robot and is denoted as \(\{T\}\). The transformation matrix of TCP frame \(\{T\}\) w.r.t. base frame \(\{B\}\) can be formulated as in Ref. [13]. \[{}^{\rm B}\,\mathbf{T}_{\rm T}={}^{0}\,\mathbf{T}_{1}\,{}^{1}\,\mathbf{T}_{2}\,{}^{2}\,\mathbf{T }_{3}\,{}^{3}\,\mathbf{T}_{4}\,{}^{4}\,\mathbf{T}_{5}\,{}^{5}\,\mathbf{T}_{6}\,{}^{W}\,\mathbf{ T}_{\rm T} \tag{1}\]  
where the first 6 transformation matrices can be expressed by  
\[{}^{i-1}\,\mathbf{T}_{i}=\mathrm{Trans}(0,0,d_{i})\mathrm{Rot}(\theta_{i},0,0) \mathrm{Trans}(a_{i},0,0)\mathrm{Rot}(0,0,\alpha_{i})\,\,i=1,\cdots,6 \tag{2}\]  
with \(d_{i},\theta_{i},a_{i},\alpha_{i}\) being the link offset, joint angle, link length and link twist of the \(i\)th link, respectively \(\mathrm{Trans}(\cdot)\) and \(\mathrm{Rot}(\cdot)\) represents homogeneous translations and rotations matrices which can be expressed as  
\[ \begin{split}\mathrm{Trans}(x,y,z)&=\left[\begin{array} []{cccc}1&0&0&x\\ 0&1&0&y\\ 0&0&1&z\\ 0&0&0&1\end{array}\right]\\ \mathrm{Rot}(\varphi,\theta,\psi)&=\left[\begin{array}{cccc}c\varphi c \theta c\psi-s\varphi s\psi&-c\varphi c\theta s\psi-s\varphi c\psi&c\varphi s \theta&0\\ s\varphi c\theta c\psi+c\varphi s\psi&-s\varphi c\theta s\psi+c\varphi c\psi&s \varphi s\theta&0\\ -s\theta c\psi&s\theta s\psi&c\theta&0\\ 0&0&0&1\end{array}\right]\end{split}  \tag{3}\]  
\({}^{W}\,\mathbf{T}_{\rm T}\) in Equation (1) can be expressed by  
\[{}^{W}\,\mathbf{T}_{\rm T}=\mathrm{Trans}(x_{\rm T},y_{\rm T},z_{\rm T})\mathrm{ Rot}(\varphi_{\rm T},\theta_{\rm T},\psi_{\rm T}) \tag{4}\]  
where \(x_{\rm T},y_{\rm T},z_{\rm T}\) represents the position of the origin for the TCP frame \(\{T\}\) w.r.t the wrist frame \(\{W\}\). \(\varphi_{\rm T},\theta_{\rm T},\psi_{\rm T}\) represents the orientation transform from \(\{W\}\) to \(\{T\}\) in the \(Z\)-\(Y\)-\(X\) Euler angles. It can be known from Equation (1) that the positioning error can be divided into two parts which contain robot kinematics error \(\Delta\,^{i}\,\mathbf{T}_{i+1}\) and calibration error of TCP frame \(\Delta\,^{W}\,\mathbf{T}_{\rm T}\). As can be seen from previous research, when the 2 positions in Cartesian space hold  
Figure 2: DH model of KUKA KR500-2830. similar joint configurations, the corresponding positioning errors have a certain similarity which can be calculated by semivariance [29] as  
\[\gamma^{*}(h)=\frac{1}{2\sum\limits_{k=1}^{n}N(h_{k})}\sum\limits_{i=1}^{n}\sum \limits_{j=1}^{N(h_{i})}\big{\|}\Delta\mathbf{P}(\theta_{i})-\Delta\mathbf{P}( \theta_{j})\big{\|}_{2}^{2} \tag{5}\]  
where \(\big{\|}\cdot\big{\|}_{2}\) represents the Euclid norm of the vector. \(\theta_{i},\theta_{j}\in\mathbb{R}^{6}\) represent the joint angles vector of different TCP positions with a total of n groups.