Inverse Kinematics
Inverse Kinematics
Problem Definition and Overview
Inverse kinematics addresses the practical problem of determining the joint variables required to achieve a desired position and orientation of a robot's end-effector (tool). Unlike forward kinematics, where joint angles are known and the resulting tool pose is computed, inverse kinematics starts with a desired tool pose and asks: What joint angles produce this pose?
Inverse Kinematics Problem: Given a desired position P and orientation R of the tool, find values for the joint variables q (e.g., θ1,θ2,…) that satisfy the arm equation Tn0(q)=[R(q)0P(q)1].
In practical applications — such as picking an object from one location and placing it at another — the task is defined by the desired position and orientation of the tool. The joint angles needed to reach that pose are unknown, making inverse kinematics essential for robot programming. See the diagram: the robot must bring its end-effector to the object's location and orientation to grasp it.
Relationship Between Forward and Inverse Kinematics
Forward (Direct) Kinematics: Maps joint space variables q=(q1,…,qn) to tool configuration space — position P=(Px,Py,Pz) and orientation R (rotation matrix). Given q, we compute P and R.
Inverse Kinematics: Maps tool configuration space (P,R) back to joint space q. This is the inverse mapping and is generally more complex.
The arm matrix (homogeneous transformation) from forward kinematics provides the equations that must be solved for the inverse problem. Without the forward kinematic relationship, inverse kinematics cannot be solved.
Solvability of Inverse Kinematics
Not every desired pose can be achieved; the inverse problem may have no solution, one solution, or multiple solutions. Several conditions determine solvability.
Necessary Conditions for Existence of a Solution
For a solution to exist, the following necessary conditions must be satisfied:
The desired tool point must lie within the robot's workspace.
If the position is beyond the reachable region, no joint configuration can achieve it.The number of degrees of freedom n must be at least 6 for arbitrary orientation.
Positioning requires 3 degrees of freedom (x,y,z).
Orientation requires 3 degrees of freedom (roll, pitch, yaw).
If n<6, not all orientations can be achieved; the missing orientation degrees of freedom become dependent. For example, a 5-DOF robot can reach any position within its workspace, but orientation will be constrained by the two remaining joints.
The desired tool orientation must not violate any joint limits.
Physical robots have limited joint ranges (e.g., a wrist pitch may only rotate ±90∘). If the required orientation exceeds these limits, no solution exists even if the position is reachable.
Multiple Solutions
Inverse kinematics rarely yields a unique solution. Common sources of multiplicity include:
Elbow-up / Elbow-down configurations: For a planar arm, the same end-effector position can be reached with the elbow bending upward or downward (two distinct joint angle sets).
Redundant robots: When n>6 (redundant degrees of freedom), there are infinitely many joint configurations for a given pose. For example, a 7-DOF robot has one extra joint; the solution requires fixing one variable arbitrarily, leading to multiple solutions.
Wrist configurations: Wrist singularities and alternative wrist orientations (e.g., flip vs. no-flip) can produce multiple angle sets.
Key point: Because of multiple solutions, the inverse problem is inherently more difficult than the forward problem, which always has a unique output for given joint angles.
Number of Independent Equations
The arm matrix Tn0 contains 12 scalar equations (9 from rotation, 3 from position). However, the rotation matrix's 9 elements are not independent:
Each column (normal n, sliding s, approach a vectors) is a unit vector: ∥n∥=1, ∥s∥=1, ∥a∥=1.
These three vectors are mutually orthogonal: n⋅s=0, n⋅a=0, s⋅a=0.
Thus, from the 9 rotation equations, only 3 independent equations exist (typically the three orthonormality constraints). The position vector gives 3 independent equations (Px,Py,Pz).
Total independent equations: 3+3=6.
Unknown joint variables: n (typically 6 for a 6-DOF robot).
If n=6, we have 6 equations in 6 unknowns — solvable in principle. If n>6, the system is underdetermined (multiple solutions). If n<6, some orientations cannot be achieved.
Solution Strategies
Two main approaches exist for solving inverse kinematics.
Closed-Form (Analytical) Solutions
Closed-form solutions use algebraic or geometric methods to obtain explicit expressions for joint variables. They are preferred because they are fast, accurate, and provide all possible solutions.
Algebraic approach: Derive scalar equations from the arm matrix and solve them using trigonometric identities and algebraic manipulations.
Geometric approach: Use geometric reasoning — consider the geometry of the arm (link lengths, joint axes) to find joint angles by constructing triangles and computing angles from known positions.
Sufficiency condition for closed-form solutions: A closed-form solution exists if the manipulator satisfies one of the following:
Three adjacent joint axes are parallel (e.g., a spherical wrist with parallel roll-pitch-yaw axes).
Three adjacent joint axes intersect at a common point (e.g., the wrist center of a PUMA-type robot).
If neither condition holds, closed-form solution is generally not possible, and numerical methods must be used.
Numerical (Iterative) Solutions
Numerical methods start with an initial guess for joint angles and iteratively adjust them until the resulting tool pose matches the desired pose within a tolerance. These are:
Slower than closed-form methods.
Time-consuming and may converge to local minima.
Used when closed-form solution does not exist or when the robot is redundant.
Algebraic Tricks for Solving Inverse Kinematics
The scalar equations from the arm matrix are nonlinear and involve sine and cosine functions. Several tricks simplify solving them.
Trick 1: Square and Add Equations
For equations of the form:
Square both and add:
This eliminates θ1 and yields an expression for cosθ2, from which θ2 can be found (using sinθ2=±1−cos2θ2).
Trick 2: Use the Tangent Half-Angle Substitution
Substitute u=tan(θ/2). Then:
This converts trigonometric equations into polynomial equations in u, which can be solved for u, then θ=2arctanu.
Trick 3: Combine Equations into Acosθ+Bsinθ=C Form
When an equation takes the form Acosθ+Bsinθ=C, it can be solved by:
Letting r=A2+B2 and γ=atan2(B,A).
Then Acosθ+Bsinθ=rcos(θ−γ)=C, giving θ=γ±arccos(C/r).
Trick 4: Obtain Both sinθ and cosθ and Use atan2
If expressions for both sinθ and cosθ can be found, use the four-quadrant arctangent function atan2(sinθ,cosθ) to get θ uniquely in (−π,π]. This avoids quadrant ambiguity present with arcsin or arccos alone.
Definition of atan2: atan2(y,x) returns the angle whose sine is y and cosine is x, determining the correct quadrant from the signs of x and y. The result lies in (−π,π].
Example 1: 2-DOF Planar Manipulator
A simple planar arm with two revolute joints, link lengths L1 and L2. Forward kinematics gives:
Goal: Solve for θ1, θ2 given Px, Py.
Step 1: Solve for θ2. Square and add the equations:
Then sinθ2=±1−cos2θ2 (two possible signs). Use atan2:
Step 2: Solve for θ1. Rewrite the original equations:
Define:
Then:
Let r=K12+K22, γ=atan2(K2,K1). Then:
Therefore:
This gives θ1 for each of the two possible θ2 values, yielding up to two distinct solutions (elbow-up and elbow-down).
Example 2: 3-DOF Planar Manipulator with Prismatic Joint
Consider a planar arm with two revolute joints (θ1, θ2) and one prismatic joint (d3) that extends vertically out of the plane. Link lengths: L1, L2; prismatic displacement d3. Forward kinematics yields:
Position:
Orientation (rotation matrix)
Thus nx=cos(θ123), ny=sin(θ123), sx=−sin(θ123), sy=cos(θ123).
Goal: Solve for θ1, θ2, θ3, d3 given Px, Py, Pz and orientation (nx, ny, sx, sy). Note that d3=Pz directly.
Step 1: Solve for θ2 exactly as in the 2-DOF case (square and add Px, Py equations):
Step 2: Solve for θ1 using the same substitution as in the 2-DOF case:
Step 3: Solve for θ123=θ1+θ2+θ3. Using nx and ny:
Step 4: Solve for θ3:
This yields all joint variables. Note the multiple solutions: each θ2 (positive or negative sine) gives a different θ1 and consequently θ3, typically producing two distinct arm configurations.
Summary of Key Concepts
Inverse kinematics is essential for practical robot control: given a desired tool pose, find joint angles.
Solution existence depends on workspace, sufficient DOF (≥6 for arbitrary pose), and joint limit constraints.
Multiple solutions arise from elbow-up/down, wrist flips, and redundancy (DOF > 6).
Closed-form solutions are preferred and possible if three adjacent joint axes are parallel or intersect.
Algebraic tricks (square-and-add, half-angle substitution, atan2, rcos(θ−γ) form) are used to solve nonlinear trigonometric equations.
The atan2 function uniquely determines an angle in (−π,π] from sin and cos values, avoiding quadrant ambiguity.
Inverse kinematics remains a challenging but fundamental topic in robotics, requiring both mathematical insight and careful handling of multiple solutions and constraints.

Ask anything
We've read this whole study set, so questions about it get the best answers.