Robotics: Analytical and Numerical Inverse Kinematics

Foundations of Robot Kinematics: Forward vs. Inverse Mapping

  • Kinematics forms the core mathematical discipline required to model, simulate, and control mechanical manipulators in physical, virtual, and augmented environments.

  • Forward Kinematics (FK):

    • Defines a deterministic mathematical mapping from the joint space configuration vector to the Cartesian operational space (end-effector position and orientation):     f:Q→Xf : \mathbf{Q} \to \mathbf{X}

    • The solution to the forward kinematic mapping is strictly unique: given a specific combination of joint variables, the manipulator can occupy only one physical location and pose in space.

    • Primarily utilized for robot state visualization, workspace reachability prediction, motion simulation, and as an underlying analytical baseline for numerical control.

  • Inverse Kinematics (IK):

    • Defines the reverse mapping from a desired task-space pose (position and orientation) to the corresponding set of joint coordinates:     f−1:X→Qf^{-1} : \mathbf{X} \to \mathbf{Q}

    • The operational challenge of robotics fundamentally centers on inverse kinematics because physical tasks are formulated in operational Cartesian coordinates (such as reaching a tool center point or tracking an object), whereas actuators are actuated strictly in joint space.

    • Unlike forward kinematics, inverse kinematics problems exhibit non-unique solutions:

    • Zero solutions: The desired pose lies outside the robot's reachable workspace or violates physical joint limit constraints.

    • Exactly one solution: The manipulator is at a unique boundary or singular reach configuration.

    • Multiple discrete solutions: Multiple distinct geometric postures (e.g., elbow-up versus elbow-down) achieve the exact same end-effector pose.

    • Infinitely many solutions: Occurs in kinematically redundant manipulators where internal degrees of freedom permit continuous self-motion while maintaining a stationary tool center point.

    • Closed-form algebraic solutions are difficult to derive and exist only for manipulators with specific geometric structures (e.g., planar arms or architectures with spherical wrists).

Analytical Inverse Kinematics for a 2-DOF Planar Manipulator

Planar two-link manipulator geometry
  • Consider a planar two-link revolute manipulator operating in a two-dimensional Cartesian plane (x,yx, y):

    • Link segment lengths are denoted by l1l_1 and l2l_2.

    • Joint angles are represented by q1q_1 (measured relative to the positive horizontal xx-axis) and q2q_2 (relative angle of link 2 with respect to the collinear extension of link 1).

    • The base of the manipulator is positioned at the origin (0,0)(0, 0), and the end-effector target is positioned at (x,y)(x, y).

  • The analytical goal is to find expressions for q1q_1 and q2q_2 given arbitrary target coordinates (x,y)(x, y) and link parameters l1,l2l_1, l_2.

Geometric decomposition using distance L and angle alpha
  • Step 1: Deriving Joint Angle q2q_2 via the Law of Cosines:

    • Construct an imaginary triangle between the base origin (0,0)(0, 0), the intermediate elbow joint, and the end-effector coordinate (x,y)(x, y).

    • The two fixed sides of this triangle are the link lengths l1l_1 and l2l_2.

    • The third side is the straight-line Euclidean distance LL from the origin to the target position:     L=x2+y2L = \sqrt{x^2 + y^2}

    • Let α\alpha denote the interior triangle angle at the elbow joint. By geometry of straight lines, q2q_2 and α\alpha are supplementary:     π=α+q2  ⟹  α=π−q2\pi = \alpha + q_2 \implies \alpha = \pi - q_2

    • Apply the Law of Cosines to this triangle:     L2=l12+l22−2l1l2cos⁡(α)L^2 = l_1^2 + l_2^2 - 2 l_1 l_2 \cos(\alpha)

    • Substitute α=π−q2\alpha = \pi - q_2 into the cosine expression:     L2=l12+l22−2l1l2cos⁡(π−q2)L^2 = l_1^2 + l_2^2 - 2 l_1 l_2 \cos(\pi - q_2)

    • Utilize the trigonometric identity cos⁡(π−x)=−cos⁡(x)\cos(\pi - x) = -\cos(x) to simplify the relation:     L2=l12+l22+2l1l2cos⁡(q2)L^2 = l_1^2 + l_2^2 + 2 l_1 l_2 \cos(q_2)

    • Rearrange the equation to isolate cos⁡(q2)\cos(q_2):     cos⁡(q2)=L2−l12−l222l1l2\cos(q_2) = \frac{L^2 - l_1^2 - l_2^2}{2 l_1 l_2}

    • Solving for q2q_2 yields two distinct solutions:     q2=±arccos⁡(L2−l12−l222l1l2)q_2 = \pm \arccos\left(\frac{L^2 - l_1^2 - l_2^2}{2 l_1 l_2}\right)

    • The positive sign (++) represents the elbow-down configuration, while the negative sign (−-) represents the elbow-up configuration.

