Inverse Kinematics Simulator — Two-Link Arm Elbow Solutions & Workspace Interactive

Interactive inverse-kinematics laboratory: place a target for a two-link arm, switch elbow branches and test reachability and singular configurations.

← Robotics Labs
About this tool — how it works & FAQOpen ▾Close ▴

About the Inverse Kinematics Simulator

This simulator poses the classic inverse-kinematics question for a vertical two-link teaching arm: given a target point, which joint angles reach it? Move the target, switch between the positive and negative elbow solutions, and drive it outside the reachable annulus to see what happens when no exact solution exists.

What the simulator shows

• A reachable-workspace board with the selected solution arm, the alternate elbow solution, the target marker and the nearest reachable projection. • Sliders for target horizontal position (-2.8 to 2.8 m), target vertical position (-0.5 to 2.8 m), first link length (0.8-1.8 m) and second link length (0.6-1.4 m). • A positive or negative elbow branch selector and an option that moves the target around a small circle. • Readouts for the shoulder and elbow solutions, tool-to-target error, whether an exact solution exists, and the Jacobian determinant.

Geometry behind the solution

The elbow angle comes from the law of cosines: cos q2 = (x² + y² - L1² - L2²) / (2 L1 L2), and q2 = ±acos of that value gives the two branches. The shoulder angle is q1 = atan2(y, x) - atan2(L2 sin q2, L1 + L2 cos q2). A target is reachable only when its radius lies between |L1 - L2| and L1 + L2. The Jacobian determinant L1 L2 sin q2 goes to zero when the arm is fully extended or folded, where the arm loses local freedom to move in some directions.

Model boundaries

This is planar positional inverse kinematics only: no joint limits, no tool-orientation constraint and no obstacle avoidance. For a target outside the annulus the lab solves a projected target and reports the remaining error. At the origin with equal link lengths it picks one representative folded solution.

Frequently asked questions

Why are there two inverse kinematics solutions?

For most interior targets a two-link arm can reach the same point with the elbow bent either way, like elbow-up and elbow-down. The positive and negative elbow branch options in the lab show both poses reaching the same target with near-zero error.

What makes a target unreachable?

A target is unreachable when its distance from the shoulder is greater than L1 + L2 or smaller than |L1 - L2|. The lab marks it unreachable and shows a projected pose with a nonzero error.

What is a singularity in this lab?

A singular pose occurs when the determinant L1 L2 sin(q2) approaches zero, meaning the arm is fully straight or fully folded. Near these poses small tool motions in some directions require very large joint motions or become impossible.

Is this a full path planner?

No. It solves static positional inverse kinematics for one target at a time, without joint limits, orientation constraints or obstacle avoidance. Choosing the branch is part of planning, but no global planner is included.

Related tools & guides