## 1 Introduction
Compared to other methods, this neural network-based path planning model can be generalized easily for different anatomies. In [22], this model was extended using an inverse reinforcement learning-based approach to ensure that it could react to dynamic environments. Although the effectiveness of the underlying neural network was demonstrated, the accuracy of this model relied heavily on the training data, and normally these data are not adequately accurate for use in clinical settings. In terms of planners based on random sampling, [PERSON] et al. [23] used a rapidly exploring random tree star (RRT*) algorithm for 3D path planning. This algorithm considered both the kinematic constraints of a magnetic steerable needle and the anatomical constraints of patients. [PERSON] et al. [24] proposed a GHRG-RRTs algorithm, consisting of a greedy heuristic strategy and a reachability-guided strategy, to be applied to an active flexible needle. [PERSON] et al. [25] used the RRT algorithm for path planning as well, where they redefined the random searching space by using kinematics and employed an evolutionary optimization procedure for trajectory optimization. However, these three algorithms did not consider the dynamism of the environment. For intraoperative path replanning, three types of replanning strategies were introduced in [6], but the simulation results were not promising. Owing to the dynamic nature of the operating environment, an online path was deformed by an extended bubble bending method in [26], and the deformed path was smoothed using a convex optimization method. This method required discretization  
Figure 1: Schematic design of the CCS level-tip needle, with a tip coordinate system (in blue) and a world coordinate system (in black). of the path into a succession of 3D points, but as the number of bubbles increased, the computation time increased. When the information on a planned trajectory is available, a real-time feedback controller is required to track the path accurately. [PERSON] et al. [27] applied the classic proportional-integral-derivative (PID) control algorithm to steer a magnetic guidewire, but with a PID controller, the tuning control gain is problematic. [PERSON] et al. [28] presented a linear quadratic Gaussian (LQG) controller for level-tip needle control in 3D space, but its dynamic response to external disturbances was not appropriate. [PERSON] et al. [29] developed a nonlinear dynamic feedback controller to track the 3D path of a programmable needle. [PERSON] et al. [30] proposed a nonlinear error equation with the proper control gains; the time derivative of the Lyapunov-like function proved to be negative semi-definite. [PERSON] et al. [31] adopted a nonlinear guidance law as the high-level controller for tracking the path of a steerable needle and proposed an active disturbance rejection control scheme to manage needle-tissue interactions. The designs of the aforementioned nonlinear systems are rather complex. [PERSON] et al. [32] implemented a full-state feedback controller with an approximately linearized control system, but they focused only on following planar trajectories. In the present work, an optimal control system consisting of an intraoperative motion planner and a feedback controller is proposed for steering a CCS needle in 3D space. The contributions of this work are as follows: the curvature of the planned trajectory is within a specific range, where the duty cycle control strategy proposed in [11] can be avoided, and the safety of intervention surgery can be improved. Compared to the conventional RRT algorithm, the proposed planning algorithm has fewer nodes and a lower cost. In physical terms, it requires a smaller rational angle. Rather than devising a completely new trajectory, the intraoperative motion planner uses the information on the best trajectory from the last round and optimizes it iteratively. The high similarity between the existing and iteratively optimized trajectories can reduce the computational cost of the algorithm.