Chapter 6: Inverse Kinematics (IK)

Lesson 1: Existence and Multiplicity of IK Solutions

This lesson formalizes the inverse kinematics (IK) problem as solving nonlinear equations induced by the forward kinematics map. We characterize when a desired end-effector pose admits zero, finitely many, or infinitely many joint-space solutions, using planar examples, workspace geometry, and local differential analysis. A multi-language lab implements existence tests and solution enumeration for a planar 2R manipulator.

1. Conceptual Overview of Inverse Kinematics Existence

For an n-DOF serial manipulator with joint coordinates \( \mathbf{q} \in \mathbb{R}^n \), the forward kinematics (FK) map sends joint configurations to end-effector poses in \( SE(3) \):

\[ f : \mathcal{Q} \subset \mathbb{R}^n \rightarrow SE(3), \quad \mathbf{q} \mapsto T(\mathbf{q}), \]

where \( \mathcal{Q} \) encodes joint limits and any joint-type constraints (e.g., revolute, prismatic). A typical pose representation splits position and orientation:

\[ T(\mathbf{q}) = \begin{bmatrix} R(\mathbf{q}) & \mathbf{p}(\mathbf{q}) \\ 0 & 1 \end{bmatrix}, \quad R(\mathbf{q}) \in SO(3),\; \mathbf{p}(\mathbf{q}) \in \mathbb{R}^3. \]

Given a desired end-effector pose \( T_d \in SE(3) \), the IK problem asks for joint vectors \( \mathbf{q} \in \mathcal{Q} \) satisfying:

\[ f(\mathbf{q}) = T_d. \]

The solution set (possibly empty) is

\[ \mathcal{S}(T_d) := \{\, \mathbf{q} \in \mathcal{Q} \mid f(\mathbf{q}) = T_d \,\} = f^{-1}(\{T_d\}) \cap \mathcal{Q}. \]

  • Existence: IK has a solution if and only if \( \mathcal{S}(T_d) \neq \emptyset \).
  • Multiplicity: The cardinality and structure of \( \mathcal{S}(T_d) \) determines whether IK is unique, has finitely many discrete solutions, or has a continuous family (self-motion).

The reachable workspace is the image of the FK map:

\[ \mathcal{W} := f(\mathcal{Q}) = \{\, T(\mathbf{q}) \mid \mathbf{q} \in \mathcal{Q} \,\} \subset SE(3). \]

Obviously, \( \mathcal{S}(T_d) \) is nonempty only if \( T_d \in \mathcal{W} \). In practice, we must also consider joint limits, collision-avoidance constraints, and other feasibility restrictions, but this lesson focuses on the core geometric and algebraic issues.

flowchart TD
  Q["Joint space Q"] --> F["Forward map f"]
  F --> W["Workspace W = f(Q)"]
  W --> Td["Desired pose T_d"]
  Td --> IK["Solve f(q) = T_d"]
  IK --> Z["No solution \n(T_d not in W)"]
  IK --> D["Finite number of \njoint solutions"]
  IK --> C["Continuum of solutions \n(redundant self-motion)"]
        

2. Workspace Geometry and Conditions for Existence

For serial arms, the workspace is a complicated 3D region in position-orientation space, but its structure already constrains IK existence. Let \( \mathbf{x}(\mathbf{q}) \in \mathbb{R}^m \) denote a minimal parametrization of the task-space quantity of interest (e.g., \( m=3 \) for planar position, \( m=6 \) for full 3D pose). Then

\[ \mathbf{x} = g(\mathbf{q}), \quad g : \mathcal{Q} \rightarrow \mathbb{R}^m. \]

The reachable task-space set is

\[ \mathcal{W}_x := g(\mathcal{Q}) = \{\, \mathbf{x}(\mathbf{q}) \mid \mathbf{q} \in \mathcal{Q} \,\} \subset \mathbb{R}^m. \]

For a given desired task vector \( \mathbf{x}_d \), IK existence is equivalent to \( \mathbf{x}_d \in \mathcal{W}_x \). That is,

