# Simplified Robotics Joint-Space Trajectory Generation with a via Point Using a Single Polynomial

Authors: Robert L. Williams
Journal: Journal of Robotics
 (2013)

---

## Abstract

This paper presents novel fourth- and sixth-order polynomials to solve the problem of joint-space trajectory generation with a via point. These new polynomials use a single-polynomial function rather than two-polynomial functions matched at the via point as in previous methods. The problem of infinite spikes in jerk is also addressed.


---

## Body

## 1. Introduction

Joint-space trajectory generation is in common usage in robotics to provide smooth, continuous motion from one set ofn joint angles to another, for instance, for moving between two distinct Cartesian poses for which the inverse pose solution has yielded two distinct sets of n joint angles. The joint-space trajectory generation occurs at runtime for all n joints independently but simultaneously.There is an entire body of literature devoted to trajectory generation (aka motion planning and path planning) at the joint level. Paul and Zhong [1] were among the first to suggest the use of polynomials for robot trajectory generation. A common joint-space trajectory generation method (linearly changing joint velocity using starting and ending parabolic blends) is identically presented by many authors [2–7]. Despite the widespread popularity of this method, it suffers from infinite spikes in jerk (the derivative of acceleration) and requires three separate functions instead of one. An identical third-order polynomial joint-space trajectory generation approach is also presented by many authors [2, 4–7]. Further, an identical fifth-order polynomial joint-space trajectory generation approach is presented by many authors [2, 4, 5, 7]. From these authors’ lists, it may appear that Koivo was the first to present these methods, when in fact they were already presented in Craig’s first edition in 1986. Fu et al. [8] depart from these standard methods, suggesting initial, intermediate, and final polynomials of order 4-3-4, 3-5-3, or 5 third-order polynomials, for a single joint motion. These are by far the most (unnecessarily) complicated methods and are presented without justification or comparison with simpler methods. For dealing with a via point in which the robot need not stop at the via point (such as for obstacle avoidance), Craig [5] suggests matching two third-order polynomials.Apparently alone amongst all of the major robotics textbook authors, Angeles [9, Section  6.5] derives a 4-5-6-7 seventh-order polynomial to fit two via points and ensure finite joint jerk at the start and end of motion. Angeles [9, Section  6.6] also presents approximation of this seventh-order polynomial with a cubic spline and discusses the associated errors.An early version of the current paper was presented by the author at a conference [10]. The original contribution of this paper is a single sixth-order polynomial to provide smooth, continuous joint motion through a via point. Previous approaches have matched two third-order polynomials at the via point. We also present a single fourth-order polynomial to accomplish the same purpose. However, this case should not be used since it leads to discontinuous accelerations, leading to infinite spikes in jerk, which is unacceptable for reliable, smooth, and long-life robotic systems. This infinite jerk problem, prevalent in all of the robotics textbooks, has also been pointed out by Macfarlane and Croft [11], who present jerk-bounded trajectories and Gosselin and Hadj-Messaoud [12] and Petrinec and Kovacic [13] who go one step further to ensure continuous, not just bounded, jerk.


## 2. Joint-Space Trajectory Generation with a via Point

Standard joint-space trajectory generation assumes that two sets ofn discrete joint parameters are known (angles for revolute joints, lengths for prismatic joints), and it is required to move smoothly in joint-space from one set to the next. For instance, given required Cartesian poses XS and XF, inverse pose kinematics calculate the required n joint value sets for achieving each of these; call them ΘS and ΘF. Note subscript S stands for start (or initial) and subscript F stands for finish (or final). The standard joint-space trajectory method then moves smoothly from ΘS and ΘF  for all n joints independently but simultaneously.Polynomials are natural choices for providing smooth, continuous motion, with some level of continuous derivatives. In many robotics motion planning problems, the robot must pass through intermediate point(s) between the start and finish poses, such as for obstacle avoidance. The joint rates and accelerations need not go to zero at these so-called via points, but they must be matched between functions meeting at the via point(s).


### 2.1. Two Third-Order Polynomials

