TL;DR:
A trajectory is a path plus timing: where each joint should be at each moment.
A cubic polynomial with zero start and end velocity gives smooth motion; its peak speed is 1.5 times the average, and its acceleration is largest at the ends.
Check the plan against the joint's speed and acceleration limits and stretch the time if it breaks them.
Telling a robot arm to go from 0° to 90° is half an instruction. It does not say how fast, or how the speed should change on the way. If the joint jumps to full speed instantly, the gears jolt, the arm shakes, and whatever it holds may spill. A good plan eases in and eases out.
Path versus trajectory
A path is the geometric route: the sequence of positions. A trajectory adds time: a function q(t) giving the position at every moment, from which velocity q̇(t) and acceleration q̈(t) follow by differentiation. The rate of change of acceleration is the jerk, q⃛(t).
Position, velocity and acceleration limits
Every joint has limits. A maximum speed, set by the motor and gearbox. A maximum acceleration, set by the torque available to speed up the arm's inertia. And a position range. A planned trajectory that exceeds any of these cannot be followed, and the motor will lag, saturate or stop with an error. Jerk matters too, because abrupt changes in acceleration excite vibrations in the arm.
Worked example: a cubic polynomial from start to goal
Move one joint from q₀ = 0° to q_f = 90° in T = 2 s, starting and ending at rest. A cubic polynomial q(t) = a₀ + a₁t + a₂t² + a₃t³ has four coefficients, matching four conditions: start position, end position, start velocity zero, end velocity zero.
Start at 0:
q(0) = a₀ = 0.Start velocity zero:
q̇(0) = a₁ = 0.End position:
a₂T² + a₃T³ = 90, so4a₂ + 8a₃ = 90.End velocity zero:
2a₂T + 3a₃T² = 0, so4a₂ + 12a₃ = 0, which givesa₂ = −3a₃.Substitute:
4(−3a₃) + 8a₃ = −4a₃ = 90, soa₃ = −22.5deg/s³ anda₂ = 67.5deg/s².
(The general formulas are a₂ = 3(q_f − q₀)/T² and a₃ = −2(q_f − q₀)/T³; here 3 × 90 / 4 = 67.5 and −2 × 90 / 8 = −22.5.) So q(t) = 67.5 t² − 22.5 t³. Check the midpoint: q(1) = 67.5 − 22.5 = 45°. Check the end: q(2) = 67.5 × 4 − 22.5 × 8 = 270 − 180 = 90°.
Velocity: q̇(t) = 135 t − 67.5 t². At t = 1: 135 − 67.5 = 67.5 °/s, the peak. The average speed is 90 / 2 = 45 °/s, so the peak is 67.5 / 45 = 1.5 times the average. Acceleration: q̈(t) = 135 − 135 t, which is +135 °/s² at t = 0 and −135 °/s² at t = 2. Jerk: q⃛ = −135 °/s³, constant.
Now check the limits. Suppose the joint can do 60 °/s and 150 °/s². Peak speed 67.5 exceeds 60, so the plan is not allowed. Stretch the time: peak speed is 1.5 × 90 / T, so T ≥ 1.5 × 90 / 60 = 2.25 s. With T = 2.25, the peak acceleration is 6 × 90 / T² = 540 / 5.0625 ≈ 106.7 °/s², below 150. Both limits are met.
The cubic has a flaw: acceleration jumps from 0 (at rest) to 135 °/s² the instant the motion starts, and back at the end. That means infinite jerk at the ends, which can rattle the arm. A quintic (fifth-order) polynomial adds conditions for zero acceleration at both ends and gives smoother starts. Other common shapes are trapezoidal velocity profiles (accelerate, cruise, decelerate) and S-curves, which limit jerk.
Several joints at once
For an arm, all joints should start and finish together, so use the same T for every joint, chosen as the largest time any single joint needs. Joint-space paths are simple, but the hand may swing in a curve. If the hand must follow a straight line, plan in hand coordinates and convert using inverse kinematics and the Jacobian, as in the Jacobian: how joint speeds become hand speed.
First runs: Run a new trajectory at reduced speed with nobody inside the arm's reach. Check that every joint stays inside its position limits and that the path avoids the table and the base. Keep the emergency stop within reach, and only raise the speed after the slow run behaves.
Where it goes wrong
Limits ignored. The controller falls behind and the real path differs from the plan.
Units mixed. Degrees versus radians in coefficients.
Jerky starts. A cubic without jerk limits can excite vibration in light, flexible arms.
Joints finish at different times. The hand takes a strange path.
Payload changes. A heavier load lowers the acceleration the motors can deliver.
Overshoot of the goal. A controller with poor tuning overshoots even from a perfect plan.
How real robots use it
Robot controllers generate these profiles automatically from speed and acceleration settings, then stream the positions to the joints, often thousands of times per second. Planners that look further ahead and respect limits during planning are related to model predictive control.
Try it yourself
In a spreadsheet, compute q(t) at steps of 0.1 s for T = 2 with the cubic above, then compute speed and acceleration with the formulas. Plot all three. Next, change T to 3 and watch peak speed and acceleration drop. You will see that doubling the time cuts peak acceleration to a quarter.
Frequently asked questions
Why zero velocity at the ends?
Most moves start and finish at rest. If the arm should pass through a point without stopping, you can set the end velocity to a nonzero value.
Why does a longer time cut acceleration so much?
Acceleration scales with 1/T². Twice the time gives one quarter of the acceleration.
