LESSON

# 1D trapezoidal trajectory

#### Share

#### Transcript

A commonly used alternative velocity profile looks like this. We accelerate. We move at constant velocity for as long as we need to and then we slow down as quickly as we can. An advantage of a trajectory like this is that we get to our destination much more quickly. The area under the two curves is the distance travelled, and that's the same in the two cases. It’s just that the red curve is much more compact. It only takes 35 time units instead of 50 time units.

This kind of motion is referred to as a trapezoidal profile. It's named after the shape of the velocity profile. It’s a trapezoid. It comprises an acceleration phase, a coasting phase - where we move at a constant velocity - and then a deceleration phase. During acceleration and deceleration, the velocity is a linear function of time. Which means, that position is a parabolic function of time. During the coasting phase, the velocity is constant. That means that the position profile is a straight line. So, this kind of motion profile, the trapezoidal profile, is also sometimes referred to as a linear segment with parabolic blend. In that robotics toolbox, it’s the function LSPB which is a contraction of a linear segment with parabolic blend.

A disadvantage of the trapezoidal profile is that acceleration is not continuous and you can see it when we change from acceleration phase to coasting phase and coasting to deceleration phase, there is a step discontinuity in acceleration. This is potentially problematic for some robots but in general, we rely on the fact that the bandwidth of the motion control systems is relatively low and it smooths out this discontinuity in acceleration.

Let's look at this type of trajectory using the MATLAB tools, I am going to create a trapezoidal trajectory using the MATLAB function LSPB which is an acronym for Linear Segment with Parabolic Blend. It's going to start with the value of zero. It's going to finish at one. We're going to do it in 50 times steps. And, here we see the trajectory. We can clearly see that the velocity profile is trapezoidal. We can see the acceleration phase, the constant velocity phase and the deceleration phase. And, these different phases are color coded in the plot of S versus time step. I can change the trajectory. So, instead of going from zero to one, it goes from zero to minus one. And, the trajectory now looks like this. So, then, I can ask for the values of S, from zero to one in 50 times steps. And it creates a vector in the workspace code S which has 50 rows. Each row corresponds to a time step. And just like the tpoly function, I can also ask for the velocity and the acceleration which in turn, we put into the workspace SD and STD and here they are also in the workspace as 50 element vectors, one row per time step.

I'm going to return to my first example. A trajectory from zero to one. We can see that the velocity of the linear segment is a little bit above 0.03. What we are going to do now is to override the automatic choice of the velocity of the linear segment. And, I'm going to suggest that it use a value of 0.025 instead. And, here we can see the trajectory is being computed. You see that the linear segment now is much longer and the parabolic blends are much shorter. I am going to suggest that it uses a slightly larger value of velocity for the linear segment. And, now we can see linear segment's quite short and the parabolic blends are longer. The range of feasible values for the velocity of the linear segment are actually quite limited. And, if I suggest a value of 0.02, it is returning an error indicating that the velocity that I specified is too small. It's not possible to compute a trapezoidal profile with that value of velocity for the linear segment.

A more efficient trajectory has a trapezoidal velocity profile.

### Skill level

Undergraduate mathematics

This content assumes high school level mathematics and requires an understanding of undergraduate-level mathematics; for example, linear algebra - matrices, vectors, complex numbers, vector calculus and MATLAB programming.

### Rate this lesson

## Check your understanding

## Discussion

## Leave a comment

Please Sign In to leave a comment.

The non-zero initial velocity causes

the polynomial to overshoot the terminal value – it peaks at 5 on a trajectory from 0 to 1.

sir can you explain this line.

I think your question relates to a different lesson, the one about polynomial trajectories starting at 4:28. Please repost your question on lesson page and be more explicit about your question.