Craig [5] suggested the use of two third-order polynomials meeting at the via point. Section 2.1 is entirely a summary of Craig’s work (with an original example by the current author). Two third-order polynomials will provide smooth motion with continuous position and velocity and zero velocity at the start and end. The two third-order polynomials are
(1)θ1(t)=a13t3+a12t2+a11t+a10,θ2(t)=a23t3+a22t2+a21t+a20,θ˙1(t)=3a13t2+2a12t+a11,θ˙2(t)=3a23t2+2a22t+a21,θ¨1(t)=6a13t+2a12,θ¨2(t)=6a23t+2a22.These two polynomials require eight constraints. Four constraints come from the initial and final time points:(2)θ1(0)=θS,θ2(t2)=θF,θ˙1(0)=0,θ˙2(t2)=0.
It is convenient to shift the time axis so that the θ2(t) polynomial has zero time starting at the via time. t1 is the end time of the first range (t1=tV) and t2 is the relative end time of the second range (t2=tF-tV).We need four more constraints. We force the first polynomial to end at the via angleθV and the second polynomial to start at the via angle θV. We also ensure that the velocities and accelerations match at the via point (they need not go to zero). This will ensure that the jerk stays finite during this via point transition between the two polynomials. The four additional constraints are
(3)θ1(t1)=θV,θ˙1(t1)=θ˙2(0),θ2(0)=θV,θ¨1(t1)=θ¨2(0).The constraints yield eight linear equations in the eight unknowns (two third-order polynomials, four unknown coefficients each). Three of the unknown polynomial coefficients are found immediately, from the initial and via time constraints:a10=θS, a11=0, and a20=θV. The simplified 5×5 matrix/vector equation to solve for the remaining three unknowns is
(4)[1t1000001t2t220012t23t222t13t12-10026t10-20]{a12a13a21a22a23}={(θV-θS)t12(θF-θV)t2000}.
Solve (4) for the remaining five unknowns for use in (12). For the special case of t1=t2=tF/2=tV=T, the analytical solution is a10=θS, a11=0, and a20=θV, and
(5)a12=-3(θF-θV)+9(θV-θS)4T2,a13=3(θF-θV)-5(θV-θS)4T3,a21=3(θF-θS)4T,a22=3(θF-θV)-3(θV-θS)2T2,a23=-5(θF-θV)+3(θV-θS)4T3.


#### 2.1.1. Example: Two Third-Order Polynomials with a via Point

Use two third-order polynomials for smooth joint-space trajectory generation, plus motion through a via point, for one joint. GivenθS=30°, θV=180°, θF=120°, tV=1.5,andtF=3 (t1=t2=1.5) sec, find θ1(t) and θ2(t):
(6)θ1(t)=-68.89t3+170t2+30,θ2(t)=55.56t3-140t2+45t+180,θ˙1(t)=-206.67t2+340t,θ˙2(t)=166.67t2-280t+45,θ¨1(t)=-413.33t+340,θ¨2(t)=333.33t-280,θ⃛1(t)=-413.33,θ⃛2(t)=333.33.
deg units are used throughout this example. These results are plotted in Figure 1.Two third-order polynomials with via point.
(a)
(b)
(c)
(d)Note that the joint angle passes through the via pointθV=180° and keeps going for a brief time; this is because the velocity is still positive beyond the first 1.5 sec. The maximum angle is θMAX=183.9°, occurring at t=1.68 sec. At θMAX, the angular velocity goes to zero (the slope of the angle is zero at that point since the angle is changing in direction). Also note that the velocity term in θ2(t), the t coefficient, is nonzero since the velocity does not need to go to zero at this via point. Further, note that the velocity and acceleration have been successfully matched at the 1.5 sec via point transition as required. Note that the jerk is not matched at the transition (the slopes of the two polynomial accelerations are of the same magnitude but of different signs), but jerk remains finite since the acceleration is matched. The jerk has infinite spikes at the start and end, which is common in the robotics books but is unacceptable.


### 2.2. Two Fifth-Order Polynomials

The two third-order polynomials presented above, matched at a via point, appear in many robotics textbooks (e.g., [5]). However, this approach suffers from discontinuous acceleration functions at the initial and final time, leading to infinite spikes in jerk at these points in time. This is unacceptable for the repeated motions of mechanical systems due to unacceptable wear, noise, and dynamic excitation. To fix this, we could match two fifth-order polynomials at the via point, specifying zero acceleration at the initial and final times (not at the via time—instead matching velocities and accelerations between the two fifth-order polynomial functions at the via time). However, this will not be presented because we came up with a better method, a single polynomial versus two matched polynomials—this original work is presented in the next two subsections.


