# Analysis and Simulation of Polishing Robot Operation Trajectory Planning
## 2 Materials and Methods
### The Establishment of the Robotic Arm Kinematics Model and the Spatial Spiral Curve Model
#### 2.1.2 Space Spiral Arc Curve Model  
Suppose the radius of the spatial spiral circular arc curve is \(r=100\) mm, the pitch is \(p=60\) mm, and the inclination angle is \(\varphi_{0}\). Assuming that the \(z\)-axis of the spatial coordinate system \(w\) for the space spiral line to be polished coincides with the axis of the helix [9], and the spatial coordinate origin is \((\alpha_{t},g_{t},z_{t})=(0,0,0)\), the parametric equations of the spiral in three-dimensional space are as follows:  
\[\left\{ \begin{array}{l}x=x_{t}+r*\cos(\frac{2\pi}{p}*\phi)\\ y=y_{t}+r*sin(\frac{2\pi}{p}*\phi)\\ \mathrm{z}=z_{t}+\phi\end{array} \right. \tag{10}\]  
Spiral inclination angle \(\varphi_{0}=atan2(\frac{p}{2r*\pi})\), where \(\varphi\) is the variable parameter in Formula (10), \(\varphi\) increases from 0 equal step distance to \(2p\), and the parameter Equation (10) can generate the spatial spiral arc curve of the corresponding pitch \(p\). Suppose that the spatial coordinate system \(w\) of the spatial helix to be polished is relative to the base coordinate frame \(\sigma\):  
\[\overset{o}{w}T=\left[ \begin{array}{ccc}1&0&0&200\\ 0&1&0&300\\ 0&0&1&400\\ 0&0&0&1\end{array} \right] \tag{11}\]  
In the spiral parameter equation given in Equation (10), the parametric variable \(\varphi\) is assigned every \(p/n\), starting from 0 and ending when the final value is \(2p\). Then, obtain the junction position coordinates on the spatial spiral curves of the two pitches \((x_{w(i)},y_{w(i)},\,x_{w(i)})\). The total number is \(2n+1\), and we can obtain the following position matrix for the \(2n+1\) nodes:  
\[T_{w}(\cdot,\cdot,i)=\left[ \begin{array}{ccc}1&0&0&x_{w(i)}\\ 0&1&0&y_{w(i)}\\ 0&0&1&z_{w(i)}\\ 0&0&0&1\end{array} \right] \tag{12}\]  
Figure 4: Simulation model of robot and grinding curve. Given \({}_{w}^{o}T\) and \(T_{w}(\cdot;\cdot;i)\), the position matrix of selected nodes on the spatial helix in the actual workpiece coordinate system can be obtained from the formula \({}_{w}^{o}T\) and \(T_{w}(\cdot;\cdot;i)\). \[T_{o}(\cdot;\cdot;i)=\left[ \begin{array}{ccc}1&0&0&x_{o(i)}\\ 0&1&0&y_{o(i)}\\ 0&0&1&z_{o(i)}\\ 0&0&0&1\end{array} \right] \tag{13}\]  
Through Formula (13), obtain the position of each node, connect the end position, and form the model of the spatial helical curve. Then, solve the joint trajectory \(q\) (position), \(\dot{q}\) (velocity), and \(\ddot{q}\) (acceleration) of the robot when passing through each node of the spatial solid curve. In this paper, we solve the problem of mapping the velocity of a robot in Cartesian space to the velocity in joint space using the vector product method. The displacements of the robot in Cartesian space \(x\) and joint space \(q\) can be represented by the following equations:  
\[x=x(q) \tag{14}\]  
After taking the derivative of both sides of Equation (14) concerning time, the relationship between the velocity of the robot in Cartesian space \(x\) and the velocity in joint space \(q\) is obtained as follows:  
\[\overset{\bullet}{x}=J(q)\overset{\bullet}{q} \tag{15}\]  
In the above formula,  
\(\dot{x}\) represents the velocity of the robot's end-effector in Cartesian space;  
\(\dot{q}\) is the joint velocity of the robot in the joint space;  
\(J(q)\) represents the Jacobian matrix for robots. Multiplying the left-hand side of both sides of Equation (15) by \(J(q)^{-1}\), we can obtain the formula for solving the joint speeds of the robot as follows:  
\[\overset{\bullet}{q}=J(q)^{-1}\overset{\bullet}{x} \tag{16}\]  
The velocity of the robot's end-effector in Cartesian space is a 6-dimensional column vector, which is \(\overset{\bullet}{x}=\left[v_{x},v_{y},v_{z},w_{x},w_{y},w_{z}\right]^{T}\). Assuming that the velocity of the robot's end-effector in the \(z\)-axis direction is uniform and the velocity value is \(v_{z}=2\) mm/s, the remaining velocity components of the \(i\)-th node can be expressed as  
\[\left\{