On Fast Jerk–, Acceleration– and Velocity–Restricted Motion Functions for Online Trajectory Generation

: Finding fast motion functions to get from an initial state (distance, velocity, acceleration) to a ﬁnal one has been of interest for decades. For a solution to be practically relevant, restrictions on jerk, acceleration and velocity have to be taken into account. Such solutions use optimization algorithms or try to directly construct a motion function allowing online trajectory generation. In this contribution, we follow the latter strategy and present an approach which ﬁrst deals with the situation where initial and ﬁnal accelerations are 0, and then relates the general case as much as possible to this situation. This leads to a classiﬁcation with just four major cases. A continuity argument guarantees full coverage of all situations which is not the case or is not clear for other available algorithms. We present several examples that show the variety of different situations and, thus, the complexity of the task. We also describe an implementation in MATLAB ® and results from a huge number of test runs regarding accuracy and efﬁciency, thus demonstrating that the algorithm is suitable for online trajectory generation.


Introduction
For achieving high throughput in handling machines, one of the most basic tasks consists of quickly moving from one position to the next one, taking into account machine restrictions regarding velocity, acceleration and jerk. This task is generally known as "path and trajectory planning" for robots and other automatic machines [1,2], and beside short execution times, other goals such as low energy consumption or low jerk have been considered in [3]. In this contribution, we restrict ourselves to a one-dimensional case where a certain distance ∆s is given and a motion function s(t) is to be found, such that symmetric restrictions regarding velocity v(t), acceleration a(t) and jerk j(t) apply, i.e., −j max ≤ j(t) ≤ j max , −a max ≤ a(t) ≤ a max and −v max ≤ v(t) ≤ v max .
The limit to the jerk function implicitly requires the acceleration function to be continuous, whereas the jerk function is allowed to have discontinuities. This task can be subdivided into subtasks regarding the given initial and final states (velocity and acceleration). In the classification given in the respective guideline of the German Association of Engineers [4], 16 combinations are stated depending on whether the initial state (v(t 0 ), a(t 0 )) is (0, 0) (called "rest": R), ( = 0, 0) (G), (0, = 0) (U) or ( = 0, = 0) (B) (German abbreviations). The most well-known task is RR ("rest-to-rest"), which, in robotics, is usually called "pointto-point motion". Kröger and Wahl [5] provide a different classification that also includes the types of restrictions, but for our purposes, the VDI classification suffices.
The task of finding a fast (sometimes also called "optimal") motion function has been investigated for several decades. Roughly, one can distinguish between two kinds of approaches: In the first approach, the task is formulated as a restricted optimization problem and then well-known or self-developed algorithms from the fields of parameter optimization or optimal control are used [6][7][8][9][10]. The class of functions considered are often spline functions [6,7,10]. Lin et al. [8] use a specific class of piecewise-defined general BB task as much as possible to the GG subtask using intermediate velocities. We do not claim to provide an optimal solution (although this might be the case) since we do not have mathematical proof for this. Therefore, we just label our solution as "fast" since, at any time, at least one restriction is exactly fulfilled, but we also show that this does not imply global optimality.
The paper is structured as follows: In the next section, we present the seven-segment motion profile with modifications and recall the "acceleration-velocity plane" introduced by Broquère et al. [20] and Broquère [21]. Section 3 models the subtask GG where initial and final velocities are 0 and, based on this, Section 4 deals with the general task. Section 5 discusses implementation issues and describes the results of the validation in MATLAB ® . Section 6 summarizes the results and discusses further work.
Note that the distance is meant to be the difference between the final and the initial value of the path scale (∆ = − ), not the "travelled distance", which might be much longer when the motion goes back first and then forward again.
As in [20][21][22], we work with a so-called 7-segment motion profile, shown in Figure 1. It is based on a piecewise constant jerk function together with initial conditions on velocity and acceleration. In this profile, the motion function has, at most, 4 segments where the jerk is ± and, at most, 3 segments with zero jerk. In the classical RR situation ("restto-rest", see Figure 1a), the sign pattern of the jerk segments is (+, −, −, +), but we allow arbitrary patterns such as (+, −, +, −) to occur in order to have full coverage of all possible configurations as will be seen later. Formally stated, we have: Note that all of these intervals might have zero length. In the example displayed in Figure 1a, the maximal values for velocity and acceleration are reached, which need not always be the case. Figure 1b provides an example for the general situation where , , and are non-zero. In that example, only is reached and two of the potentially seven segments have length zero. In order to visualize the change of velocity and acceleration in such seven-segment motion functions, Broquère [20,21] introduced the velocity-acceleration plane, shown in In order to visualize the change of velocity and acceleration in such seven-segment motion functions, Broquère [20,21] introduced the velocity-acceleration plane, shown in Figure 2. In this plane, motion functions are displayed mathematically as parametric curves (v(t), a(t)), t ∈ [t 0 , t 7 ]. When one assumes that j(t) = ±j max or 0, then the curves "move" along square root curves or horizontally (e.g., from a(t) = j max t and v(t) = 1 2 j max t 2 one obtains a(v) = 2j max v). The square root curves can be of the kind a = ± c 1 (v − c 2 ) (open to the right) or a = ± c 1 (c 2 − v) (open to the left) with constants c 1 , c 2 . We assume that the horizontal motion only occurs when a(t) = ±a max since otherwise, faster motion is possible. Motion along the square root curves is only possible clockwise since when the acceleration is positive (resp. negative), the velocity must increase (resp. decrease).
The only points where a fast motion function might stay for a time of length >0 are the points (±v max ,0). This is the case when there is a segment with zero jerk and acceleration. Figure 2a shows a representation of the classical RR situation where v max and a max are reached. Note that only points within the area bounded by the left and right square root curves and the horizontal lines at a max and −a max are admissible since only those points can be reached from (0,0) and one can go back from there to (0,0) without violating the restrictions (a larger opening of the square root curve corresponds to a higher value of j max ). The velocity-acceleration plane has one particular "pitfall" where misunderstandings can easily occur, so special care is called for: It does not show the distance ∆s, and this distance heavily depends on where in the velocity-acceleration plane a curve is placed. The length of the curve has nothing to do with the distance ∆s. The blue curve in Figure 2b depicts the motion function of Figure 1b (with positive ∆s) in the velocity-acceleration plane. The green curve has the same initial and end conditions but a negative value for ∆s. Figure 2. In this plane, motion functions are displayed mathematically as parametric curves ( ), ( ) , ∈ [ , ]. When one assumes that ( ) = ± or 0, then the curves "move" along square root curves or horizontally (e.g., from ( ) = and ( ) = one obtains ( ) = 2 ). The square root curves can be of the kind = ± ( − ) (open to the right) or = ± ( − ) (open to the left) with constants , . We assume that the horizontal motion only occurs when ( ) = ± since otherwise, faster motion is possible. Motion along the square root curves is only possible clockwise since when the acceleration is positive (resp. negative), the velocity must increase (resp. decrease). The only points where a fast motion function might stay for a time of length >0 are the points (± ,0). This is the case when there is a segment with zero jerk and acceleration. Figure 2a shows a representation of the classical RR situation where and are reached. Note that only points within the area bounded by the left and right square root curves and the horizontal lines at and − are admissible since only those points can be reached from (0,0) and one can go back from there to (0,0) without violating the restrictions (a larger opening of the square root curve corresponds to a higher value of ). The velocity-acceleration plane has one particular "pitfall" where misunderstandings can easily occur, so special care is called for: It does not show the distance ∆s, and this distance heavily depends on where in the velocity-acceleration plane a curve is placed. The length of the curve has nothing to do with the distance ∆s. The blue curve in Figure 2b depicts the motion function of Figure 1b (with positive ∆s) in the velocity-acceleration plane. The green curve has the same initial and end conditions but a negative value for ∆s.