### 2.3. Single Fourth-Order Polynomial

The first original contribution of this paper is presented in this subsection. We can achieve the same goals as the two third-order polynomials meeting at a via point much more simply; let us use only one polynomial, forced to go through the via point. Here are the constraints for meeting the required angles with smooth motion (since we use a single continuous polynomial, the velocity and accelerations are guaranteed to match and be continuous at the via point):(7)θ(0)=θSθ˙(0)=0θ(tV)=θVθ(tf)=θFθ˙(tf)=0
Note in this case since there is only one time range, it is convenient to treat all times as absolute, rather than relative as when we did matching of two third-order polynomials. With five constraints, a single fourth-order polynomial is required:
(8)θ(t)=a4t4+a3t3+a2t2+a1t+a0,θ˙(t)=4a4t3+3a3t2+2a2t+a1.Five linear equations in the five unknown polynomial coefficientsai, i=0,1,2,3,4 result from the five constraints (7). Two of the unknown polynomial coefficients are found immediately, from the initial time constraints: a0=θS and a1=0. The simplified 3×3 matrix/vector equation to solve for the remaining three unknowns is
(9)[1tVtV21tFtF223tF4tF2]{a2a3a4}={(θV-θS)tV2(θF-θS)tF20}.
The single fourth-order polynomial solution for each joint is
(10)a2=1(tF-tV)2[(θV-θS)tF2tV2-(θF-θS)(4tF-3tV)tVtF2],a3=2(tF-tV)2[-(θV-θS)tFtV2+(θF-θS)(2tF2-tV2)tF3],a4=1(tF-tV)2[(θV-θS)tV2-(θF-θS)(3tF-2tV)tF3].For the special case oftV=tF/2, the solution is
(11)a2=1tF2[16(θV-θS)-5(θF-θS)],a3=-2tF3[16(θV-θS)-7(θF-θS)],a4=8tF4[2(θV-θS)-(θF-θS)].


#### 2.3.1. Example: Single Fourth-Order Polynomial with a via Point

Use a single fourth-order polynomial for smooth joint-space trajectory generation, plus motion through a via point, for one joint. GivenθS=30°, θV=180°, θF=120°, tV=1.5,andtF=3sec, find θ(t):
(12)θ(t)=20.74t4-131.11t3+216.67t2+30,θ˙(t)=82.96t3-393.33t2+433.33t,θ¨(t)=248.89t2-786.67t+433.33,θ⃛(t)=497.78t-786.67.
Again, deg units are used throughout this example. These results are plotted in Figure 2.Single fourth-order polynomial with via point.
(a)
(b)
(c)
(d)Theθ(t) shape for the single fourth-order polynomial is very similar to that for the two third-order polynomials. Again, the joint angle passes through the via point θV=180° and keeps going briefly, due to the fact that the velocity is still positive beyond the first 1.5 sec. The peak for this fourth-order case is slightly greater and occurs in time slightly after the peak for the two third-order polynomials example. The maximum angle is θMAX=185.4°, occurring at t=1.74 sec. For the fourth-order polynomial, a side benefit has arisen: the jerk is now continuous at the via time, where it was discontinuous for the two matched third-order polynomials.The jerk still has an infinite spike at the start and end as we saw with the two third-order polynomials example, which is unacceptable. We now improve upon this with a single sixth-order polynomial in the next subsection; again, this next subsection is original work.


### 2.4. Single Sixth-Order Polynomial

