A Closed-Form Solution for the Inverse Kinematics of the 2 n -DOF Hyper-Redundant Manipulator Based on General Spherical Joint

: This paper presents a closed-form inverse kinematics solution for the 2 n -degree of freedom (DOF) hyper-redundant serial manipulator with n identical universal joints (UJs). The proposed algorithm is based on a novel concept named as general spherical joint (GSJ). In this work, these universal joints are modeled as general spherical joints through introducing a virtual revolution between two adjacent universal joints. This virtual revolution acts as the third revolute DOF of the general spherical joint. Remarkably, the proposed general spherical joint can also realize the decoupling of position and orientation just as the spherical wrist. Further, based on this, the universal joint angles can be solved if all of the positions of the general spherical joints are known. The position of a general spherical joint can be determined by using three distances between this unknown general spherical joint and another three known ones. Finally, a closed-form solution for the whole manipulator is solved by applying the inverse kinematics of single general spherical joint section using these positions. Simulations are developed to verify the validity of the proposed closed-form inverse kinematics model.


Introduction
To increase the manipulator's kinematic dexterity, more degrees of freedom (DOFs) beyond required for accomplishing a given task are introduced. These redundant DOFs can be used to accomplish additional various tasks, including obstacle avoidance, singularity avoidance, and physical limitations [1]. However, the inverse kinematics of the redundant manipulators would be more challenging and complicated than the non-redundant one because of the existence of infinite number of solutions for a given task [2]. To solve the inverse kinematics of such redundant manipulators, many algorithms have been proposed. According to the solution type of the inverse kinematics problem, these algorithms can be categorized into three groups: analytical method, numerical method, and the hybrid method [2][3][4][5].
Upon the analytical method, the joint variables can be explicitly interpreted by a function of the given pose of end-effector. Hence, the analytical method is characterized by computational efficiency and can provide all solutions for a given pose within the workspace of the manipulator [5]. However, the closed-form solution is strongly dependent on the configuration of the manipulator. It is generally known that the common 6-DOF non-redundant manipulator has a closed-form inverse kinematics solution if three consecutive revolute joint axes of the manipulator intersect at a common point or three consecutive revolute joint axes of the manipulator are parallel [6], especially the former. Actually, for the redundant manipulators, adding reasonable constraints is an effective way 2 of 19 to pursuit the closed-form inverse kinematics solution. That is because that the number of DOF is bigger than the given conditions provided by the given position and orientation. Meanwhile, the existence of the above two criterions for the non-redundant 6-DOF manipulator will greatly increase the possibility of getting the closed-form solution [7][8][9][10]. For example, Srinivas N. et al. [7] modeled the redundant manipulator as a multi-section robot composed of spherical joints and proposed an approach, which computed per-section endpoint locations as the constraints. Based on these endpoint locations, the closed-form inverse kinematics of the multi-section robot is obtained by applying the inverse kinematics of single-section robot. Kai X. et al. [9] directly enumerated the different combinations of the segment positions as the constraints. Wenfu X. et al. [10] modeled the manipulator as a multi-group manipulator and determined the Cartesian coordinates of each node by modifying the well-known backbone curve method [11]. How to add right constraints to obtain the closed-form solution requires the algebraic and geometric intuition.
In contrast to the analytical method, the solution of the joint variables solved by the numerical method is implicit in the nonlinear equations relating the joint variables and the given pose. Thus, various algorithms solving nonlinear equations can be applied to solve the inverse kinematics of the redundant manipulators, for example, Newton-Raphson algorithm [12], Levenberg-Marquardt algorithm [13], and Cyclic Coordinate Descent (CCD) method [14]. Moreover, intelligent algorithms, such as neural network [15,16], fuzzy logic [17], and generic algorithm [18] are also used for the inverse kinematics problem of the redundant manipulators. These algorithms inevitably bear sensibility to the choice of initial values, high computational burden, and numerical errors.
Upon the hybrid method combining analytical and numerical method, part of the joint variables can be given by the closed-form algorithm and the rest are solved by the numerical method. Alternatively, the solution may be in closed-form, while the closed-form solution is based on the conditions provided by some numerical method like numerical optimization. For example, to solve the inverse kinematics of the proposed (2n + 1)-DOF hyper-redundant manipulator, Ananthanarayanan H. et al. [19] provided the first two and last three joint angles given by analytical expression, and the other joint angles solved by considering the optimization of elbow locations. Kim J.S. et al. [20] determined the position of elbow of the 7-DOF manipulator by minimizing the force imposed on the elbow and the joint angles are obtained in analytical expressions by using geometric approach. Kircanski M.V. et al. [21] proposed a method for a 7-DOF manipulator where four joint angles are computed analytically and the remaining three are computed using the pseudoinverse of Jacobian matrix. Due to the addition of the closed-form solution for some joint variables, the hybrid method can efficiently improve the computational efficiency [13,21].
In this work, the hyper-redundant robot is a kind of 2n-DOF serial manipulator with n identical universal joints. These universal joints have the same mechanical mechanism, the same angle limits, and the same kinematic characteristics. Research about the inverse kinematics problem for this type of manipulator has been carried out. However, these methods involve, more or less, numerical approaches. Huang H. et al. [22] studied the inverse kinematics of the manipulators with three universal joints and one rotary joint. The last universal joint and the rotary joint are regarded as a spherical wrist. Based on this, the closed-form solution of the last six joint angles is given by functions about the first joint angle. The first joint angle was determined by minimizing total energy. Therefore, this inverse kinematics solution is not a rigorous closed-form solution. Wenfu X. et al. [10] computed the Cartesian position of each universal joint by modifying the backbone curve method in which a spatial backbone is defined using a mode function to represent the geometry of the manipulator [11]. All of the universal joint angles are solved analytically based on the above computed universal joint positions. However, the numerical optimization still exists during the process of determining the Cartesian positions of the universal joints. Thus, this approach is not a rigorous closed-form solution. Tang, L. et al. [23] provided the inverse kinematics of the single-section manipulator. However, for the inverse kinematics of the whole manipulator, the proposed approach fell into the Jacobian analysis.
Compared to the above inverse kinematics solutions for the 2n-DOF hyper-redundant serial robot with n identical universal joints, the inverse kinematics solution proposed in this paper is rigorous closed-form. In this inverse kinematics model, the universal joint is modeled as a general spherical joint through introducing a virtual revolution between two adjacent universal joints. It is surprising that all of the joints of the 2n-DOF manipulator are general spherical joints. Simultaneously, these general spherical joints can realize the decoupling of the positions and orientations. A novel method for determining the positions of these universal joints is proposed. In this method, the Cartesian coordinates of a universal joint are obtained according to three distances between the universal joint to be solved and another three different known ones. According to inverse kinematics of a single general spherical joint section, the closed-form solution for the whole manipulator is solved. How to choose the distances for solving the positions of universal joints is important in the proposed closed-form solution.
The main contribution of this paper is as follows. Firstly, a novel rule for link frames attached to the links is proposed during the process of forward kinematics, which is more intuitive and briefer than the classical (Denavit-Hartenberg) D-H convention. Secondly, a novel concept named "general spherical joint", which exists between any two adjacent link frames, is introduced. The general spherical joint is similar to spherical wrist and can realize the decoupling of the positions and orientations. Thirdly, a completely closed-form solution for the 2n-DOF manipulator is proposed. This solution is not involved with any numerical method. Moreover, the proposed method to obtain the positions of universal joints is extremely geometrically intuitive. This directly contributes to the ease to understand of the proposed closed-form solution compare to the above inverse kinematics solutions.
The remaining of the paper is organized as follows. Section 2 sets a novel rule for link frames and accomplishes the forward kinematics of the proposed 2n-DOF hyper-redundant serial robot. Section 3 introduces the definition of "general spherical joint", and solves the inverse kinematics problem by introducing the certain distances. Section 4 verifies the validity of the proposed kinematics model. Finally, Section 5 concludes this paper.

