# 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...

Thank you in advance!

• 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

## 2 Answers

This might not be the right answer for your problem, but it may give you some idea how you might solve this problem:
At the company, I'm working for, we have lot of issues concerning jerk and acceleration of rotary arms. Our approach is we use motion specified by a position-velocity diagram (User-Input). According to this profiles we calculate an acceleration (assuming infinite jerk). Next step is to calculate a jerk according to a so-called jerk-percentage. This is parameter we use to say how much time of the acceleration there is jerk. See this link where this concept is explained more in detail (only the first 3 paragraphs are related to this topic).
Anyway at the moment we have still infinite jounce (this has no influence on our application anymore). I suggest go a step further. Use the same concept, call it jounce percentage, and minize it this way.
At the end you have a simple path finding process, where you only need to identify position, time and velocity. The rest is simple calculation, which can be performed even on a 30year old 8-bit PIC

• Thank you! Allthough the points that are used for the spline are not specified (they don't really matter) I might be able to generate them. Will try your idea of jounce percentage. Nov 30, 2015 at 6:49

I don't think I have heard of an algorithm specifically for minimizing jerk and definitely none for jounce. However, here are some semi-recent academic articles and papers that may be of interest to you. They all minimize acceleration in different ways, and you may be able to be extend for jerk and jounce.