Geometric decomposition highlighting angle beta
  • Step 2: Deriving Joint Angle q1q_1:

    • Angle q1q_1 is decomposed into two constituent angles split by the diagonal vector of length LL:     q1=β+γq_1 = \beta + \gamma

    • The angle β\beta is the angle between the positive horizontal xx-axis and the vector LL.

    • Form a right-angled triangle with base xx, vertical height yy, and hypotenuse LL:     tan⁡(β)=oppositeadjacent=yx\tan(\beta) = \frac{\text{opposite}}{\text{adjacent}} = \frac{y}{x}     β=arctan⁡(yx)\beta = \arctan\left(\frac{y}{x}\right)

    • The angle γ\gamma represents the internal angle between link 1 (l1l_1) and the diagonal vector LL.

    • Apply the Law of Cosines to the triangle formed by l1,L,l_1, L,  and l2l_2, where link l2l_2 is opposite to angle γ\gamma:     l22=L2+l12−2Ll1cos⁡(γ)l_2^2 = L^2 + l_1^2 - 2 L l_1 \cos(\gamma)

    • Solve for cos⁡(γ)\cos(\gamma):     cos⁡(γ)=L2+l12−l222Ll1\cos(\gamma) = \frac{L^2 + l_1^2 - l_2^2}{2 L l_1}

    • Inverting the cosine gives:     γ=∓arccos⁡(L2+l12−l222Ll1)\gamma = \mp \arccos\left(\frac{L^2 + l_1^2 - l_2^2}{2 L l_1}\right)

    • Combining the expressions yields the complete closed-form solution for the base angle q1q_1:     q1=β+γ=atan2(y,x)∓arccos⁡(L2+l12−l222Ll1)q_1 = \beta + \gamma = \text{atan2}(y, x) \mp \arccos\left(\frac{L^2 + l_1^2 - l_2^2}{2 L l_1}\right)

Complete angular relationship including angle gamma

Implementation Considerations: The atan2 Function

  • Standard trigonometric library implementations of the single-argument arc tangent function arctan⁡(y/x)\arctan(y/x) present critical algorithmic limitations for robotics control:

    • The standard arctan⁡\arctan function only maps values to the open interval (−π/2,π/2)(-\pi/2, \pi/2), effectively restricting the angle to quadrants I and IV.

    • The division y/xy/x causes loss of signs for individual components: −y−x=yx\frac{-y}{-x} = \frac{y}{x}, meaning that a target located in quadrant III yields an identical angle to an equivalent target located in quadrant I.

    • A division-by-zero singularity occurs whenever x=0x = 0, corresponding to motion along the vertical Cartesian axis.

Discontinuity surface of the conventional arctan function
  • The two-argument arc tangent function, denoted as atan2(y,x)\text{atan2}(y, x), resolves these implementation pitfalls:

    • Accepts the numerator yy and denominator xx as independent floating-point arguments.

    • Analyzes the signs of both xx and yy to determine the true trigonometric quadrant of the vector.

    • Returns unambiguous angles spanning the complete circle: [−π,π][-\pi, \pi] (or [−180∘,180∘][-180^\circ, 180^\circ]).

    • Handles the vertical axis conditions gracefully without division by zero: atan2(y,0)=π2\text{atan2}(y, 0) = \frac{\pi}{2} for y>0y > 0, and −π2-\frac{\pi}{2} for y<0y < 0.

Continuous surface of the four-quadrant atan2 function

Kinematic Decoupling in 3-DOF Planar Manipulators