Forward Kinematics
The forward kinematics of the 2n-DOF hyper-redundant serial robot is described in this section. The studied manipulator is a serial robot consisting of n identical universal joints (UJ). For displaying purpose, the value of n is set to five. Figure 1a,b shows the link frame assignment for this manipulator, where the link frame refers to the coordinate system fixed on the link according to certain rule. Figure 1d gives the actual mechanical mechanism corresponding to Figure 1b. For the purpose of intuitiveness and convenience during kinematics analysis, the rule for link frames no longer follows the Denavit-Hartenberg (D-H) convention, and a novel rule is adopted to define Frame i for Link i:

•
Locate the origin O i of Frame i at the intersection of the two axes of UJ i + 1; • Choose axis z i along the central axis of Link i; • Choose axis y i along the common axis (Axis 1 of UJ i + 1) of the two mounting holes (mounting holes 1 and 2) of Link i for UJ i + 1; • Choose axis x i to complete a right-handed frame. At this time, this axis coincides with the Axis 2 of UJ i + 1 when the corresponding rotation angle γ i+1 of UJ i + 1 is equal to zero. When the angle γ i+1 is not equal to zero, the coincidence no longer exists.
When UJ joint angles are all equal to zero, a constant angle α i exists between link Frame i and link Frame i − 1 about the central axis of Link i, as shown in Figure 1c. Figure 1e gives the actual mechanical mechanism corresponding to Figure 1c.  Once the link frames have been established, the position and orientation of Frame with respect to Frame − 1 can be completely determined by the kinematic parameters including link length , UJ joint angles , , and the constant angle . Based on these kinematic parameters, the homogeneous transformation matrix −1 expressing the position and orientation of Frame with respect to Frame − 1 can be given by where , , , , , and represent cos , sin , cos , sin , cos , and sin , respectively. For one actual manipulator studied in this paper, and are constant, thus, the transformation matrix from Frame to Frame − 1 given by (1) is function of the two UJ joint angles, i.e., and . Based on Equation (1), the forward kinematics, i.e., the position and orientation of Once the link frames have been established, the position and orientation of Frame i with respect to Frame i − 1 can be completely determined by the kinematic parameters including link length l i , UJ joint angles β i , γ i , and the constant angle α i . Based on these kinematic parameters, the homogeneous transformation matrix A i−1 i expressing the position and orientation of Frame i with respect to Frame i − 1 can be given by  (1) gives where c α i , s α i , c β i , s β i , c γ i , and s γ i represent cos α i , sin α i , cos β i , sin β i , cos γ i , and sin γ i , respectively. For one actual manipulator studied in this paper, l i and α i are constant, thus, the transformation matrix from Frame to Frame i − 1 given by (1) is function of the two UJ joint angles, i.e., β i and γ i . Based on Equation (1), the forward kinematics, i.e., the position and orientation of Frame n with respect to Frame 0, can be given by Appl. Sci. 2021, 11, 1277