This section presents another original contribution. We can achieve the same goals as the single fourth-order polynomial with a via point and eliminate the infinite spikes in jerk at the start and end as follows. To the previous five constraints, add two more, for zero acceleration at the start and end of the single motion range. Here are the seven constraints:(13)θ(0)=θSθ˙(0)=0θ¨(0)=0θ(tV)=θVθ(tf)=θFθ˙(tf)=0θ¨(tf)=0
With the seven constraints, a single sixth-order polynomial is required:
(14)θ(t)=a6t6+a5t5+a4t4+a3t3+a2t2+a1t+a0,θ˙(t)=6a6t5+5a5t4+4a4t3+3a3t2+2a2t+a1,θ¨(t)=30a6t4+20a5t3+12a4t2+6a3t+2a2.Seven linear equations in the seven unknown polynomial coefficientsai, i=0,1,2,3,4,5,6 result from the seven constraints (13). Three of the unknown polynomial coefficients are found immediately, from the initial time constraints: a0=θS, a1=0, and a2=0. The simplified 4×4 matrix/vector equation to solve for the remaining four unknowns is
(15)[1tVtV2tV31tFtF2tF334tF5tF26tF3612tF20tF230tF3]{a3a4a5a6}={(θV-θS)tV3(θF-θS)tF300}.
The single sixth-order polynomial solution for each joint is
(16)a3=1(tF-tV)3[(θF-θS)(15tF2-24tFtV+10tV2)tVtF3(θV-θS)tF3tV31(tF-tV)3-(θF-θS)(15tF2-24tFtV+10tV2)tVtF3],a4=3(tF-tV)3[(θF-θS)(15tF2-24tFtV+10tV2)tVtF3-(θV-θS)tF2tV33(tF-tV)3+(θF-θS)(5tF3-9tFtV2+5tV3)tF4],a5=3(tF-tV)3[(θF-θS)(15tF2-24tFtV+10tV2)tVtF3(θV-θS)tFtV33(tF-tV)3-(θF-θS)(8tF3-9tF2tV+2tV3)tF5],a6=1(tF-tV)3[(θF-θS)(15tF2-24tFtV+10tV2)tVtF3(θV-θS)tV31(tF-tV)3-(θF-θS)(10tF2-15tFtV+6tV2)tF5].
For the special case of tV=tF/2, the analytical solution is
(17)a3=2tF3[32(θV-θS)-11(θF-θS)],a4=-3tF4[64(θV-θS)-27(θF-θS)],a5=3tF5[64(θV-θS)-30(θF-θS)],a6=-32tF6[2(θV-θS)-(θF-θS)].


#### 2.4.1. Example: Single Sixth-Order Polynomial with a via Point

Use a single sixth-order polynomial for smooth joint-space trajectory generation, plus motion through a via point, for one joint. GivenθS=30°, θV=180°, θF=120°, tV=1.5, and tF=3sec, find θ(t):
(18)θ(t)=-9.22t6+85.19t5-265.56t4+282.22t3+30,θ˙(t)=-55.3t5+425.9t4-1062.6t3+846.7t2,θ¨(t)=-276.5t4+1703.7t3-3186.7t2+1693.3t,θ⃛(t)=-1106.2t3+5111.1t2-6373.3t+1693.3.
Again, deg units are used throughout this example. These results are plotted in Figure 3.Single sixth-order polynomial with via point.
(a)
(b)
(c)
(d)Again, theθ(t) shape is similar to the previous two examples. The maximum angle is θMAX=185.6°, occurring at t=1.70 sec. Note the magnitude of the angular velocity, acceleration, and jerk are not greatly different for the three cases we have presented with via point. Generally they are lowest for the two third-order polynomials. This single sixth-order polynomial approach has eliminated the problem of infinite spikes in jerk at the start and end of each motion. Here, the jerk is discontinuous but it remains finite, which obeys the rule of thumb for mechanical design/motion.


## 2.1. Two Third-Order Polynomials

Craig [5] suggested the use of two third-order polynomials meeting at the via point. Section 2.1 is entirely a summary of Craig’s work (with an original example by the current author). Two third-order polynomials will provide smooth motion with continuous position and velocity and zero velocity at the start and end. The two third-order polynomials are
(1)θ1(t)=a13t3+a12t2+a11t+a10,θ2(t)=a23t3+a22t2+a21t+a20,θ˙1(t)=3a13t2+2a12t+a11,θ˙2(t)=3a23t2+2a22t+a21,θ¨1(t)=6a13t+2a12,θ¨2(t)=6a23t+2a22.These two polynomials require eight constraints. Four constraints come from the initial and final time points:(2)θ1(0)=θS,θ2(t2)=θF,θ˙1(0)=0,θ˙2(t2)=0.
It is convenient to shift the time axis so that the θ2(t) polynomial has zero time starting at the via time. t1 is the end time of the first range (t1=tV) and t2 is the relative end time of the second range (t2=tF-tV).We need four more constraints. We force the first polynomial to end at the via angleθV and the second polynomial to start at the via angle θV. We also ensure that the velocities and accelerations match at the via point (they need not go to zero). This will ensure that the jerk stays finite during this via point transition between the two polynomials. The four additional constraints are
(3)θ1(t1)=θV,θ˙1(t1)=θ˙2(0),θ2(0)=θV,θ¨1(t1)=θ¨2(0).The constraints yield eight linear equations in the eight unknowns (two third-order polynomials, four unknown coefficients each). Three of the unknown polynomial coefficients are found immediately, from the initial and via time constraints:a10=θS, a11=0, and a20=θV. The simplified 5×5 matrix/vector equation to solve for the remaining three unknowns is
(4)[1t1000001t2t220012t23t222t13t12-10026t10-20]{a12a13a21a22a23}={(θV-θS)t12(θF-θV)t2000}.
Solve (4) for the remaining five unknowns for use in (12). For the special case of t1=t2=tF/2=tV=T, the analytical solution is a10=θS, a11=0, and a20=θV, and
(5)a12=-3(θF-θV)+9(θV-θS)4T2,a13=3(θF-θV)-5(θV-θS)4T3,a21=3(θF-θS)4T,a22=3(θF-θV)-3(θV-θS)2T2,a23=-5(θF-θV)+3(θV-θS)4T3.


