Robotics and Kinematics

Chapter 5
Inverse Kinematics and Workspace Analysis

Bachelor Program in Mechatronics Engineering
Robotics and Kinematics   •   Bachelor

Inverse Kinematics and Workspace Analysis

Introduction

Forward kinematics determines the position and orientation of a robot’s end effector from known joint variables. Inverse kinematics (IK) solves the reverse problem: given a desired end-effector pose, determine the joint variables that produce it. Although this appears to be a simple reversal, it is generally more difficult because the mapping is nonlinear, may have multiple solutions, may have no solution, and may become ill-conditioned near singular configurations.

Workspace analysis complements IK by describing where a robot can place its end effector and how effectively it can do so. These concepts are central to robot design, path planning, manipulation, welding, assembly, inspection, and human–robot collaboration.

Learning objectives

By the end of this chapter, the reader should be able to:

  1. Formulate inverse-kinematic equations from a robot’s geometric or homogeneous-transform model.
  2. Solve common planar and spatial manipulators analytically.
  3. Explain multiple, unreachable, and singular solutions.
  4. Apply numerical IK using Jacobians and assess convergence.
  5. Include joint, collision, and task constraints in IK.
  6. Distinguish reachable, dexterous, and manipulability-related workspaces.
  7. Evaluate an IK solution for accuracy, feasibility, conditioning, and safety.

1. Forward and inverse kinematics

For a robot with n joints, let the joint vector be

q = [q1, q2, …, qn]T

where revolute variables are angles, measured in radians or degrees, and prismatic variables are displacements, measured in metres. The forward-kinematic mapping is

x = f(q)

where x represents the task-space pose. For a planar position task, x may be [x,y]T. For a spatial rigid-body pose, x normally contains three position coordinates and three orientation coordinates, although orientation may also be represented by a rotation matrix or quaternion.

The inverse problem is

f(q) = xd

where x_d is the desired pose. In general, solving this equation requires nonlinear algebra or numerical optimization.

A homogeneous transformation from frame j to frame i is

iTj = [ iRj ipj ; 0 0 0 1 ]

where iRj is a 3 × 3 rotation matrix and ipj is a 3 × 1 position vector. For a serial manipulator,

0Tn(q) = 0T1(q1) 1T2(q2) … n−1Tn(qn)

The IK task is to make 0Tn(q) equal, or sufficiently close, to a desired transformation 0Tn,d. Exact equality is required only when the target is feasible and the model is ideal.

Position and orientation error

A practical solver uses an error vector rather than directly comparing matrices. A position error is

ep = pd − p(q)

where both vectors must use the same length unit. For small orientation errors, a rotation-vector error can be used. If Rd is desired orientation and R(q) is current orientation, one useful definition is

eR = 1/2 [ R(q)T Rd − RdT R(q) ]^∨

where [·]^∨ converts a 3 × 3 skew-symmetric matrix into its associated 3-vector. The complete task error may be written as e = [epT,eRT]T. Position and orientation components should be scaled consistently because metres and radians have different numerical magnitudes.

2. Analytical inverse kinematics

Analytical IK derives joint variables directly using geometry, trigonometric identities, or algebraic elimination. It is fast, transparent, and suitable for real-time control, but closed-form solutions do not exist for every robot or task representation.

2.1 Two-link planar manipulator

Consider a planar two-revolute-joint robot with link lengths a_1 and a_2. The joint angles are q_1 and q_2, measured counter-clockwise from the positive x-axis. Its forward kinematics are

x = a1 cos q1 + a2 cos(q1 + q2)
y = a1 sin q1 + a2 sin(q1 + q2)

Given a target position (x_d,y_d), define

r2 = xd2 + yd2

Using the cosine rule,

cos q2 = (r2 − a12 − a22)/(2a1a2) = D

Therefore,

q2 = atan2(±√(1−D2), D)

The two signs correspond to the elbow-up and elbow-down configurations. Once q_2 is known,

q1 = atan2(yd,xd) − atan2(a2 sin q2, a1 + a2 cos q2)

These equations assume a planar robot with ideal rigid links and revolute joints, and that the target specifies position only.

The target is reachable if

|a1 − a2| ≤ r ≤ a1 + a2

