Web Simulation 

 

 

 

 

Jacobian Matrix & Velocity Kinematics 

This interactive tutorial visualizes the Jacobian matrix for a 2-DOF planar robotic arm—the “Aha!” moment where the abstract calculus of partial derivatives meets the physical reality of why can’t my robot arm move forward anymore? The focus is the mapping between Joint Velocity Space (θ̇1, θ̇2) and Task Space Velocity (, ).

 

Mathematical foundation

1. Two-link planar arm and forward kinematics

The arm has two links: length L1 (shoulder–elbow) and L2 (elbow–end-effector). Joint angles are θ1 (base) and θ2 (elbow, relative to link 1). In a math frame with x right and y up, the end-effector position is:

x = L1 cos(θ1) + L2 cos(θ1 + θ2)
y = L1 sin(θ1) + L2 sin(θ1 + θ2)

2. The Jacobian matrix

The Jacobian J is the matrix of partial derivatives of end-effector position (x, y) with respect to joint angles (θ1, θ2): J = ∂[x; y]/∂[θ1; θ2]. For the 2-link arm, differentiating the FK expressions gives:

J = [ −L1 sin θ1L2 sin(θ1+θ2), −L2 sin(θ1+θ2) ]
[ L1 cos θ1 + L2 cos(θ1+θ2), L2 cos(θ1+θ2) ]

3. Velocity mapping

J maps joint velocities to end-effector velocity: [; ] = J [θ̇1; θ̇2]. So = j11θ̇1 + j12θ̇2 and = j21θ̇1 + j22θ̇2. The green vector at the end-effector in the simulation is this instantaneous linear velocity.

4. Determinant and singularity

det(J) = j11j22j12j21. When det(J) ≈ 0, the Jacobian loses rank: the arm is at a singularity (e.g. fully extended or fully folded). At that configuration, certain task-space directions require infinite joint velocity—the arm “loses” a degree of freedom. The simulation turns the arm red and shows “SINGULARITY WARNING” when |det(J)| is below a threshold.

5. Manipulability ellipsoid

The velocity mapping v = J sends a unit circle in joint-velocity space (‖‖ = 1) to an ellipse in task space. That ellipse is the manipulability ellipse: it shows how “easy” it is to move in each task-space direction. Let B = J JT. B is symmetric and positive semi-definite. Its entries are b11 = j112+j122, b12 = j11j21+j12j22, b22 = j212+j222.

The eigenvalues λ1 ≥ λ2 of B satisfy λ2 − (trace B)λ + det(B) = 0, so λ1,2 = (trace B)/2 ± √[(trace B)2/4 − det(B)]. The semi-axis lengths of the ellipse are the singular values of J: a = √λ1 (semi-major), b = √λ2 (semi-minor). The major-axis direction (eigenvector of B for λ1) has angle θ = (1/2) atan2(2b12, b11b22) in the task (x,y) frame. The major axis is the direction of highest velocity capability; near a singularity λ2 → 0 and the ellipse flattens. The dashed circle is the reach limit (L1 + L2): at full extension the arm cannot move radially outward.

 

Worked example (with numbers)

Use L1 = 150, L2 = 120, θ1 = θ2 = 45° (π/4 rad), and joint velocities θ̇1 = θ̇2 = 0.5 rad/s. The 0.5 rad/s values are the simulator’s default joint-velocity settings—they are arbitrary choices for this example so that the numbers below match what you see in the “Jacobian J” and “Status” panels when the sliders are at θ1=45°, θ2=45°, θ̇1=0.5, θ̇2=0.5. Then θ1 + θ2 = 90°, so cos(45°) = sin(45°) ≈ 0.707, cos(90°) = 0, sin(90°) = 1.

1. End-effector position

x = 150×0.707 + 120×0 ≈ 106.1,    y = 150×0.707 + 120×1 ≈ 226.1.

2. Jacobian J (∂x/∂θ1 = −L1sin θ1L2sin(θ1+θ2), etc.)

J =
−226.1−120.0
106.10.0

3. Determinant

det(J) = j11j22j12j21 = (−226.1)(0) − (−120)(106.1) = 12727.9.

4. Task-space velocity v = J [θ̇1; θ̇2]

= (−226.1)(0.5) + (−120)(0.5) = −173.0,    = (106.1)(0.5) + (0)(0.5) = 53.0.

