Machines & mechanisms

Robot Arm Inverse Kinematics Lab

Shows how a two-link robot arm reaches a target: the reach zone, both elbow poses and which of them fit the joint limits, the chosen pose with its manipulability, a joint move and a straight-line move from a start pose with every frame flagged, 25 damped least squares iterations with a 10-degree step limit, and the reachable workspace under the joint limits as two shaded regions; refuses inputs out of range plainly, and scores five challenges. For learning inverse kinematics, joint limits and iterative solvers.

Last updated

Calculator overview

Inputs and outputs

This summary comes from the calculator's published input and output contract.

Inputs

Start elbow angle (required)
About this input

The start pose elbow angle, in degrees, from -180 to 180; its sign says which elbow pose the start belongs to.

Unit deg Default -90 Range -180 to 180
Shoulder lower limit (required)
About this input

The lower shoulder limit, in degrees, from -180 to 180 and below the upper limit.

Unit deg Default -90 Range -180 to 180
Shoulder upper limit (required)
About this input

The upper shoulder limit, in degrees, from -180 to 180 and above the lower limit; a shoulder range cannot cross 180.

Unit deg Default 150 Range -180 to 180
Start shoulder angle (required)
About this input

The start pose shoulder angle, in degrees, from -180 to 180: where both moves and the iterations begin.

Unit deg Default 90 Range -180 to 180
Upper arm length (L1) (required)
About this input

L1, the upper arm from the shoulder to the elbow, in m, from 0.05 to 2.

Unit m Default 1 Range 0.05 to 2
Target y (required)
About this input

The target up (y), in m, from -4 to 4.

Unit m Default 0.6 Range -4 to 4
Target x (required)
About this input

The target across (x), in m, from -4 to 4; the shoulder is at the origin. Drag the target on the canvas.

Unit m Default 1.2 Range -4 to 4
DLS damping (lambda) (required)
About this input

lambda, the damped least squares damping, in m, from 0 to 1: more damping means smaller, safer steps but slower convergence. Below 1E-6 m it acts as 0.

Unit m Default 0.05 Range 0 to 1
Challenge number (required)
About this input

0 for none, or 1 to 5 to load a challenge. A challenge fixes the arm, target, limits, start pose and damping it is about and leaves only its free inputs to you.

Default 0 Range 0 to 5
Your pose prediction (challenge 1) (required)
About this input

Your prediction in challenge 1: Not yet predicted, Both poses, Elbow up only, Elbow down only or Neither pose, chosen from the list. The poses stay hidden until you predict.

Default Not yet predicted Allowed Not yet predicted, Both poses, Elbow up only, Elbow down only, Neither pose
Elbow pose (required)
About this input

Elbow up (the elbow angle from -180 to 0) or Elbow down (from 0 to 180): the pose the arm keeps and the straight-line move follows.

Default Elbow up Allowed Elbow up, Elbow down
Forearm length (L2) (required)
About this input

L2, the forearm from the elbow to the tip, in m, from 0.05 to 2.

Unit m Default 0.8 Range 0.05 to 2
Elbow lower limit (required)
About this input

The lower elbow limit, in degrees, from -180 to 180 and below the upper limit.

Unit deg Default -150 Range -180 to 180
Elbow upper limit (required)
About this input

The upper elbow limit, in degrees, from -180 to 180 and above the lower limit.

Unit deg Default 150 Range -180 to 180

Outputs

Elbow flip needed before the straight line
About this output

Yes when the start pose has the other elbow sign, so the arm must flip its elbow before the straight line; else No.

No unit declared
Straight-line frames not OK
About this output

The number of straight-line frames (of 41) not flagged OK: a joint outside its limits, a frame out of reach, or the elbow flip at the start.

No unit declared
Moves: 41 frames of the joint move and of the straight-line move from the start pose to the target
About this output

The two moves, one row per frame (41): the frame, the joint move's shoulder and elbow angles, elbow and tip and flag, then the straight-line move's shoulder and elbow angles and elbow (blank when out of reach), commanded tip and flag. While challenge 1 awaits a prediction only frame 0 shows.

No unit declared
Inner radius
About this output

The inner radius |L1 - L2|, in m: closer to the shoulder than this the tip cannot reach.

Unit m
Full stretch (outer radius)
About this output

