## 3 Iterative Estimation of Coordinate Transformation and TCP Translation  
The transition from simulation to real-world execution is hindered by the discrepancy between a robot's high repeatability and its significantly lower accuracy, which is affected by multiple error sources, such as joint offsets, geometric imperfections, and environmental factors. Accurate simulation implementation requires extensive calibration, external measurement systems, and error compensation methods, which are often costly and impractical for every production scenario. Several studies have addressed the simultaneous solution of the AX = YB calibration problem [11; 18; 19; 20], providing a basis for future comparative analysis with the method proposed in this work. In this study, a methodology for robotic station measurement, including mass identification, was implemented based on the methodology and block diagram representation outlined in [2]. As a starting point, the AX = YB equation can be reformulated as follows:  
\[C_{i}\cdot\begin{bmatrix}T_{Z}\\ 1\end{bmatrix}=RA_{i}+T,fori=1,\ldots,N \tag{1}\]  
where  
\(C_{i}\)--the \(4\times 4\) transformation matrix from the robot's internal positioning system (pose of the robot's flange).  
\(A_{i}\)--the measured \(3\times 1\) position of the tool from an external tracking system (e.g., a laser tracker).  
Figure 3: Coordinate system alignments and gathered data in Polyworks Inspector® probing software.  
\(T_{Z}\)--the 3 \(\times\) 1 translation vector representing the translation of the TCP in the tool coordinate frame.  
\(R\)--3 \(\times\) 3 rotation matrix representing orientation between the World Coordinate System (WCS) and the User Coordinate System (UCS).  
\(T\)--3 \(\times\) 1 translation vector from WCS to UCS.  
The TCP translation is initialized and estimated by averaging estimated translations from all N measurements:  
\[T_{z}=\frac{1}{N}\sum_{i=1}^{N}T_{i} \tag{2}\]  
Each point \(B_{i}\) in the robot's base frame is calculated using the estimated TCP:  
\[B_{i}=R_{i}T_{z}+T_{i} \tag{3}\]  
Centroids of both measurement sets are calculated to enable zero-mean alignment:  
\[\overline{A}=\frac{1}{N}\sum_{i=1}^{N}TA_{i},\overline{B}=\frac{1}{N}\sum_{i= 1}^{N}TB_{i} \tag{4}\]  
\[\widetilde{A}_{i}=A_{i}-\overline{A},\widetilde{B}_{i}=B_{i}-\overline{B} \tag{5}\]  
The cross-covariance (correlation) matrix is computed, followed by Singular Value Decomposition (SVD) and calculation of the rotation matrix \(R\). To ensure proper rotation, the determinant is checked:  
\[H=\sum_{i=1}^{N}\widetilde{A}_{i}\overset{\sim}{B_{i}}^{T}=\overset{\sim}{A }\overset{\sim}{B}^{T} \tag{6}\]  
\[H=U\Sigma V^{T} \tag{7}\]  
\[R=VU^{T},\text{ if }\text{det}(R\ )<0:V[:,3]=-V[:,3],R=VU^{T} \tag{8}\]  
The translation T from WCS to UCS is calculated by aligning centroids:  
\[T=\overline{B}-R\cdot\overline{A} \tag{9}\]  
A refined TCP estimate is computed for each sample and averaged for the new estimation:  
\[T_{z,i}=R_{i}^{T}(RA_{i}+T-T_{i}) \tag{10}\]  
\[T_{z}=\frac{1}{N}\sum_{i=1}^{N}T_{z,i} \tag{11}\]  
The process iterates until the change in TCP estimation between iterations is smaller than a defined threshold:  
\[\left\|T_{z}^{(k)}-T_{z}^{(k-1)}\right\|<\varepsilon \tag{12}\]  
where  
\(k\)--iteration index.  
\(\varepsilon\)--convergence threshold.  
To evaluate fit accuracy, the residual error for each measurement is computed, finding the scalar error.  
\[Res_{i}=C_{i}(1:3,:)\cdot\begin{bmatrix}T_{Z}\\ 1\end{bmatrix}-(RA_{i}+T) \tag{13}\]\[err_{i}=\|Res_{i}\|\Longrightarrow errVec=\begin{bmatrix}err_{1}\\ \vdots\\ err_{N}\end{bmatrix} \tag{14}\]