1 Introduction

Nasopharynx cancer, or nasopharyngeal carcinoma (NPC), is a tumor that originates in the nasopharynx, the uppermost region of the pharynx where the nasal passage and the throat join [31]. It is a common disease occurring to ethnic Chinese people living in or emigrating from southern China; it is also the eighth most frequently occurred cancer among Singaporean men [15]. Though having a relatively low lethal rate, NPC has resulted in an increasing annual number of deaths from 45,200 in 1990 to 64,900 in 2010 [13]. Generally, the development of NPC can be divided into four stages according to the area it has spread to [15]. To obtain a high salvage rate, detection, and treatment at the early stage is essential.

NPC can be detected and diagnosed via nasoendoscopy, CT scan, PET-CT scan, biopsy, and so on. Among these methods, biopsy provides the most direct and accurate diagnosis [11]. Biopsy is a procedure of collecting a sample of the suspected tissue for further examination under the microscope. Currently, transnasal biopsy is usually performed with a pair of biopsy forceps. For areas within the anterior nasal cavity, such as the anterior nasopharynx, biopsy forceps with rigid straight shafts are often used due to their ability to direct access to the target; for areas deep inside the nasal cavity such as at the posterior nasopharynx, however, flexible forceps are more frequently used since they can be bent to approach the target. Such forceps usually work together with a cable-driven flexible fiberscope (a cable-driven endoscope robot system for nasal examination can be found in [39]) by passing through the fiberscope’s working channel. Though having a good steerability at the tip, the flexible nasal endoscope cannot avoid contact with the inner floor of the nasal cavity due to gravity when advancing to the nasopharynx. As a result, there are risks of abrasion and injury to the nasal mucosa, causing significant discomfort to patients [14] or even serious bleeding and complications [17].

Continuum tubular robots (CTRs) [33, 3537, 40], also known as concentric tube robots, which are a class of flexible robots recently developed for minimally invasive surgeries (MISs), have the characteristics that exactly overcome the aforementioned drawbacks. Typically, a CTR comprises two to three concentric tubes whose diameters range from submillimeter to three millimeters. Nested one by one, each tube is independently gripped at its proximal base to rotate and translate, leading to abundant variations of the entire shape of the tubes. As such, CTRs have the capability to navigate along complex 3D paths inside the human body via small open orifices, while avoiding collision with tissues along the slender passage thanks to their relatively high rigidity.

In the last decade, possibilities of using this novel class of robotic systems in various MISs have been continuously explored, examples including intracardiac procedure [6], urology surgery [8], neurosurgery surgery [3], prostate brachytherapy [28], and intraocular procedures [37]. Recently, CTR has also been applied to transnasal surgeries. A bi-channel concentric tube robot was developed for pituitary tumor resection [2]. The robot was designed to enhance the procedure of removing the pituitary tumor after it was exposed through the manual operation of surgeons using traditional instruments. In addition, the robot was preliminarily tested on phantoms in a remote telesurgery paradigm [32]. However, since the access from the nostril to the pituitary gland is quite straight and different operations are performed, the robot does not fit the requirements of posterior nasopharyngeal procedures for which new designs of both the robot and the end-effector are necessary.

To address the preceding problem, we have developed a complete robotic system based on the continuum tubular mechanism that is customized to the transnasal nasopharyngeal biopsy. The concept of the proposed approach is shown in Fig. 1. The robot consists of two concentric tubes that are made of biocompatible materials such as stainless steel or nickel titanium alloy (in the current prototype, we use stainless steel as the material). The curvature of the tubes is determined according to the anatomic structure of the nasal cavity. A biopsy needle is specifically designed and fabricated to equip the proposed robot for transnasal biopsy. Besides, there are two significant originalities of the proposed robotic system compared with the systems reported in the literature. The first one is the compactness of our robot. The developed robot has a length of 35 cm, a diameter of 10 cm, and a weight of 2.15 kg. Because of the compactness, the robot can be easily integrated to a positioning arm, leading to facility in adjusting the relative pose between the robot and the patient, which is essential for a practical surgical scenario whereas absent in most CTRs developed to date. The second one is that we have proposed an efficient shape-sensing and reconstruction method for the robot based on three electromagnetic (EM) tracking sensors, which is more accurate than image-based methods [18, 19] and requires fewer modifications to the robot compared with Fiber Bragg Gratings-based methods [10]. With the shape-sensing ability, the shape of the robot is able to be reconstructed to facilitate the bypassing of critical tissues during the procedure, bringing less trauma to the patients.

The robot is designed to be teleoperated by a haptic input device; the tip of the inner tube follows the movement of the stylus of the master. Both preoperative images from CT scan and intraoperative images from a nasal endoscope are incorporated for navigation. Comprehensive experiments have been conducted to validate the teleoperation and shape reconstruction algorithms. Moreover, the robot has been tested through a cadaver experiment, demonstrating its effectiveness in transnasal procedures.

