Abstract
The present work proposes an improved geodesic algorithm for the trajectory planning of multi-joint robots. First, all of the joint variables are chosen to set up a generalized local coordinate system for the product of the positional space and the orientational one. Second, by defining a new Riemannian metric that contains both the positional and rational parameters, the traditional geodesic algorithm is improved so that it becomes capable of planning robot trajectories that include both the position and the orientation. To demonstrate the effectiveness of the improvement, trajectories are planned for two typical joint robots: one being a planar 3R and the other a spatial RRPP. It is verified that the improved algorithm can generate not only smooth motions for the joints but also smooth and accurate motions for the end-effector. The improved algorithm applies to multi-joint robots with no more than six degrees of freedom.
Introduction
Trajectory planning is a fundamental problem in the design of multi-joint robots. 1 The polynomial-function-based methods are widely used to plan robot trajectories. Although the linear and parabolic polynomials can meet the requirement of trajectory in some simple cases, 2 they often lead to discontinuous interpolation, which sometimes gives rise to unsatisfactory planning results. To overcome this shortcoming, higher-order (such as cubic and quartic) polynomials are instead employed to conduct trajectory planning. 1,3,4 In this respect, the most frequently used interpolation functions are splines which are piecewise polynomials, including the cubic splines 5,6 and the B-splines. 7,8
These polynomials-based methods are generally employed to plan the robot trajectories at the joint level, which inevitably leads to inaccurate movements of the end-effector in the Cartesian space. To enhance the motion precision of the end-effector, one method is to convert its Cartesian path into the joint trajectories at some intermediate points (called knots). The trajectory segments between any neighboring knots can then be calculated by interpolation. Although this method guarantees the accuracy of the knot positions in the Cartesian space, the trajectory of the end-effector is unforeseeable, because it involves no forward kinematic calculation.
Besides polynomials, geodesic functions can also be used to plan trajectories for joint robots. 9 –13 The fundamental idea of the geodesic-based trajectory planning method is to replace line or arc segments in a Euclidean space by geodesics in a Riemannian manifold. Because a geodesic curve generally represents (locally) the shortest path between two points in a Riemannian manifold, 14 the geodesic-based method can always yield an optimal trajectory.
Some literature addressed the geodesic trajectory planning in the joint space. 15,16 In order to generate joint trajectory by the geodesic method, inverse kinematic analysis has to be performed. 15 However, it is usually a difficult work to get a constant solution to the inverse kinematic equations. To avoid the troublesome inverse kinematic analysis, Selig and Ovseevitch employed the group theory to describe the geodesic paths in the joint space. 16
In addition to the group theory, the theory of Riemannian geometry can also be directly used to make the geodesic trajectory planning easy to operate. 10 This involves two main steps. First, the Riemannian metric needs to be constructed according to the planning task; second, the trajectories are planned by solving the geodesic equations. Either the distance or the kinetic energy can be chosen as the Riemannian metric to achieve the optimal trajectory with the minimum distance or minimum kinematic energy. 17 Because only the positional parameters are considered, the distance-based Riemannian metric cannot be used to tackle the orientation problems that involve the rotational parameters. Due to this reason, when the distance metric is chosen as the Riemannian metric, the geodesic method is unsuitable to be applied in planning trajectories for both planar 3R robots and multi-joint robots with more than three degrees of freedom (DOFs). In this case, it has been demonstrated that not all of the joint trajectories of the Kuka youBot arm that has five joints can be planned by the geodesic method. 10
By constructing a Riemannian metric that contains both the positional and rotational parameters, the present paper proposes an improved geodesic algorithm for trajectory planning. Because the rotational parameters are included into the Riemannian metric, the improved algorithm can be used to tackle the orientational problems, and thus it can be applied in trajectory planning for both planar 3R robots and multi-joint robots with no more than six DOFs. It is demonstrated by two examples that the improved algorithm can yield not only smooth motions for the joints but also smooth and accurate trajectories for the end-effector.
The improved geodesic trajectory planning algorithm
Geodesics are natural generalization of lines. A geodesic is (locally) the shortest path between points in a Riemannian manifold. Constructing different manifolds and Riemannian metrics, one can obtain different geodesics such as lines, arcs and paths of minimum distance or minimum kinetic energy.
Assume that M is a Riemannian manifold and g is a Riemannian metric of M. In general, the Riemannian metric can be represented as
where
It is desirable to deduce equations describing the geodesic paths in the joint space. Let
We say that γ is a geodesic if and only if it satisfies the geodesic equations
The Christoffel symbols
where gmi is the element of G−1. 18
The solution of (3) with boundary conditions gives the joint trajectories. The flow graph of the geodesic algorithm is shown in Figure 1.

