## 4 Path Generator Solving for Inverse Kinematics
### Optimization Method with Sequential Quadratic Programming  
This paper employs SQP to solve the complex inverse kinematic model with joint limits. This algorithm numerically searches for the optimal solution of the robot arm configuration corresponding to the desired position and orientation of the end-effector. The objective function is the minimization of the norm of the six-DoF errors between the desired position and orientation and the calculated values from the forward kinematic model. The constraint is the mechanical actuation limits. The objective function and the constraints can be described as Equation (11). The position and orientation errors are nondimensionalized, with division by 1 mm and 1\({}^{\circ}\), respectively, used to calculate the six-DoF error norm. Each step finds the converged solution with iteration, and the initial value of each step is obtained from the solution in the previous step. In each step, wire-driven actuation values are calculated from the optimal solution of inverse kinematics of arm configuration through the wire-driven model. An open-loop control process with the optimization path generator is shown as a block diagram in Figure 10. The computation time for each step due to iteration is a critical issue in  
Figure 9: Distal section views of robotic arm and wire assignment. this approach. The computing power of the controller should be considered to implement this method. Equation (11) is  
\[ \begin{split}\underset{\theta_{1},\theta_{2},\theta_{3},\theta_{4}, \gamma,\psi}{\text{min.}}&\sqrt{e_{x}^{2}+e_{y}^{2}+e_{z}^{2}+e_{ roll}^{2}+e_{pitch}^{2}+e_{yaw}^{2}}\\ \text{subject to}&-45^{\circ}<\theta_{1}<45^{\circ}\\ &-45^{\circ}<\theta_{2}<45^{\circ}\\ &-90^{\circ}<\theta_{3}<90^{\circ}\\ &-90^{\circ}<\theta_{4}<90^{\circ}\\ &-50\,mm<\gamma<50\,mm\\ &-180^{\circ}<\psi<180^{\circ}\\ \end{split} . \tag{11}\]  
The proposed path generator with the optimization algorithm was tested with the motion of the robot arm. Suturing tasks are the most important missions of this robot. The desired position and orientation were generated and recorded by surgeons to simulate the motions of suturing using an Omega 6 haptic master device (Force Dimension, Switzerland). This study sampled one of the most knotty paths to implement from several trajectories, as shown in Figure 11. The path generator calculates the joint angles, translation stroke, and rotation angle by solving for the inverse kinematics, as shown in Figure 12. The computation loop time is fixed as 10 ms. These actuation values are used in the forward kinematics, and the error of the path generator can be derived as shown in Figure 13. The error increased dramatically at around 120 s. However, this result was not due to inferior performance from the optimization path generator and showed that the constraint logic works well. There were mechanical limitations to the robot arm, and the range of actuation was bounded by the constraint logic. At one point, the master device generated a position and orientation that the robot arm could not reach. This happened occasionally in real-time teleoperation with a human operator. In this case, one of the proximal joint angles \(\theta_{2}\) was well-bounded, as shown in Figure 12a. When the reference distance and angle were 1 mm and \(1^{\circ}\), respectively, the six-DoF position and orientation errors could be nondimensionalized. The mean squared error (MSE) was 0.036 within 100 s before the constraint logic started to operate. This value is an acceptable precision for the teleoperation of surgery. Finally, the driving wire length for the calculated joint bending angles was generated, as shown in Figure 14. At an operating loop time of 10 ms, the operators who tested the robot did not feel any delays. However, this computation time may not be enough to implement additional features such as a validity check of the actuation value within smooth motion for safe operation and feedforward tension compensation to avoid hysteresis.