# Path Planning for Laser Cladding Robot on Artificial Joint Surface Based on Topology Reconstruction
## 4 Generation of Laser Cladding Paths
### Determination of the Robot Position and Pose  
In order to form a uniform and stable molten pool on the substrate during the laser cladding process, the laser beam is usually required to be perpendicular to the laser cladding surface. If the molten pool inclines during the cladding process, the shape and size of the coating section will be inconsistent, which affects the final quality of the coatings [26; 27]. In this paper, therefore, the laser head was fixed on the worktable to keep it vertical all the time, and the workpiece clamped by the robot moved accordingly. In this mode, the laser beam was always perpendicular to the cladding surface, and the molten pool basically remained stable without tilting, which was beneficial for the formation of coatings. The coordinates and normal vector of the interpolation point were recorded as \(V=[Vx~{}Vy~{}Vz]^{\mathrm{T}}\) and \(a=[a_{x}~{}a_{y}~{}a_{z}]^{\mathrm{T}}\) respectively in the workpiece coordinate system. The position and pose of the TCP defined as \(P=[Px~{}Py~{}Pz~{}\alpha~{}\beta~{}\gamma]\) could be calculated using a series of transformations. The rotation matrix \(T\) composed of vectors \(n\), \(o\) and \(a\) could be expressed as:  
\[T=\left[ \begin{array}{ccc}n_{x}&o_{x}&a_{x}\\ n_{y}&o_{y}&a_{y}\\ n_{z}&o_{z}&a_{z}\end{array} \right], \tag{3}\]  
where \(a=[a_{x}~{}a_{y}~{}a_{z}]^{\mathrm{T}}\) denotes the normal vector of the interpolation point, \(o=[o_{x}~{}o_{y}~{}o_{z}]^{\mathrm{T}}\) is defined as the direction vector of the cladding processing path, and \(n=[n_{x}~{}n_{y}~{}n_{z}]^{\mathrm{T}}\) is determined by \(n=o\times a\). Matrix \(T\) represented the rotation matrix of the interpolation point relative to the workpiece coordinate system. However, in actual processing, the normal vector of the interpolation point was strictly required to coincide with the laser beam. Therefore, to meet this requirement, it was wise to set the interpolation point coordinate system \(\{P\}\) to be consistent with the world coordinate system \(\{W\}\) by adjusting the pose of the robot TCP. In other words, setting the pose of the robot made the vectors \(n\), \(o\) and \(a\) coincide with the \(X\), \(Y\) and \(Z\) axes of the world coordinate system, respectively, as shown in Figure 10.  
Figure 9: (**a**) Vertex normal vector estimation. (**b**) Estimation of normal vector of the interpolation point. In this case, the rotation matrix \(T^{\prime}\) of the TCP coordinate system relative to the world coordinate system was equal to the rotation matrix of the workpiece coordinate system relative to the interpolation point coordinate system, expressed as the following:  
\[T^{\prime}=T^{-1}=\left[ \begin{array}{ccc}n_{x}&n_{y}&n_{z}\\ o_{x}&o_{y}&o_{z}\\ a_{x}&a_{y}&a_{z}\end{array} \right] \tag{4}\]  
As shown in Figure 11, vector \(L\) represents the position vector of the laser focus in the world coordinate system; vector \(V\) represents the position vector of the interpolation point in the workpiece coordinate system; and vector \(D\) represents the laser defocusing quantity of cladding processing. The position vector \(V^{\prime}\) of the interpolation point in the world coordinate system could be expressed as the following:  
\[V^{\prime}=T^{\prime}V=\left[ \begin{array}{ccc}n_{x}&n_{y}&n_{z}\\ o_{x}&o_{y}&o_{z}\\ a_{x}&a_{y}&a_{z}\end{array} \right]\left[ \begin{array}{c}v_{x}\\ v_{y}\\ v_{z}\end{array} \right] \tag{5}\]  
Furthermore, the position coordinates of the robot TCP could be expressed as the following:  
\[P=L-D-V^{\prime} \tag{6}\]  
Figure 10: Schematic diagram of robot TCP pose changes. The pose coordinates of the robot TCP are described as RPY rotation angles: \(\alpha\) (Roll angle), \(\beta\) (Pitch angle) and \(\gamma\) (Yaw angle) as shown in Figure 12, which respectively represented the rotation of the robot TCP coordinate system around the Z, Y and X axis of the world coordinate system. The compound rotation matrix RPY was:  
\[