Fig. 1
figure 1

Illustration of the proposed continuum tubular robot for nasopharyngeal biopsy

2 Methods

2.1 Structure design

2.1.1 Overview

As previously mentioned, the robot comprises two concentric tubes, each having a rotational degree of freedom (DOF) and a translational DOF, accumulating to four DOFs in total. When the outer tube is straight, its rotation does not affect either the position or the orientation of the tip, so the robot degenerates to a 3-DOF one. Although decrease in DOF will weaken the dexterity of the robot in general, it has advantages in transnasal procedures. According to the sectional shape of the nasal cavity [27], which is mostly flat and narrow in the beginning part, rotation of a curved outer tube will increase the chance of collision between the tube and the nasal septum or conchae. Therefore, we set the outer tube to be straight for the application of nasopharyngeal biopsy. However, the robot retains the ability to actuate as many as four DOFs in case a curved outer tube needs to be used in extended applications.

Figure 2a shows the structure design of our CTR that is actuated by four DC motors (47:1 Metal Gearmotor, Pololu) with Hall sensors as the position feedback. The main parts of the robot include a cylinder casing, top and bottom covers, a swing cap, and modular carriers within the casing. The fabricated prototype is displayed in Fig. 2b.

Fig. 2
figure 2

The proposed continuum tubular robot. a 3D model. b Fabricated prototype

Fig. 3
figure 3

Detailed design of the modular carrier. a Modular carrier. b Tight stacking of modular carriers and limit switches

Fig. 4
figure 4

Compact and lightweight CTR integrated with a positioning arm for more convenient pose tuning. a Illustration of the surgery scene where the proposed robot is held by a robotic arm to perform surgery. b The prototype integrated with a passive positioning arm

2.1.2 Casing

The actuator casing is a cylinder with a diameter of 9.1 cm and a length of 25 cm. It is worth noting that these dimensions are not the overall size of the robot because there are some parts outside the casing that are not accounted for, e.g., the two motors actuating the translation of each tube. It is assumed that both tubes have the same starting point when the modular carriers are at their utmost bottom. With a casing length of 25 cm, the outer tube will be able to extend a maximum of 12 cm while the inner tube is allowed to extend up to 6 cm more from the outer tube depending on the position of the top modular carrier with respect to the bottom modular carrier. This translation limit is sufficient for the workspace requirement of transnasal procedures [2]. Detailed workspace analysis will be conducted in Sect. 2.2.

Fig. 5
figure 5

3D-printed biopsy needle for transnasal biopsy

2.1.3 Modular carriers

The design incorporates two modular carriers corresponding to the actuation of the outer tube and the inner tube, respectively. Each carrier has a shape that is slightly bigger than a semicircle (Fig. 3a) to support the concentric tubes that run through the middle of the circle. Meanwhile, the shape of the modular carrier also allows tight stacking by allowing the long, round motors to pass through without being blocked by the other modular carrier (Fig. 3b). Tight stacking is important to maximize the usage of the space inside the casing.

The inclusion of the gear system shown in Fig. 3a not only transfers the rotation of the motor shaft to the concentric tube in the middle, but also allows a tight grip on the concentric tube through the tightening of a screw on the gear bore. Translation of the modular carrier occurs when the lead screw rotates, which is controlled by the motors at the end. The flanged linear guide at the top of the modular carrier connects this linear actuator screw with the modular carrier.

For safety, limit switches (Fig. 3b) are mounted to each carrier so that the carriers will not collide with each other or with the covers of the casing.

2.1.4 Integration with a positioning arm

With a total length of 35 cm, a diameter of 10 cm, and a weight of 2.15 kg, the designed CTR is easy to be integrated with a robotic arm. A gripper is fabricated by 3D printing to hold the robot, which is then mounted onto a 5-DOF passive positioning arm. This enables the robot to be conveniently positioned to a suitable place and adjusted to the best orientation. Figure 4 simulates a transnasal procedure using the integrated system on a skull model.

2.1.5 End-effector

Although there have been plenty of off-the-shelf biopsy needles for various procedures, none of them directly fit the proposed robotic system due to mismatch in size. Therefore, a biopsy needle is specifically designed and fabricated for the transnasal robotic nasopharyngeal biopsy. The mechanism of the biopsy needle is shown in Fig. 5. It mainly comprises a slotted needle grasped by a push–pull rod and a bevel sheath rigidly attached to a sliding block. The needle and sheath are made of stainless steel, while the other parts are made of ABS by 3D printing. The sliding block is connected to the base through a spring, based on which a trigging mechanism is adopted to enable fast moving of the sheath. The length of the biopsy needle is customized to fit the length of the robot. With an outer diameter of 1.2 mm, the biopsy needle is capable of being inserted through the inner lumen of the robot and guided by the robot to reach target surgical sites. When performing biopsy, the surgeon first inserts the slotted needle into the lesion, then trigs the sliding block to make the bevel sheath cut the specimen, and lastly withdraws the needle out of the robot’s tube.

