## 2 Materials and Methods
### Experimental Design and Introduction
#### 2.1.3 Robotic Arm's Inverse Kinematics  
Consider a robotic joint with degrees of freedom at any given time, and the number of degrees of freedom required to perform a task in the Cartesian coordinate system. Then, the joint angle vector of the robotic arm can be defined as Equation (8):  
\[\theta(t)=[\theta_{1},\theta_{2},\ldots\theta_{n}]\in R^{n} \tag{8}\]  
The end position vector of the robot arm describing the task can be defined as Equation (9):  
\[r(t)=[x_{1},x_{2},\ldots x_{n}]\in R^{m} \tag{9}\]  
Inverse kinematics is to invert the angle and angular velocity solution of each joint according to the trajectory of the end in the Cartesian coordinates. Thus, the basic task of the robot arm is defined as follows: the end of the robotic arm must achieve the required trajectory in the Cartesian coordinates; if the default trajectory is expressed as a time series, the basic task of the robotic arm can be expressed as finding the minimum value of the correct position of the end, as in Equation (10):  
\[Minimize\Big{(}r(t)-r_{ref}(t)\Big{)}^{T}\Big{(}r(t)-r_{ref}(t)\Big{)} \tag{10}\]  
Normally, the forward kinematic relation is non-linear and it is difficult to obtain the inverse analytical relation; therefore, to obtain the inverse relation, it is generally obtained by differentiation.  
\[\dot{r}(t)=J(\theta(t))\dot{\theta}(t) \tag{11}\]  
where \(J(\theta(t))\) is the Jacobian matrix, which is used to describe the velocity vector relationship between the Cartesian coordinates of the robotic arm end point and the joint angle, as shown in Equation (12).  
\[J(\theta(t))=\frac{\partial f(\theta(t))}{\partial\theta(t)} \tag{12}\]  
When the degrees of freedom of the robotic arm are the same as those required for the preset task \((n=m)\), and \(|J|\
eq 0\), then the inverse kinematics can be obtained from Equation (13), where \(J^{-1}=\frac{adj(I)}{|J|}\).  
\[\dot{\theta}(t)=J^{-1}(\theta(t))\dot{r}(t) \tag{13}\]  
When the degrees of freedom of the robotic arm are greater than the degrees of freedom required by the default task \((n>m)\), then the robotic arm is a redundant robot arm for this task. For the inverse kinematics of the robotic arm with redundant degrees of freedom, one of the particular solutions can be obtained by the Moore-Penrose pseudoinverse; when using the Moore-Penrose pseudoinverse to calculate the inverse kinematics, a particular solution can be obtained such that \(\|\dot{\theta}\|\) has a minimum at time \(t_{k}\in\Big{[}t_{0}t_{f}\Big{]}\). If \(rank[J(\theta(t_{k}))]=m\) is established at \(t_{k}\in\Big{[}t_{0}t_{f}\Big{]}\), then the pseudoinverse of the Jacobian matrix can be defined as in Equation (14):  
\[J^{+}(\theta(t_{k}))=J(\theta(t_{k}))^{T}\big{(}J(\theta(t_{k})))J\Big{(}( \theta(t_{k}))^{T}\Big{)}^{-1} \tag{14}\]  
The particular solution of the inverse kinematics can be expressed as Equation (15):  
\[\dot{\theta}(t_{k})=J^{+}(\theta(t_{k}))\dot{r}(t_{k}) \tag{15}\]  
At some time \(t_{s}\in\Big{[}t_{0},t_{f}\Big{]}\) does not fulfill \(Rank[J(\theta(t_{k}))]=m\), i.e., when \(Rank[J(\theta(t_{k}))]<m\), the robot arm is at the singularity point, and near the singularity point, the correct solutioncannot be obtained using Equation (14) because of \(\left|J(\theta(t_{s}))J(\theta(t_{s}))^{T}\right|=0\). Thus, the trajectory should be planned to avoid singularities to prevent the robotic arm from being in an odd attitude.