Three-link planar arm showing end-effector orientation
  • When control requirements demand both the position (x,y)(x, y) and absolute orientation θ\theta of the tool in the plane, a 3-DOF planar arm is needed.

  • The task-space target vector contains three parameters:   x=(xyθ)T\mathbf{x} = \begin{pmatrix} x & y & \theta \end{pmatrix}^T

  • The joint variable vector consists of three revolute angles:   q=(q1q2q3)T\mathbf{q} = \begin{pmatrix} q_1 & q_2 & q_3 \end{pmatrix}^T

  • Concept of Kinematic Decoupling:

    • Solves complex multi-variable kinematic mappings by separating positional degrees of freedom from orientational degrees of freedom.

    • In a 3-link planar manipulator, the orientation θ\theta of the final link with length l3l_3 is purely a linear sum of all joint angles:     θ=q1+q2+q3\theta = q_1 + q_2 + q_3

    • The wrist joint located at coordinates (c,d)(c, d) can be calculated independently of the first two links by projecting backward along link 3 from the end-effector coordinate (x,y)(x, y):     c=x−l3cos⁡(θ)c = x - l_3 \cos(\theta)     d=y−l3sin⁡(θ)d = y - l_3 \sin(\theta)

    • Once the coordinates of the wrist (c,d)(c, d) are determined, the first two joint angles q1q_1 and q2q_2 are solved directly via the standard 2-DOF planar inverse kinematics procedure using target (c,d)(c, d) and link lengths l1,l2l_1, l_2.

    • Finally, the third joint angle q3q_3 is obtained by rearranging the global orientation constraint:     q3=θ−q1−q2q_3 = \theta - q_1 - q_2

  • Comprehensive Worked Example:

    • Consider link segment lengths:     l1=1,l2=1,l3=1l_1 = 1, \quad l_2 = 1, \quad l_3 = 1

    • Desired end-effector pose target:     x=1+12,y=1−12,θ=−π4x = 1 + \frac{1}{\sqrt{2}}, \quad y = 1 - \frac{1}{\sqrt{2}}, \quad \theta = -\frac{\pi}{4}

    • Trigonometric values for the given orientation:     cos⁡(−π4)=12\cos\left(-\frac{\pi}{4}\right) = \frac{1}{\sqrt{2}}     sin⁡(−π4)=−12\sin\left(-\frac{\pi}{4}\right) = -\frac{1}{\sqrt{2}}

    • Calculate the wrist center coordinates (c,d)(c, d):     c=x−l3cos⁡(θ)=(1+12)−1×12=1c = x - l_3 \cos(\theta) = \left(1 + \frac{1}{\sqrt{2}}\right) - 1 \times \frac{1}{\sqrt{2}} = 1     d=y−l3sin⁡(θ)=(1−12)−1×(−12)=1d = y - l_3 \sin(\theta) = \left(1 - \frac{1}{\sqrt{2}}\right) - 1 \times \left(-\frac{1}{\sqrt{2}}\right) = 1

    • The wrist position is evaluated as (c,d)=(1,1)(c, d) = (1, 1).

    • Solve 2-DOF inverse kinematics for links 1 and 2 reaching (c,d)=(1,1)(c, d) = (1, 1):     L2=c2+d2=12+12=2L^2 = c^2 + d^2 = 1^2 + 1^2 = 2     cos⁡(q2)=L2−l12−l222l1l2=2−12−122×1×1=02=0\cos(q_2) = \frac{L^2 - l_1^2 - l_2^2}{2 l_1 l_2} = \frac{2 - 1^2 - 1^2}{2 \times 1 \times 1} = \frac{0}{2} = 0     q2=±arccos⁡(0)=±π2q_2 = \pm \arccos(0) = \pm \frac{\pi}{2}

    • Compute base angle q1q_1:     β=atan2(d,c)=atan2(1,1)=π4\beta = \text{atan2}(d, c) = \text{atan2}(1, 1) = \frac{\pi}{4}     cos⁡(γ)=L2+l12−l222Ll1=2+1−12×2×1=222=12  ⟹  γ=π4\cos(\gamma) = \frac{L^2 + l_1^2 - l_2^2}{2 L l_1} = \frac{2 + 1 - 1}{2 \times \sqrt{2} \times 1} = \frac{2}{2\sqrt{2}} = \frac{1}{\sqrt{2}} \implies \gamma = \frac{\pi}{4}

    • Evaluate both branches:

    • Branch 1 (Elbow-down, q2=+π2q_2 = +\frac{\pi}{2}):       q1=β−γ=π4−π4=0q_1 = \beta - \gamma = \frac{\pi}{4} - \frac{\pi}{4} = 0       q3=θ−q1−q2=−π4−0−π2=−3π4q_3 = \theta - q_1 - q_2 = -\frac{\pi}{4} - 0 - \frac{\pi}{2} = -\frac{3\pi}{4}       q(1)=(0π2−3π4)T\mathbf{q}^{(1)} = \begin{pmatrix} 0 & \frac{\pi}{2} & -\frac{3\pi}{4} \end{pmatrix}^T

    • Branch 2 (Elbow-up, q2=−π2q_2 = -\frac{\pi}{2}):       q1=β+γ=π4+π4=π2q_1 = \beta + \gamma = \frac{\pi}{4} + \frac{\pi}{4} = \frac{\pi}{2}       q3=θ−q1−q2=−π4−π2−(−π2)=−π4q_3 = \theta - q_1 - q_2 = -\frac{\pi}{4} - \frac{\pi}{2} - \left(-\frac{\pi}{2}\right) = -\frac{\pi}{4}       q(2)=(π2−π2−π4)T\mathbf{q}^{(2)} = \begin{pmatrix} \frac{\pi}{2} & -\frac{\pi}{2} & -\frac{\pi}{4} \end{pmatrix}^T

Kinematic Decoupling for 6-DOF Spatial Manipulators with Spherical Wrists

