Trajectory planning in joint and Cartesian space
Turning start and goal positions into timed motion: joint versus Cartesian planning, cubic and quintic polynomials, LSPB (trapezoidal) profiles and via-point blending.
Drafted with Aria, reviewed by the AiCanCode.org team. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
A robot told simply to "go to point B" would jump its motors from rest to full speed instantly — impossible, and damaging to gearboxes. Trajectory planning turns start and goal positions into a time history of position, velocity and acceleration that the servo loops can follow smoothly, within motor limits, in the shortest reasonable cycle time.
Key ideas
Path vs trajectory. A path is the geometric route (a sequence of points). A trajectory is a path plus timing: q(t), q̇(t), q̈(t). Path planners (RRT, PRM, A*) find collision-free routes; trajectory generators then time-parameterise them.
Joint-space planning. Interpolate each joint from its start to its goal value, usually so all joints start and finish together.
- Cheap: inverse kinematics is needed only at the end points.
- Joint velocity and acceleration limits are easy to respect; no singularity problems along the way.
- The tool path in Cartesian space is a curve, not a straight line — used for point-to-point moves (MOVEJ / PTP).
Cartesian-space planning. Interpolate the tool pose (straight line, circular arc) and run inverse kinematics at every control cycle.
- Needed when the tool path matters: welding seams, gluing, insertion (MOVEL / LIN, MOVEC / CIRC).
- Costlier, may pass near singularities (joint rates explode) or out of reach midway, and joint limits are checked only indirectly.
- Orientation is interpolated with axis-angle or quaternion slerp, not by interpolating Euler angles independently.
Interpolating functions.
- Linear in time: constant velocity, but velocity jumps at the ends → infinite acceleration. Used only with blends.
- Cubic polynomial: 4 coefficients fit start/end position and velocity. Velocity is smooth; acceleration is finite but jumps at the start and end (the jerk is infinite there).
- Quintic polynomial: 6 coefficients also fix start/end accelerations (usually zero) → smooth acceleration, bounded jerk. Smoother but higher peak velocity.
- Linear segment with parabolic blends (LSPB, trapezoidal velocity): constant acceleration, constant cruise velocity, constant deceleration. Time-efficient and what most industrial controllers use; S-curve (jerk-limited) profiles soften the corners further.
- Splines through many via points give continuous velocity and acceleration across segments.
Via points. For multi-point paths, the robot need not stop at intermediate points; controllers blend (fly-by, zone or "CNT" settings) segments so the tool passes near, not exactly through, the via point.
Synchronisation. The slowest joint sets the move time; other joints are slowed so all finish together.
Formulas
Cubic, rest-to-rest from θ₀ to θ_f in time T (Δ = θ_f − θ₀):
θ(t) = θ₀ + a₂·t² + a₃·t³, a₂ = 3·Δ / T², a₃ = −2·Δ / T³
θ̇_max = 1.5·Δ / T (at t = T/2), θ̈(0) = 6·Δ / T²
General cubic with end velocities: a₀ = θ₀, a₁ = θ̇₀, a₂ = (3Δ − (2θ̇₀ + θ̇_f)·T) / T², a₃ = (−2Δ + (θ̇₀ + θ̇_f)·T) / T³
Quintic, rest-to-rest with zero end accelerations:
θ(t) = θ₀ + Δ·(10·τ³ − 15·τ⁴ + 6·τ⁵), τ = t / T; θ̇_max = 1.875·Δ / T
LSPB (trapezoidal velocity), cruise velocity V:
t_b = (V·T − Δ) / V, acceleration a = V / t_b
- Valid for Δ/T < V ≤ 2Δ/T (V = 2Δ/T gives a triangular profile with no cruise).
Units: θ in rad or degrees, t and T in s, θ̇ in rad/s or °/s, θ̈ in rad/s² or °/s².
Worked examples
Example 1 (standard). A joint moves from 10° to 70° in 2 s, starting and ending at rest, with a cubic. Find the coefficients, θ at t = 1 s, the peak velocity and the starting acceleration.
- Δ = 60°, T = 2 s.
- a₂ = 3·60 / 2² = 45 °/s²; a₃ = −2·60 / 2³ = −15 °/s³.
- θ(1) = 10 + 45·1² − 15·1³ = 40° (the midpoint, as expected by symmetry).
- θ̇(t) = 2a₂t + 3a₃t² → θ̇(1) = 90 − 45 = 45 °/s = 1.5·60/2 ✓.
- θ̈(0) = 2a₂ = 90 °/s² (= 6Δ/T²).
Answer: θ(t) = 10 + 45t² − 15t³ (degrees); θ(1) = 40°; θ̇_max = 45 °/s; θ̈(0) = 90 °/s².
Example 2 (GATE level). The same 60° move in 2 s is done with an LSPB profile at cruise velocity V = 40 °/s. Find the blend time, the acceleration and check feasibility. Compare with a quintic.
- Feasibility: Δ/T = 30 °/s < 40 °/s ≤ 2Δ/T = 60 °/s ✓.
- t_b = (V·T − Δ)/V = (40·2 − 60)/40 = 20/40 = 0.5 s.
- a = V / t_b = 40 / 0.5 = 80 °/s².
- Check distance: area under the trapezoid = V·(T − t_b) = 40·1.5 = 60° ✓.
- Quintic for comparison: θ̇_max = 1.875·60/2 = 56.25 °/s, with zero start and end acceleration.
Answer: t_b = 0.5 s, a = 80 °/s²; quintic peak speed 56.25 °/s.
Common mistakes
- Assuming a cubic gives zero acceleration at the ends — only a quintic (or higher) does.
- Using linear interpolation without blends and ignoring the velocity jump.
- Choosing an LSPB cruise velocity outside Δ/T < V ≤ 2Δ/T.
- Interpolating Euler angles for orientation in Cartesian moves — use quaternions or axis-angle.
- Thinking a joint-space move gives a straight tool path.
- Forgetting to synchronise joints, so they arrive at different times.
For GATE ME
Expect numerical questions on cubic polynomial coefficients, the position, velocity or acceleration at a given time, peak velocity of a rest-to-rest cubic, and LSPB blend time or acceleration. Conceptual questions compare joint vs Cartesian planning and cubic vs quintic smoothness. Practise writing a₂ and a₃ from memory and checking θ(T) = θ_f.
Quick check
- For a rest-to-rest cubic, where does the peak velocity occur?
- Which polynomial order is the lowest that can set zero start and end acceleration?
- A joint moves 90° in 3 s by a rest-to-rest cubic. Peak velocity?
- Which planning space guarantees a straight-line tool path?
- LSPB: Δ = 100°, T = 4 s. What is the largest allowed cruise velocity?
Answers: 1. At t = T/2; 2. Fifth order (quintic); 3. 45 °/s; 4. Cartesian space; 5. 50 °/s (triangular profile).
Interview questions
All Robotics interview questionsTry answering each one aloud before you open it.
1.What is trajectory planning in robotics?Concept
Trajectory planning in robotics refers to the process of determining a path or sequence of movements that a robot should follow to achieve a specific task. This involves calculating the positions, velocities, and accelerations of the robot's joints or end-effector over time, ensuring smooth and efficient motion.
2.Explain the difference between joint space and Cartesian space in trajectory planning.Concept
In trajectory planning, joint space refers to the space defined by the robot's joint angles. Planning in joint space involves calculating the trajectory in terms of these angles. Cartesian space, on the other hand, refers to the space defined by the robot's end-effector position and orientation in a 3D coordinate system. Planning in Cartesian space involves calculating the trajectory in terms of these coordinates.
3.Why is trajectory planning important in robotics?Application
Trajectory planning is crucial in robotics because it ensures that the robot moves smoothly and efficiently from one point to another while avoiding obstacles and minimizing energy consumption. It also helps in achieving precise control over the robot's movements, which is essential for tasks that require high accuracy.
4.What are some common methods used for trajectory planning in robotics?Concept
For timing a motion between points: linear interpolation with parabolic blends (LSPB or trapezoidal velocity), cubic and quintic polynomials, S-curve (jerk-limited) profiles, and cubic or B-splines through via points. For straight-line tool moves the controller interpolates position linearly and orientation with quaternion slerp, solving IK every cycle. Sampling planners such as RRT and PRM, or graph search such as A*, find a collision-free geometric path, which a trajectory generator then time-parameterises.
5.How does inverse kinematics play a role in trajectory planning?Application
Inverse kinematics is used in trajectory planning to determine the joint angles required to achieve a desired position and orientation of the robot's end-effector. It is essential for converting a trajectory planned in Cartesian space into joint space commands that the robot can execute.
6.What happens if a robot's trajectory is not planned correctly?Application
If a robot's trajectory is not planned correctly, it may result in inefficient or jerky movements, collisions with obstacles, or failure to reach the desired position. This can lead to increased wear and tear on the robot, reduced accuracy, and potential safety hazards.
7.Explain the concept of a 'smooth trajectory' in robotics.Concept
A smooth trajectory in robotics refers to a path where the robot's movements are continuous and without abrupt changes in velocity or acceleration. This is important to minimize mechanical stress on the robot, reduce energy consumption, and ensure precise and stable operation.
8.Why might a robot use a cubic polynomial for trajectory planning, and what is its limitation?Application
A cubic has four coefficients, exactly enough to match start and end position and velocity, so it gives a smooth position and continuous velocity with very little computation. For a rest-to-rest move, a₂ = 3Δ/T² and a₃ = −2Δ/T³, with peak velocity 1.5Δ/T at mid-time. Its limitation is that acceleration cannot also be set: it starts at 6Δ/T² instead of zero and jumps at the end points, giving infinite jerk and exciting vibration. A quintic fixes this.
9.A robot's end-effector moves in a straight line from A (0, 0, 0) m to B (1, 1, 1) m in 5 s. What constant speed would that need, and why would a real controller not use it directly?Numerical
The distance is √(1² + 1² + 1²) = √3 ≈ 1.732 m, so a constant speed of 1.732/5 ≈ 0.346 m/s, directed along (1, 1, 1)/√3. A real controller cannot jump from rest to 0.346 m/s instantly, so it uses a trapezoidal or S-curve speed profile along the line. The peak speed is then higher than this average, for example up to 0.69 m/s for a triangular profile.
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?