of 19
For unified symbol, the following notation will be used:

General Spherical Joint
To solve the inverse kinematics and illustrate the essence of the kinematics for the 2n-DOF redundant manipulator with n identical UJs, a novel concept named as "general spherical joint" (GSJ) is introduced.
General spherical joint is inspired by the homogeneous transformation between any two adjacent frames. Notice that the rotation component of the homogeneous transformation matrix is obtained by multiplying three basic rotation matrices about three orthonormal axes. Based on this fact, the joint between any two adjacent frames can be regard as a spherical joint, i.e., the new concept general spherical joint. In accordance with the spherical wrist, GSJ also possesses the property of three consecutive revolute joint axes intersecting at a common point. These three revolute joint axes include the two axes of i-th UJ and the central axis of Link i, as shown in Figure 2. The revolution about the central axis of Link i is embodied in the constant angle α i between link Frame i and link Frame i − 1. Thus, this revolution is virtualized as the third DOF of the GSJ to form the three revolute axes intersecting at a common point.
For unified symbol, the following notation will be used:

General Spherical Joint
To solve the inverse kinematics and illustrate the essence of the kinematics f 2 -DOF redundant manipulator with identical UJs, a novel concept named as "g spherical joint" (GSJ) is introduced.
General spherical joint is inspired by the homogeneous transformation betwee two adjacent frames. Notice that the rotation component of the homogeneous tra mation matrix is obtained by multiplying three basic rotation matrices about thr thonormal axes. Based on this fact, the joint between any two adjacent frames can gard as a spherical joint, i.e., the new concept general spherical joint. In accordanc the spherical wrist, GSJ also possesses the property of three consecutive revolute join intersecting at a common point. These three revolute joint axes include the two axe th UJ and the central axis of Link , as shown in Figure 2. The revolution about the c axis of Link is embodied in the constant angle between link Frame and link − 1. Thus, this revolution is virtualized as the third DOF of the GSJ to form the revolute axes intersecting at a common point. Based on the GSJ, the studied 2 -DOF manipulator can be regard as a serial whose links are connected by identical GSJs. Simultaneously, the GSJ can also r Based on the GSJ, the studied 2n-DOF manipulator can be regard as a serial robot, whose links are connected by n identical GSJs. Simultaneously, the GSJ can also realize the decoupling between the position and orientation just as the spherical joint. Thus, considering the GSJ i − 1 in Figure 2, the relationship between these two adjacent locations p i−1 and p i can be given by The manipulator studied in this paper is a strange robot. Most series robot commonly has only one spherical joint, which often acts as the last joint. This joint is called as spherical wrist, which can decouple the solutions for the position and for the orientation of endeffector. However, according to Equation (4), all joints of the studied manipulator can realize the decoupling between position of this joint and orientation of the corresponding end-effector. This fact is essential for the following inverse kinematics derivation of the whole manipulator.

