A small path, a large command
Software prepares a sequence of gripper points, each only millimetres from the previous one. Calculation confirms each is reachable. Yet halfway through, it requests a large elbow rotation. The target need not have jumped and the motor need not be faulty. The software may have changed which solution it selects. This article explains why end position does not always identify one arm posture, and how to keep the choice consistent along a path.
Abstract. We analyze an ideal planar arm with two rotary joints and links of 0.5 and 0.4 metres. We derive two solutions for a target and compare two selection rules on a 0.6-metre-radius arc: minimize absolute shoulder angle at each point, or choose the configuration nearest the previous one. In the executed calculation, a roughly 6-millimetre target step produces changes of about 82.25° at the shoulder and 194.36° at the elbow under the first rule. The second retains its branch and changes only the shoulder by about 0.573°. These are differences between requested configurations, not measured speeds or instantaneous motions of a real robot.
Position and configuration are different information
Fix a plane with x and y axes and the shoulder at the origin. L₁ and L₂ are link lengths in metres. q₁ is the first link’s angle from the x axis; q₂ is the second link’s angle relative to the first. Positive angles are counterclockwise and calculation uses radians: 180° equals π radians. Configuration q = (q₁,q₂) describes both joints. Point p = (x,y) describes only tip position. Gripper orientation is not constrained; adding it would change the problem and could eliminate solutions.
Forward kinematics asks where the tip lands when angles are known. Add link projections on x and y. The second uses q₁ + q₂ because its orientation includes both rotations. This also supplies a final inverse-solution check: substituting any candidate must recover the target. An algorithm claiming a solution is not enough; we can verify it geometrically.
Deriving both branches without hiding them in software
Inverse kinematics asks which angles reach a given point. First find q₂ using shoulder distance r. Rotating the whole arm through q₁ changes direction but not r. Square x and y and add them: cross terms become 2L₁L₂ cos(q₂), while cos² + sin² = 1 removes the other angles. One unknown remains. Quantity C is dimensionless because square metres are divided by square metres.
For C strictly between −1 and 1, cosine admits opposite angles and thus two branches. Outside that interval no real solution exists. At its boundaries the branches coincide geometrically, accounting for equivalent ±π representations. With our lengths, reachable radius ranges from |0.5−0.4| = 0.1 metres to 0.5+0.4 = 0.9 metres. Our 0.6-metre arc lies inside this annulus. Multiple solutions are not caused by noise or approximation; they belong to ideal geometry.
We still need q₁ for each branch. Let φ be target direction, computed by atan2(y,x). Unlike arctangent of y/x alone, atan2 uses both coordinate signs to distinguish quadrants. At q₁ = 0 the tip vector has components L₁ + L₂ cos(q₂) and L₂ sin(q₂). Its angle β is another atan2. Rotating the first joint by φ − β aligns it with the requested direction. Each q₂ therefore comes with a different q₁.
At x = 0.6 metres and y = 0, C is −0.125. The program finds q₂ = ±97.18076°, with shoulders ∓41.40962°. Substituting either configuration into forward kinematics recovers (0.6,0) within the checked numerical tolerance. They are different configurations of one model with the same endpoint. The graph shows coincident tips and elbows on opposite sides of x. We cannot call either posture better before specifying a criterion.
| Branch | q1 (°) | q2 (°) | x (m) | y (m) |
|---|---|---|---|---|
| + | -41.40962 | 97.18076 | 0.6 | 0 |
| − | 41.40962 | -97.18076 | 0.6 | 0 |
A reasonable rule for one configuration can fail on a sequence
Construct 31 points on a short arc: φ ranges from −0.15 to +0.15 radians in 0.01 steps. Each point is (0.6 cosφ, 0.6 sinφ). Neighbor distance is 2 × 0.6 sin(0.01/2), about 0.005999975 metres. No timestamps are assigned: this is a sampled geometric path, not a timed trajectory. Synthetic limits are shoulder −170° to +170° and elbow −150° to +150°. Both branches satisfy them at all 31 points; code checks this and reconstructed position.
The first rule picks the smallest absolute q₁ at every point, perhaps to keep the shoulder near zero. It ignores the preceding configuration. Negative φ favors negative q₂, positive φ favors positive q₂. At zero direction the costs tie and our code chooses the first candidate. Near this tie the minimum changes branch: selected cost stays low but selected configuration changes substantially. The selected solution jumps; the desired point does not.
Between points 14 and 15, zero-indexed, requested shoulder angle changes by 82.24629° and elbow by 194.36151°. The requested tip moves about 6 mm. Software has not specified a mathematically instantaneous physical motion; it produced distant consecutive references. A real controller might slow down, reject or interpolate, with consequences requiring evaluation. Our narrower, checkable result is that Cartesian path continuity does not guarantee continuity of configurations from independent choices.
Could denser points alone solve the problem? Test it rather than assume it. Take targets at directions −ε and +ε. At ε = 0.005 radians they are about 6 mm apart; reducing ε to 0.0005 reduces separation to about 0.6 mm. Yet independent selection still chooses opposite branches: elbow change remains 194.36°. Shoulder change approaches 82.82° rather than zero. The added sensitivity calculation confirms this: smaller geometric steps do not remove the selection defect.
The formulas explain why without relying solely on the plot. Set γ = arccos(C) and β₀ = β(γ), positive here. Before zero the selected branch has q₂ = −γ and q₁ = −ε + β₀; afterwards q₂ = +γ and q₁ = +ε − β₀. Absolute change is 2γ at the elbow and 2β₀ − 2ε at the shoulder. As ε tends to zero both remain nonzero. This selection property needs correction, not sample spacing. Tie-breaking at exactly zero only changes which side shows the switch.
Using the previous configuration
The second rule remembers only previous q. Initially select the negative-q₂ branch explicitly. At each new point, compare candidate distance from that configuration and take the nearest. On our short interval the previous branch differs by only 0.01 radians at the shoulder, while switching changes both angles. The rule stays on its branch. This is also clear analytically: at constant radius C is constant, so q₂ and β are constant; q₁ changes exactly with φ.