2.2 Workspace and tube parameters

Workspace is defined as a set of positions that the tip of the inner tube can reach in this paper. For CTRs, workspace varies significantly with different DOF configurations as well as the parameters of the tube pairs. For a given number of DOFs, the selection of tube parameters should consider the features of the desired workspace. In this section, we will discuss some representative cases. For simplicity, the outer tubes in the following cases are assumed to dominate the inner tubes in stiffness.

2.2.1 Workspace

Fig. 6
figure 6

Workspace comparison for 3-DOF CTR with three initial configurations. Top: all the outstretched part of the inner tube exposes; middle: the outstretched part of the inner tube is partially covered by the outer tube; bottom: the outstretched part of the inner tube is totally covered by the outer tube

The workspaces of the 3-DOF CTR with three different initial configurations are compared in Fig. 6. Calculation of the workspaces has considered the actual stroke of each tube. Since the spatial workspace is axisymmetric, we only draw the sectional profile on a plane that passes through the axis of symmetry. The planar shape of the nasal cavity that is extracted from [27] is also overlaid onto the workspaces for comparison.

As can be seen in Fig. 6, even though only the length of the outer tube differs, the workspace varies significantly. In the first configuration, the robot has a workspace that covers more at the lateral edges while less along the middle axis. The second configuration generates a workspace that distributes more evenly, evincing not only a relatively large overall workspace, but also a continuous coverage along the axis of symmetry. In the last configuration, the workspace shrinks to the middle axis and expands less area compared with the former two configurations. Among the three configurations, only the second one results in a workspace that covers the entire nasal cavity including the posterior nasopharynx, indicating that the robot is able to both navigate along the nostril passage and go deep inside the nostril cavities.

2.2.2 Tube parameters

Table 1 Parameters of the tubes

By comparing the three different cases in Fig. 6, the second configuration is adopted as the initial state of our robot. The actual parameters set in the real prototype are listed in Table 1, where \(L_{\hbox {s}}\) stands for the length of the straight section, \(L_{\hbox {c}}\) stands for the length of the curved section, R stands for the radius of the curved section, OD stands for the diameter of the outer wall, and ID stands for the diameter of the inner wall.

2.3 Sensing

2.3.1 Shape reconstruction

It is significant to know the shape of the tubes when manipulating the robot for avoiding collision with the nasal mucosa and thus reducing trauma to the patient. Although the kinematic model of the robot can provide an estimation of the shape, it is inaccurate due to deflections of parameters and unknown external forces. Therefore, much more complex modeling is required to take the deformation of the tubes into account [12]. Medical images such as 3D ultrasound images [18, 19] and MRI images [16] have been used to track the shape of a needle inserted into a human body. However, the accuracy of shape reconstruction seriously depends on the imaging quality, and the usage of the materials for the robot is subjected to the requirements of the imaging modality [26]. Fiber Bragg grating sensors have also been employed for measurement of needle shape [10], but the sensors are expensive and difficult to be mounted to the tubes. Therefore, we propose an effective and economic method to estimate the shape by attaching EM sensors (3D Guidance, Northern Digital Inc.) along the tubes, which requires few modifications to the robot. An estimation algorithm based on Bézier curve fitting is developed, while similar methods have been applied to the shape reconstruction of a cable-driven robot by our group [24, 25].

Fig. 7
figure 7

Shape reconstruction using 3-order Bézier curve fitting

As shown in Fig. 7, a continuous section of the tube can be approximated by a 3-order Bézier curve, whose shape is determined by a starting point \(P_0\), an ending point \(P_3\), and two control points \(P_1\) and \(P_2\). The curve is expressed as

$$\begin{aligned} B(t) = (1-t)^3{{P}}_0+3(1-t)^2t{P}_1+3(1-t)t^2{P}_2+t^3{P}_3 \end{aligned}$$
(1)

where \(t\in [0,1]\). By attaching two EM sensors at the ends of this section of tube, the position of \(P_0\) and \(P_3\) can be obtained. The tangent direction, denoted as unit vectors \(h_0\) and \(h_3\), is also acquirable from the EM tracking system. Then, the position of \(P_1\) and \(P_2\) can be expressed as

$${{P}}_1= {{P}}_0+{{S}}_{01}{{h}}_0$$
(2)
$$P_2= P_3-S_{23}h_3$$
(3)