\[ \mathcal{S}(\mathbf{x}_d) := \{\, \mathbf{q} \in \mathcal{Q} \mid g(\mathbf{q}) = \mathbf{x}_d \,\} \neq \emptyset \quad \Longleftrightarrow \quad \mathbf{x}_d \in \mathcal{W}_x. \]

The geometry of \( \mathcal{W}_x \) depends strongly on the link lengths and joint limits. For planar manipulators, position workspaces are often annular regions; for 3D manipulators they can be spherical shells or more irregular shapes.

In general, computing \( \mathcal{W}_x \) exactly is difficult, but for low-DOF planar arms we can derive explicit conditions for existence. These planar results are not only pedagogically useful, but also illustrate the interplay between algebraic equations and geometry that governs IK multiplicity in higher dimensions.

3. 2R Planar Manipulator: Explicit Existence Conditions

Consider a planar 2R manipulator with link lengths \( \ell_1, \ell_2 > 0 \), revolute joints \( \theta_1, \theta_2 \), and base at the origin. The end-effector position \( (x,y) \) is

\[ \begin{aligned} x(\theta_1,\theta_2) &= \ell_1 \cos\theta_1 + \ell_2 \cos(\theta_1 + \theta_2), \\ y(\theta_1,\theta_2) &= \ell_1 \sin\theta_1 + \ell_2 \sin(\theta_1 + \theta_2). \end{aligned} \]

Let \( r = \sqrt{x^2 + y^2} \) be the distance from the base to the desired point. A standard derivation uses the law of cosines:

\[ r^2 = x^2 + y^2 = \ell_1^2 + \ell_2^2 + 2 \ell_1 \ell_2 \cos\theta_2. \]

Solving for \( \cos\theta_2 \) gives

\[ \cos\theta_2 = \frac{x^2 + y^2 - \ell_1^2 - \ell_2^2}{2 \ell_1 \ell_2}. \]

A real solution for \( \theta_2 \) exists if and only if \( |\cos\theta_2| \leq 1 \), i.e.

\[ -1 \leq \frac{x^2 + y^2 - \ell_1^2 - \ell_2^2}{2 \ell_1 \ell_2} \leq 1. \]

Multiplying through and rearranging yields the classical condition

\[ (\ell_1 - \ell_2)^2 \leq x^2 + y^2 \leq (\ell_1 + \ell_2)^2, \]

or, equivalently, \( |\ell_1 - \ell_2| \leq r \leq \ell_1 + \ell_2 \).

Proof sketch of the inequality.

  • The upper bound \( r \leq \ell_1 + \ell_2 \) comes from the configuration where both links are colinear in the same direction, maximally extending the arm.
  • The lower bound \( r \geq |\ell_1 - \ell_2| \) comes from the configuration where links are colinear but pointing in opposite directions, minimizing the distance.
  • Algebraically, enforcing \( |\cos\theta_2| \leq 1 \) and squaring both sides yields \( (x^2 + y^2 - \ell_1^2 - \ell_2^2)^2 \leq 4 \ell_1^2 \ell_2^2 \), which factors into \( (x^2 + y^2 - (\ell_1 + \ell_2)^2) (x^2 + y^2 - (\ell_1 - \ell_2)^2) \leq 0 \), equivalent to the interval condition above.

Thus, the reachable position workspace of the 2R arm is a planar annulus (including its boundary) centered at the origin. A point \( (x,y) \) is IK-feasible if and only if it lies in this annulus.

4. Multiplicity in Non-Redundant Manipulators

A manipulator is non-redundant for a given task when the number of joint DOFs equals the task dimension: \( n = m \). For example:

  • 2R planar arm tracking planar position: \( n = m = 2 \).
  • 6R industrial arm tracking full 3D pose: \( n = m = 6 \).

Even when \( n = m \), the IK problem \( g(\mathbf{q}) = \mathbf{x}_d \) may admit multiple solutions due to nonlinear trigonometric equations and joint-periodicity.

4.1. 2R Planar Arm: Elbow-Up vs Elbow-Down

Once \( \cos\theta_2 \) is determined, two possible values for \( \theta_2 \) arise from \( \sin\theta_2 = \pm\sqrt{1-\cos^2\theta_2} \). These correspond to the elbow-up and elbow-down postures:

\[ \theta_2^{(\pm)} = \operatorname{atan2}(\pm s_2, c_2), \quad c_2 = \cos\theta_2, \quad s_2 = \sqrt{1 - c_2^2}. \]

The first joint angle \( \theta_1 \) is obtained from

\[ \theta_1^{(\pm)} = \operatorname{atan2}(y,x) - \operatorname{atan2}\bigl(\ell_2 s_2^{(\pm)}, \ell_1 + \ell_2 c_2\bigr). \]

  • For interior points of the workspace annulus, there are exactly two distinct IK solutions (modulo joint-periodicity).
  • On the outer boundary \( r = \ell_1 + \ell_2 \) or inner boundary \( r = |\ell_1 - \ell_2| \), the elbow-up and elbow-down configurations coincide and we obtain a single solution (degenerate multiplicity).

4.2. Discrete Solution Sets for 6R Arms

For general 6R manipulators with a spherical wrist, analytic IK reduces to solving coupled polynomial equations (often of degree up to 4) in one scalar variable. Substituting back produces up to a finite number of joint-space solutions (commonly up to 8 for many industrial geometries, and up to 16 in the most general 6R case).

From an algebraic viewpoint, the FK equations define a polynomial system in unknowns \( \cos\theta_i \), \( \sin\theta_i \); eliminating trigonometric functions yields polynomial equations whose roots correspond to IK branches. The number of isolated real roots determines the multiplicity of IK solutions (subject to joint-limit constraints).

5. Redundancy and Continuous Families of IK Solutions

A manipulator is redundant for a task when \( n > m \). Then the IK constraint \( g(\mathbf{q}) = \mathbf{x}_d \) generically defines a manifold of joint-space solutions with positive dimension.

\[ \text{deg. of redundancy} = n - m. \]

A simple example is a 3R planar manipulator controlling only the end-effector position \( (x,y) \) (no orientation requirement), so \( n=3, m=2 \). For generic link lengths and reachable target \( (x_d,y_d) \), the IK solution set is typically a 1D curve in joint space.

One useful way to see this is to treat the first two joints as performing a 2R positioning task, and the third joint as adjusting the orientation without changing the position (by counter-rotation between joints 2 and 3). The parameter along this self-motion curve can be used later for secondary objectives (e.g., avoiding joint limits), but that topic belongs to redundancy resolution rather than IK existence.

In higher-DOF manipulators (e.g., 7R arms tracking 6D end-effector pose), IK has an infinite number of solutions whenever the task is reachable. Multiplicity here is not a finite count but a smooth manifold of configurations.

6. Local Analysis: Jacobian Rank and IK Multiplicity

Let \( g : \mathcal{Q} \rightarrow \mathbb{R}^m \) denote the task map, and let \( \mathbf{x}_d = g(\mathbf{q}^\star) \) for some configuration \( \mathbf{q}^\star \). The Jacobian matrix introduced in Chapter 1,

\[ \mathbf{J}(\mathbf{q}) := \frac{\partial g}{\partial \mathbf{q}}(\mathbf{q}) \in \mathbb{R}^{m \times n}, \]

provides a local linear approximation:

\[ g(\mathbf{q}^\star + \delta\mathbf{q}) \approx g(\mathbf{q}^\star) + \mathbf{J}(\mathbf{q}^\star)\,\delta\mathbf{q}. \]

6.1. Non-Redundant Case \( n = m \)

When \( n = m \), the Jacobian is square. If \( \det \mathbf{J}(\mathbf{q}^\star) \neq 0 \), the inverse function theorem guarantees the existence of a locally unique smooth inverse near \( \mathbf{x}_d \). Concretely, there are neighborhoods \( U \ni \mathbf{q}^\star \), \( V \ni \mathbf{x}_d \) such that

\[ g \big\vert_U : U \rightarrow V \]

is a diffeomorphism, and hence every \( \mathbf{x} \in V \) has a unique preimage in \( U \). Thus, in non-singular regions, IK solutions are locally unique (though multiple branches may exist globally).

6.2. Redundant Case \( n > m \)