The Subtask GG: Zero Acceleration Initially and Finally
In this section, we consider a motion with zero acceleration initially and finally. Let resp. be the initial resp. final velocity. We first determine the time ( , ) necessary to get from the initial to the final state by applying first maximal (minimal) jerk and then minimal (maximal) jerk where in between the jerk might be zero and the acceleration equal to ± . Examples are shown in Figure 3 in the velocity-acceleration plane. Type 1 depicts the situation where | − | is so small that maximal/minimal acceleration is not reached, whereas in type 2, the latter is the case. When ± is just reached, we have | − | = , so type 1 occurs when | − | < and type 2 when | − | ≥ .

The Subtask GG: Zero Acceleration Initially and Finally
In this section, we consider a motion with zero acceleration initially and finally. Let v A resp. v E be the initial resp. final velocity. We first determine the time T(v A , v E ) necessary to get from the initial to the final state by applying first maximal (minimal) jerk and then minimal (maximal) jerk where in between the jerk might be zero and the acceleration equal to ±a max . Examples are shown in Figure 3 in the velocity-acceleration plane. Type 1 depicts the situation where |v E − v A | is so small that maximal/minimal acceleration is not reached, whereas in type 2, the latter is the case. When ±a max is just reached, we have |v E − v A | = a max 2 j max , so type 1 occurs when |v E − v A | < a max 2 j max and type 2 when (2) Figure 3 shows examples for the GG situation, each of which works just for one specific given distance. For other distances, the curve goes from to an intermediate velocity and then further on to the final velocity , as is shown in Figure 4 for three situations ( > , < , ≤ ≤ ), where the third situation is not the fastest as we will see. In type 1, the maximally reached acceleration is We summarize the result as follows: (2) Figure 3 shows examples for the GG situation, each of which works just for one specific given distance. For other distances, the curve goes from v A to an intermediate velocity v m and then further on to the final velocity v E , as is shown in Figure 4 for three situations where the third situation is not the fastest as we will see.  From (1) and (2), we can easily compute the overall time and distance when going via an intermediate velocity : In order to visualize how the distance changes when and are fixed and runs from to , one can plot ( , , ) over , as shown in Figure 5a. For From (1) and (2), we can easily compute the overall time and distance when going via an intermediate velocity v m : In order to visualize how the distance changes when v A and v E are fixed and v m runs from v min to v max , one can plot S(v A , v E , v m ) over v m , as shown in Figure 5a. For seeing in one plot how is adequate, as shown in Figure 5b. Both parts provide interesting information which will also be of use for the general situation (Section 4). If v m = v max (resp. v m = v min ) and remains constant for a certain time interval, the distance increases (resp. decreases) linearly with time. Therefore, in Figure 5b, the graph could be extended linearly to the left and to the right. We further observe that the distance varies continuously with v m , which follows mathematically from (2) and (3); therefore, for any given distance, a solution can be found.
In order to visualize how the distance changes when and are fixed and runs from to , one can plot ( , , ) over , as shown in Figure 5a. For seeing in one plot how ( , , ) varies simultaneously, a parametric curve ( ( , , ), ( , , ), ∈ [− , ]) is adequate, as shown in Figure 5b. Both parts provide interesting information which will also be of use for the general situation (Section 4). If = (resp. = ) and remains constant for a certain time interval, the distance increases (resp. decreases) linearly with time. Therefore, in Figure 5b, the graph could be extended linearly to the left and to the right. We further observe that the distance varies continuously with , which follows mathematically from (2), (3); therefore, for any given distance, a solution can be found. The behavior shown in Figure 5a might be astonishing at first sight; the distance increases first when is below before decreasing monotonously. We explain this using Figure 4b. Here, there are two controversial effects: decreasing makes the velocity curve lie "lower", leading to a smaller integral (less distance); on the other hand, the time needed to get to becomes larger, leading to a longer integration interval (larger distance). Obviously, in the long run, the first effect becomes dominant, but in the short term, the second one is dominant, leading to an increase in distance. This gives, already, an The behavior shown in Figure 5a might be astonishing at first sight; the distance increases first when v m is below v A before decreasing monotonously. We explain this using Figure 4b. Here, there are two controversial effects: decreasing v m makes the velocity curve lie "lower", leading to a smaller integral (less distance); on the other hand, the time needed to get to v E becomes larger, leading to a longer integration interval (larger distance). Obviously, in the long run, the first effect becomes dominant, but in the short term, the second one is dominant, leading to an increase in distance. This gives, already, an impression of the complexity of the situation, which is easily overlooked, leading to false assumptions. Figure 5a shows that depending on the given distance, there are up to five solutions to the motion problem using an intermediate velocity v m . Five solutions occur when the given distance is slightly above S(v A , v E ). This also shows that the fact that, at any time, one of the restrictions is taken does not guarantee optimality. Figure 5b shows which solution is the fastest one; for a given distance, the lowest intersection of the vertical line at that distance with the curve provides the best solution. One can also observe that the best time is discontinuous over the given distance. In [22], Sidobre and Desormeaux also provide examples for this phenomenon. They also use a parametric curve of distance over time needed, but they use a different parameter (time).
For finding the best solution within the class of seven-segment functions, one has to solve the equation S(v A , v E , v m ) = ∆s. We will explain how to do this efficiently in Section 5.