Closed-Form Solution for Single-GSJ Section
The kinematic parameters α i , β i and γ i for a single-GSJ section shown in Figure 2 can be determined for the given orientation R i−1 i of Frame i with respect to Frame i − 1. Moreover, the solution of these kinematic parameters is in closed-form expression. Considering the actual mechanical structure of GSJ, the range of the three joint angles α i , β i and γ i can be given by α i ∈ [−π/2, π/2], β i ∈ (−π/2, π/2) and γ i ∈ (−π/2, π/2), respectively. According to (1), α i , β i and γ i can be given by and respectively, where c γ i > 0 is exploited in Equation (5) and the first equation of Equation (6), and sgn(·) denotes the signum function. For actual manipulator, the value of angle α i is constant. Hence, for any given desired orientation R i−1 i within the workspace of the single-GSJ section, the computed value of α i by using Equation (5) should be equal to the actual value. From Equation (6), the value of β i and γ i only depend on the component a i−1 i of the given rotation matrix. This is another important fact for the following inverse kinematics of the whole manipulator.

Closed-Form Solution for Multiple-GSJ Section
This section illustrates the process of solving the inverse kinematics problem of the whole manipulator studied in this paper. The inverse kinematics derived in the previous section for a single-GSJ section can be iteratively applied to multiple serial GSJ sections to model an n-GSJ section manipulator. Given a list of a i−1 i (i = 1, · · · , n), the values of β i and γ i can be computed for each GSJ section by applying the single-GSJ inverse kinematics. The list of a i−1 i (i = 1, · · · , n) can be determined by providing a list of locations p i (i = 0, · · · , n − 1) of GSJs i (i = 0, · · · , n − 1). This section proposes a distance-based algorithm to determine the list of locations.
Therefore, the inverse kinematics problem for multiple-GSJ section can be transformed to the determination of the x, y and z coordinates p i of the GSJs i (i = 0, · · · , n − 1) and the determination of a i−1 i based on the above GSJ coordinates. Finally, the solution of the GSJ angles is got by using the inverse kinematics of single-GSJ section. The information flow during the process of solving the inverse kinematics of the whole manipulator is shown in Figure 3.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 7 of 19 0, ⋯ , − 1) and the determination of −1 based on the above GSJ coordinates. Finally, the solution of the GSJ angles is got by using the inverse kinematics of single-GSJ section. The information flow during the process of solving the inverse kinematics of the whole manipulator is shown in Figure 3. based on this information, where the , and coordinates of a three-dimensional point can be determined by three distances between this unknown point and another three known points.
As shown in Figure 4, , +1 represents the distance between the unknown and the known +2 , and represents the distance between the unknown and the known 0 . GSJ i+1 Link n End-effector Combining , +1 , with the third known distance +1 , i.e., link length, gives In fact, Equation (7) provides the basic position information for the location of GSJ according to the relative distances of four locations of GSJs, i.e., unknown , known +1 , +2 , and 0 . Further calculation of Equation (7) gives a quadratic equation about the unknown , : where = 1 + 1 2 + 2 2 , = −2 1 1 − 2 2 2 , = 1 2 + 2 2 − ( ) 2 , 0, ⋯ , − 1) and the determination of −1 based on the above GSJ coordinates. Finally, the solution of the GSJ angles is got by using the inverse kinematics of single-GSJ section. The information flow during the process of solving the inverse kinematics of the whole manipulator is shown in Figure 3. As shown in Figure 4, , +1 represents the distance between the unknown and the known +2 , and represents the distance between the unknown and the known 0 .
As shown in Figure 4, l v,i+1 represents the distance between the unknown O i and the known O i+2 , and l O i represents the distance between the unknown O i and the known O 0 .
Further, the x, y and z coordinates of the location of GSJ O i is given by where i.e., p 1,··· ,n−2 = p 1,··· ,n−2 l v,2 , l O 1 , · · · , l v,n−1 , l O n−2 . Based on this, the distances l v,2 and l O 1 , . . . , l v,n−1 and l O n−2 should also satisfy the following inequality constraints: where the value of i includes 1, · · · , n − 2, L i = l v,i+1 , l O i , · · · , l v,n−1 , l O n−2 represents the related variables for the corresponding i, and the first equation defines the workspace of the mechanism, while the second represents a singular configuration in which the two consecutive Links i + 1 and i + 2 are parallel. In particular, p i+2 = p n , p i+1 = p n−1 in the situation where i is equal to n − 2; p i+2 = p n−1 , p i+1 = p n−2 l v,n−1 , l O n−2 in the situation where i is equal to n − 3.

