Elbow up or elbow down? Choosing between solutions
Two sets of joint angles put the hand on the same bolt. One of them smashes the elbow into a shelf. How does a robot choose?
About 30 min · 3 goals · Checked by automated tests
1.Why should I care?
Multiple IK solutions are a gift and a trap. The gift: a robot can reach around obstacles. The trap: picking the 'other' solution halfway through a move sends the elbow sweeping across the cell. Real controllers choose deliberately, and stick with their choice.
- ◇ Find both elbow-up and elbow-down solutions for a two-link arm target.
- ◇ Choose between solutions using obstacles, joint limits and how far the joints must move.
- ◇ Explain why switching solutions mid-move is dangerous.
2.Discover
In the robot-arm lab, set a target and solve IK in both elbow modes. Record θ1 and θ2 for each. Then imagine a shelf just above the arm: which solution would hit it? Move the target towards the outer edge: what happens to the difference between the two solutions?
Explorer 01 — Robotic kinematics
From joint angles to a position, and back again
Forward kinematics turns joint angles into an end-effector position. Inverse kinematics asks the harder question: which angles put the tip where I want it?
Fig. — 2-link planar arm · units cm · y up
Joint angles (relative)
Arm geometry
- End x
- 15.1 cm
- End y
- 26.4 cm
- Distance r
- 30.4 cm
- workspace 5.0–35.0 cm
- |sin θ2|
- 0.87
- well-conditioned
- Tip angle φ
- 95.0°
State
Forward kinematics. Joint angles: joint 1 35°, joint 2 60°. End effector at x 15.1 cm, y 26.4 cm, 30.4 cm from the base. Elbow well-conditioned (|sin θ2| = 0.87).
Forward kinematics. Joint angles: joint 1 35°, joint 2 60°. End effector at x 15.1 cm, y 26.4 cm, 30.4 cm from the base. Elbow well-conditioned (|sin θ2| = 0.87).
How to read this
The base sits at the centre (grid squares are 10 cm). Each thick bar is a link; circles are joints J1, J2. The shaded ring is the workspace: every point the tip can reach with unlimited joint travel. Its outer edge is L1 + L2; the inner hole appears when one link is longer than the others combined.
Arcs show each joint angle. θ1 is measured from the dashed horizontal; θ2 from the dashed extension of link 1. In inverse mode the square is the target (dashed and labelled unreachable when outside the ring), and the arm is solved with the law of cosines. Most targets have two solutions: elbow-up and elbow-down.
Assumptions & limitations
- Ideal rigid links and revolute joints with no mass, friction, backlash, or flex.
- Joints may rotate a full ±180°; real joints have hard limits that shrink the workspace, and links cannot pass through each other or the floor.
- Kinematics only: nothing here says whether the motors are strong or fast enough to hold or reach a pose (that is dynamics).
- Three-link inverse kinematics is made solvable by fixing the tool angle φ; real controllers choose among redundant solutions with extra goals.
- Unreachable targets are projected onto the nearest edge of the reachable ring for display; a real controller would refuse or plan around them.
Can't use the interactive? Read a description instead
The robot-arm lab can solve IK with the elbow up or down. Without it: for L1 = 0.4 m, L2 = 0.25 m and target (−0.03, 0.489) m, elbow down gives θ1 ≈ 63.0°, θ2 = 85°; elbow up gives θ1 ≈ 124.1°, θ2 = −85°. The two arms are mirror images across the line from the shoulder to the target.
3.Checkpoint: guided practice
Check what you just discovered before going on. Hints appear after a wrong answer.
Practice 1
What do the elbow-up and elbow-down solutions for the same target always share?
4.Predict
For a target to the right of the base, how are the elbow-up and elbow-down shoulder angles related?
Guess first. Being wrong here is how the surprise works.
5.Understand
Mirror images
The two solutions share |θ2| and are reflections of each other across the line from shoulder to target. With this course's convention elbow up has θ2 < 0, elbow down θ2 > 0. At the edges of the ring (θ2 = 0 or ±180°) they coincide; in the middle of the ring they differ the most.
How to choose
Common rules: (1) reject any solution outside joint limits or that collides with something; (2) among the rest, pick the one closest to the current joint angles, so the move is short and predictable; (3) keep the same branch throughout a task. Many industrial arms fix the branch in the program ('elbow up' configuration) for exactly this reason.
Don't flip mid-move
If a controller re-solves IK at every step of a straight-line hand move and naively picks 'the first solution', it can jump from one branch to the other. The hand target barely changes, but the elbow swings through a huge arc in one step. That's a sudden, fast, dangerous motion, and a classic bug to test for.
Explain it another way
Reach for a cup on a table: you can lead with your elbow up and out, or tucked low. Both get your hand there. You pick the one that doesn't knock the vase over, and you don't swap halfway.
The IK solution set for a reachable interior target is {(θ1⁺, θ2⁺), (θ1⁻, θ2⁻)}. Choosing by minimum ‖θ − θ_current‖ gives continuity along smooth paths as long as the path stays away from the workspace boundary, where the branches meet.
L1 = 0.4, L2 = 0.25, target (−0.03, 0.489): |θ2| = 85.0°. Elbow down θ2 = +85°: θ1 = 93.51° − 30.55° = 62.96°. Elbow up θ2 = −85°: θ1 = 93.51° + 30.55° = 124.06°.
Welding robots in car factories are programmed with a fixed configuration so that the hoses and cables on the elbow always sit on the same side and never wind up as the arm moves.
Worked example 1
The arm is at (θ1, θ2) = (40°, −70°). The two IK solutions for the next target are (45°, −75°) and (−5°, 75°). Which should it use?
The first: it's 5° away on each joint, on the same branch (θ2 negative). The second needs a 45° shoulder move and a 150° elbow swing.
Common mix-ups
- Elbow up and elbow down are equally good, so it doesn't matter which you pick.
✓ Obstacles, joint limits and continuity with the current pose usually make one clearly better. - Re-solving IK every step is always safe.
✓ Only if you keep the same branch; switching branches mid-move causes sudden large joint motions.
6.Practice on your own
Practice, not a test. Wrong answers get a hint and another try.
Practice 2 · a fresh version every time
A two-link arm (L1 = 0.4 m, L2 = 0.4 m) must reach (0.114, 0.396) m with the elbow UP (θ2 negative). Its elbow angle is θ2 = −118°. What is the shoulder angle θ1, in degrees? (between −180 and 180)
Practice 3 · a fresh version every time
A two-link arm has L1 = 0.5 m and L2 = 0.35 m. Its hand must reach (-0.047, 0.583) m. How much must the elbow bend, |θ2|, in degrees? (The elbow-up and elbow-down solutions share this size.)
Practice 4
Which rule best avoids sudden elbow swings during a long move?
Practice 5
L1 = 0.4 m, L2 = 0.3 m. At what distance from the shoulder (other than 0.1 m) do the two IK solutions merge into one, in metres?
7.Apply it
A shelf occupies y > 0.45 m. For an arm with L1 = 0.4 m and L2 = 0.3 m reaching (0.5, 0.2) m, compute both solutions and the elbow position of each (the elbow is at L1(cos θ1, sin θ1)). Which one hits the shelf? Confirm in the lab.
8.Reflect
9.Go further
- Inverse kinematics (Wikipedia) ↗Analytic and numerical IK, and the issue of multiple solutions.
Concepts: Inverse kinematics and the workspace