For r > a1+a2 or r < |a1−a2|, no real IK solution exists. At either boundary, the arm is fully stretched or folded and the two branches merge.

Worked example: two-link arm

Let a1 = 0.60 m, a2 = 0.40 m, and target (xd,yd)=(0.70,0.30) m. Then

r2 = 0.702 + 0.302 = 0.58 m2
D = (0.58−0.36−0.16)/(2×0.60×0.40) = 0.06/0.48 = 0.125

Thus

q2 = ±acos(0.125) ≈ ±82.82°

For the positive branch,

q1 = atan2(0.30,0.70) − atan2(0.40 sin82.82°,0.60+0.40 cos82.82°)

which gives approximately q1 = −8.3°. The second branch gives approximately q1 = 43.0° and q2 = −82.82°. Substitution into the forward equations should reproduce the target, apart from rounding.

2.2 Decoupling position and orientation

Many six-axis industrial manipulators have a spherical wrist: the last three joint axes intersect at one point. This structure permits position and orientation to be solved separately.

Let p_d be the desired tool-center-point position, R_d the desired orientation, and d_6 the distance from the wrist centre to the tool along the final tool axis. If z_6 is the tool’s final-axis unit vector, the wrist centre is

pw = pd − d6 z6

For a desired orientation, z6 is usually the third column of Rd, subject to the chosen tool-frame convention. The first three joints are solved from p_w. The wrist orientation is then obtained from

3R6 = (0R3)T 0R6

where 0R6 = Rd. The last three joint angles are extracted from 3R6. This method can produce shoulder-left/right, elbow-up/down, and wrist-flip solutions. It is valid only when the actual robot geometry supports the assumed decoupling and frame conventions are used consistently.

3. Multiple, unreachable, and singular solutions

Multiple solutions

A robot can reach the same pose in several joint configurations. Multiple solutions arise from geometric symmetry, redundant joints, or periodic revolute angles. A controller should select a solution using criteria such as:

  • proximity to the current joint vector;
  • avoidance of joint limits and collisions;
  • clearance from singularities;
  • low energy or motion time;
  • compatibility with the next path point.

The mathematically nearest solution is not always the safest or fastest solution.

Unreachable solutions

A pose is unreachable when no joint vector satisfies the kinematic equations and all physical constraints. Unreachability may be caused by insufficient reach, an impossible orientation, joint limits, obstacles, or an inadequate number of degrees of freedom. A numerical solver that fails to converge does not by itself prove unreachability; analytical bounds or a constrained feasibility test are preferable.

Singular solutions

The geometric Jacobian relates joint velocity to task-space velocity:

ẋ = J(q) q̇

where J(q) = ∂f/∂q and units depend on the selected task coordinates. A configuration is singular when the Jacobian loses rank. For a square Jacobian, a common test is

det J(q) = 0

For a non-square Jacobian, rank deficiency is the relevant condition, not a determinant.

At a singularity, some Cartesian velocity directions cannot be generated instantaneously, and very large joint velocities may be required for a modest task-space velocity. Singularities can also cause numerical instability and branch changes. They may be classified as workspace-boundary, internal, or wrist singularities depending on their geometric origin.

For the two-link planar arm, the position Jacobian is

J = [ −a1 sin q1 − a2 sin(q1+q2) −a2 sin(q1+q2) ;
a1 cos q1 + a2 cos(q1+q2) a2 cos(q1+q2) ]

Its determinant is

det J = a1 a2 sin q2

Thus the arm is singular when q2 = 0 or π modulo 2π: the links are collinear.

4. Numerical inverse kinematics

Numerical IK is essential for robots without convenient closed-form solutions, redundant robots, constrained tasks, and optimization-based control. Starting from an initial estimate q_k, linearization gives

e(qk + ∆q) ≈ e(qk) + J(qk)∆q

For the convention e = xd−f(q), a basic Newton step is

∆q = J(qk)^† e(qk)

where J^† is the Moore–Penrose pseudoinverse. The update is qk+1=qk+α∆q, with step size 0<α≤1. Iteration stops when the error norm is below a specified tolerance and the joint vector satisfies all constraints.

For a square nonsingular Jacobian, J^†=J-1. For a redundant robot, the null-space term can improve a secondary objective:

∆q = J^†e + (I−J^†J)∆q0

Here I is the identity matrix and ∆q0 is a preferred secondary motion, such as motion away from joint limits. The null-space term does not change the first-order task velocity because J(I−J^†J)=0.

Near singularities, the damped least-squares method is safer:

∆q = JT(JJT + λ2I)-1e

where λ ≥ 0 is a damping factor. Larger λ reduces excessive joint motion but introduces residual task error. A variable damping strategy increases λ as the smallest singular value of J approaches zero.

Numerical algorithm

A robust numerical IK procedure is:

  1. Specify the target pose, coordinate frames, units, and tolerances.
  2. Choose an initial guess, preferably near the current robot configuration.
  3. Compute forward kinematics and the pose error.
  4. Compute the Jacobian.
  5. Calculate a pseudoinverse or damped least-squares step.
  6. Apply step-size control and project or reject violations of constraints.
  7. Test position, orientation, joint-limit, collision, and velocity criteria.
  8. Repeat until convergence or a maximum iteration count is reached.
  9. Verify the final solution by forward substitution.

A good implementation reports failure explicitly rather than returning the last iterate as if it were valid.

5. Constraints and optimization

Real IK is a constrained problem. Typical constraints include

qmin ≤ q ≤ qmax
|q̇i| ≤ q̇i,max, |τi| ≤ τi,max

and collision-clearance constraints such as d(q) ≥ dmin, where d(q) is the minimum distance between robot and environment.

A general optimization formulation is

minq ||We e(q)||2 + λq2||Wq(q−qref)||2 + λs2 φs(q)

subject to joint, collision, and task constraints. Here W_e weights task errors, W_q penalizes departure from a reference posture, φ_s penalizes poor singularity conditioning, and λ_q and λ_s are nonnegative weights. The objective is dimensionally meaningful only when the error components are scaled consistently.

For position-only control with more joints than task coordinates, redundancy can be used for obstacle avoidance, posture shaping, or manipulability improvement. However, secondary objectives must never compromise hard safety constraints.

6. Workspace analysis

The reachable workspace is the set of all positions that the reference point can attain under allowable joint values:

WR = {x ∈ ℝm : x = f(q), q ∈ Q}

where Q is the joint-limit set and m is the task-space dimension. If orientation is included, the workspace is a subset of position–orientation space and is often called a configuration-dependent or task workspace.

The dexterous workspace is the set of positions at which the end effector can attain the required range of orientations:

WD = {p : every orientation in Oreq is feasible at p}

It is generally smaller than the reachable workspace. A point may be reachable in one orientation but not dexterous for a task requiring arbitrary orientation.

For an unrestricted two-link planar arm, the position workspace is an annulus:

|a1−a2| ≤ √(x2+y2) ≤ a1+a2

Joint limits remove portions of this annulus. For example, restricting q_1 to a narrow interval produces a sector-like region rather than a complete annulus.

Workspace boundaries

Workspace boundaries occur when the robot reaches joint limits or when the Jacobian loses rank. Boundary analysis is useful because it identifies reduced mobility, high actuator demand, and possible numerical difficulty. A sampled workspace can be generated by sweeping or randomly sampling q within Q, evaluating f(q), and storing the resulting points. A dense sample provides an approximation, not a proof of completeness.

Manipulability

Yoshikawa’s velocity manipulability measure for a full-row-rank Jacobian is

w(q) = √det(JJT)

A larger value generally indicates greater velocity capability in multiple task directions, while w = 0 indicates rank deficiency. Because translational and rotational Jacobian components have different units, a combined measure requires appropriate scaling. Manipulability is not the same as force capability, accuracy, or collision-free reachability.

The singular values of J provide directional information. If σ_max and σ_min are the largest and smallest singular values, a common condition number is

κ(J) = σmax/σmin

provided σ_min > 0. Large κ indicates poor conditioning; at a rank-deficient singularity, κ tends to infinity.

7. Applied case: pick-and-place robot-cell design

Background

Consider an illustrative six-axis articulated robot assigned to pick components from a conveyor and place them into a fixture. The fixture lies near the outer reach boundary, and the gripper must approach vertically with a specified yaw range.

Problem