Determination of l v,i+1 and l O i
This sub-section discusses how to determine the distance l v,i+1 and l O i involved in distance-based algorithm. Considering the joint limits of GSJ angles, the value of the two distances is restricted by the following inequalities: where l l v,i+1 and l l O,i are the lower bound of l v,i+1 and l O i considering the joint limits, respectively, i.e., l l
In actual detection tasks, the hyper-redundant manipulator's end effector needs to be maintained at a target point in a narrow space with a fixed position and orientation, as shown in Figure 5, and all of the manipulator's links cannot collide with the environment.
Assume that the structural environment of the narrow space is known. The minimum distance between Link i (i = 1, 2, 3, 4) and the environmental boundary can be expressed as where A i (u) represents the point on the straight line O i−1 O i where Link i is, and its coordinate value is  By combining the boundary distribution, and taking the avoidance of collision between the links and the boundary as the criterion, the distances , +1 and can be used to describe the manipulator's overall configuration in a narrow space scene more intuitively. This is the reason why the two distances are chosen as the parameters of the inverse kinematics solution process. Take Figure 6 as an example, the environment has four boundaries, and the coordinate system origins +1 , +2 and the link lengths +1 , +2 are known. Considering that Link + 1 whose posture is to be determined cannot collide with Boundaries 3 and 4, it is easy to select a , +1 based on the position information of the two boundaries. At this time, the choice of is the intersection (only part of the intersection is made in the figure) of two spheres whose sphere centers and radii are +1 , +2 and +1 , , +1 respectively. Some points (collision points 1 and 2) in the intersection may cause the link to collide with Boundaries 1 and 2. By introducing the distance , these points that cause collision can be eliminated. Therefore, , +1 and jointly determine the collision-free posture (collision-free point) of Link + 1. Combining Equations (10) and (11), the determination algorithm of , +1 and can be summarized, as shown in Figure 7. The algorithm successively uses Equations (11)- (16) to gradually narrow the value range. In this process, according to Equations (14) and The symbol u ∈ represents the linear parameter, when u ∈ [0, 1], A i (u) only represents the point on the link's axis, and C i,v represents the point on the narrow environment boundary that is closest to Link i. In actual calculation, the distances l v,i+1 , l O i and u in Equation (13) are given by and respectively, where ∆ l v,i+1 , ∆ l O i , and ∆ u denote the value intervals of l v,i+1 , l O i and u, respectively, and N l v,i+1 , N l O i , and N u denote the maximum of the indices k 1 , k 2 , and k 3 , respectively.
Let δ i denote the maximum distance from the point on Link i to the link's axis. If it means that Link i has no collision with the boundary. Take a five-UJ manipulator as an example to describe the above collision detection analysis process, as shown in Figure 5. By combining the boundary distribution, and taking the avoidance of collision between the links and the boundary as the criterion, the distances l v,i+1 and l O i can be used to describe the manipulator's overall configuration in a narrow space scene more intuitively. This is the reason why the two distances are chosen as the parameters of the inverse kinematics solution process. Take Figure 6 as an example, the environment has four boundaries, and the coordinate system origins O i+1 ,O i+2 and the link lengths l i+1 , l i+2 are known. Considering that Link i + 1 whose posture is to be determined cannot collide with Boundaries 3 and 4, it is easy to select a l v,i+1 based on the position information of the two boundaries. At this time, the choice of O i is the intersection (only part of the intersection is made in the figure) of two spheres whose sphere centers and radii are O i+1 , O i+2 and l i+1 , l v,i+1 respectively. Some points (collision points 1 and 2) in the intersection may cause the link to collide with Boundaries 1 and 2. By introducing the distance l O i , these points that cause collision can be eliminated. Therefore, l v,i+1 and l O i jointly determine the collision-free posture (collision-free point) of Link i + 1.
tively. This is the reason why the two distances are chosen as the parameters of the inverse kinematics solution process. Take Figure 6 as an example, the environment has four boundaries, and the coordinate system origins +1 , +2 and the link lengths +1 , +2 are known. Considering that Link + 1 whose posture is to be determined cannot collide with Boundaries 3 and 4, it is easy to select a , +1 based on the position information of the two boundaries. At this time, the choice of is the intersection (only part of the intersection is made in the figure) of two spheres whose sphere centers and radii are +1 , +2 and +1 , , +1 respectively. Some points (collision points 1 and 2) in the intersection may cause the link to collide with Boundaries 1 and 2. By introducing the distance , these points that cause collision can be eliminated. Therefore, , +1 and jointly determine the collision-free posture (collision-free point) of Link + 1. Combining Equations (10) and (11), the determination algorithm of , +1 and can be summarized, as shown in Figure 7. The algorithm successively uses Equations (11)- (16) to gradually narrow the value range. In this process, according to Equations (14) and Combining Equations (10) and (11), the determination algorithm of l v,i+1 and l O i can be summarized, as shown in Figure 7. The algorithm successively uses Equations (11)- (16) to gradually narrow the value range. In this process, according to Equations (14) and (15), only finite number of calculations of explicit equations and conditional judgments of some calculation results are performed, which satisfying the closed-form definition in [24]. Therefore, this will not affect the closed-form nature of the inverse kinematics algorithm proposed in this paper.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 11 of 19 (15), only finite number of calculations of explicit equations and conditional judgments of some calculation results are performed, which satisfying the closed-form definition in [24]. Therefore, this will not affect the closed-form nature of the inverse kinematics algorithm proposed in this paper. Using (11)- (14) to get , judging whether they satisfies (15), then saving the distances satisfying (15) Saving the distances satisfying inequalities in (9) to determine the final range End Figure 7. Determination algorithm for the distances l v,i+1 and l O i .

