A New Approach for Solving the Inverse Kinematics of Continuum Robot Based on Piecewise Constant Curvature Model

: The inverse kinematics of continuum robot is an important factor to guarantee the motion accuracy. How to construct a concise inverse kinematics model is very essential for the motion control of continuum robot. In this paper, a new method for solving the inverse kinematics of continuum robot is proposed based on the geometric and numerical method. Assumed that the deformation of the continuum robot is Piecewise Constant Curvature model (PCC), the envelope surface of the continuum robot based on single-segment is modeled and calculated. The clustering method is used to calculate the intersection of the curves. Then, a distinct sequence is designed for solving the inverse kinematics of continuum robot, and it is also suitable for the multi-segment continuum robots in space. Finally, the accuracy of the inverse kinematics algorithm is verified by the simulation and numerical experiment. The experiment results illustrate that this algorithm is with higher accuracy compared with the Jacobian iterative algorithm.


Introduction 12
Continuum robot is a new type of bionic robot with a continuous backbone without joints [1]. Compared with traditional rigid discrete robots, it can change its shape flexibly according to environmental obstacles and has strong adaptability to small environments and unstructured spaces [2,3]. Continuum robots have been used in exploration [4], medicine [5], rescue [6] and other fields [7][8][9]. As a kind of hyper redundant robot, modeling and solving the inverse kinematics of continuum robots proves to be a very interesting and challenging problem. Geometric [10] and mechanical [11] methods are widely applied in the modeling of continuum robots. Chen [12] used quadratic Bezier curve to establish the continuum robot model and sensor data is used to compensate error. Chirikjian [13] and Agrawal [14] link the shape of a particular mathematical curve to a high-degree-of-freedom (DOF) robot. Another approach is choosing an arc which closely matches the kinematics of continuum robots, due to the equal distribution of forces inherent in the design of continuum robot [5]. And the Piecewise Constant Curvature (PCC) model is also carried out by Bryan A. Jones [15] under this assumption, an assumption also made throughout this paper. Closed position and velocity kinematics [16] are also established on account of PCC model. Based on the PCC model, Zheng Li [17] used screw to build continuum robot kinematics model and solve its workspace. Tobias Mahl [18] and Sears [19] constructed Variable Constant Curvature (VCC) model for continuum robot with variable curvature, which divides each joint into multiple segments.
The traditional method of solving the inverse kinematics of continuum robot is the generalized inverse method [20,21]. The continuum robot is transformed into rigid body model and solved by iteration of Jacobian inverse matrix. But non-convergence and singularities are also inevitable through this method. Neural network [22][23][24] is also used to solve the inverse solution of continuum robot, which is also widely used for control and modeling of continuum robots. However, excessive calculation may be existed due to the large training set when the robot has many degrees of freedom. Another method is to establish the model according to the geometric relationship, and the inverse kinematics can be solved by numerical iteration, which is also applied in this paper. Williams [25] and Svenja [26] analogized the movement of a snake's tail following the head's trajectory, and proposed a follow theleader (FTL) heuristic algorithm for hyper redundant robot. Sinivas [27] proposed a geometric algorithm to get closedform inverse kinematics of multi-continuum robot. Based on PCC model, Underwater soft manipulator designed by Zheyuan Gong [28] which applied the reverse constant ·3· curvature model to get the inverse kinematics. However, few types of robots are suitable for this algorithm due to the limitation of the algorithm.
Combined with geometrical and numerical, a new approach for solving the inverse kinematics of continuum robot is proposed in this paper. Based on the PCC model, geometrical method is used to build the model of continuum robot in Section 2. Furthermore, a distinct algorithm is proposed in Section 3 through geometrical and numerical. The algorithm has a wide range of applicability, which is fitted for multi-segment continuum robots and continuum robots in space. Finally, the effectiveness and accuracy of the algorithm are verified by numerical experiments and simulation in Section 4.

Model assumptions of continuum robot
For the sake of analysis, the compliant deformation of a continuum robot can be decomposed into a constitution of many linkage motions. In order to emerge the movement adaptability of continuum robot veritably, spherical hinge is used to construct the model instead of Hooke, rolling pairs or twin-pivot joint [29,30]. A schematic diagram of twosegment continuum robot is shown in Figure 1 (a). Based on Piecewise Constant Curvature model (PCC), regardless of the shape of the robot's own joints and the area of the cross-section, the kinematics configuration of continuum robot can be described by the geometry of a finite arc.
The relationship between configuration parameters of continuum robot and single joint is illustrated in Figure 1 (b). The length of a single segment of continuum robot with n joint is l. Based on the PCC model, the bending angle is α, and the direction angle is θ. It is assumed that the rotation angle of each joint is identical, the specific relationship of configuration parameters is shown in Eq. (1). When the number of joints of a single segment continuum robot is 8 and the bending angle range is less than π/2, the relative error of the length of the single segment continuum robot is less than 0.3%. Therefore, for the purpose of simplify the model, it is considered that the length of a single segment continuum robot remains unchanged.  (2) Continuum robot is tangent continuous and no sudden change of curvature.
(3) Continuum robot has no distortion on the Z axis. (4) The influence of external loads on the shape of continuum robot is not considered.