### 2.1.1. Example: Two Third-Order Polynomials with a via Point

Use two third-order polynomials for smooth joint-space trajectory generation, plus motion through a via point, for one joint. GivenθS=30°, θV=180°, θF=120°, tV=1.5,andtF=3 (t1=t2=1.5) sec, find θ1(t) and θ2(t):
(6)θ1(t)=-68.89t3+170t2+30,θ2(t)=55.56t3-140t2+45t+180,θ˙1(t)=-206.67t2+340t,θ˙2(t)=166.67t2-280t+45,θ¨1(t)=-413.33t+340,θ¨2(t)=333.33t-280,θ⃛1(t)=-413.33,θ⃛2(t)=333.33.
deg units are used throughout this example. These results are plotted in Figure 1.Two third-order polynomials with via point.
(a)
(b)
(c)
(d)Note that the joint angle passes through the via pointθV=180° and keeps going for a brief time; this is because the velocity is still positive beyond the first 1.5 sec. The maximum angle is θMAX=183.9°, occurring at t=1.68 sec. At θMAX, the angular velocity goes to zero (the slope of the angle is zero at that point since the angle is changing in direction). Also note that the velocity term in θ2(t), the t coefficient, is nonzero since the velocity does not need to go to zero at this via point. Further, note that the velocity and acceleration have been successfully matched at the 1.5 sec via point transition as required. Note that the jerk is not matched at the transition (the slopes of the two polynomial accelerations are of the same magnitude but of different signs), but jerk remains finite since the acceleration is matched. The jerk has infinite spikes at the start and end, which is common in the robotics books but is unacceptable.


## 2.1.1. Example: Two Third-Order Polynomials with a via Point

Use two third-order polynomials for smooth joint-space trajectory generation, plus motion through a via point, for one joint. GivenθS=30°, θV=180°, θF=120°, tV=1.5,andtF=3 (t1=t2=1.5) sec, find θ1(t) and θ2(t):
(6)θ1(t)=-68.89t3+170t2+30,θ2(t)=55.56t3-140t2+45t+180,θ˙1(t)=-206.67t2+340t,θ˙2(t)=166.67t2-280t+45,θ¨1(t)=-413.33t+340,θ¨2(t)=333.33t-280,θ⃛1(t)=-413.33,θ⃛2(t)=333.33.
deg units are used throughout this example. These results are plotted in Figure 1.Two third-order polynomials with via point.
(a)
(b)
(c)
(d)Note that the joint angle passes through the via pointθV=180° and keeps going for a brief time; this is because the velocity is still positive beyond the first 1.5 sec. The maximum angle is θMAX=183.9°, occurring at t=1.68 sec. At θMAX, the angular velocity goes to zero (the slope of the angle is zero at that point since the angle is changing in direction). Also note that the velocity term in θ2(t), the t coefficient, is nonzero since the velocity does not need to go to zero at this via point. Further, note that the velocity and acceleration have been successfully matched at the 1.5 sec via point transition as required. Note that the jerk is not matched at the transition (the slopes of the two polynomial accelerations are of the same magnitude but of different signs), but jerk remains finite since the acceleration is matched. The jerk has infinite spikes at the start and end, which is common in the robotics books but is unacceptable.


