# Math behind trajectory planning

Let's assume the very simple case of a particle and a control system in one dimensional space therefore our particle can move only in a straight line and dynamics of system is described by:

$m\vec{a} = u$.

Now the problem: we would like to make our particle move from point $A$ to point $B$ in time $t$ and constrain our acceleration with some value $a_{m}$ i.e. $a$ can not exceed $a_{m}$ at any moment.

How would one do this assuming that our control system allows us to control either velocity or acceleration?

The most important things here are names of mathematical methods behind this task and explanation of how to apply them. Also consider that

$x(0) = A = 0\\ x(t) = B\\ v(0)=0\\a(0)=0\\ v(t)=0\\ a(t)=0$

• I can't understand your question. $u$ is generally the control signal to a system. What do you mean when you say $ma = u$? Do you mean the control signal is $ma$? Something else? Also, you can't control both velocity and acceleration. How do you control $v=0$ and $a=1$? Also, it's implied that you want to control position on top of that - is that correct? $x(0) = x_0$, $x(t) = x_f$? What do you mean when you say you want to constrain acceleration? Do you mean saturation or something else? May 21 '17 at 16:39
• @Chuck For the first question: I mean that there is no any other forces in the system except for generated by control signal $u$ and therefore $ma$ is equal to this force. For the second question: I agree, I should better write either velocity or force. Yes, on top of that I actually would like to control position $x(0)=0$ and $x(t)=B$. And for the latter: I mean that value of $a$ must not exceed some value $a_{m}$ at any moment. Thanks for good questions! May 21 '17 at 17:18

Since the problem is one dimensional, you are actually asking to compute a velocity profile. (A velocity profile is the information of how a path is traversed with respect to time.) Now the problem is "How to travel for $B$ units within time $T$?" (Let's call the duration $T$ instead.)

A velocity profile can be viewed as a curve in the $v$-$t$ (velocity vs time) plane. And as we all know, the area under a curve in that $v$-$t$ plane is the displacement. So any curve which passes through points $(v_0, t_0) = (0, 0)$ and $(v_2, t_2) = (0, T)$ with the area $B$ will be what you are looking for.

One velocity profile which solves the problem is as shown below. It contains two segments. From time $0$ to $t_s$, you travel with a constant positive acceleration. Then after that you travel with a constant negative acceleration (of equal magnitude). The peak velocity $v_p$ can be easily computed since we know that $$\frac{1}{2}v_{p}(T) = B.$$ This is fine as long as the magnitude of acceleration of both parts, $|a| = v_p/t_s = 2v_p/T$, does not exceed $a_m$.

Normally, people would ask how to get from $x_0 = A$ to $x_1 = B$ the fastest possible. When there are only velocity and acceleration limits, the time-optimal velocity profile can be computed analytically (see, e.g., this paper ) using polynomial interpolation. People may also be interested in other higher-order constraints such as jerk limits (i.e., limits on the rate of change of acceleration).

I don't think there is any more specific name for these things than something like trajectory generation using polynomials or splines, etc.

I think you are talking about velocity profiles.. as I know if you have a limit for the acceleration and a limit for the velocity then the fastest way to move from A to B is called Trapezoidal velocity model, which uses max acceleration until it reaches the max velocity as this image shows and the inverse when it stops, all the equations can be found if you consider that the space under the velocity curve equals to the total distance (Xf - Xi), thus you can find the minimum T if the acceleration limit and velocity limit are known

Other common profiles are bang-bang acceleration, Smoothed trapezoidal velocity model, third or fifth degree trajectory, They are well explained in Modelling identification and control of Robots By W Khalil & E Dombre