# Solving the Time-Varying Inverse Kinematics Problem for the Da Vinci Surgical Robot
## Example Analysis and Discussion
### Discussion of the Solution  
As noted in the previous section, the main focus of the solution includes the solution accuracy, real-time performance (solution speed) and the singularity problem (based on the joint position solution or not).  
Figure 5: Simulation results: (**a**) simulation in Adams, (**b**) end position comparison between target and our result, (**c**) the end orientation (Euler angles) comparison between target and our result.  
1. Solution accuracy  
Table 2 shows that for any input joint parameter, whether an integer or a decimal value accurate to nine decimal places, the error between the calculated values (output) and the given values (input) of six joint parameters of the slave manipulator is within 0.00004 degree (or mm), which demonstrates that the proposed approach for the Da Vinci surgical robot inverse kinematics is capable of finding effective solutions with high accuracy.
2. Solution speed  
The number of calculation steps of the algorithm/program is one of the influential factors that affect the solution speed. As schematically shown in Figure 3, the number of steps of the inverse kinematics approach proposed in this paper depends mainly on two factors:  
1. The number of Newton iterations in the best-case scenario, the numerical solution can be obtained by one iteration when the initial value is perfectly selected. In general, if the given initial value ensures convergence, then the solution of \(F(\mathbf{x}_{1})=0\) is expected to take approximate 20 iterations; in cases where the convergence fails, the program is designed to iterate at most 50 times and then exit to avoid a dead loop.
2. The step size. when the step size \(h\) is large, the iteration times are reduced, thereby shorten the calculation time. However, the selection of initial values will be relatively imprecise, resulting in higher possibility of solution failure due to unreasonable initial values. In cases where the step size is small, the initial values tend to be more precise, resulting in a greater possibility of obtaining a solution. However, the resulting shortcoming is the demand for more calculation steps and longer time.  
An improved calculation process is proposed by taking both factors into account: first, start the procedure by following the flow chart shown in Figure 3 with a relatively large step size; second, reduce the step size gradually for more precise initial values if the equation has no solution. This approach boosts the speed of calculation but also reduces the possibility of solution failure.
3. Singularity influences  
Our method abandons the use of Jacobian matrix inversion. Therefore, there will be barely no singular solution in the condition of a good initial value from a mathematical perspective. On the other hand, because our algorithm is based on the position increment of the manipulator's joints, Then, the motion joint position trajectory is generated by interpolation based on the initial joint position and the end joint position. The joint position interpolation is not affected by the singularity.