where \(S_{01}\) denotes the distance from \(P_0\) to \(P_1\) and \(S_{23}\) stands for the distance from \(P_2\) to \(P_3\). The problem of shape reconstruction is then reduced to determining \(S_{01}\) and \(S_{23}\).

Let us suppose the actual length of the curve, denoted as \(L_{\hbox {a}}\), is known, which is rational since we can acquire the translation distance of the tubes. In addition, we divide the reconstructed Bézier curve into k sections, the length of the ith (\(i=1,2,\ldots ,k\)) section being \(L_{b}^i\), which can be approximated by

$$L_{b}^i \approx ||B((i)/k) - B((i-1)/k)||$$
(4)

where B((i) / k) and \(B((i-1)/k)\) can be substituted by (1). Then, we can formulate the optimization problem as

$$\begin{aligned} \mathop {\min }\limits _{{S_{01}},{S_{02}}}\, f=\left( L_{\hbox {a}}-\sum \limits _{i=1}^{k}L_{b}^i\right) ^2. \end{aligned}$$
(5)

The problem can be solved by standard nonlinear optimization algorithms. In this work, we use the Levenberg–Marquardt (LM) method to solve the problem.

Fig. 8
figure 8

Sensing by EM tracker

Fig. 9
figure 9

Navigation interface

Fig. 10
figure 10

Control framework

Figure 8 illustrates a setup in which three EM sensors are mounted to the tubes. Sensor 2 and sensor 3 are attached to the tips of the outer tube and the inner tube, respectively. Sensor 1 is bound to the outer tube at a certain distance from its tip. With this setup and the algorithm introduced above, the shapes of the inner tube and the outer tube can be reconstructed.

2.3.2 Navigation

The sensor attached to the tip of the inner tube (sensor 3 in Fig. 8) can provide the tracking information of the tip. By combining this information and preoperative medical images, a real-time image-guidance module for the system is developed.

Figure 9 shows the developed image-guidance interface, which is developed based on the Image-Guided Surgery Toolkit (IGSTK) framework provided by [7]. The interface includes a fiducial registration module, an accuracy evaluation module, and a real-time visualization module. Paired-point-based registration algorithm proposed in [9] is used to implement the registration algorithm. By appointing several points of interest in the images and measuring them after registration, the user can also evaluate the target registration error (TRE). Preoperative CT images of the patient are displayed in four views: axial, sagittal, coronal, and stereo. The location of each sectional view is determined by the position of the robot’s tip. The visualization module is constantly updated by the position information from the tracking system. Therefore, the user is able to identify the relative position of the robot’s tip with respect to the patient.

It is noted that a combination between the shape reconstruction and the navigation system is possible. The reconstructed shape is represented in the EM coordinate system, which is registered to the navigation coordinate system via a registration procedure. As a result, the reconstructed shape can be overlaid to the navigation interface. Although this combination has not been available in the current system, we envision a big feasibility to integrate this function together with collision detection ability in the improved system.

2.4 Teleoperation

Teleoperation is a common manner to control a surgical robot when performing surgery. Rather than running the robot autonomously, it is preferred to control the robot under the supervision of the surgeons for safety concerns. In our robotic system, we use an input device (Geomagic Touch Phantom, 3D Systems, Inc) as a master controller to steer the robot. The movement of the robot (slave) is mapped from the motion of the input device (master) that is manipulated by a surgeon. The framework of control is shown in Fig. 10, in which an accurate forward kinematics algorithm and an efficient differential mapping algorithm are essential. In the following, the kinematics of a general CTR system will be described while our robot, which consists of a straight outer tube and a curved inner tube, is a specific case of the general derivation.

2.4.1 Forward kinematics

A torsionally rigid model [21, 30] and a torsionally compliant model [4, 20] have been proposed for the forward kinematics of CTR. The torsionally compliant model is more accurate than the torsionally rigid one, but it is much more complicated and time-consuming due to the necessity for solving a set of differential equations given boundary values. As such, in this paper, the torsionally rigid model is used in consideration of its closed form, which brings significant simplicity and efficiency. Besides, since the robot is controlled remotely by a surgeon, the efficiency of the robot overweighs the accuracy of the robot because of the involvement of human in the loop.

Suppose the final shape of an n-tube CTR consists of m sections with each having a different constant curvature denoted as \(u_i= [{u}_{ix},{u}_{iy},{u}_{iz}]\) (\(i=1,2,\ldots ,m\)) (see Fig. 11). Let \(\bar{u}_j^i\) represent the initial curvature of the jth tube at section i. We have [21],

$$\begin{aligned} u_i=\left( \sum _{j=1}^n K_j\right) ^{-1}\sum _{j=1}^n R_z\left( \theta _j\right) K_j\bar{u}_j^i \end{aligned}$$
(6)