5. Manipulability ellipse (B = J JT)

b11 = j112+j122 = (−226.1)2+(−120)2 = 65518,   b12 = j11j21+j12j22 = (−226.1)(106.1)+0 = −24008,   b22 = j212+j222 = (106.1)2+0 = 11257. Trace B = 76775, det(B) = b11b22b122 ≈ 1.61×108. Eigenvalues λ1,2 = (trace/2) ± √[(trace/2)2−det] give λ174605, λ22170. Semi-axes a = √λ1273.1, b = √λ246.6. Major-axis angle θ = (1/2) atan2(2b12, b11b22) = (1/2) atan2(−48016, 54261) ≈ −20.7°. The green ellipse in the sim at the end-effector has these semi-axes and orientation (scaled for display).

So v = [; ] = [−173.0; 53.0]. Setting the sim to θ1=45°, θ2=45°, θ̇1=0.5, θ̇2=0.5 reproduces these values in the “Jacobian J” and “Status” panels, and the manipulability ellipse matches the formulas above.

Joint angles (q)

45°
45°

Velocity mode

Click and drag the pink target to set desired end-effector position (x*, y*). Arm snaps to target via inverse kinematics (IK). Velocity vector and manipulability ellipse are hidden in this mode.

Joint velocities (q̇)

0.5
0.5

Desired velocity (ẋ, ẏ)

0
50

Jacobian J

Status

 

Usage

Choose a Velocity mode and explore:

  1. Joint angles (θ1, θ2): Use the sliders (−180° to 180°) to set the arm configuration. The arm, velocity vector (in Forward/Inverse), and manipulability ellipse (in Forward/Inverse) update in real time.
  2. Forward mode: Set joint velocities θ̇1, θ̇2 (−2 to 2 rad/s). The green vector at the end-effector is v = J [θ̇1; θ̇2]. Ghost arrows show the two columns of J. The manipulability ellipse is shown.
  3. Inverse mode: Set desired task velocity (ẋ, ẏ). Joint velocities are q̇ = J⁻¹ v. The green vector and manipulability ellipse are shown.
  4. Position (mouse) mode: Click and drag the pink target to set desired end-effector position (x*, y*). The arm snaps to the target via inverse kinematics (IK)—no Jacobian is used for the joint solution. The velocity vector and manipulability ellipse are hidden in this mode; the Jacobian panel still updates for the current posture.
  5. Ghost velocities (Forward/Inverse): Faint arrows show the contributions of θ̇1 and θ̇2 (columns of J); they add to form the green total velocity.
  6. Manipulability ellipsoid (Forward/Inverse only): The green ellipse at the end-effector comes from J JT. The major axis is the direction of highest velocity capability. Near full extension (θ2 ≈ 0) the ellipse flattens.
  7. Reach-limit circle: The dashed circle is the maximum reach (L1 + L2). In Position mode, the target is clamped to this circle.
  8. Singularity: When |det(J)| is small, the arm turns red and “SINGULARITY WARNING” appears. The ellipse becomes extremely thin in Forward/Inverse.
  9. Jacobian and Status: The 2×2 matrix J, det(J), and the current velocity relation update live in all modes.

Tips: In Forward or Inverse, set θ2 ≈ 0 to see the extended singularity and ellipse flattening. In Position (mouse) mode, grab the pink target (click near it) and drag to move the end-effector; the arm uses IK, not the Jacobian, to compute joint angles.

Parameters

  • θ1, θ2: Joint angles in degrees (−180 to 180). Defaults 45°, 45°.
  • θ̇1, θ̇2 (Forward): Joint velocities in rad/s (−2 to 2). Defaults 0.5, 0.5.
  • ẋ, ẏ (Inverse): Desired task-space velocity; q̇ = J⁻¹ v.
  • Position (mouse): Desired end-effector position (x*, y*) set by dragging the pink target. Joint angles come from closed-form IK; velocity vector and manipulability ellipse are not displayed.
  • L1, L2: Link lengths (fixed at 150 and 120 pixels).
  • det(J): Determinant of the Jacobian. Near zero indicates singularity.
  • v (ẋ, ẏ): End-effector velocity from v = J q̇ (Forward) or from sliders (Inverse), in math-frame units (scaled for display).