When \( n > m \) and \( \operatorname{rank}\mathbf{J}(\mathbf{q}^\star) = m \), the implicit function theorem asserts that the solution set of \( g(\mathbf{q}) = \mathbf{x}_d \) near \( \mathbf{q}^\star \) is a smooth manifold of dimension

\[ \dim \mathcal{S}_{\text{local}}(\mathbf{x}_d) = n - m. \]

Linearizing, to keep the end-effector fixed \( \delta\mathbf{x} = \mathbf{0} \), we require

\[ \mathbf{0} = \mathbf{J}(\mathbf{q}^\star)\,\delta\mathbf{q}, \]

so local self-motions lie in the null space \( \mathcal{N}(\mathbf{J}(\mathbf{q}^\star)) \). When \( \operatorname{rank}\mathbf{J} = m \), the dimension of this null space is \( n - m \), which matches the redundancy.

6.3. Singularities and Changes in Multiplicity

At singular configurations where \( \operatorname{rank}\mathbf{J}(\mathbf{q}^\star) < m \), the local structure of the IK solution set can change: branches of solutions may meet, appear, or disappear. For example, at the fully stretched configuration of the 2R arm, \( r = \ell_1 + \ell_2 \), the two IK branches merge into a single configuration. Such singularities will be analyzed more systematically in later chapters on differential kinematics and singularities; here, they already hint at the deep connection between Jacobian rank and IK multiplicity.

7. Multi-Language Lab: Implementing 2R IK Existence and Solutions

We now implement the analytic IK for the planar 2R arm in several programming languages. The common geometry is:

  • Inputs: link lengths \( \ell_1, \ell_2 \), desired position \( (x_d, y_d) \).
  • Outputs: a list of feasible joint pairs \( (\theta_1, \theta_2) \) within joint limits.
  • Existence test: check \( (\ell_1 - \ell_2)^2 \leq x_d^2 + y_d^2 \leq (\ell_1 + \ell_2)^2 \).

7.1. Python Implementation (NumPy)


import numpy as np

def wrap_to_pi(angle):
    """Wrap angle to (-pi, pi]."""
    return (angle + np.pi) % (2.0 * np.pi) - np.pi

def ik_2r(x, y, l1, l2, joint_limits=None):
    """
    Analytic IK for a planar 2R arm.

    Parameters
    ----------
    x, y : float
        Desired end-effector position.
    l1, l2 : float
        Link lengths (assumed > 0).
    joint_limits : tuple (lower, upper), optional
        Each is a length-2 array-like of joint limits [theta1, theta2].

    Returns
    -------
    solutions : list of np.ndarray
        Each entry is [theta1, theta2].
    """
    r2 = x**2 + y**2
    # Existence check using cosine law
    c2 = (r2 - l1**2 - l2**2) / (2.0 * l1 * l2)

    if np.abs(c2) > 1.0:
        # No real solution
        return []

    # Two possible signs for sin(theta2)
    s2_pos = np.sqrt(max(0.0, 1.0 - c2**2))
    s2_neg = -s2_pos

    solutions = []
    for s2 in (s2_pos, s2_neg):
        theta2 = np.arctan2(s2, c2)
        k1 = l1 + l2 * c2
        k2 = l2 * s2
        theta1 = np.arctan2(y, x) - np.arctan2(k2, k1)

        theta1 = wrap_to_pi(theta1)
        theta2 = wrap_to_pi(theta2)
        q = np.array([theta1, theta2])

        if joint_limits is not None:
            lower = np.array(joint_limits[0])
            upper = np.array(joint_limits[1])
            if np.any(q < lower) or np.any(q > upper):
                continue

        solutions.append(q)

    # Remove duplicates in the degenerate boundary case
    unique = []
    for q in solutions:
        if not any(np.allclose(q, q2, atol=1e-9) for q2 in unique):
            unique.append(q)

    return unique

if __name__ == "__main__":
    sols = ik_2r(0.5, 0.5, 0.4, 0.4,
                 joint_limits=([-np.pi, -np.pi], [np.pi, np.pi]))
    print("Number of solutions:", len(sols))
    for idx, q in enumerate(sols):
        print(f"Solution {idx}: theta1={q[0]:.3f}, theta2={q[1]:.3f}")
      