The full stretch L1 + L2, in m: the outer radius of the reach.

Unit m
Plot half-width
About this output

The half-width of the square plot, in m: 1.1 times the larger of the full stretch and the target distance.

Unit m
Formula module versions
About this output

The formula modules embedded in the workbook and their versions.

No unit declared
Manipulability, percent of its largest value
About this output

The manipulability as a percent of its largest value L1 x L2, reached with the elbow bent at 90 degrees.

Unit %
Manipulability (abs Jacobian determinant)
About this output

The manipulability L1 x L2 x |sin(elbow angle)| of the drawn pose, in m^2 (the absolute Jacobian determinant): 0 with the arm straight or folded.

Unit m^2
Joint-move frames outside the limits
About this output

The number of joint-move frames outside the joint limits.

No unit declared
Model version
About this output

The workbook version.

No unit declared
Model Status
About this output

OK, CHECK (a prediction is awaited, the target is out of reach, a pose breaks the joint limits, or the start pose is outside them) or NOT VALID with the reason. When NOT VALID every model result and grid cell is blank; the challenge result, goal and feedback still show.

No unit declared
Challenge 2: the three marked targets
About this output

Challenge 2's three marked targets: their name, position and whether a pose inside the joint limits reaches each (Yes or No); blank outside challenge 2.

No unit declared
Tip x
About this output

The tip x of the arm as drawn, in m (the target when reachable).

Unit m
Target y used
About this output

The target y used, m.

Unit m
Target x used
About this output

The target x used, m.

Unit m
Reachable workspace under the joint limits: the outline of each elbow region (97 points each)
About this output

The reachable workspace under the joint limits as two closed outlines of 97 points (x, y): one for the elbow-down poses and one for the elbow-up poses; blank for a region the elbow limits leave empty, and while challenge 1 awaits a prediction.

No unit declared
Upper arm length (L1) used
About this output