The General Task: Arbitrary Velocity and Acceleration, Initially and Finally
In this section, we consider the general case where initial and final velocities and accelerations can be arbitrary. We start with introducing some auxiliary functions that will be helpful in the later exposition. For an arbitrary admissible point (v 0 , a 0 ) in the velocity-acceleration plane, v b (v 0 , a 0 ) is defined to be the velocity for which the following holds: If you start at the point (v b (v 0 , a 0 ), 0) and apply minimum (resp. maximum) jerk if a 0 < 0 (resp. a 0 ≥ 0), then you reach (v 0 , a 0 ). The index b here stands for "backward", i.e., going backward from (v 0 , a 0 ). Figure 6 illustrates the definitions. Analogously, v f (v 0 , a 0 ) is defined to be the velocity for which the following holds: If you start at the point (v 0 , a 0 ) and apply maximum (resp. minimum) jerk if a 0 < 0 (resp. a 0 ≥ 0), then you reach (v f (v 0 , a 0 ), 0). The index f here stands for "forward". An easy computation yields: Moreover, let S b (v 0 , a 0 ) be the additional distance when one goes from (v b (v 0 , a 0 ), 0) to (v 0 , a 0 ), applying minimum (resp. maximum) jerk if a 0 < 0 (resp. a 0 ≥ 0). Analogously, S f (v 0 , a 0 ) is defined to be the distance when one goes from (v 0 , a 0 ) to (v f (v 0 , a 0 ), 0), applying maximum (resp. minimum) jerk if a 0 < 0 (resp. a 0 ≥ 0). Again, an easy computation shows: Finally, let T a (a 0 ) be the time needed to go from a point (v, a 0 ) (v arbitrary) to v f (v, a 0 ) (or, equivalently, to go from v b (v, a 0 ) to (v, a 0 )), applying maximum resp. minimum jerk. We have: T a (a) = |a| j max (6) Robotics 2021, 10, x FOR PEER REVIEW 8 of 27 If one changes the positive direction of the distance, then the original problem is transformed into a problem with data −Δs, − , − , − and − which has the same solution regarding time intervals, only the sign factors for have to be changed (see Broquère, 2011). Therefore, we can restrict ourselves to two main situations: ≤ 0 and ≥ 0, or ≥ 0 and ≥ 0. The other combinations can be transformed into the former ones by changing the positive direction of distance. These two main cases are further split up into four sub-cases which depend additionally on ( , ), ( , ), ( , ) and ( , ); see Table 1.
Case C ≥ 0 and ≥ 0 ( , ) ≤ ( , ) and ( , ) ≤ ( , ) If one changes the positive direction of the distance, then the original problem is transformed into a problem with data −∆s, −v A , −a A , −v E and −a E which has the same solution regarding time intervals, only the sign factors for j max have to be changed (see Broquère, 2011). Therefore, we can restrict ourselves to two main situations: a A ≤ 0 and a E ≥ 0, or a A ≥ 0 and a E ≥ 0. The other combinations can be transformed into the former ones by changing the positive direction of distance. These two main cases are further split up into four sub-cases which depend additionally on Table 1.