where \(\theta _j\) is the rotation angle of the jth tube, \(K_j= diag(E_{jx}I_{jx}, E_{jy}I_{jy}, G_{jz}J_{jz})\) is the stiffness matrix (here, E is the Young’s modulus, I is the area moment of inertia, G is the shear modulus, and J is the polar moment of inertia), and \(R_z()\) means rotation about the Z-axis. Note that for some sections, only part of the n tubes get involved. In this case, we just need to set \(K_j=0\) for the uninvolved tubes and (6) still applies.

Fig. 11
figure 11

Definition of parameters

For a circular arc with curvature \(u_i\) and length \(s_i\), the transformation from its proximal base to the distal end can be expressed by a transformation matrix

$$\begin{aligned} g_i(u_i, s_i)={\exp }\left( \hat{\xi }_i s_i\right) \end{aligned}$$
(7)

where \(\hat{\xi }_i=\left[ \begin{array}{ll} \hat{u}_i &{} v_i\\ 0 &{} 0 \end{array}\right]\) (here \(\hat{u}_i\) is the skew-symmetric matrix of \(u_i\), and \(v_i=\left[ 0\;\;0\;\;1\right] ^T\)), and \(\exp ()\) means exponential mapping [23]. Hence, a chain multiplication rule can be applied to the concatenation of multiple sections. As a result, the position and orientation of the distal tip represented by a transformation matrix g can be obtained by

$$\begin{aligned} g=\prod _{i=1}^m g_i(u_i, s_i). \end{aligned}$$
(8)

2.4.2 6D differential mapping

Under the assumption of fully torsional rigidness, the general inverse kinematics of the CTR can be solved numerically based on Jacobian matrix, which will be derived next by using Lie group theory.

According to [23], the spatial velocity twist \(\xi ^s = \left[ (\omega ^s)^T,(v^s)^T\right] ^T\) at the tip of the robot is defined as

$$\begin{aligned} \xi ^s=\left( \dot{g}g^{-1}\right) ^\vee \end{aligned}$$
(9)

where \(()^\vee\) means to extract the \(6 \times 1\) twist coordinate from a \(4 \times 4\) twist matrix. In regard to the inverse kinematics, the instantaneous differential of g can be replaced by the difference between the target transformation \(g_{\hbox {t}}\) and the current transformation \(g_{\hbox {c}}\), i.e.,

$$\begin{aligned} \xi ^s=\left( {\Delta } gg^{-1}\right) ^\vee = \left( (g_{\hbox {t}} - g_{\hbox {c}})g_{\hbox {c}}^{-1}\right) ^\vee . \end{aligned}$$
(10)

If \(g_{\hbox {t}}g_{\hbox {c}}^{-1}\) is in the neighborhood of the identity, Eq. (10) can be further approximated by [34, 38]

$$\begin{aligned} \xi ^s = (\log (g_{\hbox {t}}g_{\hbox {c}}^{-1}))^\vee \end{aligned}$$
(11)

where \(\log ()\) logarithmically maps a transformation matrix to its twist matrix.

On the other hand, the relationship between the spatial velocity twist and the joint speed can be expressed by

$$\begin{aligned} \xi ^s=J\dot{q} \end{aligned}$$
(12)

where J is called the Jacobian matrix and \(\dot{q}=\left[ \dot{\theta }_1,\dot{l}_1,\dot{\theta }_2,\dot{l}_2,\ldots ,\dot{\theta }_n,\dot{l}_n\right]\) is the joint speed. Similarly, as regards the inverse kinematics, \(\dot{q}\) should be replaced by \({\Delta } q\) which is the variation of the joints.

Using adjoint transformation, we have

$$\begin{aligned} & \xi ^s & =\left( \dot{g}_1 g_1^{-1}\right) ^\vee +Ad_{g_1}\left( \dot{g_2}g_2^{-1}\right) ^\vee +\cdots +Ad_{g_1 g_2 \ldots g_{m-1}}\left( {\dot{g}}_m g_m^{-1}\right) ^\vee \end{aligned}$$
(13)

where

$$\begin{aligned} \left( \dot{g_i}g_i^{-1}\right) ^\vee =A_i\dot{\xi }_i+\xi _i\dot{s}_i=A_i \sum _{j=1}^n \frac{\partial \xi _i}{\partial \theta _j} \dot{\theta }_j+\xi _i \sum _{j=1}^{n} \frac{\partial s_i}{\partial l_j} \dot{l}_j. \end{aligned}$$
(14)

Here, \(A_i\) is given by [34, 38]