The upper arm length used, m (the challenge's when it fixes it).

Unit m
Tip y
About this output

The tip y of the arm as drawn, in m.

Unit m
Distance of the target from the shoulder
About this output

The distance of the target from the shoulder, in m.

Unit m
Shoulder upper limit used
About this output

The upper shoulder limit used, degrees.

Unit deg
Reach zone of the target
About this output

Inside the reach, At the outer edge (arm straight), At the inner edge (arm folded), Beyond the reach or Inside the inner hole: where the target lies, decided with a band of 1E-9 of the full stretch around each radius.

No unit declared
Shortfall (how far out of reach)
About this output

How far the target is out of reach, in m: its distance beyond the full stretch, or inside the inner radius; 0 when reachable.

Unit m
Start shoulder angle used
About this output

The start shoulder angle used, degrees.

Unit deg
Start elbow angle used
About this output

The start elbow angle used, degrees.

Unit deg
Shoulder lower limit used
About this output

The lower shoulder limit used, degrees.

Unit deg
Joint move: largest distance from the line
About this output

How far the joint move's curved tip path strays from the straight line, in m (the largest over its 41 frames).

Unit m
DLS damping (lambda) used
About this output

The damping used, m, as entered or fixed (a value below 1E-6 m is computed as 0 but shows as entered).

Unit m
DLS: steps cut to the 10-degree limit
About this output

The number of iterations whose step was cut to the 10-degree limit.

No unit declared
DLS: joint-angle gap to the analytic pose
About this output

How far the final iterate's joint angles are from the nearer analytic pose, in degrees; blank unless the target is inside the reach and the method got within 1 mm.

Unit deg
DLS: first iteration within 1 mm
About this output

The first damped least squares iteration whose tip is within 1 mm of the target; blank when none of the 25 gets there.

No unit declared
Damped least squares: 25 iterations from the start pose
About this output

The damped least squares iterations, one row per iteration (26, from the start pose): the joint angles, the tip, the error, the requested step (degrees) and OK, Clamped or Singular; the last row takes no step. While challenge 1 awaits a prediction only row 0 shows.

No unit declared
DLS: tip error after 25 iterations
About this output

The tip error after 25 iterations, in m.

Unit m
Challenge result
About this output

No challenge selected, MET or NOT MET.

No unit declared
Challenge feedback
About this output

A prompt while challenge 1 awaits a prediction, else the met or not-met feedback of the selected challenge; blank with no challenge.

No unit declared
Arm shoulder angle (chosen pose)
About this output

The shoulder angle of the arm as drawn (the chosen elbow pose, or the closest pose when out of reach), in degrees.

Unit deg
Arm elbow angle (chosen pose)
About this output

The elbow angle of the arm as drawn, in degrees.

Unit deg
Challenge score
About this output

100 when the selected challenge is met, else 0.

No unit declared
Challenge: the value scored
About this output

The value the selected challenge scores: the number of poses within the limits, the number of marked targets reachable within the limits, the error of iteration 10 (m), the manipulability share (percent) or the number of straight-line frames not OK; blank with no challenge, while challenge 1 awaits a prediction, or when not valid.

No unit declared
Challenge goal
About this output

The goal of the selected challenge; blank with no challenge.

No unit declared
Elbow y
About this output

The elbow y of the arm as drawn, in m.

Unit m
Elbow x
About this output

The elbow x of the arm as drawn, in m.

Unit m
Elbow-up pose: shoulder angle
About this output

The shoulder angle of the elbow-up pose that reaches the target, in degrees; blank when out of reach and while challenge 1 awaits a prediction.

Unit deg
Forearm length (L2) used
About this output

The forearm length used, m.

Unit m
First straight-line frame not OK
About this output

The first straight-line frame not flagged OK; blank when every frame is OK.

No unit declared
Poses within the joint limits
About this output

Both poses, Elbow up only, Elbow down only or Neither pose: which poses reach the target within the joint limits; Out of reach when the target cannot be reached. Blank while challenge 1 awaits a prediction.

No unit declared
Elbow-up pose: elbow angle
About this output

The elbow angle of the elbow-up pose, in degrees (from -180 to 0); blank as for its shoulder angle.

Unit deg
Elbow-down pose: elbow angle
About this output

The elbow angle of the elbow-down pose, in degrees (from 0 to 180); blank as above.

Unit deg
Elbow pose used
About this output

The elbow pose used.

No unit declared
DLS: largest requested step
About this output

The largest joint step the method asked for over the 25 iterations, in degrees, before the 10-degree limit cuts it.

Unit deg
Elbow lower limit used
About this output

The lower elbow limit used, degrees.

Unit deg
Elbow upper limit used
About this output

The upper elbow limit used, degrees.

Unit deg
Elbow-down pose: shoulder angle
About this output

The shoulder angle of the elbow-down pose that reaches the target, in degrees; blank as above.

Unit deg
This page is provided by LogicCommons for informational purposes only. Results are analysis outputs computed from the inputs you supply and are not professional advice. Verify all inputs and results independently.

LogicCommons is in beta. If a result, label, or reference looks wrong, tell us here; we read every message.

Methodology

Purpose and model boundary

This lab models a planar two-link robot arm on a fixed base and shows how it reaches a target. For the target you place it returns where the target lies relative to the arm's reach, both elbow poses that reach it and which of them fit the joint limits, the pose the arm keeps, and that pose's manipulability. From a start pose it plays two 41-frame moves to the target, a joint move and a straight-line move, and flags every frame. It runs 25 iterations of the damped least squares method (DLS) from the same start pose, with a step limit of 10 degrees per iteration, and draws the reachable workspace under the joint limits as two outlines, one for each elbow pose. Five scored challenges turn the lab into exercises.

It is a lab for learning inverse kinematics, joint limits and iterative solvers, not a tool for programming, planning or checking the motion of any real machine. The arm is kinematics only: two rigid links of zero thickness joined by pin joints, with no masses, torques, speeds, backlash or collisions, no obstacles and no path search. A move with no flagged frame is not a safe trajectory for real hardware.

The model is the calculation authority. The page sends the values you set to the model and draws only what the model returns: the arm, every move frame, the iteration plot and both workspace outlines come from the model's results; the page computes no angle or position itself.

Inputs and units

Input Meaning and unit
Upper arm length (L1) The link from the shoulder to the elbow, from 0.05 to 2 m.
Forearm length (L2) The link from the elbow to the tip, from 0.05 to 2 m.
Target x The target across, from -4 to 4 m. The shoulder is at the origin.
Target y The target up, from -4 to 4 m.
Elbow pose Elbow up (the elbow angle from -180 to 0 degrees) or Elbow down (from 0 to 180 degrees): the pose the arm keeps and the straight-line move follows.
Shoulder lower and upper limits The shoulder's allowed range, each from -180 to 180 degrees, the lower below the upper. A shoulder range cannot cross 180 degrees.
Elbow lower and upper limits The elbow's allowed range, each from -180 to 180 degrees, the lower below the upper.
Start shoulder angle The start pose's shoulder angle, from -180 to 180 degrees: where both moves and the iterations begin.
Start elbow angle The start pose's elbow angle, from -180 to 180 degrees. Its sign says which elbow pose the start belongs to.
DLS damping (lambda) λ, from 0 to 1 m. More damping gives smaller, safer steps but slower convergence. A damping below 1×10⁻⁶ m is computed as 0.
Challenge number 0 for none; 1 to 5 loads one of the five challenges.
Your pose prediction Not yet predicted, Both poses, Elbow up only, Elbow down only or Neither pose. Only challenge 1 uses it.

Sign conventions: x is to the right and y is up, with the shoulder at (0, 0). The shoulder angle θ₁ is the angle of the upper arm from the +x axis, counterclockwise positive. The elbow angle θ₂ is the angle of the forearm relative to the upper arm, counterclockwise positive: 0 is the arm straight, 180 or -180 fully folded. Elbow down means θ₂ from 0 to 180 and Elbow up means θ₂ from -180 to 0. For a target to the right of the base, Elbow down puts the elbow below the line from the shoulder to the target, which is where the names come from; the model uses only the sign of θ₂.

The target is set by dragging it on the canvas. In a challenge, the inputs the challenge fixes cannot be changed.

Governing relationships

Forward kinematics. For a pose (θ₁, θ₂) the elbow is at (L1 cos θ₁, L1 sin θ₁) and the tip at

  • x = L1 cos θ₁ + L2 cos(θ₁ + θ₂)
  • y = L1 sin θ₁ + L2 sin(θ₁ + θ₂)

An angle that is a whole multiple of 90 degrees takes its sine and cosine exactly (0, 1 or -1), so the straight and folded poses and angles along the axes carry no rounding.

The wrap rule. An angle is brought into the range from -180 (exclusive) to 180 (inclusive) by W(a) = ((a + 180) mod 360) − 180, with an exact -180 read as 180. It is the only wrap rule in the lab.

The reach zone. The full stretch is R_max = L1 + L2 and the inner radius R_min = |L1 − L2|. The target lies at the distance r = √(x² + y²) from the shoulder. The model decides the zone with a band of 1×10⁻⁹ × R_max around each radius, tested in this order:

  1. Beyond the reach when r is more than R_max plus the band;
  2. At the outer edge (arm straight) when r is within the band of R_max;
  3. Inside the inner hole when r is less than R_min minus the band;
  4. At the inner edge (arm folded) when r is within the band of R_min;
  5. Inside the reach otherwise.

The target is reachable in the first two edge zones and inside the reach. On an edge the pose is set exactly straight or folded, so the tip can miss the target by up to 1×10⁻⁹ times the full stretch (at most 4×10⁻⁹ m).

The two poses inside the reach. With the direction to the target φ = atan2(y, x), the model forms the elbow's cosine without cancellation, from the two factored distances to the edges:

  • 1 − cos θ₂ = (R_max − r)(R_max + r) / (2 L1 L2)
  • 1 + cos θ₂ = (r − R_min)(r + R_min) / (2 L1 L2)
  • cos θ₂ is half their difference, and sin θ₂ = √((1 − cos θ₂)(1 + cos θ₂)), which is positive inside.

For the elbow sign σ (+1 for Elbow down, −1 for Elbow up):

  • θ₂ = σ · atan2(sin θ₂, cos θ₂)
  • β = atan2(σ L2 sin θ₂, L1 + L2 cos θ₂)
  • θ₁ = W(φ − β)

This is the law of cosines in a form that stays accurate near the straight and folded poses. The two poses' elbow angles are exact negatives of each other.

Edges and targets out of reach. On the outer edge or beyond, the pose is straight (θ₂ = 0) and points at the target (θ₁ = W(φ)); beyond the reach this is the closest the arm can get. On the inner edge or in the hole the pose is folded (θ₂ = 180 for Elbow down, -180 for Elbow up) and θ₁ = W(φ) when L1 ≥ L2, else W(φ + 180). When the target is at the base itself, its direction is undefined and the arm keeps the start shoulder angle.

The shortfall. How far the target is out of reach: r − R_max beyond the reach, R_min − r in the hole, and 0 when it is reachable.

The joint-limit test. A joint angle is within its limits when it lies from the lower limit minus 1×10⁻⁹ degrees to the upper limit plus 1×10⁻⁹ degrees. Every limit test in the lab uses this rule. A pose from inverse kinematics tests its shoulder angle as written, or as the same direction written as θ₁ − 360 when only that form fits the limits (this matters only for a shoulder angle at 180 with a lower limit near -180). The start pose and the move frames test their angles literally.

Manipulability. The manipulability of the kept pose is L1 · L2 · |sin θ₂|, in m², the absolute value of the Jacobian determinant. It is 0 with the arm straight or folded and largest, L1 · L2, with the elbow bent at 90 degrees. The share is 100 · |sin θ₂|, as a percent of that largest value.

The joint move. Each of the 41 frames k = 0 to 40 has the weight w = k/40. Both joint angles move in a straight line from the start pose to the kept pose: θ = θ_start · (1 − w) + θ_end · w, so frame 0 is the start pose and frame 40 the kept pose exactly. The tip follows a curve. A frame is flagged Joint limit when either angle is outside its limits, else OK. Because a joint range is an interval, a joint move whose two ends lie within the limits never leaves them.

The straight-line move. The commanded tip at frame k lies on the straight line from the start tip S to the target T: P = S · (1 − w) + T · w. At every frame the model solves the inverse kinematics above for the commanded tip, on the chosen elbow pose. Frame 0 takes the start pose itself when the start belongs to the chosen elbow pose (the start elbow angle has the chosen sign, or is 0). The shoulder angle is unwrapped: each frame takes the previous frame's shoulder angle plus the wrapped change, so the shoulder turns continuously and may pass 180 or -180, which then breaks the limits. Each frame's flag is the first that applies:

  • Out of reach when the commanded tip is out of reach; the frame shows the commanded tip only;
  • Elbow flip at frame 0 when the start pose has the other elbow sign, so the arm must flip its elbow before the move;
  • Joint limit when either angle is outside its limits;
  • OK otherwise.

The arm never flips its elbow during the move.

How far the joint move strays. With the line from S to T, each joint-move frame's tip distance from that line is |dx · (y − S_y) − dy · (x − S_x)| / √(dx² + dy²), where (dx, dy) = T − S; when S and T coincide it is the tip's distance from S. The output is the largest distance over the 41 frames.

Damped least squares. Row 0 holds the start pose. Each row k = 0 to 25 computes the tip by forward kinematics and the error vector e = T − tip, with its length as the tip error. Rows 0 to 24 then take a step:

  • The Jacobian, per radian: J₁₁ = −y_tip, J₁₂ = −L2 sin(θ₁ + θ₂), J₂₁ = x_tip, J₂₂ = L2 cos(θ₁ + θ₂).
  • The requested step is Δθ = Jᵀ (J Jᵀ + λ² I)⁻¹ e, converted to degrees. The 2 × 2 inverse is written in closed form. Its determinant is computed as det(J)² + λ² · trace(J Jᵀ) + λ⁴, with det(J) = L1 L2 sin θ₂, a sum of terms that are never negative, so it does not lose accuracy near the straight pose.
  • With λ = 0 this is the Newton step J⁻¹ e. At the straight or folded pose (the elbow within 1×10⁻⁹ degrees of 0 or 180) an undamped step does not exist: the requested step is 0 and the row is flagged Singular, so the method stays where it is.
  • The requested step's size is the length of (Δθ₁, Δθ₂) in degrees. When it is more than 10 degrees, the applied step is the requested step scaled down to a length of 10 degrees and the row is flagged Clamped; otherwise the applied step is the requested step and the row is flagged OK.
  • The next row's angles are this row's plus the applied step. They are not wrapped, and the method ignores the joint limits.

Row 25 shows the pose, the tip and the error only. The method has converged at the first row whose tip error is at most 1 mm (0.001 m). The angle gap compares the last row's angles with the nearer of the two analytic poses: for each pose, the larger of the two wrapped joint differences, then the smaller of the two poses' gaps. It is shown only when the target is inside the reach and some row came within 1 mm.

The reachable workspace. The set of tips the arm can reach within its joint limits is the image of the rectangle of allowed joint angles. The model splits it at the straight pose into two regions:

  • the elbow-down region, with the elbow from the larger of the elbow lower limit and 0 to the smaller of the elbow upper limit and 180;
  • the elbow-up region, with the elbow from the elbow lower limit to the smaller of the elbow upper limit and 0.

A region exists when its elbow range has a positive width. Its outline is the tip traced around the boundary of its joint rectangle: four edges of 24 equal angle steps each, 97 points in all, the last repeating the first so the loop closes. Where the two regions overlap, both elbow poses reach the point.

The plot size. The plot is a square centred on the shoulder, with a half-width of 1.1 times the larger of the full stretch and the target distance.

Calculation sequence

The model works through the relationships above in this order:

  1. It checks the entered inputs in the order of the status list under Errors and warnings, up to the challenge number and the prediction.
  2. It fixes the values used: your inputs, or in a challenge the challenge's fixed values, keeping the inputs the challenge leaves free. Under NOT VALID every result is blank.
  3. It finds the target's distance, the reach zone and the shortfall, both elbow poses and which of them fit the joint limits.
  4. It sets the kept pose on the chosen elbow pose, its elbow and tip, and its manipulability.
  5. It builds the 41 frames of the joint move and of the straight-line move, flags each frame and counts the flagged frames.
  6. It runs the 25 damped least squares iterations from the start pose.
  7. It traces the two workspace outlines and, in challenge 2, tests the three marked targets.
  8. It sets the status and, in a challenge, scores the challenge.

Outputs and interpretation

  • Status: OK, CHECK or NOT VALID, with the reason (see Validation and status logic and Errors and warnings).
  • Reach: the reach zone of the target, the full stretch and the inner radius (m), the target's distance from the shoulder (m) and the shortfall (m, 0 when reachable).
  • Poses: the shoulder and elbow angles of the elbow-up and the elbow-down pose (degrees, blank when the target is out of reach), and which poses fit the joint limits: Both poses, Elbow up only, Elbow down only, Neither pose, or Out of reach. On the outer edge the two poses are the same straight pose, and both are reported.
  • The arm as drawn: the shoulder and elbow angles of the kept pose (the chosen elbow pose, or the closest pose when the target is out of reach), the elbow and tip positions (m), the manipulability (m²) and its share of the largest value (percent).
  • Moves: the number of straight-line frames not flagged OK (0 to 41), the number of joint-move frames outside the limits, the first straight-line frame not OK (blank when every frame is OK), whether the elbow must flip before the straight line (Yes or No), and the joint move's largest distance from the straight line (m).
  • Damped least squares: the first iteration within 1 mm (blank when none of them gets there), the tip error after 25 iterations (m), the largest requested step before the limit (degrees), the number of steps cut to the 10-degree limit, and the angle gap to the nearer analytic pose (degrees).
  • Plot half-width (m).
  • Values used: the lengths, target, elbow pose, limits, start pose and damping actually solved. In a challenge these are the challenge's fixed values. The damping shows as entered or fixed, even when a value below 1×10⁻⁶ m is computed as 0.
  • Grids:
    • Moves: 41 rows, one per frame, with the joint move's shoulder and elbow angles, elbow, tip and flag, then the straight-line move's shoulder and elbow angles and elbow (blank when out of reach), commanded tip and flag.
    • Damped least squares: 26 rows, from the start pose: the joint angles, the tip, the error, the requested step (degrees) and the flag OK, Clamped or Singular. The last row takes no step, so its step and flag are blank.
    • Reachable workspace: 97 points (x, y) of each region's outline, elbow down and elbow up. A region the elbow limits leave empty has blank columns.
    • Marked targets: challenge 2's three targets, with their position and whether a pose within the joint limits reaches each (Yes or No). Blank outside challenge 2.

The page plays the moves frame by frame exactly as returned, plots the iteration error and the requested step from the iteration rows, and fills the two workspace outlines.

Reading the results:

  • Inside the reach the elbow-up and elbow-down elbow angles are exact negatives. With equal links reaching (1, 1), the poses are (0, 90) and (90, -90) and the manipulability is 1 m².
  • A straight-line move that leaves the limits or the reach is not a warning: it is a normal result, counted and flagged frame by frame. The joint move between the same two poses may stay legal while its tip curves away from the line.
  • The unwrapped straight-line shoulder angle can end past 180 degrees and read Joint limit at frame 40, while the kept pose, the same direction written within -180 to 180, fits the limits.
  • The requested step column shows what the method asked for before the 10-degree limit. With little damping it can ask for very large steps near the straight pose; with too much damping it creeps.
  • The tip error after 25 iterations can read exactly 0 when the iterations land on the target to the last bit.
  • A DLS run that does not converge, for example toward a target out of reach, is not a warning either.

Challenges

Choose a challenge number from 1 to 5. The model loads that challenge's arm, target, limits, start pose and damping, and the inputs it fixes replace yours (the "used" outputs show the values in effect). Only the inputs the challenge leaves free stay yours. The challenge result reads MET or NOT MET, the score is 100 when met and 0 otherwise, and a goal and a feedback line say what is asked and what to try next. The value the challenge scores is shown as well.

  1. Which poses fit? Predict which elbow poses reach the marked target within the joint limits before you see the arm. Until you choose a prediction, the status asks for one, and the poses, the arm as drawn, the moves after frame 0, the iterations after row 0 and the workspace stay hidden. It is met when your prediction equals the poses that fit.
  2. Fit the limits. Set the four joint limits so all three marked targets can be reached within them, with each joint's range at most 120 degrees wide.
  3. Tame the steps. Choose the damping so the iterations get within 1 mm of the target by iteration 10, without ever requesting a joint step over 45 degrees.
  4. Most agile pose. Move the target to where the arm, elbow up, reaches it within the limits with a manipulability of at least 98% of its largest value.
  5. Straight and legal. Choose a start pose so that every frame of the straight-line move to the target is flagged OK.

Validation and status logic

The status reads the first message in the list under Errors and warnings that applies: the NOT VALID input checks first, then the CHECK items, then OK. OK means the target is reachable, the chosen elbow pose fits the joint limits and the start pose is within them. A CHECK still returns every result, except while challenge 1 awaits a prediction; it marks a result that deserves a second look. The CHECK items also apply inside a challenge.

Assumptions and limitations

  • A rigid planar two-link arm with pin joints and its base at the origin; links from 0.05 to 2 m, the target within 4 m of the base on each axis. Kinematics only: no masses, torques, speeds, link thickness, backlash or collisions, no obstacles and no path search.
  • Joint limits lie inside -180 to 180 degrees, so a shoulder range cannot cross 180 degrees.
  • On an edge of the reach the pose is exactly straight or folded, and the tip may miss the target by up to 1×10⁻⁹ times the full stretch (at most 4×10⁻⁹ m); the shortfall reads 0 there.
  • Each move has 41 frames. The straight-line move keeps the chosen elbow pose and never flips the elbow on the way; a start pose on the other elbow pose is flagged at frame 0 instead.
  • The damped least squares method takes 25 steps with no joint limits, a 10-degree applied step limit and the damping in metres. Undamped, it cannot move at the straight or folded pose. Its rows are an exercise in how the method behaves, not a solver the other results depend on.
  • With damping near 0 and a target out of reach, the iteration rows are sensitive to rounding and can differ in about the ninth significant digit between calculation engines; the page shows 3 to 4 digits.
  • Each workspace outline joins its points with straight chords of at most 15 degrees of joint travel, so the filled shape is slightly smaller than the true region, by up to about 1.1% of its area.
  • A value within about 1×10⁻⁹ of a threshold, such as a target on the band edge of the reach, an angle exactly equal to a joint limit, the 10-degree step limit, the 1 mm convergence test or a challenge's bound, may round either way.

Restrictions and non-computing states

Every input is required; a blank or out-of-range value, or a dropdown value that is not one of its listed choices, reads NOT VALID.

Under NOT VALID every result is blank, and every entry of every grid. The version texts still show. With a challenge selected, the challenge result reads NOT MET with a score of 0 and the goal and the not-met feedback still show; with none, it reads No challenge selected.

Errors and warnings

The status messages, in the order they are checked:

  • NOT VALID: each link length must be from 0.05 to 2 m
  • NOT VALID: the target x and y must each be from -4 to 4 m
  • NOT VALID: choose the elbow pose from the list: Elbow up or Elbow down
  • NOT VALID: each joint limit must be from -180 to 180 degrees, with each minimum below its maximum
  • NOT VALID: each start angle must be from -180 to 180 degrees
  • NOT VALID: the damping must be from 0 to 1 m
  • NOT VALID: the challenge number must be a whole number from 0 to 5, and the prediction one of the listed choices
  • CHECK: make your prediction first: the poses, moves and workspace appear once you choose one: challenge 1 is selected and no prediction has been chosen.
  • CHECK: the target is out of reach (beyond the arm's full stretch or inside its inner hole), so the arm points at it as closely as it can: the reach zone is Beyond the reach or Inside the inner hole.
  • CHECK: neither elbow pose reaches the target within the joint limits: the target is reachable, but both poses break a joint limit.
  • CHECK: the chosen elbow pose breaks a joint limit; the other elbow pose reaches the target within the limits: switching the elbow pose would fit the limits.
  • CHECK: the start pose is outside the joint limits, so both moves begin outside them: the start angles are tested as entered.
  • OK: the target is reachable, the chosen elbow pose fits the joint limits and the start pose is within them.

References

This laboratory is an educational model of a planar two-link robot arm. Forward kinematics places the elbow and the tip from the two joint angles. Inverse kinematics finds both elbow poses that reach a target from the law of cosines, written in a factored form that stays accurate near the straight and folded poses. The manipulability is the absolute value of the arm's Jacobian determinant. The damped least squares method steps the joint angles toward the target with Jᵀ(JJᵀ + λ²I)⁻¹e, limited to 10 degrees per step, and becomes the Newton step when the damping is 0.

Sources and further reading

  • Forward and inverse kinematics of planar arms, including the two solutions of the two-link arm, and the manipulator Jacobian and its singularities: J. J. Craig, Introduction to Robotics: Mechanics and Control, 3rd edition, Pearson Prentice Hall, 2005, chapter 4, Inverse Manipulator Kinematics, and chapter 5, Jacobians: Velocities and Static Forces.
  • Velocity kinematics, manipulability, and analytic and numerical (Newton-Raphson) inverse kinematics: K. M. Lynch and F. C. Park, Modern Robotics: Mechanics, Planning, and Control, Cambridge University Press, 2017, chapter 5, Velocity Kinematics and Statics, and chapter 6, Inverse Kinematics.
  • Forward and inverse kinematics and the manipulator Jacobian: M. W. Spong, S. Hutchinson and M. Vidyasagar, Robot Modeling and Control, John Wiley & Sons, 2006.
  • The analytical inverse kinematics of the two-joint planar arm (both elbow branches and the straight and folded special cases), its Jacobian and the Newton-Raphson step: K. Hauser, Robotic Systems, online textbook, University of Illinois at Urbana-Champaign, chapter Inverse Kinematics. Robotic Systems, Inverse Kinematics
  • The manipulability measure: T. Yoshikawa, "Manipulability of Robotic Mechanisms", The International Journal of Robotics Research, vol. 4, no. 2, 1985, pp. 3-9.
  • Damped least squares near singular poses: C. W. Wampler, "Manipulator Inverse Kinematic Solutions Based on Vector Formulations and Damped Least-Squares Methods", IEEE Transactions on Systems, Man, and Cybernetics, vol. 16, no. 1, 1986, pp. 93-101; and Y. Nakamura and H. Hanafusa, "Inverse Kinematic Solutions With Singularity Robustness for Robot Manipulator Control", Journal of Dynamic Systems, Measurement, and Control, vol. 108, no. 3, 1986, pp. 163-171.

No table or text from any of these publications is reproduced, and none of their authors or publishers has reviewed or endorses this laboratory.

This laboratory is for learning. Its results hold only within its stated ranges; it is not a tool for programming, planning or checking the motion of any real robot or machine.

Results are informational and not professional advice. See our Terms of Use. Powered by SpreadsheetWeb · About · Privacy · Terms