Conditions on
From Table 1, it is logically clear that this is a complete coverage of all cases. We will see that only in case C do we need a further division into two sub-cases. In the sequel, we use the following abbreviations: Our general procedure in the following treatment of the cases is based on the principle that we try to relate the general case BB as much as possible to the special case GG by either embedding the general case in a GG situation or extending a GG situation to the general case BB. We discuss case A in detail, elaborating on the lines of argumentation, and will then treat cases B-D shorter.
In this case, E lies "right of" A in the sense that E lies on a square root curve (open to the right) right of the square root curve (open to the right) on which the point A lies or the curves are identical.
For a certain subset of all distances ∆s, we can embed the task in a GG task for going Figure 7a. Making v m smaller and inserting a phase with constant velocity v min enables us to realize arbitrarily small values for ∆s (mathematically spoken: ∆s goes to −∞ when the length of the phase with constant v min goes to ∞). We get the corresponding distances by computing: Note that this holds for v min ≤ v m , but we will disregard, first, this restriction on v m and allow v m to be arbitrarily small and correct that later.
We can similarly cover arbitrarily large distances by extending the GG task going from (v f A , 0) to (v bE , 0) via a v m ≥ v bE , as is shown in Figure 7b. When v m reaches v max , one can insert a phase with constant velocity v max . Again, we will disregard this restriction on v m first and correct that later. We obtain the corresponding distances by computing: As we will see in examples, there might be a gap between the interval of distances covered in Part I and that covered in Part III. Distances in this gap can be achieved in two ways.
We again extend the GG task going from where we let v m run from right to left (!), i.e., from v f E to v bE , and then "cut off" the part going from v bE to v m and back to v bE (shown in Figure 7c as a dashed pink curve). This continuously connects the distance covered in Part I when using v m = v f A with the distance covered in Part III when using v m = v bE . Therefore, we have a full coverage of all possible real distances. We obtain the corresponding distances by computing: Robotics 2021, 10, 25 9 of 26 Another way to close the gap is a bit more complicated and is shown in Figure 7d. The first part up to point C is the same as in Part IIa, but then we have the sequence −j max , j max , −j max instead of j max , −j max , j max in Part IIa. We can embed part of the curve in a GG task going from (v bE , 0) to (v f E , 0) via a v m with v f A < v m < v bE , as is shown in Figure 7d.
max j max , the minimal acceleration −a max is reached and going on to the left with v m does not further change the distance ∆s since the parts added are cut off again later, as can be seen by drawing a figure which is omitted here. We can compute the corresponding distances in the following way: In our experiments (see the examples below), we have encountered a situation where a solution using Part IIb provides a shorter time than a solution using Part IIa, but then the distances were already covered by Part I or III, which provided even shorter times. However, since we have no mathematical proof that this is always the case, we simply include both possibilities. As we will see in the implementation section, this adds only the effort of finding the roots of three additional polynomials. Note that in case of v f A = v bE or a E = 0, parts IIa/b do not occur.
For each of the parts, the times needed can be easily computed: As in the GG task, we can illustrate different situations by plotting (S(v m ), T(v m )) as a parametric curve for parts I-III. We present a few examples showing interesting situations and behavior. In the examples, all distances have the unit m, velocities m/s, acceleration m/s 2 and jerk m/s 3 . Units are omitted for the sake of brevity. As restrictions, we have chosen values similar as the ones used in [1]: j max = 30, a max = 10, v max = 20.
Example 1: No gap between Parts I and III, but Parts IIa or IIb are better. Initial and final conditions: (18,9). Note that the colors used in the following figures have nothing to do with the colors used in Figure 7. The corresponding curve is shown in Figure 8a, where the green part (Part I) goes on to the left, covering arbitrarily small (negative) distances, and the black part (Part III) goes on to the right, covering arbitrarily large distances. One can see that Parts I and III cover all distances but Parts IIa and IIb provide solutions needing less time in the interval of distances where they are valid. There is no huge difference between Parts IIa and IIb, but when zooming in (Figure 8b), one can see that, in this example, the red part (Part IIa) is better. Figure 8 also shows that for a given distance, there might be several solutions in different parts or in the same part, as we have already recognized in the GG situation in Section 3. For example, for the distance ∆s = 18, there are two solutions in Part I and one solution each in Parts IIa and IIb.  Note that this holds for ≤ , but we will disregard, first, this restriction on and allow to be arbitrarily small and correct that later. We can similarly cover arbitrarily large distances by extending the GG task going from ( , 0) to ( , 0) via a ≥ , as is shown in Figure 7b. When reaches , one can insert a phase with constant velocity . Again, we will disregard this restriction on first and correct that later. We obtain the corresponding distances by computing: As we will see in examples, there might be a gap between the interval of distances covered in Part I and that covered in Part III. Distances in this gap can be achieved in two ways.
We again extend the GG task going from ( , 0) to ( , 0) via a with < < , where we let run from right to left (!), i.e., from to , and then "cut off" the part going from to and back to (shown in Figure 7c as a dashed pink curve). This continuously connects the distance covered in Part I when using = with the distance covered in Part III when using = . Therefore, we have a full coverage of all possible real distances. We obtain the corresponding distances by computing:  9) . We use the same accelerations as in Example 1 but shift the velocities to the left by 28. In this way, variations are also produced in [22].
The corresponding curve is shown in Figure 9a. Again, the green part (Part I) goes on to the left, covering arbitrarily small (negative) distances, and the black part (Part III) goes on to the right, covering arbitrarily large distances. Parts I and III cover all distances and one of them provides the best solution, so Parts IIa and IIb are not needed. There is no huge difference between Parts IIa and IIb, but when zooming in (Figure 9b), one can see that, in this example, the blue part (Part IIb) is better. Part IIb provides a solution where the jerk changes sign three times (see Figure 7d), whereas in the solution of Part IIa, the jerk changes sign only two times. Therefore, the conjecture that solutions with less changes are better, which might look plausible at first sight, is wrong. What might be true  10,9). We use the same accelerations as in Example 1 but shift the velocities to the left by 28. In this way, variations are also produced in [22].
The corresponding curve is shown in Figure 9a. Again, the green part (Part I) goes on to the left, covering arbitrarily small (negative) distances, and the black part (Part III) goes on to the right, covering arbitrarily large distances. Parts I and III cover all distances and one of them provides the best solution, so Parts IIa and IIb are not needed. There is no huge difference between Parts IIa and IIb, but when zooming in (Figure 9b), one can see that, in this example, the blue part (Part IIb) is better. Part IIb provides a solution where the jerk changes sign three times (see Figure 7d), whereas in the solution of Part IIa, the jerk changes sign only two times. Therefore, the conjecture that solutions with less changes are better, which might look plausible at first sight, is wrong. What might be true is that the best solution (here from Part I) always has the lowest number of sign changes, but we do not have mathematical proof for this conjecture.
The corresponding curve is shown in Figure 9a. Again, the green part (Part I) goes on to the left, covering arbitrarily small (negative) distances, and the black part (Part III) goes on to the right, covering arbitrarily large distances. Parts I and III cover all distances and one of them provides the best solution, so Parts IIa and IIb are not needed. There is no huge difference between Parts IIa and IIb, but when zooming in (Figure 9b), one can see that, in this example, the blue part (Part IIb) is better. Part IIb provides a solution where the jerk changes sign three times (see Figure 7d), whereas in the solution of Part IIa, the jerk changes sign only two times. Therefore, the conjecture that solutions with less changes are better, which might look plausible at first sight, is wrong. What might be true is that the best solution (here from Part I) always has the lowest number of sign changes, but we do not have mathematical proof for this conjecture.  9). We use the same accelerations as in Example 1 but shift the velocities by −11.5. For Parts I and III, the remarks given in Examples 1 and 2 are still valid; see Figure 10. However, here, in both parts, the distance changes monotonously. This example shows that without using the  (6.5, 9). We use the same accelerations as in Example 1 but shift the velocities by −11.5. For Parts I and III, the remarks given in Examples 1 and 2 are still valid; see Figure 10. However, here, in both parts, the distance changes monotonously. This example shows that without using the constructions of Parts IIa or IIb, a certain range of distances (here, roughly from 1.4 to 3) might not be covered. In the example, Part IIa provides the better solution and we have not encountered an example of case A where Part IIb is best, but we do not have proof that this is always so.  9). We use the same accelerations as in Example 1 but shift the velocities to the left by −17.2.
In this example, zooming shows that the red Part IIa curve "bulges" to the right (Figure 11b) (cf. similar examples in [22]). Therefore, there is a small interval of distances to the right by about −5.34 where Part IIa provides the best solution, ending at the S-value of the utmost right point of the red curve. This example demonstrates that for finding the best solution, it is, in general, not sufficient to just consider the interval of distances between the "end points" of the parts. If one considers the interval of S-values between the end points of the red curve, then on that interval, the Part I curve (green) is always better. Therefore, an approach working with "critical distances" as in [20] has its limits.  8,9). We use the same accelerations as in Example 1 but shift the velocities to the left by −17.2.
In this example, zooming shows that the red Part IIa curve "bulges" to the right (Figure 11b) (cf. similar examples in [22]). Therefore, there is a small interval of distances to the right by about −5.34 where Part IIa provides the best solution, ending at the S-value of the utmost right point of the red curve. This example demonstrates that for finding the best solution, it is, in general, not sufficient to just consider the interval of distances between the "end points" of the parts. If one considers the interval of S-values between the end points of the red curve, then on that interval, the Part I curve (green) is always better. Therefore, an approach working with "critical distances" as in [20] has its limits.
In this example, zooming shows that the red Part IIa curve "bulges" to the right (Figure 11b) (cf. similar examples in [22]). Therefore, there is a small interval of distances to the right by about −5.34 where Part IIa provides the best solution, ending at the S-value of the utmost right point of the red curve. This example demonstrates that for finding the best solution, it is, in general, not sufficient to just consider the interval of distances between the "end points" of the parts. If one considers the interval of S-values between the end points of the red curve, then on that interval, the Part I curve (green) is always better. Therefore, an approach working with "critical distances" as in [20] has its limits. The examples given above show that a visualization using a parametric ( , ) curve allows to easily create a variety of examples for finding counter-examples to conjectures one might have in mind. This has also been presented in [22] using a different parameterization. Using allows us to easily recognize in which part the best solution occurs. Moreover, the parameter has a direct meaning in the velocity-acceleration plane. One might be inclined to look for further patterns to see in advance which part provides the best solution, but even this small set of examples shows the variability. We will make no further distinctions but just compute the solution(s) provided by each part and take the This has also been presented in [22] using a different parameterization.
Using v m allows us to easily recognize in which part the best solution occurs. Moreover, the parameter v m has a direct meaning in the velocity-acceleration plane. One might be inclined to look for further patterns to see in advance which part provides the best solution, but even this small set of examples shows the variability. We will make no further distinctions but just compute the solution(s) provided by each part and take the best one (this approach is also used in [22]). We consider this as a sound compromise between complexity (comprehensibility) on the one hand and computational effort on the other hand. We find the best solution within the solutions provided by Parts I-III by inserting the given distance in Equations (7)-(10) and computing v m . As we will see in the next section, this requires finding the roots of polynomials. For each solution candidate, it is checked whether v m is admissible (real and within the allowed range). For the admissible ones, one computes the times and chooses the solution with lowest time. If v m < v min or v m > v max , one sets v m = v min resp. v m = v max and inserts a phase with constant (minimum or maximum) velocity.
In this case, E lies "left of" A in the sense that E lies on a square root curve (open to the right) left of the square root curve (open to the right) that the point A lies on. We can proceed in the same way as we did in case A and have, again, four parts, as shown in Figure 12. stant (minimum or maximum) velocity. Case B: ≤ 0 and ≥ 0, > In this case, E lies "left of" A in the sense that E lies on a square root curve (open to the right) left of the square root curve (open to the right) that the point A lies on. We can proceed in the same way as we did in case A and have, again, four parts, as shown in Figure 12. Again, with Part I resp. III, we can realize arbitrarily small resp. large distances going via intermediate velocities .
Arguing as in case A, we obtain for Parts I and III the same formulae as in (7) and (8)  Again, with Part I resp. III, we can realize arbitrarily small resp. large distances going via intermediate velocities v m . Arguing as in case A, we obtain for Parts I and III the same formulae as in (7) and (8) resp. (11) and (12), but the ranges for v m are different for Part I v m ≤ v bE and for Part III v m ≥ v f A . The formulae for Parts IIa and IIb are different and provided below.
We omit examples for this case since they provide no new insights. The procedure for computing the best solution follows the same lines as the one described in case A.
Case C: a A ≥ 0 and a E ≥ 0, v bA ≤ v bE and v f A ≤ v f E In this case, E lies "right of" A in the sense that E lies in the area right of or on the square root curve through A open to the right, and right of or on the square root curve through A open to the left (Figure 13).
We omit examples for this case since they provide no new insights. The procedure for computing the best solution follows the same lines as the one described in case A. Case C: ≥ 0 and ≥ 0, ≤ and ≤ In this case, E lies "right of" A in the sense that E lies in the area right of or on the square root curve through A open to the right, and right of or on the square root curve through A open to the left ( Figure 13). We split this case up into two sub-cases ( ≤ and > ) that need partially different treatments. The sub-cases are shown in Figure 14. In the first sub-case (left), we have a closed curved quadrilateral ABED, whereas in the second one (right), we have a curved pentagon, ABCED. Note that in the first sub-case, there might also occur a curved pentagon when is reached, but this does not require a further distinction. Sub-Case Ca: ≤ As in case A, we split up the construction of solutions for all distances into different parts, as shown in Figure 15. With Part I resp. III, we can realize arbitrarily small resp. We split this case up into two sub-cases (v bE ≤ v f A and v bE > v f A ) that need partially different treatments. The sub-cases are shown in Figure 14. In the first sub-case (left), we have a closed curved quadrilateral ABED, whereas in the second one (right), we have a curved pentagon, ABCED. Note that in the first sub-case, there might also occur a curved pentagon when a max is reached, but this does not require a further distinction.
We omit examples for this case since they provide no new insights. The procedure for computing the best solution follows the same lines as the one described in case A. Case C: ≥ 0 and ≥ 0, ≤ and ≤ In this case, E lies "right of" A in the sense that E lies in the area right of or on the square root curve through A open to the right, and right of or on the square root curve through A open to the left ( Figure 13). We split this case up into two sub-cases ( ≤ and > ) that need partially different treatments. The sub-cases are shown in Figure 14. In the first sub-case (left), we have a closed curved quadrilateral ABED, whereas in the second one (right), we have a curved pentagon, ABCED. Note that in the first sub-case, there might also occur a curved pentagon when is reached, but this does not require a further distinction. Sub-Case Ca: ≤ As in case A, we split up the construction of solutions for all distances into different parts, as shown in Figure 15. With Part I resp. III, we can realize arbitrarily small resp. Sub-Case Ca: v bE ≤ v f A As in case A, we split up the construction of solutions for all distances into different parts, as shown in Figure 15. With Part I resp. III, we can realize arbitrarily small resp. large distances going via intermediate velocities v m ≤ v bE resp. v m ≥ v f A . If equality holds, then Part I and Part III provide the same point and, hence, the same distance ∆s. Therefore, Parts I and III already cover all distances but do not necessarily provide the shortest time. Some distances can be realized better by going directly within the curved quadrilateral ABED using the sequence j max , −j max , j max in Part IIa or the sequence −j max , j max , −j max in Part IIb (see Figure 15c,d). We will give an example for this situation below. large distances going via intermediate velocities ≤ resp. ≥ . If equality holds, then Part I and Part III provide the same point and, hence, the same distance Δs. Therefore, Parts I and III already cover all distances but do not necessarily provide the shortest time. Some distances can be realized better by going directly within the curved quadrilateral ABED using the sequence , − , in Part IIa or the sequence − , , − in Part IIb (see Figure 15c,d). We will give an example for this situation below. Arguing as in case A, we obtain the following formulae for distances and times: We provide some examples that give an insight into the variability of situations. We use the same values for the restrictions as in the examples given for Case A, i.e., j max = 30, a max = 10, v max = 20. We have, again, one set of initial and final conditions and shift this in the v-direction. The values used for producing Figure 16   We recognize that the parts are no longer connected, but there are two "connectivity components", Parts I/III and IIa/b. It can also be seen that Parts I and III provide solutions for all distances, but for the distances for which Parts IIa and IIb are applicable, they provide shorter times. In example 1, Part IIb is better than Part IIa, and in example 2, it is the other way around.
In this example, we also recognize the disconnectedness. In addition, we see that both the red curve (Part IIa) and the blue curve (Part IIb) "bulge". Part IIb provides the shortest solution within a range of distances from about 0.068 to about 0.074, whereas for Part IIa, this holds for a range from about 0.074 to about 0.116. This again shows that an approach considering different cases only between the distances reached at the boundary points of the parts cannot always provide the best solution.
Sub-Case Cb: We recognize that the parts are no longer connected, but there are two "connectivity components", Parts I/III and IIa/b. It can also be seen that Parts I and III provide solutions for all distances, but for the distances for which Parts IIa and IIb are applicable, they provide shorter times. In example 1, Part IIb is better than Part IIa, and in example 2, it is the other way around.
In this example, we also recognize the disconnectedness. In addition, we see that both the red curve (Part IIa) and the blue curve (Part IIb) "bulge". Part IIb provides the shortest solution within a range of distances from about 0.068 to about 0.074, whereas for Part IIa, this holds for a range from about 0.074 to about 0.116. This again shows that an approach considering different cases only between the distances reached at the boundary points of the parts cannot always provide the best solution.

