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.
• 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.
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.
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.
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.
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.
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.
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.