GSJ Angles for Multiple-GSJ Section
Based on a list of locations provided by the distance-based algorithm in Section 3.3.1, the corresponding list of a i−1 i (i = 1, · · · , n) can be obtained through the following derivation: From Equation (4), the component a i of rotation matrix is given by For given β 1 , γ 1 , · · · , β i−1 , γ i−1 , the component a i of rotation matrix R i can also be expressed by Combining Equations (17) and (18) gives Applying the inverse kinematics of single-GSJ section expressed in Equation (6) gives the closed-form solution for GSJ angles. Set the value of i equal to 1, . . . , n successively, and the solution of (β 1 , γ 1 , · · · , β n , γ n ) can be computed by Equations (6) and (19). The combination of Equations (6) and (19) provides the closed-form solution for the studied 2n-DOF serial manipulator with n identical UJs.
Next, the closed-form property of the proposed inverse kinematics solution is analyzed. The closed-form is determined by two parts, i.e., the determination of the two distances and the resolution of GSJ angles for multiple-GSJ section. Using a finite number of standard operations [24], Equation (14) gives the closed-form solution of the two distances after judging whether they satisfy the constraints in Equations (10) and (16). This ensures the first part's closed-form property. The closed-form of the inverse kinematics solution formed by Equations (6), (9), and (19) is obvious. Hence, closed-form property of the proposed inverse kinematics solution for the 2n-DOF hyper-redundant manipulator is ensured.