A purely geometric reach check suggests that the fixture is reachable. During commissioning, however, one approach pose produces very large wrist velocities, while another apparently valid pose causes a collision with the conveyor guard.

Analysis

The engineering team first defines the complete target transformation, not merely the TCP position. Analytical IK generates several shoulder, elbow, and wrist branches. Each branch is filtered against joint limits and checked by forward kinematics. The remaining candidates are evaluated using collision distance, distance from singular configurations, and displacement from the current joint vector.

The selected branch is then refined using damped least squares. A manipulability threshold is included as a warning criterion, while collision and joint limits are treated as hard constraints. The approach path is sampled continuously rather than checking only the initial and final poses.

Approach and outcome

The team moves the fixture slightly inward, changes the approach orientation by 12°, and selects an elbow configuration with larger wrist clearance. The final trajectory maintains the required placement tolerance, avoids the guard, and keeps the minimum singular value above the commissioning threshold. Cycle time increases slightly, but unexpected stops and peak joint speeds are substantially reduced.

Learning points

  1. Position reachability does not guarantee orientation feasibility.
  2. Multiple IK solutions should be evaluated globally over a path.
  3. A mathematically valid solution can be unsafe near a singularity or obstacle.
  4. Workspace design should include orientation, joint limits, clearance, and process tolerances.
  5. Numerical verification by forward kinematics is mandatory before execution.

8. Implementation practice and limitations

Use radians internally, retain explicit frame labels, and test trigonometric expressions with atan2 rather than a one-argument inverse tangent when quadrant information matters. Treat approximate numerical equality with tolerances rather than exact floating-point comparisons. Check the residual pose error independently of the solver’s status flag.

Analytical solvers are fast but sensitive to geometry conventions, branch handling, and special cases. Numerical solvers are flexible but depend on initialization, scaling, stopping criteria, and local conditioning. Neither method automatically accounts for calibration errors, flexible links, backlash, payload-induced deflection, or unmodelled compliance. Experimental validation is therefore required for high-precision or safety-critical applications.

Modern systems increasingly combine analytical seeds, numerical refinement, signed-distance collision models, and optimization-based motion planning. Machine-learning methods may provide rapid initial guesses, but they must be verified against the kinematic model and safety constraints. A learned prediction should not bypass deterministic collision, limit, and emergency-stop mechanisms.

Chapter Summary

Inverse kinematics determines joint variables that produce a desired end-effector pose. Analytical methods provide rapid closed-form solutions for suitable robot geometries, while numerical methods use Jacobians, pseudoinverses, damping, and optimization to handle general and constrained problems. A target may have multiple solutions, no feasible solution, or solutions near singularities. Jacobian rank, determinant in the square case, singular values, manipulability, and condition number help identify these conditions.

Reachable workspace describes all attainable positions under joint constraints; dexterous workspace describes positions supporting the required orientation set. Workspace boundaries arise from joint limits and singular configurations. In professional practice, IK solutions must be checked for pose residual, joint limits, collisions, velocity and torque limits, singularity proximity, and path-wide feasibility. Analytical and numerical tools are complementary, and both depend on accurate models and careful validation.

Key Terms

Inverse kinematics: Determination of joint variables from a desired end-effector pose.

Forward kinematics: Computation of end-effector pose from joint variables.

Homogeneous transformation: Matrix combining rotation and translation between coordinate frames.

Jacobian: Matrix mapping joint velocities to task-space velocities.

Pseudoinverse: Generalized inverse used to solve non-square or rank-appropriate linear systems.

Damped least squares: Numerical IK method that limits instability near singularities.

Elbow-up solution: One geometric branch of a planar or articulated manipulator.

Elbow-down solution: The alternative geometric branch.

Reachable workspace: Set of positions attainable under allowable joint values.

Dexterous workspace: Positions at which the required orientations are attainable.

Singularity: Configuration in which the Jacobian loses rank.

Manipulability: Measure of the robot’s ability to generate motion in task-space directions.

Condition number: Ratio of largest to smallest singular value of a matrix.

Redundancy: Having more joint variables than task-space constraints.

Null space: Joint motions that produce no first-order task-space motion.

Joint-limit constraint: Lower and upper allowable bounds on a joint variable.

Pose residual: Difference between desired and achieved pose.