7.2. C++ Implementation (Header-Only Function)


#include <vector>
#include <array>
#include <cmath>
#include <algorithm>

struct JointLimits2R {
    std::array<double, 2> lower;
    std::array<double, 2> upper;
};

inline double wrapToPi(double angle) {
    const double twoPi = 2.0 * M_PI;
    angle = std::fmod(angle + M_PI, twoPi);
    if (angle < 0.0) {
        angle += twoPi;
    }
    return angle - M_PI;
}

bool ik2R(double x, double y,
          double l1, double l2,
          std::vector<std::array<double, 2> > &solutions,
          const JointLimits2R *limits = nullptr)
{
    solutions.clear();

    const double r2 = x * x + y * y;
    const double denom = 2.0 * l1 * l2;
    const double c2 = (r2 - l1 * l1 - l2 * l2) / denom;

    if (std::fabs(c2) > 1.0) {
        // No real solutions
        return false;
    }

    const double s2_pos = std::sqrt(std::max(0.0, 1.0 - c2 * c2));

    // Loop over elbow-up / elbow-down
    const double s2_candidates[2] = { s2_pos, -s2_pos };
    for (double s2 : s2_candidates) {
        const double theta2 = std::atan2(s2, c2);
        const double k1 = l1 + l2 * c2;
        const double k2 = l2 * s2;
        double theta1 = std::atan2(y, x) - std::atan2(k2, k1);

        double t1 = wrapToPi(theta1);
        double t2 = wrapToPi(theta2);

        // Check joint limits if provided
        if (limits) {
            if (t1 < limits->lower[0] || t1 > limits->upper[0] ||
                t2 < limits->lower[1] || t2 > limits->upper[1]) {
                continue;
            }
        }

        solutions.push_back({t1, t2});
    }

    // Optional: remove duplicate solutions in singular cases
    if (solutions.size() == 2) {
        const double eps = 1e-9;
        const auto &q0 = solutions[0];
        const auto &q1 = solutions[1];
        if (std::fabs(q0[0] - q1[0]) < eps &&
            std::fabs(q0[1] - q1[1]) < eps) {
            solutions.pop_back();
        }
    }

    return !solutions.empty();
}
      

7.3. Java Implementation


import java.util.ArrayList;
import java.util.List;

public class IK2R {

    public static class JointLimits {
        public double[] lower = new double[2];
        public double[] upper = new double[2];

        public JointLimits(double l1, double u1, double l2, double u2) {
            lower[0] = l1; upper[0] = u1;
            lower[1] = l2; upper[1] = u2;
        }
    }

    private static double wrapToPi(double angle) {
        double twoPi = 2.0 * Math.PI;
        angle = (angle + Math.PI) % twoPi;
        if (angle < 0.0) {
            angle += twoPi;
        }
        return angle - Math.PI;
    }

    public static List<double[]> ik2R(
            double x, double y,
            double l1, double l2,
            JointLimits limits)
    {
        List<double[]> solutions = new ArrayList<>();

        double r2 = x * x + y * y;
        double c2 = (r2 - l1 * l1 - l2 * l2) / (2.0 * l1 * l2);

        if (Math.abs(c2) > 1.0) {
            return solutions; // empty
        }

        double s2_pos = Math.sqrt(Math.max(0.0, 1.0 - c2 * c2));
        double[] s2Candidates = new double[] { s2_pos, -s2_pos };

        for (double s2 : s2Candidates) {
            double theta2 = Math.atan2(s2, c2);
            double k1 = l1 + l2 * c2;
            double k2 = l2 * s2;
            double theta1 = Math.atan2(y, x) - Math.atan2(k2, k1);

            double t1 = wrapToPi(theta1);
            double t2 = wrapToPi(theta2);

            if (limits != null) {
                if (t1 < limits.lower[0] || t1 > limits.upper[0] ||
                    t2 < limits.lower[1] || t2 > limits.upper[1]) {
                    continue;
                }
            }

            solutions.add(new double[] { t1, t2 });
        }

        return solutions;
    }

