SCARA with a consistent bent elbow follows a curved violet groove beside a small fixture.

What you need

Use a sampled Cartesian path, both inverse-kinematics branches and explicit joint limits in a simulator.

Candidate squared-angle change. Nearby branch: 8 degree²; Other branch: 23,944 degree².
Candidate squared-angle change. Original Academy diagram using illustrative values; not a measured hardware result.
Read the diagram as a data table
Values used in the illustration
Condition or componentdegree²
Nearby branch8
Other branch23,944

The calculation

cost = Σ w_i × Δθ_i²

Δθ_i is the physically valid joint displacement from the previous state and w_i is a positive weighting. Handle angle wrapping according to actual travel limits.

Worked example

Illustrative numbers. Replace them with your measured inputs.

From previous angles (10°,70°), candidates (12°,68°) and (80°,-68°) have unweighted costs 8 and 23,944 degree². The first is locally smoother, but it still needs limit and collision checks.

Try it step by step

  1. Generate both inverse-kinematics candidates at each path point and reject invalid or colliding configurations first.
  2. Compute physically meaningful differences, respecting joints that cannot wrap continuously through 360°.
  3. Select the candidate with the smallest justified motion cost and retain it as the next reference.
  4. Inspect the whole path for singularities and branch dead ends; a greedy local choice may need a globally planned alternative.

How to check the result

Plot joint angle against path progress and inspect sudden jumps before adding any timing or drive commands.

Common mistake to avoid

The lowest cost is not necessarily collision-free or globally feasible. Never switch branches abruptly to escape a bad point while hardware is moving.

Reference reading

Primary references for the underlying models, APIs or application context. The worked numbers and plots above are educational calculations, not results reported by these sources.

Read our methods, limitations and safety notes.