Simulation
In this simulation, the parameters of the 2n-DOF manipulator are shown as follows: the number of UJ n = 5, the link lengths l i = 1.0, i = 1, · · · , 5, and the GSW angles α i = 9 • , and β i , γ i (i = 1, · · · , 5) with bounds "not more than 25 • and not less than −25 • ". For this manipulator, the distances introduced in the proposed closed-form inverse kinematics includes l v,4 , l O 3 , l v,3 , l O 2 , l v,2 , l O 1 . Based on Equation (11), these introduced distances have the following value ranges got by using the joint angle bounds: In addition, these distances also satisfy the following inequality constraints given by Equation (10): ∆ l v,4 , l O 3 ≥ 0 and p 5,x p 4,y − p 5,y p 4,x = 0 during the process of computing p 3 ; ∆ l v,3 , l O 2 , l v,4 , l O 3 ≥ 0 and p 4,x p 3,y − p 4,y p 3,x = 0 during the process of computing p 2 ; ∆ l v,2 , l O 1 , l v,3 , l O 2 , l v,4 , l O 3 ≥ 0 and p 3,x p 2,y − p 3,y p 2,x = 0 during the process of computing p 1 .
To verify the validity of the proposed closed-form inverse kinematics model, the solution for a random single given pose, the straight-line paths along the x-axis, y-axis, and z-axis of the base frame, and the circle path are solved through using the proposed closed-form inverse kinematics. The tool used to perform the simulation is an open source software called GNU Octave. row space whose boundary is a cylindrical surface with a radius of 0.55. By using Equations (10), and (12)- (16) with the selected intervals ∆ l v,4 = ∆ l v,3 = ∆ l v,2 = 0.001, ∆ l O3 = ∆ l O2 = 0.001, and ∆ u = 0.001 and the maximum envelope distances δ 1 = · · · = δ 5 = 0.2, the range of these distances l v,4 , l O 3 , l v,3 , l O 2 , l v,2 can be further reduced. The reduced value range is presented in the form of a combination of these five distances, as shown in Figure 8. As it can be seen, the value ranges of l v,4 , l O 3 , l v,3 , l O 2 , l v,2 have great decrease comparing to the ones computed by Equation (11) and are close to their respective upper bonds. This is because that the smaller value of these distances indicates the larger joint angles and satisfying the need of harmony between these distances to make all joint angles within their limits is necessary. In fact, the function of Figure 8 is to provide the initial estimate for the value of these distances.

ER REVIEW 13 of 19
Moreover, according to Figure 9, the configurations of link 5 remain unchanged because of the existence of the general spherical wrist, i.e., the 5th general spherical joint. Simultaneously, the solution changes in law with the change of the distance of ,4 .

Solutions for the Straight-Line Paths along the x-axis, y-axis, and z-axis of the Base Frame
Further, to verify the validity of the proposed closed-form inverse kinematics, the straight-line paths along the x-axis, y-axis, and z-axis of the base frame are regarded as test objects and the solution of these paths are solved by applying the proposed closed-form inverse kinematics. For the straight-line path along the x-axis started at the above given pose, all of the distances are equal to valid value, which are 1.9573, 2.9249, 1.9706, 1.9730, and 1.9690, respectively. The configurations of the manipulator plotted through using the forward kinematics is shown in Figure 10a. The corresponding joint angles is shown in Figure 10b. For the straight-line path along the y-axis started at the above given pose, all of the distances are equal to valid value, which are 1.9573, 2.9249, 1.9706, 1.9730, and 1.9690, respectively. For the straight-line path along the z-axis started at the above given pose, all of the distances are equal to valid value, which are 1.9633, 2.9249, 1.9706, 1.9730, and 1.9690, respectively. The results for the straight-line paths along the y-axis and z-axis are shown in Figures 11 and 12, respectively. pose, all of the distances are equal to valid value, which are 1.9573, 2.9249, 1.9706, and 1.9690, respectively. For the straight-line path along the z-axis started at the given pose, all of the distances are equal to valid value, which are 1.9633, 2.9249, 1.9730, and 1.9690, respectively. The results for the straight-line paths along the y-ax z-axis are shown in Figures 11 and 12, respectively.
According to Figures 10b,11b and 12b, the solution changes continuously w change of coordinate, while the five distances used remain the same.

Solution for a Circle Path
After the above test for the line path, the circle path is also tested using the propos closed-form inverse kinematics. This circle path passes through the end-effector posit shown in Figure 9, and the projection of this circle path in the plane is a circle who origin is ( 0 0 0 ). For this circle path, all of the distances are equal to valid value, wh are 1.9573, 2.9249, 1.9706, 1.9730, and 1.9690, respectively. The configuration of the man ulator plotted through using the forward kinematics is shown in Figure 13a. The cor sponding joint angles is shown in Figure 13b. According to Figures 10b, 11b and 12b, the solution changes continuously with the change of coordinate, while the five distances used remain the same.