$$\begin{aligned} {A_i}&= {} {s_i}I + \frac{{4 - {\vartheta _i}\sin \left( {{\vartheta _i}} \right) - 4\cos \left( {{\vartheta _i}} \right) }}{{2{{\left\| {{u_i}} \right\| }^2}}}{{\Omega } _i} \nonumber \\&+ \frac{{4{\vartheta _i} - 5\sin \left( {{\vartheta _i}} \right) + {\theta _i}\cos \left( {{\vartheta _i}} \right) }}{{2{{\left\| {{u_i}} \right\| }^3}}}{\Omega } _i^2 \nonumber \\&+ \frac{{2 - {\vartheta _i}\sin \left( {{\vartheta _i}} \right) - 2\cos \left( {{\vartheta _i}} \right) }}{{2{{\left\| {{u_i}} \right\| }^4}}}{\Omega } _i^3\nonumber \\&+ \frac{{2{\vartheta _i} - 3\sin \left( {{\vartheta _i}} \right) + {\theta _i}\cos \left( {{\vartheta _i}} \right) }}{{2{{\left\| {{u_i}} \right\| }^5}}}{\Omega } _i^4 \end{aligned}$$
(15)

where

$$\begin{aligned} {{\Omega } _i}&= {} \left[ {\begin{array}{*{20}{c}} {{{\hat{u}}_i}}&{}0\\ {{{\hat{v}}_i}}&{}{{{\hat{u}}_i}} \end{array}} \right] \end{aligned}$$
(16)
$$\begin{aligned} {\vartheta _i}&= {} \left\| {{u_i}} \right\| {s_i}. \end{aligned}$$
(17)

By defining

$$\begin{aligned} b_j^i&= {} \frac{\partial \xi _i}{\partial \theta _j} \end{aligned}$$
(18)
$$\begin{aligned} c_j^i&= {} \frac{\partial s_i}{\partial _j}, \end{aligned}$$
(19)

combining (13)–(19), and comparing with (12), we have

$$\begin{aligned} J = \left[ J_1,J_2,\ldots ,J_n\right] \end{aligned}$$
(20)

where

$$\begin{aligned} J_j= \left[ \sum _{i=1}^{m}Ad_{g_1g_2\ldots g_{i-1}}A_i b_j^i,\sum _{i=1}^{m}Ad_{g_1g_2\ldots g_{i-1}} \xi _ic_j^i\right] . \end{aligned}$$
(21)

Based on the Jacobian matrix, the inverse kinematics can be solved through an iterative procedure given an initial estimation and an updating rule. If the Jacobian matrix is full rank, the updating rule can be simply

$$\begin{aligned} q_{k+1} = q_k + {\Delta } q = q_k + J^{-1} \xi ^s \end{aligned}$$
(22)

which is the Gauss–Newton method. Otherwise, the robot is redundant, i.e., the column rank of J is greater than the row rank, then the updating rule can be [22]

$$\begin{aligned} q_{k+1} = q_k + {\Delta } q = q_k + J^\dagger \xi ^s + (I - J^\dagger J) \triangledown H \end{aligned}$$
(23)

where \(J^\dagger\) is the pseudo-inverse of J and H is a constraint function that can be constructed according to the optimization objective. The last item projects the gradient of H to the null space of J so that Eq. (12) is not violated. To overcome the possible singularity of the Jacobian matrix, an alternative damped least-squares updating rule [29] (substantially the Levenberg–Marquardt method) can be adopted as

$$\begin{aligned} q_{k+1} = q_k + (J^T J +\alpha _1^2 I + \alpha _2^2 W)^{-1}(J^T \xi ^s +\alpha _1 \triangledown H) \end{aligned}$$
(24)

where W is a symmetric positive definite weight matrix and \(\alpha _1\) and \(\alpha _2\) are two scaling factors.

2.4.3 3D position differential mapping

As the robot has no more than four DOFs, only the position of the distal tip of the tubular robot is to be controlled. Therefore, a slight change has to be made to the Jacobian matrix derived in Sect. 2.4.2. Let \(P_T\) be the coordinate of a point measured in the tool frame {T}. It is expressed in the base frame as

$$\begin{aligned} \left[ \begin{matrix} {{{P}}_{B}} \\ 1 \\ \end{matrix} \right] =g\left[ \begin{matrix} {{{P}}_{T}} \\ 1 \\ \end{matrix} \right] . \end{aligned}$$
(25)

The deviation of \(P_B\) can be derived as [34]

$$\begin{aligned} {\Delta } P_B = \left[ -\hat{P}_B,I \right] \xi ^s = \left[ -\hat{P}_B,I \right] J{\Delta } q. \end{aligned}$$
(26)

Let us define \(K = \left[ -\hat{P}_B,I \right] J\), and K is called the teleoperation Jacobian matrix.

