Robotic Arm Kinematics & DH Calculator

Simulate forward and inverse kinematics for 2-DOF and 3-DOF planar robotic manipulators. Compute end-effector Cartesian coordinates, solve joint angles, and inspect Denavit-Hartenberg transformation matrices in real time.

⚙️ Engineering 🤖 Forward & Inverse Kinematics 📐 Denavit-Hartenberg (D-H) ⚡ Interactive 2D Canvas
Quick Overview & Direct Answer

Robotic Arm Kinematics & DH Parameters Calculator: Free Robotic Arm Kinematics & DH Parameters Calculator tool: calculate robotic arm forward and inverse kinematics using Denavit-Hartenberg (D-H).

Primary Use Structural calculations, fluid dynamics, electrical engineering formulas
Input Formats Engineering variables, voltage, current, resistance, stress limits
Output Format Calculated engineering values, tolerance checks
Processing Mode 100% Client-Side In-Browser Math Engine
Access Tier Free, unlimited, no sign-up needed

Kinematic Configuration

Link Lengths (mm)

Joint Angles (Degrees)

35°
45°
-30°

Planar Arm Visualization

In Workspace
■ Link 1 ■ Link 2 ■ Link 3 ● End-Effector
End-Effector X
256.4 mm
End-Effector Y
218.1 mm
Orientation (φ)
50.0°
Max Reach (R_max)
450.0 mm

Denavit-Hartenberg (D-H) Parameters Table

Link (i) θᵢ (Joint Angle) dᵢ (Offset) aᵢ (Length) αᵢ (Twist)

1. Mathematical Foundations of Manipulator Kinematics

In mechanical robotics and mechatronic engineering, kinematics is the mathematical study of the geometric motion of multi-body articulated mechanisms without regard to the forces or torques that produce that motion. An industrial robotic arm is modeled as an open kinematic chain composed of rigid bodies (termed links) connected in series by kinematic pairs (termed joints). For revolute joints (which provide single-axis rotary motion), the fundamental challenge of robotic manipulation involves mapping between two distinct coordinate spaces:

  • Joint Space ($mathbf{q} in mathbb{R}^n$): The internal coordinate vector of joint angular displacements $mathbf{q} = [ heta_1, heta_2, dots, heta_n]^T$, measured directly by rotary encoders or resolvers attached to the drive motors.
  • Operational / Cartesian Space ($mathbf{x} in mathbb{R}^m$): The external physical coordinates describing the position and spatial orientation of the robot's end-effector (gripper, welding torch, suction cup) relative to a static world base coordinate frame: $mathbf{x} = [x, y, z, phi, heta, psi]^T$.

2. Forward Kinematics (FK) for Planar Manipulators

Forward kinematics computes the operational position of the end-effector given a known vector of joint angles. For a 3-DOF planar manipulator operating in the $(X, Y)$ plane with link lengths $L_1, L_2, L_3$ and joint angles $ heta_1, heta_2, heta_3$ defined relative to preceding links, the Cartesian coordinates are evaluated using simple trigonometry:

$$x = L_1 cos( heta_1) + L_2 cos( heta_1 + heta_2) + L_3 cos( heta_1 + heta_2 + heta_3)$$
$$y = L_1 sin( heta_1) + L_2 sin( heta_1 + heta_2) + L_3 sin( heta_1 + heta_2 + heta_3)$$
$$phi = heta_1 + heta_2 + heta_3$$

Where $phi$ represents the total tool orientation angle with respect to the horizontal $X$-axis. For a 2-DOF arm, $L_3 = 0$ and the equations reduce to the first two terms.

3. The Denavit-Hartenberg (D-H) Convention & Homogeneous Transforms

Jacques Denavit and Richard Hartenberg introduced a standard four-parameter convention in 1955 to systematically attach reference frames to each link in a spatial kinematic chain. The relative position and orientation from coordinate frame $i-1$ to frame $i$ is described by a $4 imes 4$ homogeneous transformation matrix $^{i-1}T_i$ defined by four elementary transformations:

$$^{i-1}T_i = egin{bmatrix} cos heta_i & -sin heta_icosalpha_i & sin heta_isinalpha_i & a_icos heta_i sin heta_i & cos heta_icosalpha_i & -cos heta_isinalpha_i & a_isin heta_i 0 & sinalpha_i & cosalpha_i & d_i 0 & 0 & 0 & 1 end{bmatrix}$$

The four fundamental D-H parameters are:

  1. Link Length ($a_i$): The distance along the mutual perpendicular axis $X_i$ between joint axes $Z_{i-1}$ and $Z_i$.
  2. Link Twist ($alpha_i$): The angle of rotation around axis $X_i$ required to align axis $Z_{i-1}$ with axis $Z_i$.
  3. Link Offset ($d_i$): The distance along axis $Z_{i-1}$ from the origin of frame $i-1$ to the intersection with axis $X_i$ (variable in prismatic joints).
  4. Joint Angle ($ heta_i$): The angle of rotation around axis $Z_{i-1}$ required to align axis $X_{i-1}$ with axis $X_i$ (variable in revolute joints).

The total transformation from the base frame to the tool tip is obtained through matrix multiplication: $^0T_n = , ^0T_1 cdot , ^1T_2 dots , ^{n-1}T_n$.

4. Analytical Inverse Kinematics (IK) & Geometric Solving

