# A Self-Calibration Method for Robot End-Effector Using Spherical Constraints
## 3 Parameter Identification
### Error Parameter Identification Method  
The robot's end-effector collects positional data by making contact with the surface of the calibration sphere, where its theoretical position should describe a perfect sphere. However, due to geometric error and end-effector deformation, the actual position in three-dimensional space deviates from this ideal sphere. To address this, the parameter identification method aims to determine the appropriate error parameters such that, after correcting for these errors, the actual position of the robot's end-effector conforms to a standard sphere. The following objective function is then optimized using the least squares method, which can be expressed as Equation (31). \[\underset{x}{\text{min}}F(x)=\left\|f(x)\right\|_{2}^{2} \tag{31}\]  
For practical calibration, it is necessary to collect \(n\) points on the surface of the calibration sphere and perform fitting, with the robot assuming different poses for each point. Thus, Equation (32) holds:  
\[f(x)=\left[f_{1}\left(\widetilde{\mathbf{X}}\right)f_{2}\left(\widetilde{\widetilde {\mathbf{X}}}\right)\ \cdots\ f_{n}\left(\widetilde{\mathbf{X}}\right)\right]^{T} \tag{32}\]  
For each point, we can express it as shown in Equation (33). \[f_{i}\left(\widetilde{\mathbf{X}}\right)=\left(\widetilde{A}_{i}\widetilde{\widetilde {\mathbf{X}}}+\mathbf{p}_{i}^{\mathbf{N}}\right)^{T}\left(\widetilde{A}_{i}\widetilde{ \widetilde{\mathbf{X}}}+\mathbf{p}_{i}^{\mathbf{N}}\right)-R^{2},i=1,2,\cdots,n \tag{33}\]  
Simplifying, we obtain Equation (34). \[f_{i}\left(\widetilde{\widetilde{\mathbf{X}}}\right)=\widetilde{\widetilde{\mathbf{X} }}\widetilde{A}_{i}\widetilde{\widetilde{\mathbf{X}}}+2\left(\mathbf{p}_{i}^{\mathbf{N}} \right)^{T}\widetilde{A}_{i}\widetilde{\widetilde{\mathbf{X}}}+\left(\mathbf{p}_{i}^{ \mathbf{N}}\right)^{T}\mathbf{p}_{i}^{\mathbf{N}}-R^{2},i=1,2,\cdots,n \tag{34}\]  
By performing a first-order [PERSON] expansion of the function \(f(x)\) at \(\widetilde{\widetilde{\mathbf{X}}}=\widetilde{\widetilde{\mathbf{X}}}_{\mathbf{k}}\) and neglecting higher-order terms, we obtain Equation (35). \[F\left(\widetilde{\widetilde{\mathbf{X}}}_{\mathbf{k}}+\Delta\widetilde{\widetilde{ \mathbf{X}}}_{\mathbf{k}}\right)=\left\|f\left(\widetilde{\widetilde{\mathbf{X}}}_{\mathbf{k} }\right)+J\left(\widetilde{\widetilde{\mathbf{X}}}_{\mathbf{k}}\right)^{T}\Delta \widetilde{\widetilde{\mathbf{X}}}_{\mathbf{k}}\right\|_{2} \tag{35}\]  
Moreover, as shown in Equation (36), the Jacobian matrix can be obtained by taking the partial derivatives. \[J_{i}\left(\widetilde{\widetilde{\mathbf{X}}}_{\mathbf{k}}\right)=\frac{\partial f}{ \partial\widetilde{\widetilde{\mathbf{X}}}_{\mathbf{k}}}=2\widetilde{A}_{i}^{\to matrix singularity when using the Gauss-Newton algorithm for iterative calculations. To address this, the Levenberg-Marquardt algorithm is employed to solve the increment equation, which is shown in Equation (38).  
\[\Delta\widetilde{\mathbf{X}}_{\mathbf{k}}=-\left[J\left(\widetilde{\mathbf{X}}_{\mathbf{k}} \right)J\left(\widetilde{\mathbf{X}}_{\mathbf{k}}\right)^{T}+\lambda I\right]^{-1}J \left(\widetilde{\mathbf{X}}_{\mathbf{k}}\right)f\left(\widetilde{\mathbf{X}}_{\mathbf{k}}\right) \tag{38}\]  
\(\lambda\) is a positive adjustable coefficient. In nonlinear least squares problems, the choice of the initial values is crucial. If the initial values are not chosen appropriately, it may lead to slow convergence or cause the algorithm to become trapped in a local optimum. In this calibration problem, since the robot's geometric errors are small, the initial values can be set to zero. The initial values for the end-effector deformation error parameters can be derived based on their physical meaning. The coordinates of the calibration sphere's center, \(\mathbf{p}_{\mathbf{c}}=[x_{c},y_{c},z_{c}]^{T}\), can be determined by fitting the actual positions measured by the end-effector using the least squares method [18].