Similar to the inverse kinematics, the Jacobian-based teleoperation algorithm can be implemented in an iterative way as well. However, to achieve real-time control, the target position should be updated dynamically in every iteration step rather than remaining the same until it is reached. Suppose \(P_M^{k}\) be the position of the master sampled at the kth iteration step, \({\Delta } P_M^{k} = P_M^{k} - P_M^{k-1}\) is the incremental movement of the master. The desired motion of the slave \({\Delta } P_S^k\) can be obtained by an affine transformation carried on \({\Delta } P_M^k\), such as a rigid transformation with scaling. Then, the necessary motion of each joint is determined by

$$\begin{aligned} {\Delta } q_S^k = K^\dagger {\Delta } P_S^k \end{aligned}$$
(27)

which is the solution with the minimum norm. Alternatively, the updating rules suggested in (23) or (24) can be employed.

3 Results

In this section, we will present two independent experiments to validate the teleoperation and shape reconstruction methods, respectively. Then, we will show the results of a cadaver experiment which demonstrates the feasibility and effectiveness of the proposed robot system.

3.1 Experiment I: teleoperation

Fig. 12
figure 12

Teleoperating the robot to follow a linear path and a circular path

Fig. 13
figure 13

Accuracy of the robot following the predefined paths. a Linear path: mean error: 2.20 mm; standard deviation: 1.03 mm. b Circular path: mean error: 2.01 mm; standard deviation: 0.88 mm

Fig. 14
figure 14

Trajectories of the robot tip (slave) and the haptic device input (master). a X-Axis direction. b Y-Axis direction. c Z-Axis direction

To validate the proposed teleoperation algorithm, two groups of experiments were conducted. The first group was to teleoperate the robot using a Geomagic Touch Phantom to follow a linear path and a circular path on a plate, as shown in Fig. 12. The control algorithm was implemented by using C++ on a 32-bit Windows XP system with a 3.3 GHz processor and 3.2 GB RAM. When following the linear path, the plate was placed in front of the robot with its normal roughly parallel to the axis of the outer tube; when following the circular path, the plate was put at the side of the tubes. Thus, the two paths are representative in the workspace of the robot. Several evenly distributed points were marked along the paths. When the robot reached these points, the position of the master was recorded from the controller of the haptic device, and the results are depicted in Fig. 13. The slave position that is represented by empty circles and the master position that is represented by solid circles are aligned by using the point-based registration algorithm proposed in [9]. It is clear that the proposed teleoperation algorithm based on the torsional rigid model achieves good tracking accuracy, with a mean error of 2.20 mm when following a linear path, and a mean error of 2.01 mm when following a circular path.

The second group of experiments were to investigate the efficiency of the teleoperation algorithm. In this group, we recorded the actual trajectory of the master read from the controller of the haptic device and the trajectory of the robot tip calculated based on the encoder position of each motor and the kinematics model with respect to time. The efficiency of the robot following the trajectory of the master was shown in Fig. 14, where the master trajectory is represented by red solid line and the robot tip trajectory is represented by blue dashed line. It can be seen that in all the three directions, the robot can follow the master input within 0.1s (the time lag between the master trajectory and the slave trajectory with the same coordinate position), which accounts for both the calculation time of the algorithm and the response time of the transmission mechanism.

3.2 Experiment II: shape reconstruction

We also carried out a group of experiments to demonstrate the proposed shape reconstruction algorithm. As seen in Fig. 15, a pair of tubes were used to form two sections of curves, and three EM coils were attached to the ends of each section (the two sections share the same sensor at their connecting point). The tubes were laid on a graph paper so that the shape of the tubes can be measured.

When changing the length of the inner tube that extended out of the outer tube, the entire tubes represent different shapes. Based on the tracked position and orientation of the sensors, we reconstructed the entire shape of the tubes under six different configurations and compared the results with the drawn shapes on the graph paper. The results are shown in Fig. 16, where the green and red solid lines represent the reconstructed shapes, and the blue and cyan dashed lines represent the measured shapes. To numerically indicate the shape reconstruction accuracy, we sample the measured shape of the tubes with a interval of 10 mm along the length of the tubes starting from the position of sensor 1 and then find the closest point on the reconstructed shape to each sampled point on the measured shape. The errors between the two sets of points are statistically compared; the results are listed in Table 2. It can be seen that the reconstructed shape well fits the real shape, with a mean error approximating 1 mm along the length of the tubes in each configuration shown in Fig. 16. This proves that the proposed shape reconstruction algorithm is capable of estimating the real shape of the tubes during operations.

Fig. 15
figure 15

Setup of the shape reconstruction experiments

Fig. 16
figure 16

Results of the shape reconstruction experiments

Table 2 Errors between the reconstructed shapes and the measured shapes

3.3 Experiment III: cadaver experiment

Fig. 17
figure 17

Cadaver experiment setup

Fig. 18
figure 18

The cadaver experiment using the proposed robot to perform a transnasal biopsy procedure