Sub-Case Cb: v bE > v f A
This case is depicted in Figure 14b. Regarding Part I resp. III, the same holds as was stated for sub-case Ca, i.e., we can realize arbitrarily small resp. large distances going via intermediate velocities, but here, v m ≤ v f A resp. v m ≥ v bE (see Figure 17a,b). Moreover, if equality holds, then Part I and Part III do not provide the same point and, hence, the same distance ∆s.
This case is depicted in Figure 14b. Regarding Part I resp. III, the same holds as was stated for sub-case Ca, i.e., we can realize arbitrarily small resp. large distances going via intermediate velocities, but here, ≤ resp. ≥ (see Figure 17a,b). Moreover, if equality holds, then Part I and Part III do not provide the same point and, hence, the same distance Δs. In order to guarantee the continuity of covered distances, we again include two other parts called Part IIa and IIb, using the sequence , − , in Part IIa and the sequence − , , − in Part IIb (see Figure 17c,d). In Part IIa, the motion curve starting at A moves up in the direction of D beyond the point F, then moves down to a point on the curve CE and then up to E (see Figure 17c). This is much the same as shown in Figure 15c for the previous sub-case Ca, but note that now, the motion curve must go beyond F (otherwise one would need a sequence with three changes in jerk instead of two). In Part IIb, the motion curve starting at A moves down in the direction of B, then moves up to a point on the curve DE (which lies above the point G) and then down to E (see Figure 17d). We checked that all possible distances are covered by using continuity: If in Part I we choose = , then we obtain the motion curve ABGE. This is also the motion curve one obtains in Part IIb when one goes down to the point B. At the other "end" of Part IIb, one obtains the motion curve ADE (i.e., going down by 0). This is also the motion curve one obtains in Part IIa when one goes up from A to D. At the other "end" of Part IIa, one obtains the motion curve AFCE. We also obtains this motion curve when we choose = in Part III. Therefore, Parts IIa and b fulfill the purpose to continuously connect Parts I and III. As we will see in the examples, in this sub-case, the special situation might occur that we need both Parts IIa and IIb to have a full coverage of all In order to guarantee the continuity of covered distances, we again include two other parts called Part IIa and IIb, using the sequence j max , −j max , j max in Part IIa and the sequence −j max , j max , −j max in Part IIb (see Figure 17c,d). In Part IIa, the motion curve starting at A moves up in the direction of D beyond the point F, then moves down to a point on the curve CE and then up to E (see Figure 17c). This is much the same as shown in Figure 15c for the previous sub-case Ca, but note that now, the motion curve must go beyond F (otherwise one would need a sequence with three changes in jerk instead of two). In Part IIb, the motion curve starting at A moves down in the direction of B, then moves up to a point on the curve DE (which lies above the point G) and then down to E (see Figure 17d). We checked that all possible distances are covered by using continuity: If in Part I we choose v m = v f A , then we obtain the motion curve ABGE. This is also the motion curve one obtains in Part IIb when one goes down to the point B. At the other "end" of Part IIb, one obtains the motion curve ADE (i.e., going down by 0). This is also the motion curve one obtains in Part IIa when one goes up from A to D. At the other "end" of Part IIa, one obtains the motion curve AFCE. We also obtains this motion curve when we choose v m = v bE in Part III. Therefore, Parts IIa and b fulfill the purpose to continuously connect Parts I and III. As we will see in the examples, in this sub-case, the special situation might occur that we need both Parts IIa and IIb to have a full coverage of all distances, whereas in the other cases considered so far, only one of the parts was needed for this purpose.
The formulae for distances and time are the same as in the previous sub-case (i.e., Equations (19)-(26)) but the ranges for v m are different. Therefore, we just provide these ranges: We provide some examples that give an insight into the variability of situations and the specifics of this sub-case. We use the same values for the restrictions as in the examples given for case A, i.e., j max = 30, a max = 10, v max = 20. We have, again, one set of initial and final conditions and shift this in the v-direction: (v A , a A ) = (0.5, 4.9), (v E , a E ) = (2.76, 7.9).
We provide some examples that give an insight into the variability of situations and the specifics of this sub-case. We use the same values for the restrictions as in the examples given for case A, i.e., = 30, = 10, = 20. We have, again, one set of initial and final conditions and shift this in the v-direction: ( , ) = (0.5,4.9), ( , ) = (2.76,7.9).
Example 1: Shift = 0, i.e., we use exactly the data given above (Figure 18a). In this example, there is a gap between Parts I and III. Only Part IIa is needed to fill the gap. It also provides the shortest time where it is valid. One can see how one goes continuously from Part I via IIb and IIa to III as described above.
Example 2: Shift = −1.3, i.e., we use: ( , ) = (−0.8,4.9), ( , ) = (1.46,7.9) (Figure 18b). Here, both parts IIa and IIb are needed to cover all possible distances. For a certain distance, there is only one part that covers that distance and is, hence, automatically the best one.  In this example, there is a gap between Parts I and III. Only Part IIa is needed to fill the gap. It also provides the shortest time where it is valid. One can see how one goes continuously from Part I via IIb and IIa to III as described above.
Here, both parts IIa and IIb are needed to cover all possible distances. For a certain distance, there is only one part that covers that distance and is, hence, automatically the best one.
Example 3: Shift =−1.05, i.e., we use: (v A , a A ) = (−0.55, 4.9), (v E , a E ) = (1.71, 7.9) (Figure 18c). This example looks, at first, similar to example 2, but when one zooms into the interesting area, one can recognize that for some distances covered by Part IIb (blue), there is also a coverage by Part IIa with a shorter time. Moreover, for some distances (e.g., 0.132), there are even three solutions within Part IIb, one of them having the shortest time. This again shows the variability of situations.
Case D: a A ≥ 0 and a E ≥ 0, v bA > v bE or v f A > v f E This case is illustrated in Figure 19. Case D is the easiest one since it can be completely reduced to the GG situation by a combination of embedding and extension and we just need Parts I and III. Figure 19 shows situations when both of the two velocity conditions are fulfilled, but it is easy to check that nothing changes when only one of them holds. Consider the GG task for going from (v f A , 0) to (v f E , 0) via a v m I ≤ v bE . If one extends this by going from A to (v f A , 0) and cuts off the part going from E to (v f E , 0), one obtains a motion curve from A to E with a certain distance. Making v m I smaller and inserting a phase with velocity v min enables us to realize arbitrarily small values for ∆s. Similarly, the red motion curve can be constructed from the GG task going from (v bA , 0) to (v bE , 0) via a v m I I ≥ v f A . Again, making v m I I larger and inserting a phase with velocity v max enables us to realize arbitrarily large values for ∆s. Since for v m I = v bE and v m I I = v f A we obtain the same motion curve, we continuously cover all distances.
again shows the variability of situations. Case D: ≥ 0 and ≥ 0, > or > This case is illustrated in Figure 19. Case D is the easiest one since it can be completely reduced to the GG situation by a combination of embedding and extension and we just need Parts I and III. Figure 19 shows situations when both of the two velocity conditions are fulfilled, but it is easy to check that nothing changes when only one of them holds. Consider the GG task for going from ( , 0) to ( , 0) via a ≤ . If one extends this by going from A to ( , 0) and cuts off the part going from E to ( , 0), one obtains a motion curve from A to E with a certain distance. Making smaller and inserting a phase with velocity enables us to realize arbitrarily small values for Δs. Similarly, the red motion curve can be constructed from the GG task going from ( , 0) to ( , 0) via a ≥ . Again, making larger and inserting a phase with velocity enables us to realize arbitrarily large values for Δs. Since for = and = we obtain the same motion curve, we continuously cover all distances. We obtain the same formulae for distances and times as for Parts I and III in Case Ca, i.e., Equations (19), (20), (23), (24) also hold in this case. Since there are no remarkable special situations occurring in this case, we give no examples.

