## 3 Comprehensive Calibration of the Coal Gangue Sorting System
### Calibration between the Conveyor Belt System and the Robot System  
The coordinate system relationship between the systems is shown in Figure 3. The robot coordinate system established regarding the robot is \(R-X_{\rm R}Y_{\rm R}Z_{R}\), and the camera coordinate system established for the industrial camera is \(V-X_{V}Y_{V}Z_{V}\). In the field of view of the camera, the conveyor belt plane is used as the XY plane to establish the conveyor belt initial coordinate system \(C-X_{\rm C}Y_{\rm C}Z_{\rm C}\). The \(X_{\rm C}\) direction is consistent with the movement direction of the conveyor belt. * Transformation matrix and scale factor  
The calibration of the conveyor belt calculates the pose of the conveyor belt relative to the robot coordinate system. The matrix \(H_{\rm C}^{\rm R}\) is used to represent the transformation relationship between the two coordinate systems. If the initial position of the conveyor belt measured by the camera is \(P^{\rm C}\), then the attitude of this point in the robot coordinate system is:  
\[P^{\rm R}=H_{\rm C}^{\rm R}P^{\rm C} \tag{1}\]  
Since the conveyor belt coordinate system changes dynamically along the direction of conveyor belt movement, the value of the change can be calculated using the change of the encoder. In this  
Figure 2: Flowchart of software design for the coal gangue identification and positioning system. paper, a parameter of the conveyor belt is represented by the encoder scale factor \(Factor_{c}\) (encoder factor). The proportional relationship between the reading change in the robot coordinates and the encoder reading change is the scale factor [31]. * Calibration method of the conveyor belt  
The calibration of the conveyor belt is completed on the robot Kemotion control system. The controller has a conveyor belt tracking function module and completes the relevant configuration work, shifts the visual coordinate system to the conveyor belt, and establishes a conveyor belt coordinate system Trackingbase. The whole calibration process uses the teaching device to display the robot end coordinate position point and the value provided by feedback by the encoder in real time. The calibration steps are as follows:  
1. Place the object within the visual range, then click the \"workpiece grab\" button. At this time, check the encoder reading \(V_{e0}\) using the teaching device, as shown in Figure 4a. 2. Start the conveyor belt, move the workpiece to the working area of the robot, pause the conveyor belt, manually jog the robot to the workpiece grasping position (i.e., point P1, as shown in Figure 4b) using the teaching device, and record the robot position \(P_{1}^{R}(x_{1},y_{1},z_{1})\) and encoder reading \(V_{e1}\). 3. Restart the conveyor belt, move the workpiece to run for a distance (the workpiece is still in the grasp range), pause the conveyor belt again, and move the robot to the position above the workpiece grasping point (i.e., point P2, as shown in Figure 4c). Record the robot position \(P_{2}^{R}(x_{2},y_{2},z_{2})\) and encoder position \(V_{e2}\). 4. Select another workpiece (workpiece 2) and place it at the diagonal point of the first workpiece in the visual range (in order to improve accuracy, there should be a maximum deviation from workpiece 1 in the Y direction). Then click \"workpiece grab\" and record the encoder reading \(V_{e3}\), as shown in Figure 4d. 5. Start the conveyor belt, move workpiece 2 to the middle of the robot's workspace, pause the conveyor belt, move the robot inching function to point P3 of workpiece 2, and record the position of robot and encoder. Record the position \(P_{3}^{R}(x_{3},y_{3},z_{3})\) in the robot coordinate system and the encoder reading \(V_{e3}^{\prime}\), as shown in Figure 4e. Figure 3: System coordinate system. Figure 4: _Cont._  
In summary, the coordinates of \(P_{1}^{R}\), \(P_{2}^{R}\), \(P_{3}^{R}\), and \(O_{C}^{R}\) in the scope of robot grasping are marked, and the relationship is shown in Figure 5, where \(O_{C}^{R}\) represents the dynamic origin position of the conveyor belt.