Inverse kinematics determines the necessary joint angles $( heta_1, heta_2)$ to position the tool tip at a requested target coordinate $(x, y)$. Unlike forward kinematics (which always yields a unique deterministic position), inverse kinematics is highly non-linear, can yield multiple valid solutions (e.g. elbow-up vs. elbow-down postures), or may have zero solutions if the target lies outside the manipulator's workspace boundary.

Solving the 2-DOF Elbow Configuration via the Law of Cosines

For a 2-link planar arm with target coordinates $(x, y)$, the distance from the base origin to the target is $r = sqrt{x^2 + y^2}$. Applying the Law of Cosines to the triangle formed by links $L_1, L_2$, and radius $r$:

$$r^2 = x^2 + y^2 = L_1^2 + L_2^2 - 2 L_1 L_2 cos(180^circ - heta_2) = L_1^2 + L_2^2 + 2 L_1 L_2 cos heta_2$$
$$cos heta_2 = rac{x^2 + y^2 - L_1^2 - L_2^2}{2 L_1 L_2}$$

The elbow angle $ heta_2$ is determined using the two-argument arctangent function ($ ext{atan2}$):

$$sin heta_2 = pm sqrt{1 - cos^2 heta_2}$$
$$ heta_2 = ext{atan2}(pmsqrt{1 - cos^2 heta_2}, , cos heta_2)$$

Where the positive sign ($+sin heta_2$) yields the elbow-down configuration, and the negative sign ($-sin heta_2$) yields the elbow-up configuration. Once $ heta_2$ is established, base joint angle $ heta_1$ is computed geometrically:

$$ heta_1 = ext{atan2}(y, x) - ext{atan2}(L_2 sin heta_2, , L_1 + L_2 cos heta_2)$$

5. Worked Engineering Case Study: SCARA Pick-and-Place Positioning

Design Scenario: An industrial electronics assembly SCARA arm has link lengths $L_1 = 250 ext{ mm}$ and $L_2 = 200 ext{ mm}$. A surface-mount component feeder is located at Cartesian target coordinates $x = 300 ext{ mm}, y = 200 ext{ mm}$. We solve for the required joint angles:

  1. Calculate squared distance: $r^2 = 300^2 + 200^2 = 90,000 + 40,000 = 130,000 ext{ mm}^2$.
  2. Check workspace bounds: $R_{min} = |250 - 200| = 50 ext{ mm}$; $R_{max} = 250 + 200 = 450 ext{ mm}$. Since $r = sqrt{130,000} approx 360.55 ext{ mm}$ falls within $[50, 450]$, a valid solution exists.
  3. Evaluate $cos heta_2$: $$cos heta_2 = rac{130,000 - 250^2 - 200^2}{2 imes 250 imes 200} = rac{130,000 - 62,500 - 40,000}{100,000} = rac{27,500}{100,000} = 0.275$$
  4. Compute $ heta_2$ (elbow-down branch): $ heta_2 = arccos(0.275) approx 74.04^circ$.
  5. Evaluate $ heta_1$: $$eta = ext{atan2}(200 imes sin(74.04^circ), , 250 + 200 imes 0.275) = ext{atan2}(192.28, , 305.0) approx 32.23^circ$$ $$alpha = ext{atan2}(200, 300) approx 33.69^circ$$ $$ heta_1 = 33.69^circ - 32.23^circ approx 1.46^circ$$

Thus, commanding joint motors to $ heta_1 = 1.46^circ$ and $ heta_2 = 74.04^circ$ positions the pick-and-place nozzle precisely over the component feeder.

6. Kinematic Singularities & Workspace Boundaries

A kinematic singularity occurs when the robotic Jacobian matrix $mathbf{J}(mathbf{q})$ (which relates joint velocities $dot{mathbf{q}}$ to Cartesian end-effector velocities $dot{mathbf{x}} = mathbf{J}dot{mathbf{q}}$) loses rank ($det(mathbf{J}) = 0$). In a 2-DOF planar manipulator, the Jacobian determinant is:

$$det(mathbf{J}) = L_1 L_2 sin( heta_2)$$

Singularities arise when $sin( heta_2) = 0$, which corresponds to $ heta_2 = 0^circ$ (arm fully extended at outer boundary) or $ heta_2 = pm 180^circ$ (arm completely folded back onto itself). At these critical points:

  • The robot loses the ability to move in the radial direction outward.
  • Cartesian velocity control algorithms demand infinite joint velocities ($dot{mathbf{q}} = mathbf{J}^{-1}dot{mathbf{x}}$), causing motor driver overcurrent faults.
  • Trajectory planning software must insert path blending or damped least-squares (Levenberg-Marquardt) pseudo-inverses to safely transit near singular zones.

7. Frequently Asked Questions

Frequently Asked Questions

Standard DH parameters (Denavit-Hartenberg 1955) attach frame $i$ to link $i$'s distal joint, while Modified DH parameters (Craig 1986) attach frame $i$ to link $i$'s proximal joint. Both formulations are mathematically equivalent, but Craig's notation simplifies kinematic representations for branched tree-topology manipulators.

In a 3-link arm, the first two links position the wrist joint at $(x_w, y_w) = (x - L_3cosphi, y - L_3sinphi)$. Once the 2-DOF inverse kinematics solves $ heta_1$ and $ heta_2$ for the wrist point, the third joint is solved trivially by subtraction: $ heta_3 = phi - heta_1 - heta_2$.

The reachable workspace encompasses all Cartesian points $(x, y, z)$ the end-effector can touch with at least one orientation. The dexterous workspace is the smaller sub-volume where the robot can position the end-effector with any arbitrary spatial orientation.