## 2.2. Two Fifth-Order Polynomials

The two third-order polynomials presented above, matched at a via point, appear in many robotics textbooks (e.g., [5]). However, this approach suffers from discontinuous acceleration functions at the initial and final time, leading to infinite spikes in jerk at these points in time. This is unacceptable for the repeated motions of mechanical systems due to unacceptable wear, noise, and dynamic excitation. To fix this, we could match two fifth-order polynomials at the via point, specifying zero acceleration at the initial and final times (not at the via time—instead matching velocities and accelerations between the two fifth-order polynomial functions at the via time). However, this will not be presented because we came up with a better method, a single polynomial versus two matched polynomials—this original work is presented in the next two subsections.


## 2.3. Single Fourth-Order Polynomial

The first original contribution of this paper is presented in this subsection. We can achieve the same goals as the two third-order polynomials meeting at a via point much more simply; let us use only one polynomial, forced to go through the via point. Here are the constraints for meeting the required angles with smooth motion (since we use a single continuous polynomial, the velocity and accelerations are guaranteed to match and be continuous at the via point):(7)θ(0)=θSθ˙(0)=0θ(tV)=θVθ(tf)=θFθ˙(tf)=0
Note in this case since there is only one time range, it is convenient to treat all times as absolute, rather than relative as when we did matching of two third-order polynomials. With five constraints, a single fourth-order polynomial is required:
(8)θ(t)=a4t4+a3t3+a2t2+a1t+a0,θ˙(t)=4a4t3+3a3t2+2a2t+a1.Five linear equations in the five unknown polynomial coefficientsai, i=0,1,2,3,4 result from the five constraints (7). Two of the unknown polynomial coefficients are found immediately, from the initial time constraints: a0=θS and a1=0. The simplified 3×3 matrix/vector equation to solve for the remaining three unknowns is
(9)[1tVtV21tFtF223tF4tF2]{a2a3a4}={(θV-θS)tV2(θF-θS)tF20}.
The single fourth-order polynomial solution for each joint is
(10)a2=1(tF-tV)2[(θV-θS)tF2tV2-(θF-θS)(4tF-3tV)tVtF2],a3=2(tF-tV)2[-(θV-θS)tFtV2+(θF-θS)(2tF2-tV2)tF3],a4=1(tF-tV)2[(θV-θS)tV2-(θF-θS)(3tF-2tV)tF3].For the special case oftV=tF/2, the solution is
(11)a2=1tF2[16(θV-θS)-5(θF-θS)],a3=-2tF3[16(θV-θS)-7(θF-θS)],a4=8tF4[2(θV-θS)-(θF-θS)].


### 2.3.1. Example: Single Fourth-Order Polynomial with a via Point

Use a single fourth-order polynomial for smooth joint-space trajectory generation, plus motion through a via point, for one joint. GivenθS=30°, θV=180°, θF=120°, tV=1.5,andtF=3sec, find θ(t):
(12)θ(t)=20.74t4-131.11t3+216.67t2+30,θ˙(t)=82.96t3-393.33t2+433.33t,θ¨(t)=248.89t2-786.67t+433.33,θ⃛(t)=497.78t-786.67.
Again, deg units are used throughout this example. These results are plotted in Figure 2.Single fourth-order polynomial with via point.
(a)
(b)
(c)
(d)Theθ(t) shape for the single fourth-order polynomial is very similar to that for the two third-order polynomials. Again, the joint angle passes through the via point θV=180° and keeps going briefly, due to the fact that the velocity is still positive beyond the first 1.5 sec. The peak for this fourth-order case is slightly greater and occurs in time slightly after the peak for the two third-order polynomials example. The maximum angle is θMAX=185.4°, occurring at t=1.74 sec. For the fourth-order polynomial, a side benefit has arisen: the jerk is now continuous at the via time, where it was discontinuous for the two matched third-order polynomials.The jerk still has an infinite spike at the start and end as we saw with the two third-order polynomials example, which is unacceptable. We now improve upon this with a single sixth-order polynomial in the next subsection; again, this next subsection is original work.


## 2.3.1. Example: Single Fourth-Order Polynomial with a via Point