Implementation and Validation with MATLAB ®
In both the GG and the BB situations, beside splitting into several cases, which is easy to implement, the main task consists of solving an equation. In GG and in Parts I and III of the BB cases, the equation is of the type: = ( , , ) = ( , ) + ( , ) where is unknown and the distance and the velocities , are given. The equations for Parts IIa and IIb in the BB situation (9), (10), (15), (16), (21) and (22) can be rewritten in the form: We abbreviate the difference on the right hand side as ( , , ). We obtain the same formulae for distances and times as for Parts I and III in Case Ca, i.e., Equations (19), (20), (23), (24) also hold in this case. Since there are no remarkable special situations occurring in this case, we give no examples.

Implementation and Validation with MATLAB ®
In both the GG and the BB situations, beside splitting into several cases, which is easy to implement, the main task consists of solving an equation. In GG and in Parts I and III of the BB cases, the equation is of the type: where v m is unknown and the distance w and the velocities v A , v E are given. The equations for Parts IIa and IIb in the BB situation (9), (10), (15), (16), (21) and (22) can be rewritten in the form: We abbreviate the difference on the right hand side as S neg (v A , v E , v m ). We split up Equation (28) into sub-cases depending on whether the maximum acceleration is reached going from v A to v m resp. from v m to v E (cf. Equations (1) and (2)): If we have the BB task, we first determine which of the cases, A to D, is applicable (or rewrite the problem by changing the direction of distance). In the respective case, we determine the solutions for an equation of type w = S(v A , v E , v m ) for Parts I and III and the solutions for an equation of type w = S neg (v A , v E , v m ) for Parts IIa and IIb as described above. Note that even for Parts I and III where we can relate the BB task to a GG task by embedding or extension, we cannot simply use an algorithm for the GG task since we have to take into account the restrictions on the interval where v m must lie. We have to determine the zeros of, at most, 12 polynomials of degree 4 (four parts with three polynomials each at most). Then, we additionally check whether the solutions for v m are within the given range for the respective part (the ranges are given in the equations above) and drop those who are not. If v m < v min or v m > v max , we insert a phase with constant velocity. We then compute the lengths for the different time intervals in the seven-segment profile and sum these up. The candidate with the lowest sum is then the best one within the set of all candidates considered. The algorithm is described semi-formally in Algorithm 2.  If we have a GG task, we can determine in advance which one of the Equations (30)-(33) is applicable and determine whether we have case (α) or (β) (we omit the details). Therefore, we would have to find the roots of at most one polynomial.
Regarding validation, we have to state first what we intend to validate. Since the presented algorithm logically covers all possible situations by the continuity argument we explained in the previous section, theoretically, there is no necessity for validation otherwise than checking for a mistake in the argumentation that might come up during test runs. What certainly needs validation is the implementation of the algorithm, particularly regarding numerical issues such as cancellation effects (accuracy). Moreover, for checking the algorithm's suitability for online trajectory planning, it is also important to investigate efficiency, i.e., the time necessary for finding the solution. Our accuracy and efficiency check was performed by having a huge number of test runs with randomly generated data covering all the cases and parts described in Section 4. We used the following scheme:

•
We first prescribe upper boundary values for j max , a max , v max , called j maxb , a maxb , v maxb , and the largest distance ∆s max is considered. We choose 100 for each (units: m/s 3 , m/s 2 , m/s, m) for our test runs to allow for a larger range but this is a bit arbitrary.

•
Within the interval [0.0001·j maxb , j maxb ], we generate a random value for j max and proceed analogously for a max , v max . Moreover, for ∆s ∈ [−∆s max , ∆s max ], we do so randomly.

•
Within the area in the velocity-acceleration plane that is bounded by the horizontal lines at ±a max and the left and right square root curves shown in Figure 3, we choose values for (v A , a A ) and (v E , a E ) randomly.
has been generated randomly this way, a test run for computing the best function is performed and it is checked whether the solution really gives the prescribed final velocity and acceleration and the distance ∆s within a certain margin of error. If the error is larger than 10-7, the configuration producing it is recorded for further investigation.
Given this scheme, we made several runs with 10 7 random configurations which took about 40 min each (depending on whether the profiler in MATLAB was turned on or off). During the first test runs, we encountered, a few times, the situation that no solution was found, which is in contradiction with the logical argumentation in Section 4. The reasons were, as already assumed, of numerical origin and of two different kinds. In the first type of situation, the solutions were at border points between different parts. Consider, for example, case B: If there is a solution very close to the border for v m between Part IIa and Part IIb (i.e., v m = v f A ), then it might not be accepted in Part IIa because it is required there that v m > v f A . By simply allowing equality here (which in theory means one has an overlap between Parts IIa and III), one can avoid this problem. One could also allow a small overlapping ε-interval here. The second type of situation where no solution was found had its origin in the error margin for the distance in the computation of candidates (roots of the polynomials). By enlarging the error margin, this type of problem could be avoided in the subsequent runs. Since, in the final solution, the distance is again checked, this does not lead to the acceptance of solutions with errors above a specified value. Actually, since distances are computed using Equations (30)-(33), stated above in this section, we might have typical cancellation effects when v A and v m or v E and v m have nearly the same absolute value.
We performed a test run with 10 8 configurations, which provided a solution for all configurations, so the numerical remedies reported above seem to work. Table 2 gives information on errors. The maximum error in ∆s was 6.57 × 10 −6 and there were only 15 configurations with errors in ∆s of more than 1 × 10 −7 . Therefore, we conclude that the implementation provides acceptable results for realistic situations regarding the values for j max , a max and v max .  Table 3 provides information on the case and part coverage. It shows that all cases and parts were sufficiently covered except for Part IIb in cases A and B (in case D, Parts IIa and IIb do not occur; see Section 4). In earlier test runs with less configurations, it was nearly always the case that there was no example for Part IIb in cases A and B, and we conjectured already in Section 4 that Part IIb might be unnecessary. A closer look at the configurations that led to the 12 entries for Part IIb in cases A and B revealed that, again, this is a numerical effect. As is shown in Figure 10, if the solution point is very close to the "meeting point" of the curves for Parts IIa, IIb and III, it might happen that because of round-off errors, IIb gives a lower time value than IIa, although zooming in shows that Part IIb is above Part IIa. Practically, this does not really matter since the solutions provide nearly the same time. Therefore, we still stick to our conjecture that in cases A and B, Part IIb never contains the best solution. Regarding efficiency, we wanted to investigate whether the computation of the best function can be performed within a controller cycle which might be 1 ms (cf. [12]) or less, and for very fast controllers, even 100 µs. In our computations, we used a desktop PC with a Xeon E5-1630v4 processor with 3.7 GHz.
It is not straightforward to generate valid efficiency data when running MATLAB functions. As stated in Mathwork's own performance white paper [23], there is much "noise" to be taken into account, which might lead to considerable variation of times. This noise includes scheduling of processes and threads by the operating system and use of different memory caches. Moreover, the just-in-time compiler of MATLAB compiles a function once and uses then the compiled version. The variation can be made visible by running the best function with a fixed configuration several times, such that the computational work is identical. This gave values between a few milliseconds and a few hundred microseconds. We took this into account by repeating the computation for the same configuration several times and then taking the lowest value. We measured the times for the best function finder for 100,000 configurations, each repeated 1000 times, which provides a good coverage of all cases and parts. The maximum time was 303 µs. The result already shows that a run of the best function finder can be performed with a cycle time of 1 ms without any problem. However, there is even considerable potential for improvement. One of the main tasks in the best function finders is the computation of roots of the 12 polynomials of degree 4. In a test run with 1,000,000 configurations with 20 repetitions each, we measured an average time of 156 µs for computing the roots of the 12 polynomials. MATLAB's roots function is a general root-finding function for polynomials of an arbitrary degree. For polynomials of degree 4 (also called "quartics"), there are many more efficient special solvers available. For solving a quartic accurately and efficiently, Orellana and De Michele [24] needed less than 0.5 µs on a dual-core i7 processor with 3.3 GHz. This means that by using such a specific solver, we can reduce the effort for root finding to about 6 µs (12 polynomials). That would cut the "worst case" time for computing the best function of about 303 µs by half. Moreover, our current MATLAB code contains overhead for providing additional information, and the code is split up into several small functions for making it better readable. Modern compilers contain optimizers that try to reduce the overhead when actually producing the executable code, e.g., by so-called "inlining", where calls to "small functions" are substituted by inserting the code of the functions into the calling function. Orellana and De Michele [24] showed that by using a certain optimizer option, they could reduce the time needed by about half. This indicates that the time needed for computing the best function could even be brought well below 100 µs. This is comparable with the time reported in [12] for the worst case (540 µs for six axes) and in [19] as average (74 µs for one axis). Sidobre and Desormeaux [22] even achieved 2.5 µs, but the three-variable Newton method they applied after first obtaining an approximation did not always provide the optimal solution. The most important criterion for online trajectory generation is not the absolute time as long as the computation can be performed within one controller cycle.