Last, we tested our robotic system on a cadaver experiment. The aim of the experiments was to validate the feasibility of the proposed system and methods in transnasal robotic nasopharyngeal biopsy. The setup of the experiment is shown in Fig. 17. The robot was mounted on a passive arm whose pose was manually adjusted before the robot was manipulated. A surgeon operated a master input device to telemanipulate the robot. The aforementioned navigation system (not shown in the figure due to limited scope of the camera) was integrated to track the position of the robot. In addition, an endoscope was inserted into the nasal cavity to provide a direct visual feedback. After delivering the robot to the target site, the surgeon inserted the biopsy needle into the lumen of the tubes, extended it to reach the target, performed biopsy by operating the push–pull rod of the needle, and then retracted the needle and the tubes out of the nasal cavity.

Figure 18 displays the biopsy procedure using the proposed robotic system. The first row shows the process of delivering the robot to the target position; the second row demonstrates the biopsy operation using the biopsy needle; and the last row displays the process of retracting the robot out of the transnasal passage. The edges of the tube are marked in order to enhance the legibility of the figure. It can be observed that the robot successfully reached the target through a curved path without collision with the nasal wall, and the biopsy needle was capable of being penetrated into the lesion.

4 Discussion

The three groups of experiments have validated the efficacy of our robotic system to be used in a transnasal nasopharyngeal biopsy. The results of the teleoperation experiments show that the system has a mean error of 2.20 mm and 2.01 mm when following a linear path and a circular path, respectively, which is sufficient for the biopsy procedure since biopsy imposes relatively loose requirements on the accuracy of location in general (<5 mm for standard forensic biopsies and 2 mm for scientific purposes) [5]. Besides, since the robot works in a teleoperation mode, the accuracy will be guaranteed by incorporation of a navigation system and involvement of human in the loop in a real surgical scenario. The teleoperation system has also been proved to have a lag time no more than 0.1 s, which ensures the robot to response promptly to the intention of the surgeon, leading to intuitive and safe operations. Moreover, the shape reconstruction method proposed in this paper provides an economic and accurate real-time estimation of the shape of the tubes, which is significant because we can use this information, together with the navigation system and the relative rigidity of the tubes, to assist the operation of the surgeon to avoid collision between the robot and the nasal mucosa. Having this unique capability makes the proposed robotic system surpass other systems that rely on flexible endoscopes in terms of less risks of trauma to patients.

The cadaver experiment has further demonstrated the feasibility of the system to be applied to a real nasopharyngeal biopsy procedure. During the experiment, the surgeon succeeded in operating the haptic input device to steer the movement of the robot until its tip reached the target site. Then, another surgeon implemented the biopsy using our specially designed biopsy needle. The whole procedure, costing less than five minutes, was fluent and successful. However, during the experiment, we found the sampled tissue was not sufficient for the requirement of medical examination. The reason was that the slot of the prototype biopsy needle was not deep enough and the tip of the outer sheath had limited sharpness. This would not be a problem after improvement of the fabrication of biopsy needle.

Despite the significant progress that has been achieved in the development of the current prototype, further enhancements of the system are necessary to make it applied to clinical procedures in the operating room. First, combination of the reconstructed shape and the navigation interface will be integrated to our system, based on which a collision detection algorithm will be developed to enhance the safety during the surgeon’s operation. Second, sterilization issues will be addressed. Actually, Ref. [1] has provided a good example attempting to solve the sterilization problem of the CTR for intracerebral hemorrhage evacuation, based on which it can be further investigated for the application of nasopharyngeal biopsy. Last but not least, possibilities of this design being applied to other transnasal procedures will be explored since this mechanism shows great promises. Different instruments such as micro-forceps and scissors could be equipped to the robot in these procedures, as long as the size of the instrument suits the inner diameter of the tubes’ lumen.

5 Conclusion

This paper has presented the design of a compact and portable continuum tubular robot aiming at transnasal procedures. Having a length of 35 cm, a diameter of 10 cm, and a weight of 2.15 kg, the robot can be conveniently integrated with a positioning arm to achieve more convenient pose tuning. Structural design, end-effector design, and workspace analysis were discussed in detail. In addition, teleoperation of the CTR using a haptic input device was developed for position control in 3D space. Moreover, based on an EM tracking system that was integrated with the robot, a navigation system that is able to incorporate the proposed shape reconstruction algorithm has been developed. Ample experiments were conducted to test the ability of the proposed prototype. Results showed that the teleoperation system had an accuracy of 2.20 mm in following a linear path, an accuracy of 2.01 mm in following a circular path, and a lag time of 0.1 s. It was also found that the proposed shape reconstruction algorithm had a mean error of around 1 mm along the length of the tubes. Besides, the feasibility and effectiveness of applying the proposed robot to transnasal procedures were demonstrated by a cadaver experiment. The proposed robotic system holds promise to enhance clinical operation in transnasal procedures.