Envelope line/surface of single-segment continuum robot
A schematic diagram of a single-segment continuum robot is shown in Figure 2. According to the geometric continuity, the parameter equations of continuum robot can be derived as Eq. (2) and Eq. (3).
According to the geometric relationship, the envelope line/ surface of continuum robot can be drawn. If the starting point of the robot is known to be at point A, the tip point B must be on the envelope/surface shown in Figure 2 below, and vice versa. By solving the intersection of two or more envelopes, inverse kinematics of continuum robot can be further obtained. The coordinate transformation of continuum robot in space and on the plane is illustrated in Figure 3. Through coordinate transformation, the tip pose of single-segment continuum robot is shown in Eq. (4).
The tip pose of the two-segment continuum robot is illustrated in Appendix C.
Likewise the tip pose of continuum robot on the plane can be obtained in Eq. (5) and Eq. (6) 3 Inverse Kinematics of Continuum Robot

Inverse kinematics of two-segment continuum robot on the plane
As shown in Figure 4, the bending angle of the twosegment continuum robot in the plane are α1 and α2, respectively. The terminal coordinates of the continuum robot are B(x,y). The general steps for solving the inverse kinematics of continuum robot are illustrated as follows.
(1) Solve the rotation angle range of the second curve In order to calculate the tip rotation angle range θ, find the two extreme positions where the two curves are tangent.
(2) Find the intersection of two curves In the current pose, draw the first curve S1 and the second curve S2 of continuum robot. In the specific algorithm, the two curves are discretized into points. As illustrated in Appendix A, the clustering algorithm is used to solve the intersection of two curves.
(3) Make auxiliary curves at the intersection As shown in Figure 4 (a), an auxiliary curve S1-2 is drawn at the intersection along the tangent direction of first ·5· segment continuum robot. If there is a feasible solution, the tip point must pass the second curve S2 and the auxiliary curve S1-2 at the same time.
(4) Find a feasible solution and check the continuity of the solution As illustrated in Figure 4 (a), repeat step (2) and (3), a series of curves are drawn within the rotation angle range of the second curve. Then check the continuity of the solution until a feasible solution is found. A feasible solution of continuum robot is presented in Figure 4 (b).

Figure 4
Inverse kinematics of two-segment continuum robot

Inverse kinematics of multi-segment continuum robot on the plane
(1) Three-segment continuum robot, giving the tip pose Similar to the method of solving two-segment continuum robot, the rotation angle range of the second curve can be obtained. Within the rotation angle range, a series of curves are made to solve the intersection of curves and auxiliary curves are produced at the intersection as illustrated by Figure 5 (b). A feasible solution is found as shown in Figure  5 (c).
(2) Multi-segment continuum robot, giving certain constraints There may be many inverse kinematics for multisegment continuum robots, which need to be solved under certain restricted conditions. Thus, this article will not discuss them.

Inverse kinematics of two-segment continuum robot in space
As shown in Figure 6, the bending angle of the twosegment continuum robot in space are α1 and α2 respectively and the direction angle are θ1 and θ2 respectively. The terminal coordinates of the continuum robot are B (x, y, z). The general steps for solving the inverse kinematics of continuum robot are illustrated as follows. The first curve V1 is generated at the origin and the second curve V2 is made at point C along the tip pose as illustrated in Figure 6. In the specific algorithm, the two curves are discretized into points, and a series of planes parallel to the OXY plane are used to intercept the two curves. Points less than a certain threshold from the intercept plane are projected onto the plane. The problem of solving the intersection of surfaces can be transformed into a problem of solving the intersection of curves on plane. And more details can be found in Appendix C.
(2) Make auxiliary curves at line of intersection In the current tangent plane, an auxiliary curve V1-2 is made at the intersection. As shown in Figure 6 (a), if there is a feasible solution at this position, the tip point must be on both the curve V2 and the curve V1-2. As illustrated in Figure 6 (b), the auxiliary curve is not at the tip point, so there is no feasible solution. (

3) Solve feasible solutions
If there is a feasible solution, and the intersection point is (x1, y1, z1). Substitute the coordinates of the intersection obtained into Eq. (6).

) Further solve the exact solution
On the basis of the solution obtained, the sampling rate is increased, and the angle range of the curve is determined and reduced. Repeat the above steps until a required accuracy is achieved.

Figure 6
Inverse kinematics of two-segment continuum robot in space

