# Which trajectory planning algorithm for minimizing jerk

In order to perform a cyclic task, I need a trajectory planning algorithm. This trajectory should minimize jerk and jounce.

When I search for trajectory planning algorithms, I get many different options, but I haven't found one which satisfies my requirements in terms of which values I can specify. An extra complicating factor is that the algorithm should be used online in a system without too much computing power, so mpc algorithms are not possible...

The trajectory I am planning is 2D, but this can be stripped down to 2 trajectories of 1 dimention each. There are no obstacles in the field, just bounds on the field itself (minimum and maximum values for x and y)

Values that I should be able to specify:

• Total time needed (it should reach its destination at this specific time)
• Starting and end position
• Starting and end velocity
• Starting and end acceleration
• Maximum values for the position.

Ideally, I would also be able to specify the bounds for the velocity, acceleration, jerk and jounce, but I am comfortable with just generating the trajectory, and then checking if those values are exceeded.

Which algorithm can do that?

So far I have used fifth order polynomials, and checking for limits on velocity, acceleration, jerk and jounce afterwards, but I cannot set the maximum values for the position, and that is a problem...

• do you mean fifth order polynomials? Nov 27, 2015 at 17:28
• There may not be any common algorithm for this. I would recommend following TobiasK's answer -- otherwise consider the problem using a cost function that depends on jerk: $J = K \int_{t_1}^{t_2} \dddot{x}^2 dt$ Nov 27, 2015 at 20:23
• Could you please specify why did you mention both "Staring and ending position" and maximum values for the position? What do you mean by the second one? Also...could you please specify what has priority? execution time or motion dynamic bounds? In the case where the specified total time needed is too short, should the bounds be violated or the total time be violated?
– 50k4
Nov 29, 2015 at 17:40
• @Brian, Will look into that as well! Nov 30, 2015 at 6:58
• @50k4: For example, what happens is that my input values are: y0 = 5 cm, v0 = 3 cm/s and yEnd = 5 cm, vEnd = -2 cm/s. Because the trajectory has to contain a turning point, a maximum is reached, and that value may or may not be out of reach for the machine. I would like to limit this position Nov 30, 2015 at 6:59