## 3 The 3D Motion-Planning Algorithm
### The 3D Intraoperative Motion Planner
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline  & & & & & & & & & \\ \cline{2-8}
**Target Point** & \multicolumn{4}{c}{**Preoperative Path Tracking**} & \multicolumn{4}{c}{**Intraoperative Path Tracking**} \\ \cline{2-8}  & **Mean** & **STD** & **Max** & **Target** & **Mean** & **STD** & **Max** & **Target** \\ \hline Point 1 & 4.379 & 1.470 & 1.062 & 4.864 & 0.005 & 0.015 & 0.106 & 0.106 \\ Point 2 & 3.709 & 1.281 & 0.865 & 3.998 & 0.005 & 0.014 & 0.104 & 0.104 \\ Point 3 & 3.495 & 1.215 & 0.846 & 4.131 & 0.004 & 0.009 & 0.068 & 0.068 \\ Overall Results & 3.861 & 1.322 & 0.924 & 4.331 & 0.005 & 0.013 & 0.093 & 0.093 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Trajectory-following results of the cases with/without intraoperative motion planning algorithm. The above evaluation indicates that the optimal control algorithm, which consists of a full-state space controller and an intraoperative motion planner, not only has superior positioning accuracy in dynamic environments, but is also considerably safer for patients than the conventional needle-steering algorithm. ## 6 Conclusions

Herein, we presented our research on the optimal control of a CCS needle. Based on the concept of projected steering offset, a 3D kinematic model of a CCS needle was formulated using the Euler angle presentation. A static motion planner was derived from the goal-biased RRT* algorithm, an optimization function was defined for improving steering safety and efficiency, and the best trajectory was selected using the optimization function in the preoperative stage. In addition, an intraoperative motion-planning algorithm was proposed to update the optimal trajectory in dynamic environments. To compute the control input directly, the kinematics was converted into chain form, and a state space controller was used to accurately track the desired trajectory. A simulation system was built to demonstrate the superiority of the optimal control algorithm, the parameters of the motion planner and state space controller were optimized, and a steering test was conducted in regard to a dynamic system with moving obstacles. The resulting target points indicated that the proposed optimal controller was adequate for steering the CCS needle. Although the simulation results are promising, an experimental demonstration of the optimal control algorithm for CCS needle steering is underway. A real-time ultrasound-sensing module can be used in real settings; several brief experiments can be conducted with the acquisition of the feedback signal from an ultrasound device. Torsional deformation along the needle shaft was ignored in this work, and a compensation algorithm is required to improve the shaft rotation accuracy. The modeling of dynamic environments needs to be explored further. The environment relevant to a specific intervention surgery will be built using the scanning data on the tissue at the lesion site. After ex vivo demonstration of the steering algorithm, the steering system will be implemented in a clinical application. Figure 9: (a) Trajectory-following result without intraoperative path planning algorithm. (b) Trajectory-following result with intraoperative path planning algorithm. **Author Contributions:** Conceptualization, C.Z. and S.Y.K. ; methodology, B.X. ; software, B.X. ; validation, B.X. ; formal analysis, B.X. ; writing--original draft preparation, B.X. ; writing--review and editing, B.X. and S.Y.K. ; supervision, C.Z. and S.Y.K. ; funding acquisition, B.X. All authors have read and agreed to the published version of the manuscript. **Funding:** This research was supported by the \"Pioneer\" and \"Leading Goose\" R&D Program of Zhejiang (Grant No. 2024C03038). **Institutional Review Board Statement:** Not applicable. **Informed Consent Statement:** Not applicable. **Data Availability Statement:** The data presented in this study are available on request from the corresponding author.