Use a single fourth-order polynomial for smooth joint-space trajectory generation, plus motion through a via point, for one joint. GivenθS=30°, θV=180°, θF=120°, tV=1.5,andtF=3sec, find θ(t):
(12)θ(t)=20.74t4-131.11t3+216.67t2+30,θ˙(t)=82.96t3-393.33t2+433.33t,θ¨(t)=248.89t2-786.67t+433.33,θ⃛(t)=497.78t-786.67.
Again, deg units are used throughout this example. These results are plotted in Figure 2.Single fourth-order polynomial with via point.
(a)
(b)
(c)
(d)Theθ(t) shape for the single fourth-order polynomial is very similar to that for the two third-order polynomials. Again, the joint angle passes through the via point θV=180° and keeps going briefly, due to the fact that the velocity is still positive beyond the first 1.5 sec. The peak for this fourth-order case is slightly greater and occurs in time slightly after the peak for the two third-order polynomials example. The maximum angle is θMAX=185.4°, occurring at t=1.74 sec. For the fourth-order polynomial, a side benefit has arisen: the jerk is now continuous at the via time, where it was discontinuous for the two matched third-order polynomials.The jerk still has an infinite spike at the start and end as we saw with the two third-order polynomials example, which is unacceptable. We now improve upon this with a single sixth-order polynomial in the next subsection; again, this next subsection is original work.


## 2.4. Single Sixth-Order Polynomial

This section presents another original contribution. We can achieve the same goals as the single fourth-order polynomial with a via point and eliminate the infinite spikes in jerk at the start and end as follows. To the previous five constraints, add two more, for zero acceleration at the start and end of the single motion range. Here are the seven constraints:(13)θ(0)=θSθ˙(0)=0θ¨(0)=0θ(tV)=θVθ(tf)=θFθ˙(tf)=0θ¨(tf)=0
With the seven constraints, a single sixth-order polynomial is required:
(14)θ(t)=a6t6+a5t5+a4t4+a3t3+a2t2+a1t+a0,θ˙(t)=6a6t5+5a5t4+4a4t3+3a3t2+2a2t+a1,θ¨(t)=30a6t4+20a5t3+12a4t2+6a3t+2a2.Seven linear equations in the seven unknown polynomial coefficientsai, i=0,1,2,3,4,5,6 result from the seven constraints (13). Three of the unknown polynomial coefficients are found immediately, from the initial time constraints: a0=θS, a1=0, and a2=0. The simplified 4×4 matrix/vector equation to solve for the remaining four unknowns is
(15)[1tVtV2tV31tFtF2tF334tF5tF26tF3612tF20tF230tF3]{a3a4a5a6}={(θV-θS)tV3(θF-θS)tF300}.
The single sixth-order polynomial solution for each joint is
(16)a3=1(tF-tV)3[(θF-θS)(15tF2-24tFtV+10tV2)tVtF3(θV-θS)tF3tV31(tF-tV)3-(θF-θS)(15tF2-24tFtV+10tV2)tVtF3],a4=3(tF-tV)3[(θF-θS)(15tF2-24tFtV+10tV2)tVtF3-(θV-θS)tF2tV33(tF-tV)3+(θF-θS)(5tF3-9tFtV2+5tV3)tF4],a5=3(tF-tV)3[(θF-θS)(15tF2-24tFtV+10tV2)tVtF3(θV-θS)tFtV33(tF-tV)3-(θF-θS)(8tF3-9tF2tV+2tV3)tF5],a6=1(tF-tV)3[(θF-θS)(15tF2-24tFtV+10tV2)tVtF3(θV-θS)tV31(tF-tV)3-(θF-θS)(10tF2-15tFtV+6tV2)tF5].
For the special case of tV=tF/2, the analytical solution is
(17)a3=2tF3[32(θV-θS)-11(θF-θS)],a4=-3tF4[64(θV-θS)-27(θF-θS)],a5=3tF5[64(θV-θS)-30(θF-θS)],a6=-32tF6[2(θV-θS)-(θF-θS)].


### 2.4.1. Example: Single Sixth-Order Polynomial with a via Point