Conclusions
In this contribution, we investigate how a fast motion function can be found when restrictions for jerk, acceleration and velocity, initial and final values for velocity and acceleration and the distance are given. Our approach applies a seven-segment motion profile with piecewise constant jerk, which was already considered by other authors. We developed an algorithm for computing such a profile which considers only four major cases and, hence, has a manageable complexity. We investigate these cases systematically in the velocity-acceleration plane, which provides an easily understandable visual explanation. The investigation showed that there are often several seven-segment profiles fulfilling the condition differing considerably in execution time. We take the best one, whereas the algorithm by Ezair et al. [19] leads to just one of them. Since (like Sidobre/Desormeaux [22]) we do not have mathematical proof that there are no other seven-segment profiles with shorter times, we only claim to have a "fast" solution, not necessarily an "optimal" one. Moreover, a continuity argument proved that we cover all possible distances, whereas in the work by Sidobre and Desormeaux [22] treating the same problem, only a brief explanation but no proof is given.
We implemented our algorithm in MATLAB, where we reduced the computation essentially to the finding of roots of up to 12 polynomials of degree 4, which can easily be re-implemented. A large test run with 10 8 configurations showed that a solution was always found and all cases as well as all parts were covered satisfactorily. This also supports our claim of full coverage of all possible situations. Moreover, our timing experiments showed that our algorithm is suitable for online trajectory generation. Although finding the zeros of up to 12 polynomials makes our algorithm a bit slower than algorithms for special situations (such as [12]), the additional cost is small since very fast solvers for quartics are available.
There are also clear limitations to the approach using a seven-segment profile. Since the jerk function is piecewise constant, the discontinuity might lead to unwanted vibrations. As stated in the literature review, for special situations such as RR ("rest-to-rest"), smoother functions have been designed. This deficit of the seven-segment approach might be reduced by working with a 15-segment profile with continuous jerk. A feasible way for finding such a profile in the general BB task might be to generalize the approach developed in this contribution. A further limitation of the seven-segment approach is that it does not handle variable constraints but only constant ones, and the constraints are assumed to be symmetric, although it would be possible to modify our approach in order to include asymmetric constraints.
We have not tested the applicability of seven-segment profiles experimentally since this has already been performed by other authors (e.g., [12,22]), on whom we rely. In real applications such as robotics, the situation we investigated in this article is only one problem among many. Further considerations are necessary when there are several drives that need coordination or when restrictions change and one has to turn the initial state into an admissible one first. One can find strategies for this in [12,19,20,25].

Conflicts of Interest:
The author declares no conflict of interest. Table A1. Polynomials and solutions for w = S(v A , v E , v m ).