In the right plot, inspect the green elbow lines: independent reference changes from negative to positive; the memory-based one remains negative. Shoulder lines show a linked consequence, not a second experiment. Lines connect samples for reading, not a verified physical interpolation. Horizontal axis is target direction, not time; slope gives no speed or acceleration without a time law.
Angle distance needs a convention
The norm is Euclidean distance between two angles in radians, equally weighted. It is not one axis’s rotation or an energy measurement. Our joints have bounded intervals and values are compared directly within them. For a genuinely continuous axis, 179° and −179° may be only 2° apart along an allowed turn; naive subtraction gives 358°. The metric must respect joint type and actual limits, not just numerical representation.
The elbow jump is not just crossing a ±180° representation boundary. Solutions are near ±97° and joint limits are ±150°. Going through 180° is not permitted. This is a configuration difference, not merely angle printing. Continuously passing from negative to positive q₂ would cross zero; the arm would then be fully extended with r = 0.9 metres. It could not remain on our 0.6-metre arc through that passage. The branches are separated along the arc in this model.
When the whole path and other constraints matter
Nearest-previous selection is local: it sees the next point, not the future. Another problem might preserve a branch that later hits a limit or obstacle, while another initial choice permits the whole task. One alternative represents candidates at each point as nodes and feasible consecutive transitions as edges. Graph search then considers the sequence. Yet reachable endpoints alone do not make an edge feasible; the intervening motion must be checked with a suitable model.
With two candidates per point, local comparison costs constant work per step: O(N) for N points. A graph with B candidates per point may require O(NB²) consecutive-level comparisons before geometric verification cost. We have not implemented or measured that planner; this is structural analysis, not a benchmark. Orientation, obstacles, speed, acceleration and torque enlarge the problem. Solving our arc does not establish safety, collision freedom or dynamic feasibility on an industrial machine.
Reproducing and separating calculation from physical testing
The package includes experiment.py, plot.py and all 31 samples in results JSON. ik computes candidates with arccos and atan2; fk reconstructs position. Assertions check Cartesian error below 10⁻¹² metres and joint bounds on assigned points. The program compares both rules on one sequence and finds the largest configuration step. The 10⁻¹² tolerance checks numerical model calculation, not robot accuracy. No randomness means no seed is needed. Run the following snippet in the extracted package directory.
General software needs further checks: unreachable targets, exact bounds, equivalent representations, merging branches and tolerance near C = ±1. Always clipping C to [−1,1] would conceal truly unreachable targets; tolerance handling must distinguish numerical error from geometric impossibility. Attached code is scoped to declared data. Physical testing would add real parameters, calibration, timing control and path verification. No arm was moved and no hardware performance measured here.
What this example answers
Nearby tip targets can produce jumping requested configurations because the inverse problem has multiple solutions and pointwise selection can switch branches. On our short arc, remembering the previous configuration avoids switching and keeps consistent joint changes. This suggests a useful question when an AI application proposes robot goals: which continuity and constraints are preserved after the proposal? Industrial and collaborative robotics is a direction EL-AI intends to explore. This educational study clarifies a design requirement without attributing existing robots, installations or experiments to the company.
Source and contribution
Primary source: Kris Hauser, Robotic Systems, chapter 6 “Inverse Kinematics”, sections on the inverse problem, choosing solutions and analytical 2R derivation. We read derivation steps and algorithm, not just the introduction. Educational page accessed 10 October 2026 without assigning an unverified publication date. Link lengths, arc, selection rules and numerical comparison were constructed for this article. It is an AI-assisted educational derivation and analysis, not original peer-reviewed research or a new robotics benchmark.
Kris Hauser — Robotic Systems, Chapter 6: Inverse Kinematics.
import json
from experiment import ik, fk
import math
for q in ik(.6, 0):
print('angles deg', [math.degrees(v) for v in q])
print('position m', fk(q))
r = json.loads(open('results.json', encoding='utf8').read())
print('largest transition', r['largest_naive_transition'])
Code, data, and instructions · JSON. Educational calculations executed with Python 3.14.0; figures with Matplotlib 3.11.2. AI-assisted analysis, without claiming peer review or human review. Original illustrative ImageGen cover: it does not document EL-AI people, premises, or installations. Sources accessed 10 October 2026.