Wrist centre: Point used to decouple position and orientation in suitable six-axis robots.

Configuration branch: One distinct joint solution corresponding to a target pose.

Damped Jacobian: Jacobian-based method regularized to reduce singularity sensitivity.

Review Questions

Short Answer Questions

  1. What is the difference between forward and inverse kinematics?
  2. Why can a single planar target have two inverse-kinematic solutions?
  3. State the reachability condition for a two-link planar arm.
  4. What does Jacobian rank loss signify?
  5. Distinguish reachable workspace from dexterous workspace.

Long Answer Questions

  1. Derive the analytical IK equations for a two-link planar revolute manipulator and explain every solution branch.
  2. Explain how a spherical wrist permits position–orientation decoupling in a six-axis robot.
  3. Compare pseudoinverse and damped least-squares numerical IK, including their behaviour near singularities.
  4. Explain how joint limits and collision constraints change workspace analysis.
  5. Discuss why manipulability and condition number are useful but incomplete measures of robot performance.

Analytical / Application Questions

  1. For a robot with a1=0.5 m and a2=0.3 m, determine whether the target (x,y)=(0.9,0) m is reachable. Justify your answer.
  2. Design a numerical IK procedure for a redundant robot that must reach a target while avoiding a cylindrical obstacle. Identify the objective, hard constraints, stopping tests, and failure responses.
  3. A trajectory approaches a configuration where the smallest Jacobian singular value tends toward zero. Explain the expected actuator behaviour and propose two corrective strategies.

Multiple Choice Questions with Answers

Question 1

For a two-link planar arm, which condition indicates that a target at radial distance r is reachable?

A. r > a_1 + a_2 only

B. r < |a_1 − a_2| only

C. |a_1 − a_2| ≤ r ≤ a_1 + a_2

D. r = a_1 − a_2 for all targets

Correct Answer: C. |a_1 − a_2| ≤ r ≤ a_1 + a_2

Question 2

What do the two signs in q2 = atan2(±√(1−D2),D) represent?

A. Two link lengths

B. Elbow-up and elbow-down configurations

C. Position and orientation errors

D. Two different Jacobian dimensions

Correct Answer: B. Elbow-up and elbow-down configurations

Question 3

For a square Jacobian, a common singularity test is:

A. det J = 1

B. det J = 0

C. trace J = 0 always

D. J must be diagonal

Correct Answer: B. det J = 0

Question 4

Which method is specifically designed to reduce numerical instability near singularities?

A. Damped least squares

B. Unscaled forward substitution

C. Random joint resetting at every iteration

D. Ignoring the Jacobian

Correct Answer: A. Damped least squares

Question 5

The reachable workspace is best defined as:

A. All orientations of a robot at one fixed point

B. All points attainable under allowable joint values

C. Only points on the workspace boundary

D. Only points with maximum manipulability

Correct Answer: B. All points attainable under allowable joint values

Question 6

What is the main purpose of the null-space term in redundant IK?

A. To change the robot’s link lengths

B. To produce secondary motions without first-order task motion

C. To eliminate all joint variables

D. To guarantee that every target is reachable

Correct Answer: B. To produce secondary motions without first-order task motion

Question 7

For the two-link planar arm, det J = a1a2 sin q2. Which configuration is singular?

A. q_2 = 90° only

B. q_2 = 45° only

C. q_2 = 0° or 180° modulo 360°

D. q_2 = 30° only

Correct Answer: C. q_2 = 0° or 180° modulo 360°

Question 8

Which statement about dexterous workspace is correct?

A. It is always larger than reachable workspace

B. It concerns positions supporting the required orientation set

C. It ignores orientation completely

D. It contains only singular configurations

Correct Answer: B. It concerns positions supporting the required orientation set

Question 9

If σmin approaches zero, the condition number κ=σmax/σmin generally:

A. Approaches zero

B. Approaches one

C. Becomes very large

D. Becomes negative

Correct Answer: C. Becomes very large

Question 10

For a1=0.6 m and a2=0.4 m, what is the maximum radial reach?

A. 0.2 m

B. 0.4 m

C. 0.6 m

D. 1.0 m

Correct Answer: D. 1.0 m

Robotics and Kinematics
Chapter 5 of 15