The LabROBOT ARM WORKSHOP INVERSE KINEMATICS

REACH A POINT IN SPACE

Point at a spot.
The arm finds the angles.

A turning base, a shoulder and an elbow. Move the target and the arm solves its own joint angles. Then find out why some points have two answers, some have none, and some are easy to reach but not safe.

Moving to the target…

TARGET DISTANCE2.55 mReach 0.20–3.20 m
SHOULDER1.5°Goal 1.5°
ELBOW74.5°Elbow down
BASE TURN14.0°Towards the target
TIP TO TARGET0.0 cmOn target
OBSTACLEOffRadius 0 m

01 / THE ARM

Drag the target.

Drag the target · drag space to orbit · scroll to zoom

02 / THE DIAGRAM

Side view, to scale.

Side view of the arm.

Drawn to scale in the vertical plane that faces the target. Drag anywhere on it, or tab to the target and use the arrow keys.

FROM ABOVE14.0° turnTarget 2.06 m out across the floor
STRETCH80% of full reach1 cm further = 0.6° of elbow
01 Target
2.0 m

Distance across the floor along x. The base turns to face it.

0.5 m
1.5 m

Lowest 0.1 m, which is 0.5 m above the floor. The target can’t go into the floor.

02 Arm
1.7 m

Shoulder to elbow.

1.5 m

Elbow to the tip (the wrist centre).

Which way the elbow bends

Both reach the same tip position. The angles differ.

±175°

How far each joint may turn either way. Real joints have end stops.

03 Obstacle
Off

A ball fixed at x 1.3, height 0.8, z 0.35 m. 0 turns it off.

HOW THE ARM SOLVES IT

The elbow angle alone sets how far the tip is from the shoulder. The shoulder then tilts the bent arm to point at the target. The base turns first, so everything happens in one vertical plane.

WHAT’S HAPPENING

Read the arm.

TRY THIS

Three reaching problems.

    How the model works

    One plane at a time. The base turns to the target’s direction, yaw = atan2(z, x). After that the shoulder and elbow only have to reach a point in a flat vertical plane: u = √(x² + z²) out and y up.

    The elbow sets the distance. The upper arm (l1), the forearm (l2) and the line from shoulder to target (r) make a triangle. The law of cosines gives the elbow angle: cos q2 = (r² − l1² − l2²) / (2·l1·l2). It has two answers, +q2 and −q2. These are elbow down and elbow up.

    The shoulder sets the direction. q1 = atan2(y, u) − atan2(l2·sin q2, l1 + l2·cos q2). This tilts the bent arm so the tip lands on the target.

    Reach. The triangle only exists when |l1 − l2| ≤ r ≤ l1 + l2. Further than that, no elbow angle works. Closer than |l1 − l2|, the arm cannot fold tight enough. That is the hole in the middle.

    Motion. Each joint closes the same fraction of its remaining gap every instant, 1 − e^(−3·dt). That makes a straight line on the joint map. It is not a straight line for the tip. If there is no answer, or the answer is past a joint limit, the arm stays where it is.

    The floor (this page’s rule). The model has no floor, so the page adds one, 0.405 m below the shoulder. No part of the arm may go below it. The links are checked at the width of the 3D covers: 0.25 m around the upper arm and elbow, 0.19 m around the forearm and wrist. If the chosen elbow would hit the floor and the other one is clear, the arm uses the other one and says so. If both would, it stops at the closest pose that stays above the floor and shows how far short it is. Before each move the page samples the straight joint path; if it would dip into the floor, the arm goes round on a safe path instead.

    Contact. Each link is treated as a rod 7.5 cm in radius. The pose touches the obstacle when either rod comes closer to its centre than radius + 0.075 m. The page samples this 60 times per model second during a move, so it can show contact on the way as well as at the end.

    Near full stretch the elbow angle changes fastest with distance: |dq2/dr| = r / (l1·l2·|sin q2|). At full stretch sin q2 = 0, so no joint motion can push the tip further out. Engineers call this a singularity.

    Honest limits
    • This is geometry, not physics. There are no motors, masses, torques or speeds. The motion is smoothed joint interpolation.
    • Contact is only checked against one ball, using thin 7.5 cm rods. The robot’s covers and gripper are wider than that. There is no self-contact check. Nothing here plans a path around the obstacle.
    • The floor is this page’s rule, not part of the model. It uses simple capsules as wide as the 3D covers, so a pose can be refused when a real arm would just fit. The gripper is decoration past the tip: the 3D view tilts it like a wrist so it stays above the floor. Paths round the floor are found on a 4° grid of poses; they are safe, not the shortest or smoothest.
    • The obstacle’s position is fixed by the model (x 1.3, height 0.8, z 0.35 m). You can change its size.
    • The tip is the wrist centre. The 3D gripper and wrist are decoration past that point. The 3D link covers are stretched to the chosen lengths.
    • The joint map’s red area assumes the base is already turned to the target. During a move the base is still turning, so the path can cross red cells without contact, or touch without crossing them. The red dots on the path are measured contacts.
    • Heights are measured from the shoulder pivot, not the floor. The floor is 0.405 m below the shoulder, where the pedestal stands. The model accepts targets from 0.1 m above the shoulder, so the target always stays at least 0.5 m above the floor.
    • A real industrial arm has six joints and a wrist that sets the tool’s orientation. This one has three and only places a point.
    Sources & further reading

      The model notes are in RESEARCH.md. Related labs: Chain Reaction Builder and Motion Design Playground.