Anthropomorphic arm with spherical wrist
  • In general 3D operational space, complete positioning and orientation requires six degrees of freedom:

    • Three translational parameters: position vector p=(xyz)T\mathbf{p} = \begin{pmatrix} x & y & z \end{pmatrix}^T.

    • Three orientational parameters: rotation matrix R∈SO(3)R \in SO(3) or three Euler angles (e.g., yaw, pitch, roll).

  • Solving arbitrary coupled 6-DOF non-linear equations analytically is mathematically impossible in general.

  • Pieper's Criterion and the Spherical Wrist:

    • Closed-form analytical decoupling is mathematically viable if and only if three consecutive joint axes intersect at a single common point, or three consecutive axes are parallel.

    • An architecture where axes z4,z5,z_4, z_5, and z6z_6 intersect at a single point is termed a spherical wrist.

Mechanical structure of a spherical wristKinematic decoupling of wrist and end-effector
  • Six-Step Decoupling Algorithm for Spatial Manipulators:

    1. Wrist Center Extraction: The tool center point is displaced from the wrist intersection point along the approach vector a\mathbf{a} (the z6z_6 direction) by distance d6d_6. Compute wrist position pw\mathbf{p}_w:      pw=pe−d6R(001)\mathbf{p}_w = \mathbf{p}_e - d_6 R \begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix}

    2. Base Joint Solution (q1q_1): The first joint rotation governs the horizontal azimuth angle of the wrist position:      q1=atan2(pwy,pwx)q_1 = \text{atan2}(p_{wy}, p_{wx})      (Subject to a second solution shifted by 180∘180^\circ if the shoulder reaches backward).

    3. Shoulder and Elbow Solution (q2,q3q_2, q_3): The wrist position is projected onto the plane formed by links 1 and 2. This reduces to the 2-DOF planar geometry discussed previously, yielding 2 solutions (elbow-up and elbow-down).

    4. Combine Positional Branches: Step 2 and Step 3 yield 2×2=42 \times 2 = 4 distinct positional configurations (q1,q2,q3)(q_1, q_2, q_3).

    5. Evaluate Arm Sub-Chain Rotation Matrix: For each positional solution, evaluate forward kinematics of the first three joints to determine the intermediate frame orientation R30(q1,q2,q3)R_3^0(q_1, q_2, q_3).

    6. Spherical Wrist Inverse Kinematics (q4,q5,q6q_4, q_5, q_6):

    • The total desired orientation is the product of the arm rotation and wrist rotation:        R=R30R63  ⟹  R63=(R30)TRR = R_3^0 R_6^3 \implies R_6^3 = (R_3^0)^T R

    • The matrix R63R_6^3 is factored into equivalent Euler rotations corresponding to the wrist physical axes (e.g., ZYZZYZ or ZXZZXZ rotation sequences).

    • Because Euler angles yield two mathematical parameterizations per rotation matrix (differing by sign flips and 180∘180^\circ offsets in the wrist roll), each arm configuration produces two wrist solutions.

      • The complete spatial system produces a maximum of 4×2=84 \times 2 = 8 analytical inverse kinematic solutions.

Kinematic Redundancy and Numerical Inverse Kinematics

The 7-DOF Baxter dual-arm collaborative robot
  • A robotic system is defined as kinematically redundant when its joint space dimension mm strictly exceeds the task-space dimension nn required to specify the operational task:   f:Q⊆Rm→X⊆Rn,n<mf : \mathbf{Q} \subseteq \mathbb{R}^m \to \mathbf{X} \subseteq \mathbb{R}^n, \quad n < m

  • Physical Examples of Redundant Systems:

    • Planar arm with m=2m = 2 actuated joints where the controlled task space is restricted solely to end-effector vertical height (n=1n = 1).

    • Anthropomorphic robot arm (e.g., Baxter manipulator) possessing m=7m = 7 revolute joints operating in standard task spaces of position (n=3n = 3) or pose (n=6n = 6).

    • Humanoid robot arms (e.g., iCub manipulator) featuring m=10m = 10 degrees of freedom (including torso and hip articulations) mapped to n=3n = 3 or n=6n = 6 operational coordinates.

    • Other advanced platforms include the Honda ASIMO humanoid and multi-axis KUKA industrial robotic arms.

  • Consequences of Redundancy:

    • Redundant manipulators possess a non-trivial nullspace, meaning there are infinitely many continuous joint configurations that produce the exact same end-effector pose.

    • Closed-form analytical algebraic inversion is impossible for general redundant systems.

    • Solution requires numerical optimization and local differential kinematics.

Resolved Motion Rate Control (RMRC): Principles and Formulation

