Interactive Lecture
Forward and Inverse Kinematics for Manipulators
by Dr Arnaldo Delli Carri
Robotics kinematics is the study of motion in robotic systems without considering the forces that cause the motion. It forms the mathematical foundation for robot control, trajectory planning, and manipulation. Kinematics allows us to answer two fundamental questions:
Forward kinematics determines where the end-effector is located given the joint angles; inverse kinematics solves for the joint angles needed to reach a desired end-effector position and orientation.
The Denavit-Hartenberg convention provides a systematic method to describe the geometry of serial manipulators. Each link is described by four parameters that define the transformation from one joint frame to the next:
DH Parameters:
The transformation from frame \(i-1\) to frame \(i\) is represented by a 4×4 homogeneous transformation matrix that combines rotation and translation:
\[{}^{i-1}T_i = \begin{bmatrix} \cos\theta_i & -\sin\theta_i\cos\alpha_i & \sin\theta_i\sin\alpha_i & a_i\cos\theta_i \\ \sin\theta_i & \cos\theta_i\cos\alpha_i & -\cos\theta_i\sin\alpha_i & a_i\sin\theta_i \\ 0 & \sin\alpha_i & \cos\alpha_i & d_i \\ 0 & 0 & 0 & 1 \end{bmatrix}\]
Forward kinematics (FK) computes the position and orientation of the end-effector given the joint variables. For a serial manipulator with \(n\) joints, the transformation from the base frame to the end-effector is:
\[{}^0T_n = {}^0T_1 \cdot {}^1T_2 \cdot \ldots \cdot {}^{n-1}T_n\]
For a planar 2R manipulator:
\[x = L_1\cos\theta_1 + L_2\cos(\theta_1 + \theta_2)\]
\[y = L_1\sin\theta_1 + L_2\sin(\theta_1 + \theta_2)\]
Inverse kinematics (IK) is the reverse problem: given a desired end-effector pose, find the joint angles. This is generally more challenging as it may have:
Geometric Solution for Planar 2R Manipulator:
\[\theta_2 = \pm \cos^{-1}\left(\frac{x^2 + y^2 - L_1^2 - L_2^2}{2L_1L_2}\right)\]
\[\theta_1 = \text{atan2}(y, x) - \text{atan2}\left(L_2\sin\theta_2,\ L_1 + L_2\cos\theta_2\right)\]
The ± sign gives two solutions: elbow-up (+) and elbow-down (-).
Workspace: The workspace of a manipulator is the set of all positions the end-effector can reach. For a planar 2R manipulator, the workspace is an annulus (ring) with inner radius \(|L_1 - L_2|\) and outer radius \(L_1 + L_2\).
Adjust the joint angles and link lengths to see how the robot manipulator moves. The forward kinematics equations calculate the end-effector position (shown as a red circle). Observe how the coordinate frames move with each link.
Click anywhere in the workspace to set a target position (green circle). The inverse kinematics solver will calculate the required joint angles. For a 2R manipulator, there are typically two solutions: Elbow-Up and Elbow-Down. Use the toggle button to switch between solutions.
| Concept | Equation | Description |
|---|---|---|
| DH Transformation | \({}^{i-1}T_i = Rot_{z,\theta_i} Trans_{z,d_i} Trans_{x,a_i} Rot_{x,\alpha_i}\) | Transformation from frame i-1 to i |
| Forward Kinematics | \({}^0T_n = \prod_{i=1}^{n} {}^{i-1}T_i\) | Base to end-effector transformation |
| 2R FK: X Position | \(x = L_1\cos\theta_1 + L_2\cos(\theta_1 + \theta_2)\) | End-effector x-coordinate |
| 2R FK: Y Position | \(y = L_1\sin\theta_1 + L_2\sin(\theta_1 + \theta_2)\) | End-effector y-coordinate |
| 2R IK: θ₂ | \(\theta_2 = \pm\cos^{-1}\left(\frac{x^2+y^2-L_1^2-L_2^2}{2L_1L_2}\right)\) | Second joint angle (± for two solutions) |
| 2R IK: θ₁ | \(\theta_1 = \text{atan2}(y,x) - \text{atan2}(L_2\sin\theta_2, L_1+L_2\cos\theta_2)\) | First joint angle |
| Workspace Radius | \(R_{\text{min}} = |L_1 - L_2|, \quad R_{\text{max}} = L_1 + L_2\) | Reachable workspace boundaries |
| Reachability Condition | \(|L_1 - L_2| \leq \sqrt{x^2 + y^2} \leq L_1 + L_2\) | Target must be within workspace |
| Joint \(i\) | \(\theta_i\) | \(d_i\) | \(a_i\) | \(\alpha_i\) |
|---|---|---|---|---|
| 1 | \(\theta_1\)* | 0 | \(L_1\) | 0 |
| 2 | \(\theta_2\)* | 0 | \(L_2\) | 0 |
| 3 | \(\theta_3\)* | 0 | \(L_3\) | 0 |
* indicates joint variable (revolute joint)
A planar 2R robot manipulator has link lengths \(L_1 = 150\) mm and \(L_2 = 100\) mm. The joint angles are \(\theta_1 = 30°\) and \(\theta_2 = 45°\). Calculate the position of the end-effector.
Show Solution
Solution:
Given:
Formulas:
\[x = L_1\cos\theta_1 + L_2\cos(\theta_1 + \theta_2)\]
\[y = L_1\sin\theta_1 + L_2\sin(\theta_1 + \theta_2)\]
Calculation:
First, calculate \(\theta_1 + \theta_2 = 30° + 45° = 75°\)
X-coordinate:
\[x = 150\cos(30°) + 100\cos(75°)\]
\[x = 150(0.866) + 100(0.259)\]
\[x = 129.9 + 25.9 = 155.8 \text{ mm}\]
Y-coordinate:
\[y = 150\sin(30°) + 100\sin(75°)\]
\[y = 150(0.5) + 100(0.966)\]
\[y = 75.0 + 96.6 = 171.6 \text{ mm}\]
Answer: The end-effector position is (155.8 mm, 171.6 mm)
For the same manipulator in Problem 1 with \(L_1 = 150\) mm and \(L_2 = 100\) mm, determine the workspace. What is the minimum and maximum reach?
Show Solution
Solution:
Given:
Formulas:
\[R_{\text{min}} = |L_1 - L_2|\]
\[R_{\text{max}} = L_1 + L_2\]
Calculation:
Minimum reach (fully folded):
\[R_{\text{min}} = |150 - 100| = 50 \text{ mm}\]
Maximum reach (fully extended):
\[R_{\text{max}} = 150 + 100 = 250 \text{ mm}\]
Answer: The workspace is an annulus with inner radius 50 mm and outer radius 250 mm. Any target position with distance from the origin between 50 mm and 250 mm can be reached.
A 2R manipulator with \(L_1 = 100\) mm and \(L_2 = 100\) mm needs to reach a target at position (120, 80) mm. Calculate the joint angles for the elbow-up configuration.
Show Solution
Solution:
Given:
Formulas:
\[r = \sqrt{x^2 + y^2}, \quad R_{\text{min}} = |L_1 - L_2|, \quad R_{\text{max}} = L_1 + L_2\]
\[\cos\theta_2 = \frac{x^2 + y^2 - L_1^2 - L_2^2}{2L_1L_2}, \qquad \theta_1 = \text{atan2}(y, x) - \text{atan2}(L_2\sin\theta_2,\ L_1 + L_2\cos\theta_2)\]
Step 1: Check if target is reachable
\[r = \sqrt{x^2 + y^2} = \sqrt{120^2 + 80^2} = \sqrt{14400 + 6400} = 144.2 \text{ mm}\]
\[R_{\text{min}} = |100 - 100| = 0 \text{ mm}\]
\[R_{\text{max}} = 100 + 100 = 200 \text{ mm}\]
Since \(0 \leq 144.2 \leq 200\), target is reachable. ✓
Step 2: Calculate θ₂ (elbow-up: positive solution)
\[\cos\theta_2 = \frac{x^2 + y^2 - L_1^2 - L_2^2}{2L_1L_2}\]
\[\cos\theta_2 = \frac{14400 + 6400 - 10000 - 10000}{2(100)(100)} = \frac{800}{20000} = 0.04\]
\[\theta_2 = +\cos^{-1}(0.04) = +87.7°\]
Step 3: Calculate θ₁
\[\theta_1 = \text{atan2}(y, x) - \text{atan2}(L_2\sin\theta_2, L_1 + L_2\cos\theta_2)\]
\[\theta_1 = \text{atan2}(80, 120) - \text{atan2}(100\sin(87.7°), 100 + 100\cos(87.7°))\]
\[\theta_1 = 33.7° - \text{atan2}(99.92, 104.0)\]
\[\theta_1 = 33.7° - 43.9° = -10.2°\]
Answer: For elbow-up configuration: \(\theta_1 = -10.2°\), \(\theta_2 = 87.7°\)
Can a 2R manipulator with \(L_1 = 80\) mm and \(L_2 = 60\) mm reach a target at (200, 50) mm? If not, explain why and suggest the closest reachable point.
Show Solution
Solution:
Given:
Formulas:
\[r = \sqrt{x^2 + y^2}, \quad R_{\text{min}} = |L_1 - L_2|, \quad R_{\text{max}} = L_1 + L_2\]
\[\phi = \text{atan2}(y, x), \qquad x_{\text{closest}} = R_{\text{max}}\cos\phi, \qquad y_{\text{closest}} = R_{\text{max}}\sin\phi\]
Step 1: Calculate distance to target
\[r = \sqrt{x^2 + y^2} = \sqrt{200^2 + 50^2} = \sqrt{40000 + 2500} = 206.2 \text{ mm}\]
Step 2: Calculate workspace limits
\[R_{\text{min}} = |80 - 60| = 20 \text{ mm}\]
\[R_{\text{max}} = 80 + 60 = 140 \text{ mm}\]
Step 3: Check reachability
Since \(r = 206.2\) mm \(> R_{\text{max}} = 140\) mm, the target is UNREACHABLE.
Step 4: Find closest reachable point
The closest point is on the maximum reach circle in the direction of the target:
\[\text{Direction angle: } \phi = \text{atan2}(50, 200) = 14.0°\]
Closest reachable point (using the exact ratios \(\cos\phi = 200/206.155 = 0.9701\), \(\sin\phi = 50/206.155 = 0.2425\) so the final answer isn't shifted by rounding \(\phi\) first):
\[x_{\text{closest}} = R_{\text{max}}\cos\phi = 140(0.9701) = 135.8 \text{ mm}\]
\[y_{\text{closest}} = R_{\text{max}}\sin\phi = 140(0.2425) = 34.0 \text{ mm}\]
Answer: The target is unreachable because it's 206.2 mm from the origin, which exceeds the maximum reach of 140 mm. The closest reachable point is approximately (135.8, 34.0) mm.