    public static void main(String[] args) {
        JointLimits lim = new JointLimits(-Math.PI, Math.PI, -Math.PI, Math.PI);
        List<double[]> sols = ik2R(0.5, 0.5, 0.4, 0.4, lim);
        System.out.println("Number of solutions: " + sols.size());
        for (int i = 0; i < sols.size(); ++i) {
            double[] q = sols.get(i);
            System.out.printf("Solution %d: theta1=%.3f, theta2=%.3f%n", i, q[0], q[1]);
        }
    }
}
      

7.4. MATLAB / Simulink Implementation


function solutions = ik2R(x, y, l1, l2, jointLimits)
%IK2R Analytic IK for planar 2R arm.
%   solutions is an N-by-2 matrix of [theta1, theta2].

    if nargin < 5
        jointLimits = [];
    end

    r2 = x.^2 + y.^2;
    c2 = (r2 - l1^2 - l2^2) / (2.0 * l1 * l2);

    if abs(c2) > 1.0
        solutions = zeros(0, 2); % no real solution
        return;
    end

    s2_pos = sqrt(max(0.0, 1.0 - c2^2));
    s2_candidates = [s2_pos; -s2_pos];

    solutions = [];
    for k = 1:numel(s2_candidates)
        s2 = s2_candidates(k);
        theta2 = atan2(s2, c2);
        k1 = l1 + l2 * c2;
        k2 = l2 * s2;
        theta1 = atan2(y, x) - atan2(k2, k1);

        t1 = wrapToPi(theta1);
        t2 = wrapToPi(theta2);

        if ~isempty(jointLimits)
            lower = jointLimits(1, :);
            upper = jointLimits(2, :);
            if any(t1 < lower(1) | t1 > upper(1)) || ...
               any(t2 < lower(2) | t2 > upper(2))
                continue;
            end
        end

        solutions(end+1, :) = [t1, t2]; %#ok<AGROW>
    end
end

function ang = wrapToPi(angle)
%WRAPTOPI Wrap angle to (-pi, pi].
    ang = mod(angle + pi, 2.0 * pi);
    idx = ang < 0.0;
    ang(idx) = ang(idx) + 2.0 * pi;
    ang = ang - pi;
end
      

Simulink note. This MATLAB function can be placed inside a MATLAB Function block to form a Simulink component that maps desired Cartesian positions to joint angles, with no control logic yet. Simulink robot models can use this block as a purely kinematic component feeding desired joint positions into subsequent control blocks.

7.5. Wolfram Mathematica Implementation


(* Analytic IK for planar 2R arm in Mathematica *)

Clear[ik2R]
ik2R[x_, y_, l1_, l2_] := Module[
  {r2, c2, sols, th1, th2},
  r2 = x^2 + y^2;
  c2 = (r2 - l1^2 - l2^2)/(2 l1 l2);

  If[Abs[c2] > 1,
   Return[{}]; (* no real solutions *)
  ];

  (* Solve symbolically and then numerically if desired *)
  sols = Solve[
    {
      x == l1 Cos[th1] + l2 Cos[th1 + th2],
      y == l1 Sin[th1] + l2 Sin[th1 + th2]
    },
    {th1, th2},
    Reals
  ];

  (* Simplify solutions modulo 2 Pi *)
  {Mod[th1, 2 Pi, -Pi], Mod[th2, 2 Pi, -Pi]} /. sols
]

(* Example usage *)
ik2R[0.5, 0.5, 0.4, 0.4]
      

Symbolic tools like Mathematica are particularly well suited to deriving closed-form IK expressions and investigating multiplicity, because they can manipulate trigonometric and polynomial systems exactly before numerical evaluation.

8. Practical Flow for IK Existence and Solution Enumeration

In practice, IK solvers typically follow a pipeline that first checks approximate reachability, then runs analytic or numerical solvers, and finally filters solutions using joint limits and other constraints.

flowchart TD
  S["Given desired pose T_d and joint limits"] --> W["Check if T_d is within approximate workspace"]
  W -->|"no"| U["Report unreachable target"]
  W -->|"yes"| SOLVER["Run analytic or numerical IK solver"]
  SOLVER --> CLS["Classify solution set: zero / finite / continuous"]
  CLS --> FILT["Filter solutions by joint limits and basic constraints"]
  FILT --> R["Return solution set and multiplicity information"]
        