Solution for a Circle Path
After the above test for the line path, the circle path is also tested using the proposed closed-form inverse kinematics. This circle path passes through the end-effector position shown in Figure 9, and the projection of this circle path in the xy plane is a circle whose origin is 0 0 0 . For this circle path, all of the distances are equal to valid value, which are 1.9573, 2.9249, 1.9706, 1.9730, and 1.9690, respectively. The configuration of the manipulator plotted through using the forward kinematics is shown in Figure 13a. The corresponding joint angles is shown in Figure 13b. closed-form inverse kinematics. This circle path passes through the end-effector positi shown in Figure 9, and the projection of this circle path in the plane is a circle who origin is ( 0 0 0 ). For this circle path, all of the distances are equal to valid value, wh are 1.9573, 2.9249, 1.9706, 1.9730, and 1.9690, respectively. The configuration of the man ulator plotted through using the forward kinematics is shown in Figure 13a. The cor sponding joint angles is shown in Figure 13b.

Discussion
As expected by the determination algorithm for the distances shown in Figure 7, for the desired end effector pose, Figure 8 shows all of the distance combinations that meet the constraints described by Equations (10)- (16). Each set of combinations corresponds to a set of inverse kinematics solutions. By using the proposed closed-form inverse kinematics in Equations (6), (9), and (19), Figure 9 shows different manipulator configurations and joint angles corresponding to different distance combinations. The end-effector poses of these configurations remain unchanged. Simultaneously, the calculated joint angles are within the given joint limit "not more than 0.4363 rad (25 • ) and not less than −0.4363 rad (−25 • )". These results verify the correctness of the proposed inverse kinematics model. Moreover, compared with the inverse kinematics based on backbone curve in [10], the proposed model is completely closed-form. Compared with the algorithm based on Jacobian analysis in [23], the proposed method can solve all joint angles at once. Compared with the inverse kinematics model proposed in [22] for three universal joints and one rotary joint manipulator, the proposed algorithm has stronger applicability.
Using a set of constant distance combinations, Figure 10 shows the inverse kinematics solution when the end-effector moves linearly along the x axis. Figures 11 and 12 show the corresponding results for the yand z-axes, respectively. Figure 13 shows the inverse kinematics solution when the end effector performs circular motion. These joint angles are all within the given joint limit. These results further verify the correctness of the proposed inverse kinematics model. Simultaneously, these results also indicate that the distance combination has the following property: a set of distance combinations can be used to solve the inverse kinematics of different end-effector poses. These distances have geometric meanings as shown in Figure 6, so this property has certain guiding significance for path planning and obstacle avoidance of the 2n-DOF hyper-redundant manipulator.

Conclusions
In this paper, a novel method to derive closed-form solution for the inverse kinematics problem of 2n-DOF redundant serial manipulators is proposed. This method is based on a novel concept named as general spherical wrist and a distance-based formula for the positions of the universal joints. It is noteworthy that the proposed general spherical joint reveals the essence of the coordinate transformation between the two link frames connected by universal joint, and it becomes an alternative joint that can realize decoupling of the positions and orientations after the spherical wrist. A determination algorithm for the introduced distances is proposed, which is the prerequisite for realizing the distance-based algorithm. Unlike other methods found in literature, the method exposed in this work does not involve any numerical optimization, and is, therefore, rigorous analytically. Moreover, this method is extremely geometrically intuitive and is easy to understand. The closed-form property of the proposed inverse kinematics solution is justified by analyzing closed-form properties of the determination of the two distances and the resolution of GSJ angles for multiple-GSJ section. The simulation results with single given pose of end-effector, straightline path along three coordinate axes of the base frame, and a circle path verify the validity and effectiveness of the proposed closed-form solution. Hence, the proposed solution can be used in trajectory planning and real-time control of the redundant manipulator. Moreover, according to the simulation results, a distance combinations' characteristic of "a set of distance combinations can be used to solve different end-effector poses" was found.
Based on this characteristic, further research will focus on the path planning and obstacle avoidance of the 2n-DOF hyper-redundant manipulator. The inverse Jacobian kinematics based on the closed-form solution proposed in this work is another research interest.
Author Contributions: Y.L. and P.Q. developed the methodology; Y.L. and P.Q. conceived and designed the simulations; Y.L. and H.L. wrote the original draft of the paper; S.D. and D.W. reviewed and edited the paper. All authors have read and agreed to the published version of the manuscript.