A 2-link planar manipulator (base at the origin, link lengths L1, L2) solves the inverse-kinematics problem analytically every time it is given a new target (x, y) — the elbow-down solution of the law-of-cosines system:
r = clamp(√(x²+y²), |L1−L2|+ε, L1+L2−ε)
cosθ2 = (r² − L1² − L2²) / (2·L1·L2)
θ2 = −acos(cosθ2)
θ1 = atan2(y, x) − atan2(L2·sinθ2, L1+L2·cosθ2)
The joints don't teleport to that angle — they are rate-limited, moving at the arm-speed slider's max °/s like a real servo. When a part's mass approaches or exceeds the payload torque limit, the effective rate is throttled by min(1, limit / mass), exactly like a motor running out of torque under load: heavy parts make for visibly slower, jerkier cycles.
- Cycle — claim nearest part waiting at the pickup point → IK to part → grip → IK to the bin matching its color → release → return home.
- Targeting precision — every release point gets Gaussian jitter scaled by
(1 − precision); a part that lands outside its bin's catch width is logged as a miss, dragging the success rate down without stopping the line.
- Belt queue — parts keep arriving at the spawn rate and queue behind whichever part is waiting at the pickup point, so a slow/overloaded arm visibly backs the line up.