For low-DOF arms and common industrial geometries, analytic formulas (like those for the 2R example) are preferred for speed and robustness. For complex or highly redundant robots, numerical IK (developed in a later lesson) is used, but the notions of existence and multiplicity discussed here still apply.

9. Problems and Solutions

Problem 1 (2R Workspace Inequality): For a planar 2R arm with link lengths \( \ell_1, \ell_2 > 0 \), derive from first principles that a point \( (x,y) \) is reachable if and only if \( (\ell_1 - \ell_2)^2 \leq x^2 + y^2 \leq (\ell_1 + \ell_2)^2 \).

Solution:

The end-effector position equations are \( x = \ell_1 \cos\theta_1 + \ell_2 \cos(\theta_1+\theta_2) \), \( y = \ell_1 \sin\theta_1 + \ell_2 \sin(\theta_1+\theta_2) \). The distance from the base is \( r = \sqrt{x^2+y^2} \). Viewing the arm as two rigid segments of lengths \( \ell_1 \) and \( \ell_2 \) forming a triangle with side \( r \), the triangle inequality implies \( |\ell_1 - \ell_2| \leq r \leq \ell_1 + \ell_2 \). Squaring yields \( (\ell_1 - \ell_2)^2 \leq r^2 \leq (\ell_1 + \ell_2)^2 \), and since \( r^2 = x^2 + y^2 \), the desired inequality follows. Conversely, if the inequality holds, a triangle with sides \( \ell_1, \ell_2, r \) exists, and the joint angles can be recovered via the law of cosines, proving equivalence.

Problem 2 (Multiplicity for 2R): For the same 2R arm, show that if \( (\ell_1 - \ell_2)^2 < x^2 + y^2 < (\ell_1 + \ell_2)^2 \), then (ignoring joint limits and periodicity) there are exactly two distinct IK solutions, while on the workspace boundary there is exactly one.

Solution:

From the cosine law, \( \cos\theta_2 = (x^2 + y^2 - \ell_1^2 - \ell_2^2)/(2 \ell_1 \ell_2) \). For interior points of the annulus, the numerator lies strictly between \( -2\ell_1\ell_2 \) and \( 2\ell_1\ell_2 \), so \( |\cos\theta_2| < 1 \). Hence \( \sin\theta_2 = \pm \sqrt{1-\cos^2\theta_2} \neq 0 \), producing two distinct angles \( \theta_2^{(\pm)} \). For each choice, the equation for \( \theta_1 \) is linear in complex exponentials or trigonometric functions and yields a unique solution modulo \( 2\pi \), so there are exactly two distinct joint pairs. On the boundary, \( |\cos\theta_2| = 1 \), so \( \sin\theta_2 = 0 \) and the two branches merge into a single configuration, giving a unique solution (up to periodicity).

Problem 3 (Redundancy Degree): Consider a 7R robot arm that tracks full 3D pose (6-dimensional task). At a configuration where the Jacobian has full row rank \( 6 \), what is the local dimension of the IK solution set, and how does this relate to self-motion?

Solution:

Here \( n = 7 \), \( m = 6 \), so the redundancy degree is \( n - m = 1 \). Full row rank of the Jacobian implies that near the considered configuration, the implicit function theorem applies and the solution set of \( g(\mathbf{q}) = \mathbf{x}_d \) is locally a 1-dimensional submanifold of joint space. Infinitesimally, joint increments satisfying \( \delta\mathbf{x} = \mathbf{0} \) lie in the 1D null space of the Jacobian. Motion along this null-space direction leaves the end-effector pose unchanged while moving the configuration through different postures, which is exactly self-motion.

Problem 4 (Local Uniqueness in 2R): Let a 2R planar arm have joint configuration \( \mathbf{q}^\star = (\theta_1^\star, \theta_2^\star) \) that is nonsingular (Jacobian determinant nonzero). Argue, without computing the Jacobian explicitly, why IK is locally unique near \( \mathbf{q}^\star \).