Use a single sixth-order polynomial for smooth joint-space trajectory generation, plus motion through a via point, for one joint. GivenθS=30°, θV=180°, θF=120°, tV=1.5, and tF=3sec, find θ(t):
(18)θ(t)=-9.22t6+85.19t5-265.56t4+282.22t3+30,θ˙(t)=-55.3t5+425.9t4-1062.6t3+846.7t2,θ¨(t)=-276.5t4+1703.7t3-3186.7t2+1693.3t,θ⃛(t)=-1106.2t3+5111.1t2-6373.3t+1693.3.
Again, deg units are used throughout this example. These results are plotted in Figure 3.Single sixth-order polynomial with via point.
(a)
(b)
(c)
(d)Again, theθ(t) shape is similar to the previous two examples. The maximum angle is θMAX=185.6°, occurring at t=1.70 sec. Note the magnitude of the angular velocity, acceleration, and jerk are not greatly different for the three cases we have presented with via point. Generally they are lowest for the two third-order polynomials. This single sixth-order polynomial approach has eliminated the problem of infinite spikes in jerk at the start and end of each motion. Here, the jerk is discontinuous but it remains finite, which obeys the rule of thumb for mechanical design/motion.


## 2.4.1. Example: Single Sixth-Order Polynomial with a via Point

Use a single sixth-order polynomial for smooth joint-space trajectory generation, plus motion through a via point, for one joint. GivenθS=30°, θV=180°, θF=120°, tV=1.5, and tF=3sec, find θ(t):
(18)θ(t)=-9.22t6+85.19t5-265.56t4+282.22t3+30,θ˙(t)=-55.3t5+425.9t4-1062.6t3+846.7t2,θ¨(t)=-276.5t4+1703.7t3-3186.7t2+1693.3t,θ⃛(t)=-1106.2t3+5111.1t2-6373.3t+1693.3.
Again, deg units are used throughout this example. These results are plotted in Figure 3.Single sixth-order polynomial with via point.
(a)
(b)
(c)
(d)Again, theθ(t) shape is similar to the previous two examples. The maximum angle is θMAX=185.6°, occurring at t=1.70 sec. Note the magnitude of the angular velocity, acceleration, and jerk are not greatly different for the three cases we have presented with via point. Generally they are lowest for the two third-order polynomials. This single sixth-order polynomial approach has eliminated the problem of infinite spikes in jerk at the start and end of each motion. Here, the jerk is discontinuous but it remains finite, which obeys the rule of thumb for mechanical design/motion.


## 3. Discussion

All joint-space trajectory generation methods presented by previous authors and the new ones proposed in this paper can easily be applied to multiple joints, simultaneously but independently.This main original contribution of this paper is to present a new joint-space trajectory generation approach using a single polynomial for motion through a given via point. The robot does not need to stop at the via point, but the motion must be smooth and continuous through the via point. A single fourth-order polynomial was developed to achieve this smooth motion through a via point and to replace the two three-order polynomials matched at the via point in common usage today. With the new approach, this via point matching comes automatically and there is no need for two-polynomial functions.An important secondary contribution of this paper is to expose a bad practice in common usage in joint-space trajectory generation in robotics today. We are not the first to notice this [11–13], but judging from the four robotics textbooks in the list of references published within the past five years, the message has not been widely understood (only [9] is concerned with preventing infinite jerk). For any functions in which the acceleration is discontinuous, the associated jerk (time derivative of acceleration) function will have infinite spikes at those acceleration discontinuities. Cam’s design teaches that these infinite spikes in jerk are unacceptable and must be avoided by the designed/motion controller. By extension, in robot joint-space trajectory generation, any method which allows discontinuous acceleration functions is unacceptable and must not be used. Unfortunately, the linear velocity with parabolic blends, the third-order polynomial, and the two third-order polynomials matched to meet at a via point all suffer from discontinuity in acceleration and thus infinite spikes in jerk. These methods are still very common in usage in the standard robotics textbooks today; these methods must be discarded. Otherwise, unacceptable noise, wear, stress, reduced life, and the introduction of bad dynamics may result.The novel single fourth-order polynomial introduced in this paper to go through a via point also suffers from this discontinuous acceleration. Therefore, to remedy this we introduced a novel sixth-order polynomial to move smoothly and continuously through a via point, with finite jerk throughout the entire motion, which is acceptable.


## 4. Conclusion

For joint-space trajectory generation in robotics, the recommendations of this paper are simple; for all joint motions without a via point, use the standard fifth-order polynomial from Craig [5]. For all joint motions with a via point, use the new single sixth-order polynomial introduced in this paper. Not only does this new sixth-order polynomial keep the jerk finite, it also achieves the via point motion with only one function.



---

*Source: 735958-2013-02-28.xml*