## 3 Guided Artificial Potential Field
### Repulsive Force
#### 3.2.2 Joint Space Repulsion  
To operate a robotic arm, the production of joint force (or moment) is crucial, the repulsive force vector is converted into the robotic arm joint force (or moment) by the Jacobian method.  
The end-effector positional state of the robotic arm (containing position and angle) can be regarded as a vector \(\dot{p}\) and the joint value of the robotic arm can be regarded as a vector \(\dot{q}\):  
\[\dot{p}=\left[\begin{array}{c}x\\ y\\ z\\ \alpha\\ \beta\\ \gamma\end{array}\right],\dot{q}=\left[\begin{array}{c}q_{1}\\ q_{2}\\ q_{3}\\ q_{4}\\ q_{5}\\ q_{6}\\ q_{7}\end{array}\right] \tag{13}\]  
where \(x\), \(y\), \(z\) represent the end-effector spatial position coordinates, and \(\alpha\), \(\beta\), \(\gamma\) are the spatial attitude angles. Where \(q_{1}\sim q_{7}\) are the robotic arm joint values. Theoretically, any element in \(\dot{p}\) can be calculated by \(\dot{q}\), so there is (14)  
\[\left[\begin{array}{c}x\\ y\\ z\\ \alpha\\ \beta\\ \gamma\end{array}\right]=\left[\begin{array}{c}f_{1}(\dot{q})\\ f_{2}(\dot{q})\\ f_{3}(\dot{q})\\ f_{4}(\dot{q})\\ f_{5}(\dot{q})\\ f_{6}(\dot{q})\end{array}\right] \tag{14}\]  
Each term on the left side of (15) is fully differentiated, and the right side is obtained by taking partial derivatives for \(q_{1}\) to \(q_{7}\):  
\[\left[\begin{array}{c}\Delta x\\ \Delta y\\ \Delta z\\ \Delta\alpha\\ \Delta\beta\\ \Delta\gamma\end{array}\right]=\left[\begin{array}{cccc}\frac{\partial f_{1} }{\partial q_{1}}&\frac{\partial f_{1}}{\partial q_{2}}&\cdots&\frac{\partial f _{1}}{\partial q_{7}}\\ \frac{\partial f_{2}}{\partial q_{1}}&\frac{\partial f_{2}}{\partial q_{2}}& \cdots&\frac{\partial f_{2}}{\partial q_{7}}\\ \vdots&\vdots&\ddots&\vdots\\ \frac{\partial f_{6}}{\partial q_{1}}&\frac{\partial f_{6}}{\partial q_{2}}& \cdots&\frac{\partial f_{6}}{\partial q_{7}}\\ \end{array}\right]\left[\begin{array}{c}\Delta q_{1}\\ \Delta q_{2}\\ \Delta q_{3}\\ \Delta q_{4}\\ \Delta q_{5}\\ \Delta q_{6}\\ \Delta q_{7}\end{array}\right] \tag{15}\]  
Figure 5: Schematic diagram of repulsive forces generated at control points.  
The vector on the left side of the equation represents the amount of change in the position of the end-effector denoted as \(\Delta P\), the matrix with 7 rows and 6 columns on the right side is the Jacobi matrix which we will denote as \(J\), and the vector on the far right side of the equation represents the amount of change in the joints denoted as \(\Delta Q\), and (15) can be abbreviated as (16)  
\[\Delta P=J\Delta Q \tag{16}\]  
In the differential scenario, this equation can be seen as a mapping relationship that converts joint velocities into end-effector velocities. By numbering the control points, with \(n\) carrying the number of joints and \(m\) representing the ordering of the control points, the Jacobian matrix \(J_{nm}\) of the control points can be derived. In the differential case, where time \(\Delta t\) is consistently one, velocity is represented by force in this document. The three components of the vector \(\overrightarrow{F_{rep}}\) are utilized as the initial three components of \(\Delta P\). Since the repulsive force does not produce torque on the control point so the last three elements of \(\Delta P\) representing the angular velocity vector are \(\theta\), which gives \(\Delta P\). From this the joint space repulsive force (or moment) vector can be calculated.  
\[M_{rep}=\text{pinv}(J_{nm})\Delta P\odot K_{rep} \tag{17}\]  
where \(M_{rep}\) signifies the joint repulsive force (or moment) vector. The function pinv stands for the pseudo-inverse of the matrix. Meanwhile, \(K_{rep}\) denotes the vector of repulsion scale factors.