Inverse kinematics of multi-segment continuum robot in space
The inverse kinematics of a three-segment continuum robot in space is illustrated in Figure 7. The position and tip pose of the continuum robot and the bending angle of the first segment of the continuum robot are known. As shown in Figure 7 (a), the second curve is made on the intersection S1, and the third curve is made according to the tip pose. Using the same method above, the intersection S2 of the two curves is solved. Take a point on the intersection S2 as the auxiliary curve S2-3. Repeat the above steps until the feasible solution is found. A feasible solution of continuum robot in this pose is shown in Figure 7 (b).

General steps for solving the inverse kinematics of continuum robot
The distinct sequence for solving the inverse kinematics of continuum robot is illustrated in Figure 8. The approximate range of the solution can be solved by using the above method. Increase the sampling rate and narrow the angle interval until a more accurate solution is obtained

Comparison of graphical method and Jacobian method
In order to verify the accuracy of the algorithm, the Jacobian iterative method is used for comparison [20,21].

·7·
The iterative relationship of this method is shown in Eq. (12).
In Eq. (12), qi is the configuration parameter of robotic arm in i -th iteration process. xf is the target position that the robot arm needs to reach, k(qi) is the forward kinematics of robot arm and ρ is the step length of each iteration. J # (q) is the pseudo-inverse of the Jacobian matrix.
As shown in Figure 9 (a), the single-segment continuum robot is transformed into a rigid manipulator model [15] [17]. The relationship between the configuration parameters of the rigid manipulator arms the singlesegment continuum robot is illustrated in Eq. (14).
As shown in Figure 9 (b), MATLAB Robotics Toolbox (RTB9.10, Petercorke, AUS) & (MATLAB, R2019b, MathWorks.Inc, US) is used to build the robot model and solve the inverse kinematics. Two segment continuum robot is used to carry out simulation, and the length of each segment is 10 units. 500 sets of tip points in the space are randomly selects in this article, the Jacobian iteration method and the geometric method in this paper are used to solve the inverse kinematics of continuum robot. And the error distribution of Jacobian method and geometric method are illustrated in Figure 10 and Figure 11 respectively. By fitting the error data, it can be found that the error of the inverse solution approximately obeys the γ distribution.  The average error of the two methods is shown in Table  1. Comparing the solution results of the two methods, the geometric method has higher accuracy. Singular poses may exist when Jacobi pseudo-inverse method is used to solve inverse kinematics. So, a small part of the inverse solution ·8· may have relatively large errors. Table 1 Comparison of the error average of the two methods

Simulation verification of the algorithm
To further verify the accuracy of the algorithm, the model of the continuum robot is imported into ADAMS (ADAMS, 2017, MSC Inc., US) for kinematic simulation. Based on PCC model, the continuum robot can be divided into two segments. As shown in Figure 11, continuum robot moves from pose 1 to pose 2. Actuators are added at the joints of the model to measure the robot's terminal posture. Fifth-order polynomial curve is used to change the configuration of the continuum robot. In order to solve the inverse kinematics of continuum robot, the geometric method is used according to the tip pose of the robot.

Figure 12 Simulation of continuum robot based on ADAMS
The simulation and calculated values of the configuration parameters during the robot movement are shown in Figure  12. And the absolute error of configuration parameters is illustrated in Figure 13. In addition to the relatively large errors that may exist in individual special positions, the simulated results agree well with the calculated results.

Discussion
Our algorithm successfully settles the problem of inverse kinematics for multi-segment continuum robot. Due to the definite geometric meaning of the algorithm, it is convenient to understand and use. However, there are still several features and limited needed to be noted: (1) Since K-means clustering method is used to solve the intersection of two curves/surfaces, and the initial location of the cluster center is randomly generated based on the given data. Therefore, within the allowable error range, subtle difference may be existed in each calculation. (2) In essence, the algorithm is a numerical algorithm combining numbers and shapes by discretizing surfaces or curves into points. Therefore, the accuracy of the algorithm largely lies in the sampling accuracy of curves and surfaces. In consequence, the selection of the sampling rate needs to be determined according to the actual calculation accuracy requirements and computational efficiency.

·9·
(3) Faced with the problem of solving the inverse kinematics of multi-segment continuum robot, large amount of calculation may be required by applying this algorithm to obtain an accurate solution. However, the approximate value can still be obtained by using this method, and it can be combined with other heuristic algorithms to obtain more accurate results.

Conclusion
A new method for solving the inverse kinematics of continuum robot is proposed in this paper. Based on Piecewise Constant Curvature model (PCC), the envelope surface and tip pose of the continuum robot is modeled and calculated. The clustering and iteration method is used to calculate the intersection of the curves. Combined with geometric and numerical method, a distinct sequence is proposed in this paper, which is well fitted for two segments continuum robots in space. Finally, the accuracy of the algorithm is verified through simulation and numerical experiment. Compared with Jacobi pseudoinverse algorithm, this algorithm has higher precision and no non-convergent or singular solution. As this algorithm is capable of definite geometric meaning, so it is easy to be accepted and applied. Therefore, the graphical method provides a new scheme for the motion control of two-stage and even multi-stage continuous robots.