Solution:

The task map for planar position, \( g(\theta_1,\theta_2) = (x(\theta_1,\theta_2), y(\theta_1,\theta_2)) \), is smooth and has the same input and output dimension (\( n = m = 2 \)). At \( \mathbf{q}^\star \), nonsingularity of the Jacobian implies that the linearization is invertible. By the inverse function theorem from multivariable calculus (reviewed in Chapter 1), this implies the existence of neighborhoods in joint and task space on which \( g \) is bijective with a smooth inverse. Hence, in a small enough neighborhood of \( \mathbf{x}_d = g(\mathbf{q}^\star) \), there is a unique joint configuration solving the IK equations, establishing local uniqueness.

Problem 5 (Joint Limits and Existence): For the 2R arm, suppose joint limits are \( \theta_1 \in [\theta_{1,\min}, \theta_{1,\max}] \), \( \theta_2 \in [\theta_{2,\min}, \theta_{2,\max}] \). Show that even if a point lies in the geometric workspace annulus, IK may still have no solution once limits are enforced. Provide a simple geometric explanation.

Solution:

The earlier workspace inequality was derived under the assumption of unrestricted joint angles. Joint limits restrict \( \mathcal{Q} \) to a rectangle in joint space. The image of this rectangle under the FK map is a strict subset of the full annulus; some points in the annulus can only be reached by configurations that violate the limits. For example, if \( \theta_{2,\max} \) is small, highly bent elbow configurations needed for near-base targets may be forbidden, making interior points in the annulus unreachable. Thus geometric reachability is necessary but not sufficient for IK existence under limits; one must additionally verify that at least one IK solution lies inside the allowed joint rectangle, which is exactly what the code in Section 7 does.

10. Summary

This lesson introduced a rigorous view of IK existence and multiplicity by framing IK as solving \( f(\mathbf{q}) = T_d \) for a nonlinear map from joint space to \( SE(3) \). We defined the workspace as the image of the forward kinematics and showed that IK existence is equivalent to membership of the desired pose in this workspace (subject to joint limits).

Using the planar 2R arm, we derived explicit analytical conditions for reachability and demonstrated how interior workspace points yield exactly two IK solutions (elbow-up and elbow-down), while boundary points yield a single solution. We then discussed redundancy, in which \( n > m \) leads to continuum families of IK solutions parameterized by the Jacobian null space. Local analysis via the inverse and implicit function theorems connected Jacobian rank to local uniqueness or self-motion.

Finally, we implemented analytic 2R IK across Python, C++, Java, MATLAB/Simulink, and Mathematica, illustrating how the same geometric reasoning translates into concrete software components that test existence and enumerate solutions. Subsequent lessons will build on this foundation to derive closed-form IK for common 3D arm geometries and to develop numerical methods for IK when analytic solutions are cumbersome or impossible.

11. References

  1. Paul, R. P. (1972). Robot Manipulators: Mathematics, Programming, and Control. MIT Press. (Foundational treatment of manipulator kinematics and IK existence.)
  2. Pieper, D. L. (1968). The kinematics of manipulators under computer control. Ph.D. thesis, Stanford University. (Classical closed-form IK for 6R arms.)
  3. Tsai, L. W., & Morgan, A. P. (1985). Solving the kinematics of the most general six- and five-degree-of-freedom manipulators by continuation methods. Journal of Mechanisms, Transmissions, and Automation in Design, 107(2), 189–200.
  4. Raghavan, M., & Roth, B. (1993). Kinematic analysis of the general 6R manipulator. Journal of Mechanical Design, 115(3), 502–508.
  5. Wampler, C. W. (1996). Manipulator inverse kinematics solutions based on vector formulations and polynomial continuation. IEEE Transactions on Robotics and Automation, 12(4), 640–647.
  6. Manocha, D., & Canny, J. (1994). Efficient inverse kinematics for general 6R manipulators. IEEE Transactions on Robotics and Automation, 10(5), 648–657.
  7. Siciliano, B., & Khatib, O. (Eds.). (2008). Springer Handbook of Robotics. Springer. (Chapters on kinematics and inverse kinematics give a modern theoretical overview.)