Flowchart of the geodesic algorithm.
The key step is to construct a Riemannian manifold M and its Riemannian metric g such that a geodesic of the Riemannian manifold is the planned path.
We take all of the possible positions and orientations of a robot as a Riemannian manifold M which is the product manifold of the position space and the orientation space. To be specific, M consists of all possible positions and orientations,
where
Then, the Riemannian metric becomes
Obviously, the Riemannian metric contains not only the positional parameters but also the rotational ones.
For robots, the kinematical equations give a description from the joint space to the Cartesian space. Because the kinematical equations are nonlinear, the inverse solution is not always unique. There is always no one-to-one mapping between the Cartesian space and the joint space. For this reason, we cannot directly take all the joint variables as the coordinate system of the Cartesian space. In order to solve this problem, local coordinates are introduced.
Assuming U is a neighbourhood of a manifold M. If
When the joint variables can be regarded as local coordinates of M, for an arbitrary point Q0 ∈ M and a neighbourhood of Q0, U, the inverse solutions of Q0 may be not unique. Without lost of generality, assume there are two inverse solutions
Here ϕ is a homeomorphism mapping and

Mappings of local coordinates.
After the Riemannian metric is constructed, the geodesics on the product space can be obtained by (3). It deserves nothing that the geodesics represented by joint variables are on the product space, but it is desirable to describe the planned trajectory on the positional space with a specific shape such as a line. Therefore, we need to pull the geodesics back to the positional space to obtain an accurate Cartesian path. For a given embedding
where φ*γ is the pullback of γ. The diagram of the pull-back is shown in Figure 3. The immediate output of the geodesic algorithm is joint trajectories. The motion performed by the robot end-effector is exactly a geodesic path.

A diagram of the pull-back.
When g2 = 0, the improved geodesic algorithm degenerates to the traditional one, i.e.
In addition, when the metric is defined as (7), the manifold we focus on is position and orientation space which is at most six dimensional. The amount of joints which can be selected as local coordinates
The properties of the improved algorithm
Effect of the perturbation component
Let us do a thorough study on the effect of the perturbation component g2.
Proof. For low-DOF robots, if we take the Riemannian metric as
Given Riemannian manifolds
From Lemma 1, the perturbation component g2 will not make a perturbation when no simplification is made. It is not easy to find and describe the embedding and the pullback. In Section 4, we will make simplifications and take the projection of a geodesic from M to M1 as the trajectories of the positional space and the joint space. The perturbation may take place when we replace the geodesic pull-back by the projection. The longer the distance is, the more evident the perturbation will be.
Output controllability
Proof. From Section 3.1, the trajectory planned by the improved algorithm is either a geodesic or the projection of a geodesic (a simplified case). First, we declare that the velocity of a geodesic is controllable. If a geodesic
Because of Lemma 2, we can adjust the velocity to make the robot move the entire distance in a given time. Thus, in the following simulations, we simply take a unified convention that the parameter s always ranges from 0 to 1. One can change the interval of the parameter s to meet other demands. If the velocity of a geodesic is set to be 1, the parameter s stands for the arc length. If parameter s is time, the motion time can be predefined. In this way, time optimal trajectory planning can be realized, as the time can be optimized to meet the kinematical constraints.
Trajectory scalings
Here, we can choose a geodesic to connect the two points. If the given points were specified as
where
When the projection of a geodesic is taken as the trajectory and perturbations arise, we can select several points on the shortest path that connects the initial point and the end point. Applying the improved algorithm to each neighbouring pair, we obtain a piecewise-geodesic that is still a line when it is mapped into the positional space. With the trajectory scaling as mentioned above, the piecewise-geodesic can be second-order continuous at the junctions. One can smooth the piecewise-geodesic at the junctions when higher-order continuity is needed.
Simulations
The improved geodesic algorithm for a planar 3R robot
A planar 3R robot is shown in Figure 4, where
where

A planar 3R robot.
The corresponding geodesic is determined by (3) and (4). By calculation, we get
The geodesic is identified by given initial conditions or boundary conditions.
In many practical systems, the calculation time is an important factor that should be taken into consideration. Unlike traditional polynomial-based methods, the proposed method does not require a constant solution to the inverse kinematics, except at the endpoints. The computational efficiency here mainly depends on the solving process of the geodesic equations, which are second-order nonlinear ordinary differential equations with the form as (3). For the planar 3R robot, Equation (3) is a system of second-order differential equations with three unknowns. When the boundary conditions are given, the function bvp4c in MATLAB can be used to solve these equations with high efficiency.
To simplify, assume that
Boundary conditions of the planar 3R robot.
A set of inverse kinematic solutions of the planar 3R robot.
The cubic polynomial interpolation is chosen to make a comparison to demonstrate the smoothness of the trajectory planned by the improved algorithm. To enhance the accuracy of the contour in the Cartesian space, we choose 11 via-points which uniformly distribute on the linear path. In order to obtain a smooth end-effector motion, the end-effector velocity is set to be constant at these via-points. The joint positions at the knots are obtained by the inverse kinematics. Cartesian velocities at the via-points are converted into joint velocities at the knots by using the inverse Jacobian. The trajectory segments between knots is calculated by interpolating cubic polynomials for each joint.
The trajectories and their velocities, accelerations and jerks of the end-effector obtained by the improved algorithm and the polynomial interpolation are compared in Figure 5. It is shown that the Cartesian path is accurate (see Figure 5(a)). The end-effector velocity, acceleration and jerk determined by the improved geodesic algorithm almost keep constant, but those obtained by the cubic polynomial interpolation oscillate obviously (see Figure 5.(b)). The maximum absolute value of position jerks for the end-effector of the geodesic trajectory is 0.042, while that of the polynomial trajectory is 41.901, as shown in Table 3. The end-effector orientation velocity, acceleration and jerk determined by the geodesic are almost constant, but those obtained by the cubic polynomial interpolation oscillate obviously (see Figure 5.(d)). The maximum absolute value of orientation jerks for the end-effector of the geodesic trajectory is 0.022, while that of the polynomial interpolation is 139.229 (see Table 3).

