Lesson 4 of 21 in this unit
Turn a target into motion.
Find alternative target-reaching postures and separate geometric reach, joint limits and obstacle contact.
By the end: Solve a planar position target, compare alternative postures, reject limit/contact violations and distinguish final geometry from feasible motion.
Prerequisites and path options
Why learn this? Translate a desired position into joint choices while recognizing unreachable targets and multiple solutions.
Start with something concrete.
Reach toward the same point with your elbow on different sides. The hand target alone does not specify the posture—or whether the route is clear.
Try the interactive modelTwo inverse-kinematics branches reach the same target. One crosses an obstacle and the other does not. What should the final-posture check do?
Change one thing. Watch what follows.
Loading this browser experiment…
Understand what changed.
A shorter explanation, with the original worked examples available below. Both explain the same experiment and its limits.
The idea in everyday terms
Forward kinematics starts with joint angles and finds the tool position. Inverse kinematics starts with the desired position and asks which joint angles produce it. A target may have no solution, several discrete solutions or a continuous family.
What to watch in the experiment
Inspect the possible arm postures and apply the stated joint and obstacle constraints. Keep the target definition precise: this task requests the tool’s position, not an arbitrary orientation too.
What this does not establish
A feasible final posture is not a verified path to reach it. Failure of displayed samples is also different from a proof that every possible posture is invalid; dynamics and self-collision need separate checks.
Open the full worked examples, calculations and limitations
This is the same reference used in Technical mode. Expand it whenever you need the exact numbers, assumptions or further explanation.
Work backward from a target
Forward kinematics starts with joint angles and calculates a tool position. Inverse kinematics, or IK, starts with the desired tool position and asks which angles produce it. An answer may not exist; a target can also have several answers. This lesson finds final postures for a two-link planar arm before asking whether those postures meet additional constraints.
The base is fixed at the world origin. The first joint angle is measured from world x. The elbow angle is relative to the first link, not another world angle. We request the tool origin’s x/y position, without prescribing orientation. This makes the contract precise: reaching the position does not mean the tool points in a chosen direction.
First ask whether the lengths can reach
Two freely rotating links of lengths L₁ and L₂ reach distances from |L₁−L₂| to L₁+L₂. The outer radius comes from stretching them straight. The inner radius comes from folding one back along the other. Unequal links therefore leave an unreachable hole around the base.
The annulus is only an initial geometry test. It ignores joint limits and obstacles. A target inside the annulus may still have no acceptable posture once those constraints apply. A target outside it must be rejected rather than silently moved to its boundary.
A triangle gives two branches
Join the base, elbow and target into a triangle. Its sides are the two links and the target’s distance from the base. The cosine rule gives the elbow angle. Reflecting the triangle across the base-to-target line produces the other elbow branch, generally with a different shoulder angle.
The equation, with each term explained
Let d² = x²+y² be the squared target distance. Then cos(q₂) = (d²−L₁²−L₂²)/(2L₁L₂). The inverse cosine, acos, returns an angle whose cosine has that value. Taking the positive and negative angle yields the two elbow branches. The shoulder angle is atan2(y,x) − atan2(L₂ sin(q₂), L₁+L₂ cos(q₂)). The two-input atan2 function preserves quadrant information, unlike dividing y by x.
Calculations use radians; displayed angles use degrees. The solver tests reach first, then clamps only boundary roundoff before calling acos. It checks every computed answer by forwarding the joint angles back to an endpoint.
At straight or fully folded boundaries, two branches can describe the same posture, so they are deduplicated. Equal links folded exactly to the base are a special case: any shoulder angle leaves the endpoint at the origin. The lab shows four members of that continuous family. They do not exhaust it, and failure of every displayed sample is not a proof that the whole family is infeasible.
A solution is a candidate, not automatic acceptance
A joint limit constrains angle values. The lab uses closed symmetric shoulder and elbow ranges around zero, expressed in canonical −180° to 180° coordinates. Every candidate retains separate position, shoulder-limit and elbow-limit results. This makes a rejected answer explainable: it might reach accurately but require an unavailable joint angle.
Obstacle checks examine the entire link segment, including its interior. A link is modeled as a capsule: a line segment thickened by a radius of 0.05 m. The obstacle is a disk. The shortest distance from the disk center to the segment, minus both radii, is signed clearance. Positive clearance means separation; zero is tangency and counts as contact; negative means overlap. The numerical contact tolerance is displayed.
The two branches may pass different checks even though they have the same endpoint. Disabling the obstacle check changes which constraints are enforced; it does not remove the obstacle from a real scene. The result explicitly says when this check is disabled.
Final-posture geometry is not motion planning
A selected candidate is a static drawing. The lab does not command or animate a route from a starting posture. Intermediate arm positions can hit an obstacle even when both endpoints are clear. Establishing a collision-free trajectory needs checks over the swept motion and the actual robot geometry.
The simplified checker also omits self-collision, ground contact and other bodies. Fully folded samples can overlap their own links. Keep the claim limited to the disk and joint constraints actually modeled here.
Kinematics concerns positions and their changes. Dynamics concerns how forces, torques and inertia produce those changes. A geometrically valid posture says nothing by itself about motor torque, acceleration, balance or control stability. These need their own models and evidence.
Produce an auditable reachability decision
For guided practice, capture two branches, a joint-limit rejection and an obstacle rejection. Explain why the endpoint alone cannot decide. For implementation practice, independently replay the forward equations, test tangent and interior-segment contacts, and include inner/outer reach boundaries and the equal-link origin case.
For a decision brief, separate “outside geometric reach,” “all finite analytic branches violate modeled constraints,” and “no displayed sample in a continuous family passed.” Then list the missing path, self-collision and dynamics checks. Three temporary captures support comparison; independent implementation review and learner pilots remain pending.
A final posture reaches the target, respects joint limits and avoids the modeled disk. What is established?
Take this idea with you.
Inverse kinematics can give zero, one, several or infinitely many postures. Check each constraint explicitly; a valid final posture does not establish a feasible motion.
Explore related topics and the topic map
How this topic connects
Explore this topic on the interactive mapUse these connections to review a foundation or choose where to go next. You can open any topic without completing the others.
What it builds on
- Describe where the robot is
Prevent coordinate-frame mistakes when combining robot positions, sensor readings and targets.
- Use a Jacobian
Connect small joint changes to tool movement and recognize directions a robot cannot easily move.
Find alternative target-reaching postures and separate geometric reach, joint limits and obstacle contact.
What it enables
- Correct errors using feedback
Understand how repeated correction can reject disturbances or cause oscillation when delayed or too aggressive.
- Plan a collision-free trajectory
Check the movement between waypoints rather than assuming clear endpoints imply a clear path.