Tangent line approximation of a one-dimensional non-linear function
  • Rather than attempting to compute the non-linear inverse function f−1f^{-1} globally in one step, Resolved Motion Rate Control (RMRC) breaks the trajectory into small differential steps resolved locally through linear approximations.

  • First-Order Taylor Series Approximation:

    • Consider a smooth, continuous, and differentiable non-linear forward kinematics function x=f(q)x = f(q).

    • In a small neighborhood around an operating point q0q_0, the function is approximated by its tangent line:     f^q0(q)=f(q0)+dfdq(q0)⋅(q−q0)=x0+f′(q0)⋅(q−q0)\hat{f}_{q_0}(q) = f(q_0) + \frac{df}{dq}(q_0) \cdot (q - q_0) = x_0 + f'(q_0) \cdot (q - q_0)

  • One-Dimensional Control Step Derivation:

    • Assume the robot currently resides at configuration q0q_0 with observed position x0=f(q0)x_0 = f(q_0), and must move toward target position x∗x^*.

    • Define a desired differential displacement step δx1\delta x_1 using a proportional control gain kk:     δx1=k⋅(x∗−x0)\delta x_1 = k \cdot (x^* - x_0)

    • The intermediate target in operational space is:     x1∗=x0+δx1x_1^* = x_0 + \delta x_1

    • Substitute into the linear approximation:     x0+δx1=x0+f′(q0)⋅((q0+δq1)−q0)x_0 + \delta x_1 = x_0 + f'(q_0) \cdot ((q_0 + \delta q_1) - q_0)     δx1=f′(q0)⋅δq1\delta x_1 = f'(q_0) \cdot \delta q_1

    • Invert the scalar linear relationship to find the required joint increment δq1\delta q_1:     δq1=1f′(q0)⋅δx1\delta q_1 = \frac{1}{f'(q_0)} \cdot \delta x_1

    • Update the joint state:     q1=q0+δq1q_1 = q_0 + \delta q_1

    • Measure or compute the true non-linear result via the forward kinematics function: x1=f(q1)x_1 = f(q_1).

  • Iterative Control Loop and Stability Caveats:

    • The update sequence is repeated iteratively:     δxt+1=k⋅(x∗−xt)\delta x_{t+1} = k \cdot (x^* - x_t)     δqt+1=1f′(qt)⋅δxt+1\delta q_{t+1} = \frac{1}{f'(q_t)} \cdot \delta x_{t+1}     qt+1=qt+δqt+1q_{t+1} = q_t + \delta q_{t+1}

    • This structure mirrors a proportional controller (P\text{P}-controller) within a classical PID scheme.

    • System Stability Limits: If the gain parameter kk is chosen too large, or if the step magnitude δx\delta x is excessive, the linear approximation breaks down, leading to numerical instability, excessive overshoot, or unbounded divergence. Consequently, kk must be kept small, or the maximum Euclidean norm of δx\delta x must be strictly clamped.

The Manipulator Jacobian and Multi-Dimensional Linearization

  • To generalize RMRC to multi-input, multi-output robotic systems (mm joint inputs, nn task-space outputs), the derivative scalar is replaced by the Jacobian matrix J(q)J(q).

  • Let the forward kinematics mapping be:   f:Q⊆Rm→X⊆Rn,x=f(q)f : \mathbf{Q} \subseteq \mathbb{R}^m \to \mathbf{X} \subseteq \mathbb{R}^n, \quad \mathbf{x} = f(\mathbf{q})

  • Differentiate each output variable xix_i (i=1,…,ni = 1, \dots, n) with respect to every joint input variable qjq_j (j=1,…,mj = 1, \dots, m):   J(q)=∂f∂q=(∂f1∂q1∂f1∂q2⋯∂f1∂qm∂f2∂q1∂f2∂q2⋯∂f2∂qm⋮⋮⋱⋮∂fn∂q1∂fn∂q2⋯∂fn∂qm)∈Rn×mJ(\mathbf{q}) = \frac{\partial f}{\partial \mathbf{q}} = \begin{pmatrix} \frac{\partial f_1}{\partial q_1} & \frac{\partial f_1}{\partial q_2} & \cdots & \frac{\partial f_1}{\partial q_m} \\ \frac{\partial f_2}{\partial q_1} & \frac{\partial f_2}{\partial q_2} & \cdots & \frac{\partial f_2}{\partial q_m} \\ \vdots & \vdots & \ddots & \vdots \\ \frac{\partial f_n}{\partial q_1} & \frac{\partial f_n}{\partial q_2} & \cdots & \frac{\partial f_n}{\partial q_m} \end{pmatrix} \in \mathbb{R}^{n \times m}   Jij=∂fi∂qjJ_{ij} = \frac{\partial f_i}{\partial q_j}

  • When computing partial derivative entry JijJ_{ij}, all joints other than qjq_j are treated as constants.

Tangent plane approximation of a multi-variable surface
  • Geometrically, the Jacobian linearizes the forward mapping about the current joint pose q0\mathbf{q}_0, defining a tangent hyperplane in operational space:   f^q0(q)=f(q0)+J(q0)⋅(q−q0)\hat{f}_{\mathbf{q}_0}(\mathbf{q}) = f(\mathbf{q}_0) + J(\mathbf{q}_0) \cdot (\mathbf{q} - \mathbf{q}_0)

  • Concrete Jacobian Derivation (m=2,n=1m = 2, n = 1):

    • Consider a 2-link planar arm where only the vertical coordinate yy of the tip is controlled:     l1=0.5,l2=0.5l_1 = 0.5, \quad l_2 = 0.5     y=f(q)=0.5sin⁡(q1)+0.5sin⁡(q1+q2)y = f(\mathbf{q}) = 0.5 \sin(q_1) + 0.5 \sin(q_1 + q_2)

    • The resulting Jacobian matrix is a 1×21 \times 2 row vector:     J(q)=(∂y∂q1∂y∂q2)J(\mathbf{q}) = \begin{pmatrix} \frac{\partial y}{\partial q_1} & \frac{\partial y}{\partial q_2} \end{pmatrix}

    • Differentiate with respect to q1q_1:     ∂y∂q1=0.5cos⁡(q1)+0.5cos⁡(q1+q2)\frac{\partial y}{\partial q_1} = 0.5 \cos(q_1) + 0.5 \cos(q_1 + q_2)

    • Differentiate with respect to q2q_2:     ∂y∂q2=0.5cos⁡(q1+q2)\frac{\partial y}{\partial q_2} = 0.5 \cos(q_1 + q_2)     (Note: The term 0.5sin⁡(q1)0.5 \sin(q_1) vanishes completely because it is strictly constant with respect to q2q_2 ).

  • The assembled Jacobian is:   J(q)=(0.5cos⁡(q1)+0.5cos⁡(q1+q2)0.5cos⁡(q1+q2))J(\mathbf{q}) = \begin{pmatrix} 0.5 \cos(q_1) + 0.5 \cos(q_1 + q_2) & 0.5 \cos(q_1 + q_2) \end{pmatrix}

Kinematic vector chain from base to end-effector

Matrix Inversion and the Moore-Penrose Pseudoinverse

  • In the scalar RMRC algorithm, mapping from task displacement δx\delta x to joint displacement δq\delta q required division by the derivative: δq=1f′(q)δx\delta q = \frac{1}{f'(q)} \delta x.

  • Matrix division is undefined in linear algebra. In square systems (m=nm = n), inversion is governed by the two-sided condition:   MM−1=M−1M=IM M^{-1} = M^{-1} M = I

    • The inverse M−1M^{-1} exists if and only if the matrix is square (m=nm = n) and non-singular (det⁡(M)≠0\det(M) \neq 0), solvable via Gaussian elimination.

  • In redundant robotics problems, the Jacobian matrix is rectangular with more columns than rows (m>nm > n). Consequently, no standard two-sided inverse exists.

  • The Right Moore-Penrose Pseudoinverse (J#J^\#):

    • For full row-rank matrices (rank(J)=n\text{rank}(J) = n), an exact right inverse satisfies:     JJ#=InJ J^\# = I_n

    • The analytical formulation of the Moore-Penrose pseudoinverse for a wide matrix (m>nm > n) is defined as:     J#=JT(JJT)−1∈Rm×nJ^\# = J^T (J J^T)^{-1} \in \mathbb{R}^{m \times n}

    • Algebraic verification:     JJ#=J(JT(JJT)−1)=(JJT)(JJT)−1=InJ J^\# = J \left(J^T (J J^T)^{-1}\right) = (J J^T) (J J^T)^{-1} = I_n

  • Worked Algebraic Derivation for a 1×21 \times 2 Matrix:

    • Let J=(ab)J = \begin{pmatrix} a & b \end{pmatrix}, where m=2,n=1m = 2, n = 1.

    • Compute the transpose:     JT=(ab)J^T = \begin{pmatrix} a \\ b \end{pmatrix}

    • Compute the product JJTJ J^T:     JJT=(ab)(ab)=a2+b2J J^T = \begin{pmatrix} a & b \end{pmatrix} \begin{pmatrix} a \\ b \end{pmatrix} = a^2 + b^2

    • Invert the scalar matrix product:     (JJT)−1=1a2+b2(J J^T)^{-1} = \frac{1}{a^2 + b^2}

    • Compute the pseudoinverse:     J#=JT(JJT)−1=(ab)(1a2+b2)=1a2+b2(ab)J^\# = J^T (J J^T)^{-1} = \begin{pmatrix} a \\ b \end{pmatrix} \left(\frac{1}{a^2 + b^2}\right) = \frac{1}{a^2 + b^2} \begin{pmatrix} a \\ b \end{pmatrix}

    • This pseudoinverse minimizes the Euclidean norm of joint increments: min⁡∥δq∥2\min \|\delta \mathbf{q}\|^2 subject to δx=Jδq\delta \mathbf{x} = J \delta \mathbf{q}.

Closed-Loop Trajectory Following and Iterative Position Control

  • The complete closed-loop position control algorithm tracking a time-varying spatial reference trajectory xt∗\mathbf{x}^*_t proceeds iteratively:

    1. State Initialization: Begin at initial joint vector q0\mathbf{q}_0 producing initial pose x0=f(q0)\mathbf{x}_0 = f(\mathbf{q}_0).

    2. Jacobian Evaluation: At each discrete time-step tt, calculate the numerical Jacobian matrix J(qt)J(\mathbf{q}_t) based on the current configuration.

    3. Operational Displacement Calculation: Compute the desired task-space step vector using error feedback gain kk:      δxt+1=k⋅(xt+1∗−xt)\delta \mathbf{x}_{t+1} = k \cdot (\mathbf{x}^*_{t+1} - \mathbf{x}_t)

    4. Pseudoinverse Computation: Evaluate the Moore-Penrose pseudoinverse J(qt)#J(\mathbf{q}_t)^\#.

    5. Joint Space Mapping: Compute the required incremental joint displacement:      δqt+1=J(qt)#⋅δxt+1\delta \mathbf{q}_{t+1} = J(\mathbf{q}_t)^\# \cdot \delta \mathbf{x}_{t+1}

    6. State Integration: Update the joint coordinates:      qt+1=qt+δqt+1\mathbf{q}_{t+1} = \mathbf{q}_t + \delta \mathbf{q}_{t+1}

    7. True Pose Evaluation: Evaluate actual end-effector pose via forward kinematics: xt+1=f(qt+1)\mathbf{x}_{t+1} = f(\mathbf{q}_{t+1}).

    8. Gain Modulation: Adjust or damp gain kk if tracking errors or velocities exceed operational thresholds.

Orientation Control: Limitations of Euler Angles and Angular Velocity Formulation

  • Direct linear interpolation of three-dimensional orientation parameters cannot be achieved by naively interpolating Euler angles (ϕ,θ,ψ\phi, \theta, \psi).

Euler angle rotation sequence showing coordinate frames
  • Failure Modes of Direct Euler Interpolation:

    • Representational Singularities (Gimbal Lock): When two rotational axes align, a degree of freedom is lost, causing mathematical derivatives to approach infinity.

    • Erratic Physical Trajectories: Interpolating individual Euler angles directly does not produce a straight-line angular transition; the end-effector wobbles and takes wildly unpredictable paths in physical space.

    • Periodic Angle Wraparounds: Abrupt sign switches occur when crossing the boundary of [−π,π][-\pi, \pi], causing numerical discontinuities in the velocity profile.

Axis-angle rotation parameterization
  • The Angular Velocity and Axis-Angle Solution:

    • Orientation kinematics must be resolved via the physical instantaneous angular velocity vector ω\mathbf{\omega}.

    • Under Euler's Rotation Theorem, any arbitrary reorientation between two frames is represented by a single pure rotation through angle θ\theta about a fixed unit directional axis e\mathbf{e}:     θ=θe\mathbf{\theta} = \theta \mathbf{e}

    • By decomposing orientation errors into an instantaneous axis-angle form, rotation can be smoothly interpolated by scaling the angular increment along a stationary axis at each time step.

RMRC for Combined Position and Orientation Control

  • High-level task goals are typically specified using intuitive Euler angles (ϕ∗,θ∗,ψ∗\phi^*, \theta^*, \psi^*), but the internal mathematical controller executes orientation tracking via rotation matrices and axis-angle angular velocity vectors.

  • Algorithmic Execution for Orientation Control:

    1. Measure Current Orientation: Compute the current end-effector orientation as a direction cosine matrix R∈SO(3)R \in SO(3).

    2. Assemble Target Rotation Matrix: Convert target Euler angles (ϕ∗,θ∗,ψ∗\phi^*, \theta^*, \psi^*) into the target rotation matrix R∗R^*.

    3. Calculate Relative Orientation Error Matrix: Determine the rotational transformation required to map the current frame into the target frame:      Rdiff=RTR∗R_{\text{diff}} = R^T R^*      (Here, RdiffR_{\text{diff}} defines the required orientation correction evaluated directly from the perspective of the current end-effector coordinate system).

    4. Extract Axis-Angle Error Vector (ωdiff\mathbf{\omega}_{\text{diff}}): Extract the unnormalized instantaneous rotation vector from the skew-symmetric off-diagonal components of RdiffR_{\text{diff}}:      ωdiff=(Rdiff,3,2−Rdiff,2,3Rdiff,1,3−Rdiff,3,1Rdiff,2,1−Rdiff,1,2)\mathbf{\omega}_{\text{diff}} = \begin{pmatrix} R_{\text{diff}, 3,2} - R_{\text{diff}, 2,3} \\ R_{\text{diff}, 1,3} - R_{\text{diff}, 3,1} \\ R_{\text{diff}, 2,1} - R_{\text{diff}, 1,2} \end{pmatrix}

    5. Scale Angular Increment: Formulate the angular rate command via scaling factor kk:      δω=k⋅ωdiff\delta \mathbf{\omega} = k \cdot \mathbf{\omega}_{\text{diff}}

    6. Map to Joint Displacements: Compute the required joint adjustments via the orientational Jacobian pseudoinverse:      δqt+1=Jω(qt)#⋅δω\delta \mathbf{q}_{t+1} = J_{\omega}(\mathbf{q}_t)^\# \cdot \delta \mathbf{\omega}

    7. Update Joint Variables: Advance configuration state:      qt+1=qt+δqt+1\mathbf{q}_{t+1} = \mathbf{q}_t + \delta \mathbf{q}_{t+1}

Kinematic Redundancy Resolution and Nullspace Stabilization

Redundancy manifold and nullspace projection
  • The Nullspace and Kinematic Drift:

    • While the basic pseudoinverse formulation δq=J#δx\delta \mathbf{q} = J^\# \delta \mathbf{x} successfully drives the end-effector along the reference path, it only optimizes instantaneous local velocities.

    • Across cyclical or long-duration trajectories, pure pseudoinverse control causes numerical and physical drift:

    • The manipulator executes identical task-space paths using completely different internal joint postures on successive cycles.

    • The arm gradually shifts away from ergonomic, central configurations.

    • Joints eventually hit their mechanical hardware end-stops, resulting in kinematic failure or singular lockups.

  • Nullspace Projection Formulation:

    • The nullspace of the Jacobian JJ consists of all internal joint velocity vectors v\mathbf{v} that produce zero motion at the end-effector:     N(J)={v∈Rm∣Jv=0}\mathcal{N}(J) = \{\mathbf{v} \in \mathbb{R}^m \mid J \mathbf{v} = \mathbf{0}\}

    • The orthogonal nullspace projection matrix Pnull∈Rm×mP_{\text{null}} \in \mathbb{R}^{m \times m} is given by:     Pnull=(Im−J#J)P_{\text{null}} = (I_m - J^\# J)

    • Properties of PnullP_{\text{null}}:

    • It projects any arbitrary joint-space vector directly onto the nullspace of JJ.

    • Multiplying by JJ yields zero: J(Im−J#J)=J−(JJ#)J=J−InJ=0J (I_m - J^\# J) = J - (J J^\#) J = J - I_n J = \mathbf{0}.

    • Consequently, any motion commanded through PnullP_{\text{null}} alters the internal posture of the robot without disturbing the position or orientation of the end-effector.

  • Secondary Task Optimization (Posture Stabilization):

    • Define a desired "home" or nominal joint posture qh\mathbf{q}_h (e.g., center of joint travel limits, minimal torque configuration).

    • The augmented redundancy resolution control law is formulated as:     δq=J#δx+(Im−J#J)⋅kh(qh−q)\delta \mathbf{q} = J^\# \delta \mathbf{x} + (I_m - J^\# J) \cdot k_h (\mathbf{q}_h - \mathbf{q})

    • Primary Task (J#δxJ^\# \delta \mathbf{x}): Guarantees exact, high-priority trajectory tracking of the end-effector in operational task space.

    • Secondary Task ((Im−J#J)⋅kh(qh−q)(I_m - J^\# J) \cdot k_h (\mathbf{q}_h - \mathbf{q})): Self-motion continuously pulls the joints toward the preferred home posture qh\mathbf{q}_h using gain khk_h, strictly utilizing internal degrees of freedom without disturbing task-space tracking.

Applications in Virtual Reality, Augmented Reality, and Advanced Interfaces

  • The mathematical principles of differential kinematics and kinematic decoupling apply beyond physical robot manipulators to computational interfaces:

    • Virtual Reality (VR) and Character Rigging: Drives inverse kinematics for avatar limb placement, maintaining physical plausibility and foot-grounding when tracked via sparse sensory inputs (e.g., headset and hand controllers).

    • Augmented Reality (AR) Registration: Maps physical user motions directly to virtual tool interactions while maintaining kinematic stability and preventing visual jitter.

    • Haptic Teleoperation: Resolves high-degree-of-freedom input controllers to multi-link robotic slaves while managing joint limit avoidance and kinematic drift.

    • Spatial Computing Stability: Prevents virtual manipulator models from exhibiting numerical divergence, gimbal lock, or discontinuous posture jumps during live real-time interaction.