The simulation results of the planar 3R robot in the Cartesian space: (a) the position; (b) the position velocity, acceleration and jerk; (c) the orientation; (d) the orientation velocity, acceleration and jerk.
Comparisons of maximum absolute jerk values.
The trajectories, velocities, accelerations and jerks of the three joints are shown in Figure 6. The joint acceleration determined by the improved geodesic algorithm is smooth, but that obtained by the polynomial interpolation fluctuates. The fluctuation of the jerks planned by the polynomial interpolation is even more remarkable. The maximum absolute value of each joint jerk determined by both methods are given in Table 3. The jerk trajectory of each joint determined by the geodesic algorithm is continuous, but that obtained by the polynomial interpolation is discontinuous.

The trajectory planning of the planar 3R robot in the joint space.
In both the Cartesian space and the joint space, the geodesic trajectory planning is smoother than the polynomial one. In the Cartesian space, the geodesic orientation is also smoother than that generated by the polynomial interpolation.
In addition, if we take d = (dp)2 as the Riemannian metric, i.e.
Then, the elements of the coefficient matrix
In this case, it is easy to verify that |D| is zero, i.e. the coefficient matrix D is singular. Therefore, the Riemannian metric d = (dp)2 cannot be applied to plan a linear motion for a planar 3R robot.
The improved geodesic algorithm for a spatial RRPP robot
Consider the spatial RRPP robot shown in Figure 7. It is a simplified model of the XHK 5140 automatic tool-changing CNC vertical boring and milling machine tool with four DOFs. The first two joints are revolute joints, while the other two are prismatic. Its link parameters are shown in Table 4.

A spatial RRPP robot.
Link parameters of the spatial RRPP robot.
The T matrix of the end-effector is
where
The Riemannian metric is given by
where
For simplicity, assume that
Boundary conditions of the spatial RRPP robot.
A set of inverse kinematic solutions of the spatial RRPP robot.
Because the traditional geodesic algorithm is unsuitable for the trajectory planning of the RRPP robot, only the results planned by the improved geodesic algorithm are provided here. The trajectory and velocity, acceleration and the jerk of the end-effector are shown in Figure 8. The trajectories, velocities, accelerations and jerks of the joints are shown in Figure 9. The orientations of the end-effector are shown in Figure 10. It is shown that the geodesic trajectory is smooth in both the Cartesian space and the joint space. Therefore, the improved geodesic algorithm is effective in treating the spatial RRPP robot, which has four DOFs: two revolute and two prismatic.

The trajectory planning of the spatial RRPP robot in the Cartesian space.

The trajectory planning of the spatial RRPP robot in the joint space.

The planned orientation of the spatial RRPP robot in the Cartesian space.
Conclusion and future work
An improved geodesic algorithm is proposed for the trajectory planning of multi-joint robots. The geodesic trajectory planning has many advantages, but there still leave many fundamental problems unsolved such as orientation trajectory planning. The method can be used to tackle the orientation problem and can be applied to multi-joint robots. Smooth trajectories of robot end-effectors and joints are obtained. The joint variables are chosen to constitute a local coordinate system of the product of the positional space and the orientational space. By defining a new Riemannian metric that contains both the positional and rotational parameters, the traditional geodesic algorithm is improved so that it becomes capable of planning trajectories that include not only the position but also the orientation. Simulations are performed on the trajectory planning of both a planar 3R robot and another spatial RRPP robot, and it is demonstrated that the improved geodesic algorithm is effective in generating smooth motions for both the end-effector and the joints.
Finally, there is a limitation which is the present improved algorithm applies to robots with no more than six DOFs. In addition, the simulations provided in this paper only focus on linear motions. These are two limitations of the present work. Therefore, the future work will be directed to construct appropriate metrics to plan trajectories of robots with more than six or redundant DOFs, to achieve the geodesic planning of curvilinear motions, and to develop the control part.
Footnotes
Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the National Key Technology R&D Program of China under Grant No. 2014BAF04B01.
