## 3 Comprehensive Calibration of the Coal Gangue Sorting System
### Calibration between the Conveyor Belt System and the Robot System
According to the above data, the scale factor can be obtained by  
\[\Delta L_{R}=\sqrt{\left(x_{2}-x_{1}\right)^{2}+\left(y_{2}-y_{1}\right)^{2}+ \left(z_{2}-z_{1}\right)^{2}} \tag{2}\]  
Figure 4: Calibration steps. Figure 5: Conveyor belt coordinates. \[\Delta L_{C}=V_{e2}-V_{e1} \tag{3}\]  
\[Factor_{c}=\frac{\Delta L_{R}}{\Delta L_{C}} \tag{4}\]  
It can be seen that if the encoder readings \(V_{e1}\) and \(V_{e2}\) at a starting distance and an end position within a certain distance of the conveyor belt movement are known, the movement distance of the target object in the direction of the conveyor movement can be obtained according to the scale factor. \[P^{\rm R}=H_{\rm C}^{\rm R}P^{\rm C} \tag{1}\]0  
The origin of the conveyor belt coordinate system enters into the range of the robot after a distance of \(\Delta L_{1}\). At this time, the coordinate of the origin of the conveyor belt coordinate system relative to the robot coordinate system is set as \(O_{C}^{R}\). The moving distance is therefore represented by \(V_{e3}\), the encoder reading which calibrates the starting point position of block 2, and \(V_{e3}^{\prime}\), the encoder reading whereby calibration block 2 runs to position P\({}_{3}\). \[P^{\rm R}=H_{\rm C}^{\rm R}P^{\rm C} \tag{1}\]1  
According to the coordinate vector diagram of conveyor belt, the following relationship can be established. \(O_{C}^{R}\): The coordinate of the origin of the moved conveyor belt coordinate system relative to the robot coordinate system. \(P_{i}^{R}\) (\(i\) = 1,2,3,4) represents the position of the workpiece in the robot coordinate system. \[\left( \begin{array}{c}(P_{3}^{R}-O_{C}^{R})\cdot(P_{2}^{R}-P_{1}^{R})=0\\ \left\|(P_{1}^{R}-O_{C}^{R})\times(P_{2}^{R}-P_{1}^{R})\right\|=0\\ ((P_{3}^{R}-O_{C}^{R})\times(P_{2}^{R}-P_{1}^{R}))\cdot(P_{2}^{R}-P_{1}^{R})=0 \end{array} \right) \tag{7}\]  
The coordinates of the origin of the moved conveyor belt coordinate system relative to the robot coordinate system can be obtained by the above Equation. \[O_{C}^{R}=(x_{C_{0}}^{R},y_{C_{0}}^{R},z_{C_{0}}^{R})^{T}\]  
\[\left\{\begin{array}{l}x_{C_{0}}^{R}=(x_{1}^{2}x_{3}-2x_{1}x_{2}x_{3}-x_{1}y _{2}y_{3}+x_{1}y_{1}y_{3}+x_{1}y_{2}^{2}-x_{1}y_{2}y_{3}-x_{1}z_{1}z_{2}+x_{1} z_{1}z_{3}+x_{1}z_{2}^{2}-x_{1}z_{2}z_{3}+x_{2}^{2}x_{3}+x_{2}y_{1}^{2}\\ -x_{2}y_{1}y_{2}-x_{2}y_{1}y_{3}+x_{2}y_{2}z_{3}+x_{2}z_{1}^{2}-x_{2}z_{1}z_{2} -x_{2}z_{1}z_{3})/(x_{1}-x_{2})^{2}\cdot(y_{1}-y_{2})^{2}\cdot(z_{1}-z_{2})^{ 2}\\ y_{C_{0}}^{R}=(x_{1}^{2}y_{2}-x_{1}x_{2}y_{1}-x_{1}x_{2}y_{2}+x_{1}x_{3}y_{2}+x _{1}y_{2}^{2}-x_{2}x_{3}y_{1}+x_{2}x_{3}y_{2}+y_{1}^{2}y_{3}-2y_{1}y_{2}y_{3}- y_{1}z_{1}z_{2}+y_{1}z_{1}z_{3}+y_{2}z_{1}^{2}\\ -y_{1}z_{2}z_{3}+y_{2 The \(O_{C}^{R}\) coordinate value is substituted into Equation (9) to obtain the following results:  
\[ \begin{array}{c}\vec{X_{C}}=\left(0.1357,-0.9908,0.0001\right)^{T}\\ \vec{Y_{C}}=\left(0.1345,-0.0183,0.9908\right)^{T}\\ \vec{Z_{C}}=\left(-0.9816,-0.1345,0.1357\right)^{T}\end{array} \]  
Figure 6 shows the original coordinate system of the conveyor belt, which is C', the coordinate system C obtained by \(\Delta L_{1}\) after operation, and the robot coordinate system R. \(H_{C}^{C}\) represents the relationship matrix between the original conveyor belt coordinate system C' and the coordinate system C obtained by running \(\Delta L_{1}\). \(H_{C}^{R}\) represents the relationship matrix between the coordinate system C obtained by running \(\Delta L_{1}\) and the robot coordinate system. The transformation matrix \(H_{C}^{R}\) between the dynamic conveyor coordinate system and the robot coordinate system is obtained via Equations (8) and (9). \[H_{C}^{R}=\left[ \begin{array}{ccc}\vec{X_{C}}&\vec{Y_{C}}&\vec{Z_{C}}&O_{C}^ {R}\\ 0&0&0&1\end{array} \right] \tag{10}\]  
\[H_{C}^{C}=Trans_{X_{C},\Delta L_{1}}=\left[ \begin{array}{cccc}1&0&0&\Delta L _{1}\\ 0&1&1&0\\ 0&0&1&0\\ 0&0&0&1\end{array} \right] \tag{11}\]  
The relationship matrix between the original coordinates of the conveyor belt and the robot coordinate system can be obtained by  
\[