|
|
||||||||
|
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 foundation1. 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) 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 θ1 − L2 sin(θ1+θ2), −L2 sin(θ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) = j11j22 − j12j21. 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 q̇ sends a unit circle in joint-velocity space (‖q̇‖ = 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, b11−b22) 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 θ1−L2sin(θ1+θ2), etc.)
3. Determinant det(J) = j11j22 − j12j21 = (−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) = b11b22−b122 ≈ 1.61×108. Eigenvalues λ1,2 = (trace/2) ± √[(trace/2)2−det] give λ1 ≈ 74605, λ2 ≈ 2170. Semi-axes a = √λ1 ≈ 273.1, b = √λ2 ≈ 46.6. Major-axis angle θ = (1/2) atan2(2b12, b11−b22) = (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 modeClick 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—
UsageChoose a Velocity mode and explore:
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
|
||||||||