SYSTEM.INITIALIZE: BLUEPRINT_UNFOLD
DWG TITLEPORTFOLIO BLUEPRINT
DRAWN BYDINESH KUMAR
SCALE1:1
REVISIONA.02
Back to Articles

Redundancy Resolution and Locomotion Gaits of Hyper-Redundant Snake Robots: Jacobian Pseudoinverse and Obstacle-Aided Motion

An advanced study on the kinematics, redundancy resolution, and locomotive gaits of hyper-redundant snake-like robots, exploring the analytical Jacobian pseudoinverse, obstacle-aided motion mechanics, central pattern generators (CPGs), and hardware implementation dynamics.

Redundancy Resolution and Locomotion Gaits of Hyper-Redundant Snake Robots: Jacobian Pseudoinverse and Obstacle-Aided Motion

Redundancy Resolution and Locomotion Gaits of Hyper-Redundant Snake Robots: Jacobian Pseudoinverse and Obstacle-Aided Motion

Section 1: Introduction and Mathematical Modeling of Kinematic Redundancy

1.1 Biological Inspiration: Ophidian Locomotion and the Engineering Transition

The study of snake locomotion, or ophidian movement, represents one of the most compelling examples of functional morphology and biomechanics in the natural world. Biological snakes (suborder Serpentes) are characterized by a limbless, highly articulated skeletal structure containing between 130 and 500 vertebrae. Each vertebral joint is actuated by a complex, overlapping network of muscles that enables continuous, high-degree-of-freedom deformation. This unique morphology allows snakes to traverse diverse, highly irregular, and unstructured environments—such as dense vegetation, narrow rock crevices, unstable sand dunes, and tree branches—that present impassable obstacles to conventional wheeled, tracked, or legged organisms.

The biological spine of a snake is driven by a sophisticated muscular system consisting of epaxial (above the ribs) and hypaxial (below the ribs) muscle groups. These muscles, such as the semispinalis-spinalis and the longissimus dorsi, span across multiple vertebrae (sometimes up to 30 vertebral segments), creating a highly coordinated system of distributed force generation. This anatomical redundancy allows the snake to smoothly control its curvature profile, distributing pressure evenly along its body to prevent stress concentration at any single joint.

Biological snakes have evolved several distinct locomotion gaits, each optimized for specific substrate conditions and environmental constraints. The four primary gaits include:

  • Lateral Undulation (Serpentine Locomotion): The most common snake gait, characterized by a continuous, wave-like bending of the body that propagates from head to tail. To generate forward thrust, the snake requires lateral contact points (e.g., rocks, twigs, or soil irregularities) against which the body can push. The physical secret behind lateral undulation lies in the anisotropic friction properties of the snake's ventral scales.

    At a microscopic level, scanning electron microscopy (SEM) reveals that these scales are covered by an array of tiny, backward-pointing spiny projections called micro-fibrils. These micro-fibrils typically have a length of $2$ to $5\ \mu\text{m}$, a width of approximately $0.2\ \mu\text{m}$, and a spatial density of around $10^6$ to $10^7$ per square millimeter. When the snake moves forward (longitudinal motion), these fibrils lie flat against the scale surface, resulting in a low sliding friction coefficient (typically $\mu_l \approx 0.1 \text{ to } 0.15$). However, when the body slides laterally or backward (transverse motion), the fibrils bend, stand up, and catch on the micro-roughness of the substrate. This interlocking mechanism creates a high transverse friction coefficient (typically $\mu_t \approx 0.3 \text{ to } 0.5$). The anisotropy ratio $\mu_t / \mu_l$ typically ranges between 2.0 and 5.0 on natural substrates. This difference allows the snake to slip forward along its own body curve while resisting lateral sliding, converting lateral muscular force into net forward propulsion.

    In robotic simulations and dynamic modeling, this anisotropic friction is mathematically represented to capture the interaction between each robot link and the environment. Under a viscous friction model, the friction force $F_{f, i}$ acting on the center of mass of the $i$-th link is formulated as:

    $$ F_{f, i} = -c_l \left( \dot{p}_i^T t_i \right) t_i - c_t \left( \dot{p}_i^T n_i \right) n_i $$

    where $\dot{p}_i \in \mathbb{R}^2$ is the velocity of the center of mass of link $i$, while $t_i = [\cos\phi_i, \sin\phi_i]^T$ and $n_i = [-\sin\phi_i, \cos\phi_i]^T$ are the unit tangent and unit normal vectors to the link's longitudinal axis, respectively. The positive constants $c_l$ and $c_t$ represent the longitudinal and transverse friction coefficients. By enforcing $c_t \gg c_l$, any lateral movement of the link is heavily damped and resisted by the ground, while longitudinal movement along the body curve is permitted with minimal resistance, thereby translating internal joint undulations into net forward translation.

  • Concertina Locomotion: Typically employed in narrow tunnels, crevices, or when climbing vertical surfaces. When using this gait, the snake anchors the posterior part of its body by pressing it laterally against the walls of the channel (creating static contact), then extends the anterior portion forward. Once the anterior section is extended, it is anchored to the walls, and the posterior section is released and pulled forward. This bellows-like motion is energetically expensive but highly effective in confined spaces. The mechanics of concertina locomotion rely on generating a normal wall force $F_n$ large enough to ensure that the static friction limit $\mu_s F_n$ exceeds the gravitational and forward resistive forces acting on the extending body segments. Mathematically, if $M_{ant}$ is the mass of the anterior extended section, and $g$ is the gravitational acceleration, the normal anchoring force $F_n$ must satisfy:
    $$ \mu_s F_n \ge M_{ant} g + F_{res} $$
    where $F_{res}$ represents the resistance of the path ahead. This requires precise coordination between the loop-anchoring muscles and the extending spinal segments.
  • Sidewinding: Optimized for low-friction or highly unstable substrates, such as loose sand. In sidewinding, the snake moves laterally across the ground by lifting sections of its body off the substrate, leaving a series of parallel, diagonal tracks. The body remains in static contact with the ground at only two moving contact zones, minimizing sliding friction and preventing the snake from sinking into loose sand. The physics of sidewinding involve the coordination of two orthogonal waves: a horizontal bending wave and a vertical lifting wave, phase-shifted by $\pi/2$ (or $90^\circ$). The segments in contact with the ground experience zero slipping, which prevents shear failure of the loose substrate and minimizes thermal energy transfer from hot desert sands.
  • Rectilinear Locomotion: Primarily used by heavy-bodied snakes (such as large pythons and boas) for slow, straight-line movement. The snake uses its ribs and ventral skin scales to create linear waves of contraction and expansion that travel from head to tail, pulling the body forward incrementally. This gait relies on the elasticity of the ventral skin and the direct coordination of costocutaneous muscles, allowing the snake to move through narrow passages without lateral body sway.

The engineering transition from biological agents to hyper-redundant serial robots is motivated by the desire to replicate this level of mobility. Traditional robotic systems with a small number of degrees of freedom (DoF) struggle in unstructured environments due to their rigid kinematic constraints. In contrast, a snake-like robot consists of a large number of active links connected in series, providing a massive redundancy of joints. Shigeo Hirose's pioneering work in the 1970s with the construction of the Active Cord Mechanism (ACM-III) demonstrated that serpentine motion could be achieved by using a series of active joints equipped with passive wheels to enforce anisotropic friction constraints. Hirose formulated the serpenoid curve, a mathematical function describing the curvature profile of a planar snake during lateral undulation, showing that a sinusoidal distribution of joint angles generates smooth, natural serpentine gaits. Subsequent work by Gregory Chirikjian and Joel Burdick formalized the "backbone curve" framework, enabling the kinematic analysis of hyper-redundant systems by mapping a continuous virtual backbone curve to a discrete physical link structure.

1.2 Hirose's Serpenoid Curve and Bessel Function Representation

To capture the mathematical essence of lateral undulation, Shigeo Hirose proposed that the body curve of a snake moving on a flat plane can be modeled by a curve whose curvature changes sinusoidally with respect to the arc length. This curve is defined as the serpenoid curve. Let $s' \in [0, S]$ represent the arc length along the backbone curve of the snake, where $S$ is the total body length. The curvature $\kappa(s')$ at any point $s'$ is expressed as:

$$ \kappa(s') = \kappa_0 \sin(a s') $$

where $\kappa_0$ represents the maximum curvature and $a$ is the spatial frequency of the body wave. The angle $\theta_{tan}(s')$ of the tangent vector to the curve at arc length $s'$ relative to the global coordinate axis is obtained by integrating the curvature:

$$ \theta_{tan}(s') = \int_0^{s'} \kappa(u) du + \theta_0 = -\frac{\kappa_0}{a} \cos(a s') + \theta_0 + \frac{\kappa_0}{a} $$

By adjusting the reference frame so that the initial angle term cancels, we can write the tangent angle profile in a simplified form:

$$ \theta_{tan}(s') = \theta_0 \sin(a s') $$

where $\theta_0$ is the winding angle of the serpentine gait, representing the maximum angle that any body segment makes with the net direction of locomotion. The Cartesian coordinates $x(s')$ and $y(s')$ of the points along the snake's body are obtained by integrating the trigonometric functions of the tangent angle:

$$ x(s') = \int_0^{s'} \cos(\theta_{tan}(u)) du = \int_0^{s'} \cos\left( \theta_0 \sin(a u) \right) du $$
$$ y(s') = \int_0^{s'} \sin(\theta_{tan}(u)) du = \int_0^{s'} \sin\left( \theta_0 \sin(a u) \right) du $$

These integrals do not possess simple closed-form expressions in terms of elementary functions. To evaluate them analytically, we employ the Jacobi-Anger expansion, which decomposes trigonometric functions of sine waves into infinite series of Bessel functions of the first kind:

$$ \cos\left( \theta_0 \sin(a u) \right) = J_0(\theta_0) + 2 \sum_{k=1}^\infty J_{2k}(\theta_0) \cos(2k a u) $$
$$ \sin\left( \theta_0 \sin(a u) \right) = 2 \sum_{k=0}^\infty J_{2k+1}(\theta_0) \sin\left( (2k+1) a u \right) $$

where $J_n(\theta_0)$ represents the Bessel function of the first kind of order $n$. Substituting these expansions into the coordinate integrals and performing term-by-term integration yields:

$$ x(s') = J_0(\theta_0) s' + 2 \sum_{k=1}^\infty \frac{J_{2k}(\theta_0)}{2k a} \sin(2k a s') $$
$$ y(s') = 2 \sum_{k=0}^\infty \frac{J_{2k+1}(\theta_0)}{(2k+1) a} \left[ 1 - \cos\left( (2k+1) a s' \right) \right] $$

The term $J_0(\theta_0) s'$ in the $x(s')$ equation represents the linear progression of the snake along the primary axis of motion. Since $|J_0(\theta_0)| \le 1$ for all $\theta_0$, this shows that the forward progress is scaled by the zeroth-order Bessel function, indicating that a larger winding angle $\theta_0$ increases the lateral width of the gait but reduces the forward progress per unit of body length.

1.3 Kinematic Redundancy and Hyper-Redundancy: Mathematical Formulation

To analyze the kinematics of a robotic system, we define the mapping between the configuration space (joint space) and the task space. Let $\mathcal{Q} \subset \mathbb{R}^n$ represent the joint configuration space, where $n$ is the number of independent, active degrees of freedom. A configuration is represented by the joint coordinate vector:

$$ \theta = [\theta_1, \theta_2, \dots, \theta_n]^T \in \mathcal{Q} $$

Let $\mathcal{X} \subset \mathbb{R}^m$ represent the task space, which defines the coordinates of interest for the task (for example, the position and orientation of the end-effector or head of the robot). A task coordinate vector is represented by:

$$ x_e = [x_1, x_2, \dots, x_m]^T \in \mathcal{X} $$

The forward kinematic mapping is a non-linear vector function $f: \mathcal{Q} \to \mathcal{X}$ that maps joint coordinates to task coordinates:

$$ x_e = f(\theta) $$

A robotic manipulator is classified based on the relationship between the joint space dimension $n$ and the task space dimension $m$:

  • Kinematic Redundancy: Occurs when the number of joint degrees of freedom is strictly greater than the number of dimensions required to define the task ($n > m$). The difference $r = n - m$ is defined as the degree of redundancy.
  • Hyper-Redundancy: Occurs when the degree of redundancy is extremely large ($n \gg m$, typically $n \ge 12$ for a 3-dimensional task space where $m = 6$).

The existence of kinematic redundancy has profound topological implications for the configuration space. For a given desired task space target $x_{e,d} \in \mathcal{X}$, the set of all joint configurations $\theta$ that achieve this target is the preimage of $x_{e,d}$ under the mapping $f$:

$$ \mathcal{M}_{\text{self}} = f^{-1}(x_{e,d}) = \{ \theta \in \mathcal{Q} \mid f(\theta) = x_{e,d} \} $$

Under the assumption that $x_{e,d}$ is a regular value of the mapping $f$, the Jacobian matrix $J(\theta) = \frac{\partial f(\theta)}{\partial \theta}$ has full row rank $m$ for all configurations $\theta \in \mathcal{M}_{\text{self}}$. According to the Implicit Function Theorem, the preimage $\mathcal{M}_{\text{self}}$ is a differentiable submanifold of the configuration space $\mathcal{Q}$ of dimension $r = n - m$. This submanifold is known as the self-motion manifold or the fiber of the kinematic map.

Physical Interpretation of the Self-Motion Manifold: The existence of $\mathcal{M}_{\text{self}}$ implies that the robot can continuously vary its joint configuration $\theta$ along trajectories restricted to this manifold without causing any movement of the end-effector in the task space. In other words, the robot can perform "internal self-motions" (such as changing its body shape, avoiding obstacles, or escaping joint limits) while keeping the end-effector perfectly stationary at $x_{e,d}$. The tangent space of the self-motion manifold at any configuration $\theta$ is represented by the null space of the Jacobian matrix, denoted by $\mathcal{N}(J(\theta))$.

1.4 Planar vs. Three-Dimensional Representations

When modeling snake robots, we must choose between planar (2D) and spatial (3D) kinematic representations. The choice represents a trade-off between mathematical simplicity and physical locomotory capability.

Planar Snake Robots: In a planar representation, all joint axes of rotation are assumed to be parallel to one another and perpendicular to the ground plane (typically the $z$-axis). Consequently, the motion of the entire robot is restricted to a 2D plane ($xy$-plane). The task space dimension is typically $m = 2$ (Cartesian position of the end-effector) or $m = 3$ (position and orientation in $SE(2)$).

The advantages of the planar model include:

  1. Simplified Kinematics: Since the joint axes are parallel, the forward kinematics reduce to cumulative 2D rotations, eliminating the need for full $SO(3)$ rotation matrices.
  2. Reduced Dynamic Complexity: The absence of gravitational torque variations out of the plane simplifies the dynamic equations of motion, making it easier to study wave propagation, scale-friction models, and propulsion forces.

However, planar robots are limited in their physical capabilities: they cannot lift sections of their body off the ground to navigate rugged terrain, climb pipes, or perform out-of-plane maneuvers like sidewinding.

Three-Dimensional Snake Robots: A spatial snake robot is typically constructed using a modular architecture with alternating orthogonal joints. For example, joint $1$ rotates about the $z$-axis (yaw), joint $2$ rotates about the $y$-axis (pitch), joint $3$ about the $z$-axis, and so on. This alternating configuration allows the robot to bend in both horizontal and vertical planes simultaneously. The task space is defined in $SE(3)$, with $m = 6$ (three translation dimensions and three orientation dimensions).

Spatial representations are necessary for analyzing complex locomotion gaits such as:

  • Helical climbing: Wrapping the robot's body around a cylinder and propagating a spatial wave to climb vertically.
  • Sidewinding: Coordinating horizontal and vertical waves with a phase shift (typically $90^\circ$) to lift segments of the body dynamically.
  • Obstacle navigation: Climbing over barriers or entering complex 3D pipe structures.

The cost of this spatial capability is a highly non-linear forward kinematic map, a susceptibility to self-collision, and a complex Jacobian matrix with coupling between out-of-plane joint motions.

1.5 Continuous Backbone Curves vs. Discrete Kinematics

In the path planning of hyper-redundant serial robots, analyzing the individual links directly can lead to highly complex formulations due to the large number of joints. To resolve this complexity, Chirikjian and Burdick introduced the continuous backbone curve framework. Rather than planning the motion of each discrete link segment, the robot's shape is modeled using a continuous space curve, and the actual joint angles are extracted by fitting the physical links to this curve.

Let $r(s') \in \mathbb{R}^3$ represent a spatial curve parameterized by the arc length $s' \in [0, S]$, where $S$ is the total length of the snake's body. To completely define the spatial orientation of the snake robot's body along this curve, we attach a local frame $R(s') \in SO(3)$ to each point of the curve. The geometry of the curve is governed by the Frenet-Serret equations or by specifying three continuous deformation functions: extension $u(s')$, curvature functions $\kappa_1(s')$ and $\kappa_2(s')$, and torsion $\tau(s')$.

To constrain the shapes of the backbone curve to a lower-dimensional representation, the deformation functions are expanded using a set of modal shape functions:

$$ \kappa_1(s') = \sum_{j=1}^M a_j \psi_j(s') $$

where $\{\psi_j(s')\}$ is a set of predefined modes (such as Fourier modes, Legendre polynomials, or Chebyshev polynomials), $\{a_j\}$ is a vector of modal participation coefficients, and $M \ll n$ is the number of modes. By restricting the shape of the continuous backbone to a small number of modes $M$, we reduce the dimensionality of the path planning problem. Once the optimal modal coefficients $\{a_j\}$ are computed, the corresponding discrete joint angles $\theta_i$ of the physical robot are calculated by minimizing the geometric fitting error between the physical joints and the continuous curve:

$$ \text{minimize} \quad \sum_{i=1}^N \|p_i(\theta) - r(s'_i)\|^2 $$

where $p_i(\theta)$ is the position of joint $i$ derived from the forward kinematics, and $r(s'_i)$ is the corresponding target point on the continuous backbone curve.

The Sampling-Based Fitting Technique for Planar Kinematics

To understand how the continuous backbone curve is converted into joint angles without executing expensive numerical optimization, let us examine the case of a planar snake robot. Suppose the robot has $N$ rigid links of equal length $L = S/N$. The shape of a continuous planar backbone curve is completely defined by its tangent angle function $\theta_{tan}(s')$ with respect to the horizontal axis, where $s' \in [0, S]$.

We expand the tangent angle function using a modal decomposition over $M$ shape modes:

$$ \theta_{tan}(s') = \sum_{j=1}^M a_j \psi_j(s') $$

where $a_j$ are the modal participation factors and $\psi_j(s')$ are the orthonormal modal shape functions. For example, if we use a Fourier sine basis:

$$ \psi_j(s') = \sin\left( \frac{j \pi s'}{S} \right) $$

The Cartesian coordinates of the points along this continuous curve, $r(s') = [x(s'), y(s')]^T$, are obtained by integrating the tangent vector:

$$ x(s') = \int_0^{s'} \cos\left( \sum_{j=1}^M a_j \psi_j(u) \right) du $$
$$ y(s') = \int_0^{s'} \sin\left( \sum_{j=1}^M a_j \psi_j(u) \right) du $$

Chirikjian and Burdick demonstrated that for a planar, modular hyper-redundant robot, an excellent discrete approximation to the backbone curve can be obtained by directly sampling the continuous tangent angle function at the midpoint of each physical link segment. Specifically, the center of the $i$-th link corresponds to the arc length:

$$ s'_i = \left( i - \frac{1}{2} \right) L = \left( \frac{2i - 1}{2N} \right) S \quad \text{for } i = 1, 2, \dots, N $$

Under this sampling scheme, the absolute orientation $\phi_i$ of the $i$-th link relative to the global $x$-axis is set equal to the continuous tangent angle evaluated at $s'_i$:

$$ \phi_i = \theta_{tan}(s'_i) = \sum_{j=1}^M a_j \psi_j(s'_i) $$

Once the absolute link orientations $\{\phi_i\}$ are determined, the relative joint angles $\{\theta_i\}$ are calculated directly by taking the differences between adjacent link angles:

$$ \theta_1 = \phi_1 = \sum_{j=1}^M a_j \psi_j(s'_1) $$
$$ \theta_i = \phi_i - \phi_{i-1} = \sum_{j=1}^M a_j \left[ \psi_j(s'_i) - \psi_j(s'_{i-1}) \right] \quad \text{for } i = 2, 3, \dots, N $$

This formulation represents a significant breakthrough: it maps the continuous shape space parameters $a = [a_1, \dots, a_M]^T \in \mathbb{R}^M$ directly and algebraically to the joint coordinates $\theta = [\theta_1, \dots, \theta_N]^T \in \mathbb{R}^N$. Since $M \ll N$ (for example, controlling a 30-link robot using only $M = 4$ shape modes), the path planning and control calculations are restricted to a low-dimensional modal space, eliminating the computational complexity associated with high-dimensional joint spaces.

Spatial Aliasing and the Nyquist Constraint in Backbone Fitting

The sampling-based fitting method requires that the discrete link structure has sufficient spatial resolution to represent the shapes defined by the continuous backbone curve. Because sampling the continuous tangent angle $\theta_{tan}(s')$ is equivalent to uniform sampling in the spatial domain, we must consider the effects of spatial aliasing.

According to the Nyquist-Shannon sampling theorem applied to spatial coordinates, to reconstruct a continuous signal containing spatial frequency components up to $f_{\max}$ without aliasing, the sampling frequency $f_s$ must satisfy $f_s > 2 f_{\max}$. In the context of a discrete snake robot:

  • The spatial sampling interval is the link length $L$, which corresponds to a spatial sampling frequency of $f_s = 1/L = N/S$ (samples per unit length).
  • The spatial frequency of the $j$-th shape mode $\psi_j(s') = \sin\left( \frac{j \pi s'}{S} \right)$ is $f_j = \frac{j}{2S}$ (cycles per unit length).
  • The highest spatial frequency component present in the continuous shape profile is $f_{\max} = f_M = \frac{M}{2S}$.

To prevent spatial aliasing—where high-frequency shape modes are folded back and incorrectly reconstructed as low-frequency joint movements—the sampling frequency must exceed the Nyquist rate:

$$ f_s > 2 f_{\max} \implies \frac{N}{S} > 2 \left( \frac{M}{2S} \right) \implies N > M $$

Physically, this constraint dictates that the number of discrete robot links $N$ must be strictly greater than the number of active shape modes $M$. If $N \le M$, the robot lacks the necessary degrees of freedom to replicate the curvature changes of the continuous curve, leading to severe geometric fitting errors and physical distortion of the intended gait. In practice, a higher margin is preferred (such as $N \ge 3M$) to ensure that the discrete links fit the continuous curve smoothly and to minimize the spatial discretization error.

1.6 Kinematics of an N-Link Serial Snake Robot ($N \ge 12$)

Let us formulate the kinematics of a general $N$-link serial snake-like robot. Let $N$ be a large integer representing a hyper-redundant configuration, such as $N \ge 12$. The robot consists of $N$ rigid, homogeneous links connected in series by $N$ revolute joints.

Let us first consider a planar model to establish the analytical framework. Let $l_i$ represent the length of link $i$ (for $i = 1, 2, \dots, N$). The joints are indexed from $1$ to $N$, with joint $1$ connecting the base (or the tail) to the first link, and joint $N$ connecting link $N-1$ to the final link $N$. The configuration of the robot is described by the joint coordinate vector:

$$ \theta = [\theta_1, \theta_2, \dots, \theta_N]^T \in \mathbb{R}^N $$

where $\theta_i$ represents the relative angle between link $i$ and link $i-1$. Let $\theta_1$ represent the absolute orientation of the first link relative to the global coordinate frame's positive $x$-axis.

Let $\phi_i$ represent the absolute orientation of link $i$ relative to the global $x$-axis. The absolute orientation of each link is the cumulative sum of the relative joint angles up to that link:

$$ \phi_i = \sum_{j=1}^i \theta_j $$

Let the origin of the base frame be $p_0 = [x_0, y_0]^T = [0, 0]^T$. The position of the joint $i$ (the connection point between link $i$ and link $i+1$) in the global frame, denoted by $p_i = [x_i, y_i]^T$, is derived recursively:

$$ x_i = x_{i-1} + l_i \cos(\phi_i) = \sum_{k=1}^i l_k \cos\left( \sum_{j=1}^k \theta_j \right) $$
$$ y_i = y_{i-1} + l_i \sin(\phi_i) = \sum_{k=1}^i l_k \sin\left( \sum_{j=1}^k \theta_j \right) $$

The end-effector (or head of the robot) is located at the tip of the $N$-th link. Its position $p_e = [x_e, y_e]^T$ and orientation $\phi_e$ are given by:

$$ x_e = \sum_{i=1}^N l_i \cos\left( \sum_{j=1}^i \theta_j \right) $$
$$ y_e = \sum_{i=1}^N l_i \sin\left( \sum_{j=1}^i \theta_j \right) $$
$$ \phi_e = \sum_{j=1}^N \theta_j $$

Thus, the forward kinematic mapping $f(\theta) = [x_e, y_e, \phi_e]^T$ maps the $N$-dimensional joint space to a 3-dimensional task space ($m = 3$):

$$ f(\theta) = \begin{bmatrix} \sum_{i=1}^N l_i \cos\left( \sum_{j=1}^i \theta_j \right) \\ \sum_{i=1}^N l_i \sin\left( \sum_{j=1}^i \theta_j \right) \\ \sum_{j=1}^N \theta_j \end{bmatrix} $$

For a spatial 3D snake robot, the recursive coordinate transformation uses homogeneous transformation matrices. Let $\{i\}$ be the coordinate frame attached to link $i$. The homogeneous transformation matrix $T_i^{i-1}(\theta_i)$ maps coordinates from frame $\{i\}$ to frame $\{i-1\}$:

$$ T_i^{i-1}(\theta_i) = \begin{bmatrix} R_i^{i-1}(\theta_i) & p_{i/i-1}^{i-1} \\ 0_{1\times3} & 1 \end{bmatrix} $$

where $R_i^{i-1}(\theta_i) \in SO(3)$ is the rotation matrix, and $p_{i/i-1}^{i-1} \in \mathbb{R}^3$ is the translation vector. The cumulative transformation from the end-effector frame $\{N\}$ to the base frame $\{0\}$ is:

$$ T_N^0(\theta) = T_1^0(\theta_1) T_2^1(\theta_2) \dots T_N^{N-1}(\theta_N) = \begin{bmatrix} R_N^0(\theta) & p_e(\theta) \\ 0_{1\times3} & 1 \end{bmatrix} $$

where:

$$ R_N^0(\theta) = \prod_{i=1}^N R_i^{i-1}(\theta_i) $$
$$ p_e(\theta) = \sum_{i=1}^N R_{i-1}^0 p_{i/i-1}^{i-1} $$

with $R_0^0 = I_{3\times3}$ and $R_{i-1}^0 = \prod_{k=1}^{i-1} R_k^{k-1}$.

1.7 The Curse of Dimensionality and the Velocity-Level Redundancy Resolution Paradigm

As the number of links $N$ increases to achieve high adaptability and flexibility, the configuration space $\mathcal{Q}$ grows in dimension. Path planning and trajectory generation for hyper-redundant robots become mathematically and computationally challenging due to the curse of dimensionality.

Consider the task of finding a collision-free path in a configuration space of dimension $N \ge 12$:

  1. Grid-Based Planners: Classical grid-based search methods (e.g., Dijkstra's algorithm, A*) discretize each dimension of the configuration space. If each joint angle is discretized into $k$ intervals, the total number of grid states is $k^N$. For $N = 12$ and a coarse discretization of $k = 10$, the search space contains $10^{12}$ states. Searching this grid requires computational resources that scale exponentially, rendering real-time applications impossible.
  2. Sampling-Based Planners: Algorithms such as Rapidly-exploring Random Trees (RRT) and Probabilistic Roadmaps (PRM) avoid discretization by sampling configurations randomly. While effective at finding paths in high-dimensional spaces, sampling-based methods are computationally expensive and do not guarantee smoothness. The resulting joint trajectories are often jerky, which can excite high-frequency dynamics in the robot's physical structure and cause actuator wear. Enforcing smooth velocities requires post-processing optimization, adding further computational overhead.
  3. Global Trajectory Optimization: Methods that optimize the entire trajectory over a time horizon (e.g., using Pontryagin's Minimum Principle or direct collocation) must solve large-scale non-linear programming (NLP) problems. These methods are prone to local minima and are typically too slow for real-time control loops.

To achieve real-time control, researchers utilize the **velocity-level (differential) redundancy resolution** paradigm. By differentiating the forward kinematic map $x_e = f(\theta)$ with respect to time, we obtain:

$$ \dot{x}_e = \frac{\partial f(\theta)}{\partial \theta} \dot{\theta} = J(\theta) \dot{\theta} $$

where $\dot{x}_e \in \mathbb{R}^m$ is the task space velocity vector, $\dot{\theta} \in \mathbb{R}^n$ is the joint velocity vector, and $J(\theta) \in \mathbb{R}^{m \times n}$ is the Jacobian matrix.

At any given instant, the configuration $\theta$ is known, and $\dot{x}_e = J(\theta) \dot{\theta}$ represents a system of linear equations. Because $n > m$, this linear system is underdetermined, admitting infinitely many solutions for the joint velocities $\dot{\theta}$. Solving this system requires linear algebraic operations (such as computing the pseudoinverse of $J(\theta)$), which scale as $O(n^3)$ using standard matrix operations. For $N = 12$ or even $N = 100$, an $O(n^3)$ computation takes less than a millisecond on a modern processor, enabling real-time control loops operating at 1 kHz.

Furthermore, differential kinematics allows us to naturally incorporate secondary objectives by decomposing the joint velocities into a minimum-norm tracking term and a self-motion term. Using the null-space projection of the Jacobian, we can track the primary task exactly while simultaneously using the internal degrees of freedom to optimize potential functions (e.g., avoiding joint limits, avoiding obstacles, or maintaining high manipulability). This local, linear algebraic formulation bypasses the curse of dimensionality, transforming a global non-linear optimization problem into a sequence of local linear operations.

Section 2: Kinematic Formulations and the Jacobian Matrix

2.1 Denavit-Hartenberg (D-H) Parameterization of a Modular 3D Snake Robot

To establish a systematic kinematic model of a modular 3D snake robot, we employ the Denavit-Hartenberg (D-H) parameterization. The robot is modeled as a serial chain of rigid links connected by revolute joints. To achieve full 3D mobility, the robot features a modular structure with alternating orthogonal joint axes: pitch joints (which allow bending in the vertical plane) and yaw joints (which allow bending in the horizontal plane).

Let us define the coordinate frames according to the standard D-H convention. The $z_{i-1}$ axis is aligned with the axis of rotation of joint $i$. The $x_i$ axis is defined along the common normal from $z_{i-1}$ to $z_i$, pointing from joint $i$ to joint $i+1$. The origin $o_i$ is at the intersection of $z_i$ and $x_i$. The transformation between frame $\{i-1\}$ and frame $\{i\}$ is parameterized by four variables:

  1. Joint angle $\theta_i$: The angle of rotation about $z_{i-1}$, measured from $x_{i-1}$ to $x_i$.
  2. Link offset $d_i$: The distance along $z_{i-1}$ from the origin $o_{i-1}$ to the intersection of the $z_{i-1}$ and $x_i$ axes.
  3. Link length $a_i$: The distance along $x_i$ from the intersection of the $z_{i-1}$ and $x_i$ axes to the origin $o_i$.
  4. Link twist $\alpha_i$: The angle of rotation about $x_i$, measured from $z_{i-1}$ to $z_i$.

Consider a modular 3D snake robot consisting of $N$ modules. Each module has a physical length $L$. We assign a pitch joint (odd indices, $i = 2k-1$) and a yaw joint (even indices, $i = 2k$). The rotation axes of the pitch and yaw joints are perpendicular to each other.

To model this alternating orthogonal structure:

  • The joint axes alternate orientations. For a pitch joint, the axis of rotation $z_{2k-2}$ is horizontal. For a yaw joint, the axis of rotation $z_{2k-1}$ is vertical.
  • To transition the axis orientation, the twist angle $\alpha_i$ alternates between $\pi/2$ and $-\pi/2$.
  • Since the joints are aligned along the longitudinal axis of each module with no lateral offset, the link offsets are $d_i = 0$ for all $i$.
  • The link length $a_i = L$ represents the physical length of each module segment.

The D-H parameters for this modular 3D snake robot are summarized in Table 2:

Table 2: D-H Parameters for a Modular 3D Snake Robot with Pitch-Yaw Joints
Link ($i$) Joint Type Joint Angle ($\theta_i$) Link Offset ($d_i$) Link Length ($a_i$) Link Twist ($\alpha_i$)
1 Pitch $\theta_1$ (Variable) 0 $L$ $\pi/2$
2 Yaw $\theta_2$ (Variable) 0 $L$ $-\pi/2$
3 Pitch $\theta_3$ (Variable) 0 $L$ $\pi/2$
4 Yaw $\theta_4$ (Variable) 0 $L$ $-\pi/2$
$\vdots$ $\vdots$ $\vdots$ $\vdots$ $\vdots$ $\vdots$
$2k-1$ Pitch $\theta_{2k-1}$ (Variable) 0 $L$ $\pi/2$
$2k$ Yaw $\theta_{2k}$ (Variable) 0 $L$ $-\pi/2$
$\vdots$ $\vdots$ $\vdots$ $\vdots$ $\vdots$ $\vdots$
$N$ Pitch/Yaw $\theta_N$ (Variable) 0 $L$ $\alpha_N$

2.2 Derivation of Forward Kinematics via Homogeneous Transformation Matrices

The Homogeneous Transformation Matrix $T_i^{i-1}$ maps vectors from the coordinate frame $\{i\}$ to frame $\{i-1\}$. It is derived by multiplying the individual matrices for each D-H parameter transformation:

$$ T_i^{i-1} = \text{Rot}(z, \theta_i) \cdot \text{Trans}(z, d_i) \cdot \text{Trans}(x, a_i) \cdot \text{Rot}(x, \alpha_i) $$

Substituting the basic transformation matrices:

$$ T_i^{i-1} = \begin{bmatrix} \cos\theta_i & -\sin\theta_i & 0 & 0 \\ \sin\theta_i & \cos\theta_i & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & d_i \\ 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 & a_i \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & \cos\alpha_i & -\sin\alpha_i & 0 \\ 0 & \sin\alpha_i & \cos\alpha_i & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} $$

Let us perform the matrix multiplication in steps:

$$ A_1 = \text{Rot}(z, \theta_i) \cdot \text{Trans}(z, d_i) = \begin{bmatrix} \cos\theta_i & -\sin\theta_i & 0 & 0 \\ \sin\theta_i & \cos\theta_i & 0 & 0 \\ 0 & 0 & 1 & d_i \\ 0 & 0 & 0 & 1 \end{bmatrix} $$
$$ A_2 = A_1 \cdot \text{Trans}(x, a_i) = \begin{bmatrix} \cos\theta_i & -\sin\theta_i & 0 & a_i \cos\theta_i \\ \sin\theta_i & \cos\theta_i & 0 & a_i \sin\theta_i \\ 0 & 0 & 1 & d_i \\ 0 & 0 & 0 & 1 \end{bmatrix} $$
$$ T_i^{i-1} = A_2 \cdot \text{Rot}(x, \alpha_i) = \begin{bmatrix} \cos\theta_i & -\sin\theta_i \cos\alpha_i & \sin\theta_i \sin\alpha_i & a_i \cos\theta_i \\ \sin\theta_i & \cos\theta_i \cos\alpha_i & -\cos\theta_i \sin\alpha_i & a_i \sin\theta_i \\ 0 & \sin\alpha_i & \cos\alpha_i & d_i \\ 0 & 0 & 0 & 1 \end{bmatrix} $$

Substituting the D-H parameters for our modular snake robot ($d_i = 0$, $a_i = L$):

  • For Pitch Joints ($i = 2k-1$, where $\alpha_i = \pi/2$):
    $$ T_{2k-1}^{2k-2} = \begin{bmatrix} \cos\theta_{2k-1} & 0 & \sin\theta_{2k-1} & L \cos\theta_{2k-1} \\ \sin\theta_{2k-1} & 0 & -\cos\theta_{2k-1} & L \sin\theta_{2k-1} \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} $$
  • For Yaw Joints ($i = 2k$, where $\alpha_i = -\pi/2$):
    $$ T_{2k}^{2k-1} = \begin{bmatrix} \cos\theta_{2k} & 0 & -\sin\theta_{2k} & L \cos\theta_{2k} \\ \sin\theta_{2k} & 0 & \cos\theta_{2k} & L \sin\theta_{2k} \\ 0 & -1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} $$

The cumulative transformation matrix from the end-effector frame $\{N\}$ to the base frame $\{0\}$ is:

$$ T_N^0(\theta) = \prod_{i=1}^N T_i^{i-1}(\theta_i) = T_1^0(\theta_1) T_2^1(\theta_2) \dots T_N^{N-1}(\theta_N) = \begin{bmatrix} R_N^0(\theta) & p_e(\theta) \\ 0_{1\times3} & 1 \end{bmatrix} $$

The position of the end-effector in the base coordinate system is extracted from the upper-right $3 \times 1$ subvector of $T_N^0(\theta)$:

$$ p_e(\theta) = \begin{bmatrix} p_x(\theta) \\ p_y(\theta) \\ p_z(\theta) \end{bmatrix} = T_N^0(1:3, 4) $$

The orientation of the end-effector is represented by the rotation matrix $R_N^0(\theta) \in SO(3)$:

$$ R_N^0(\theta) = \begin{bmatrix} n_x(\theta) & s_x(\theta) & a_x(\theta) \\ n_y(\theta) & s_y(\theta) & a_y(\theta) \\ n_z(\theta) & s_z(\theta) & a_z(\theta) \end{bmatrix} $$

To express the task space coordinates in a vector format $x_e = f(\theta)$, we can choose Z-Y-X Euler angles (roll $\phi$, pitch $\theta_y$, yaw $\psi$) to represent the orientation:

$$ x_e = \begin{bmatrix} p_e(\theta) \\ \phi_e(\theta) \end{bmatrix} = \begin{bmatrix} p_x(\theta) \\ p_y(\theta) \\ p_z(\theta) \\ \phi(\theta) \\ \theta_y(\theta) \\ \psi(\theta) \end{bmatrix} \in \mathbb{R}^6 $$

where the Euler angles are extracted from the rotation matrix $R_N^0$:

$$ \theta_y = \text{atan2}\left(-n_z, \sqrt{n_x^2 + n_y^2}\right) $$
$$ \phi = \text{atan2}(s_z, a_z) $$
$$ \psi = \text{atan2}(n_y, n_x) $$

Section 2: Kinematic Formulations and the Jacobian Matrix

2.3 The Jacobian Matrix: Analytical and Geometric Formulations

The relationship between joint velocities and task space velocities is governed by the Jacobian matrix. We must distinguish between the geometric Jacobian $J_g(\theta)$ and the analytical Jacobian $J(\theta)$.

The geometric Jacobian maps joint velocities to the physical linear velocity $v_e \in \mathbb{R}^3$ and angular velocity $\omega_e \in \mathbb{R}^3$ of the end-effector:

$$ \dot{x}_{g} = \begin{bmatrix} v_e \\ \omega_e \end{bmatrix} = J_g(\theta) \dot{\theta} $$

where $J_g(\theta) \in \mathbb{R}^{6 \times N}$. Since all joints of the snake robot are revolute, the $i$-th column of $J_g(\theta)$, denoted by $J_{g,i}$, is:

$$ J_{g,i} = \begin{bmatrix} J_{P,i} \\ J_{O,i} \end{bmatrix} $$

where:

$$ J_{P,i} = z_{i-1} \times (p_e - p_{i-1}) $$
$$ J_{O,i} = z_{i-1} $$

Here, $z_{i-1}$ is the unit vector along the rotation axis of joint $i$, expressed in the base frame. It is the third column of the rotation matrix $R_{i-1}^0$:

$$ z_{i-1} = R_{i-1}^0 \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix} $$

and $p_{i-1}$ is the position vector of the origin of frame $\{i-1\}$ in the base frame, extracted from the first three elements of the fourth column of $T_{i-1}^0$.

Derivation of the Geometric Jacobian columns

Let us prove the column formulations using rigid body kinematics. The position of the end-effector in the base frame is:

$$ p_e = p_{i-1} + R_{i-1}^0 p_{e/i-1}^{i-1} $$

where $p_{e/i-1}^{i-1}$ is the position of the end-effector relative to frame $\{i-1\}$, expressed in frame $\{i-1\}$ coordinates. Differentiating $p_e$ with respect to time, and considering only the motion of joint $i$ (with all other joints locked):

$$ \dot{p}_e^{(i)} = \dot{p}_{i-1} + \dot{R}_{i-1}^0 p_{e/i-1}^{i-1} + R_{i-1}^0 \dot{p}_{e/i-1}^{i-1} $$

Since all preceding joints are locked, $\dot{p}_{i-1} = 0$ and $\dot{R}_{i-1}^0 = 0$. The relative position vector in frame $\{i-1\}$ changes due to the rotation of joint $i$ about the $z$-axis of frame $\{i-1\}$ with velocity $\dot{\theta}_i$. In frame $\{i-1\}$, this velocity is:

$$ \dot{p}_{e/i-1}^{i-1} = \left(\dot{\theta}_i \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix}\right) \times p_{e/i-1}^{i-1} $$

Multiplying by $R_{i-1}^0$ to transform this velocity to the base frame:

$$ \dot{p}_e^{(i)} = R_{i-1}^0 \left( \left(\dot{\theta}_i \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix}\right) \times p_{e/i-1}^{i-1} \right) $$

Using the property that rotation distributes over cross product, i.e., $R(a \times b) = (Ra) \times (Rb)$:

$$ \dot{p}_e^{(i)} = \left( R_{i-1}^0 \left(\dot{\theta}_i \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix}\right) \right) \times \left( R_{i-1}^0 p_{e/i-1}^{i-1} \right) $$

We identify that $R_{i-1}^0 [0, 0, 1]^T = z_{i-1}$ and $R_{i-1}^0 p_{e/i-1}^{i-1} = p_e - p_{i-1}$. Substituting these terms:

$$ \dot{p}_e^{(i)} = \left( \dot{\theta}_i z_{i-1} \right) \times (p_e - p_{i-1}) = \left( z_{i-1} \times (p_e - p_{i-1}) \right) \dot{\theta}_i $$

This proves that the contribution of joint $i$'s velocity to the linear velocity of the end-effector is $J_{P,i} = z_{i-1} \times (p_e - p_{i-1})$. Physically, this represents the cross product of the rotation axis vector $z_{i-1}$ with the lever arm vector $(p_e - p_{i-1})$ from the joint to the end-effector, yielding the tangential velocity direction and magnitude per unit joint speed.

For the angular velocity, the rotation of joint $i$ about $z_{i-1}$ adds an angular velocity component directly along the axis $z_{i-1}$:

$$ \omega_e^{(i)} = z_{i-1} \dot{\theta}_i $$

Thus, $J_{O,i} = z_{i-1}$. Summing the contributions of all joints yields the complete geometric Jacobian $J_g(\theta)$.

Example: Analytical Jacobian of a Three-Link Planar Robot

To make this formulation concrete, let us derive the exact Jacobian matrix for a 3-link planar manipulator ($n = 3$) tracking a 2D position target ($m = 2$). The link lengths are $l_1, l_2, l_3$, and the joint angles are $\theta_1, \theta_2, \theta_3$. The absolute orientation angles of the links are:

$$ \phi_1 = \theta_1, \quad \phi_2 = \theta_1 + \theta_2, \quad \phi_3 = \theta_1 + \theta_2 + \theta_3 $$

The forward kinematic equations for the end-effector position $p_e = [x_e, y_e]^T$ are:

$$ x_e = l_1 \cos(\theta_1) + l_2 \cos(\theta_1 + \theta_2) + l_3 \cos(\theta_1 + \theta_2 + \theta_3) $$
$$ y_e = l_1 \sin(\theta_1) + l_2 \sin(\theta_1 + \theta_2) + l_3 \sin(\theta_1 + \theta_2 + \theta_3) $$

The analytical Jacobian $J(\theta) \in \mathbb{R}^{2 \times 3}$ is obtained by taking the partial derivatives of $x_e$ and $y_e$ with respect to $\theta_1, \theta_2, \theta_3$:

$$ J(\theta) = \begin{bmatrix} \frac{\partial x_e}{\partial \theta_1} & \frac{\partial x_e}{\partial \theta_2} & \frac{\partial x_e}{\partial \theta_3} \\ \frac{\partial y_e}{\partial \theta_1} & \frac{\partial y_e}{\partial \theta_2} & \frac{\partial y_e}{\partial \theta_3} \end{bmatrix} $$

Computing the derivatives:

$$ \frac{\partial x_e}{\partial \theta_1} = -l_1 \sin(\theta_1) - l_2 \sin(\theta_1 + \theta_2) - l_3 \sin(\theta_1 + \theta_2 + \theta_3) $$
$$ \frac{\partial x_e}{\partial \theta_2} = -l_2 \sin(\theta_1 + \theta_2) - l_3 \sin(\theta_1 + \theta_2 + \theta_3) $$
$$ \frac{\partial x_e}{\partial \theta_3} = -l_3 \sin(\theta_1 + \theta_2 + \theta_3) $$
$$ \frac{\partial y_e}{\partial \theta_1} = l_1 \cos(\theta_1) + l_2 \cos(\theta_1 + \theta_2) + l_3 \cos(\theta_1 + \theta_2 + \theta_3) $$
$$ \frac{\partial y_e}{\partial \theta_2} = l_2 \cos(\theta_1 + \theta_2) + l_3 \cos(\theta_1 + \theta_2 + \theta_3) $$
$$ \frac{\partial y_e}{\partial \theta_3} = l_3 \cos(\theta_1 + \theta_2 + \theta_3) $$

This gives the analytical Jacobian:

$$ J(\theta) = \begin{bmatrix} -l_1 s_1 - l_2 s_{12} - l_3 s_{123} & -l_2 s_{12} - l_3 s_{123} & -l_3 s_{123} \\ l_1 c_1 + l_2 c_{12} + l_3 c_{123} & l_2 c_{12} + l_3 c_{123} & l_3 c_{123} \end{bmatrix} $$

where $s_1 = \sin(\theta_1)$, $s_{12} = \sin(\theta_1 + \theta_2)$, $s_{123} = \sin(\theta_1+\theta_2+\theta_3)$, and similarly for the cosine terms. We can check that this matches the geometric Jacobian columns $J_{P,i} = z_{i-1} \times (p_e - p_{i-1})$ where the rotation axes are $z_0 = z_1 = z_2 = [0, 0, 1]^T$.

Analytical Jacobian Formulation

The analytical Jacobian $J(\theta)$ is defined by differentiating the end-effector pose vector $x_e = [p_e^T, \phi_e^T]^T$ with respect to time:

$$ \dot{x}_e = \begin{bmatrix} \dot{p}_e \\ \dot{\phi}_e \end{bmatrix} = J(\theta) \dot{\theta} $$

where $\dot{\phi}_e = [\dot{\phi}, \dot{\theta}_y, \dot{\psi}]^T$ is the vector of Euler angle rates. The relationship between $\dot{\phi}_e$ and the physical angular velocity $\omega_e$ is linear and depends on the current orientation $\phi_e$:

$$ \omega_e = E(\phi_e) \dot{\phi}_e $$

Let us derive $E(\phi_e)$ for Z-Y-X Euler angles (where rotation is defined as $R = R_z(\psi) R_y(\theta_y) R_x(\phi)$). The angular velocity vector $\omega_e$ is the sum of the angular velocity components associated with the rate of change of each angle:

$$ \omega_e = \dot{\psi} z_0 + \dot{\theta}_y y' + \dot{\phi} x'' $$

where:

  • $z_0 = [0, 0, 1]^T$ is the original base $z$-axis.
  • $y' = [-\sin\psi, \cos\psi, 0]^T$ is the intermediate $y$-axis after the yaw rotation $\psi$.
  • $x'' = [\cos\theta_y \cos\psi, \cos\theta_y \sin\psi, -\sin\theta_y]^T$ is the final $x$-axis after the yaw and pitch rotations.

Expressing this sum in matrix form:

$$ \omega_e = \begin{bmatrix} \cos\theta_y \cos\psi & - \sin\psi & 0 \\ \cos\theta_y \sin\psi & \cos\psi & 0 \\ -\sin\theta_y & 0 & 1 \end{bmatrix} \begin{bmatrix} \dot{\phi} \\ \dot{\theta}_y \\ \dot{\psi} \end{bmatrix} $$

Thus, the mapping matrix $E(\phi_e)$ is:

$$ E(\phi_e) = \begin{bmatrix} \cos\theta_y \cos\psi & - \sin\psi & 0 \\ \cos\theta_y \sin\psi & \cos\psi & 0 \\ -\sin\theta_y & 0 & 1 \end{bmatrix} $$

The inverse relationship is:

$$ \dot{\phi}_e = E^{-1}(\phi_e) \omega_e $$

where:

$$ E^{-1}(\phi_e) = \frac{1}{\cos\theta_y} \begin{bmatrix} \cos\psi & \sin\psi & 0 \\ -\cos\theta_y \sin\psi & \cos\theta_y \cos\psi & 0 \\ \cos\psi \sin\theta_y & \sin\psi \sin\theta_y & \cos\theta_y \end{bmatrix} $$

The analytical Jacobian $J(\theta)$ is related to the geometric Jacobian $J_g(\theta)$ by:

$$ J(\theta) = \begin{bmatrix} I_{3\times3} & 0_{3\times3} \\ 0_{3\times3} & E^{-1}(\phi_e) \end{bmatrix} J_g(\theta) $$

Note on Representation Singularities: The analytical Jacobian representation becomes singular when $\cos\theta_y = 0$ (i.e., $\theta_y = \pm \pi/2$), which corresponds to a representation singularity (gimbal lock). In physical robotic control, the geometric Jacobian is preferred because it avoids representation singularities and maps directly to physical velocities.

2.4 Kinematic Singularities and Yoshikawa's Manipulability Measure

A kinematic singularity is a configuration $\theta$ at which the Jacobian matrix $J(\theta) \in \mathbb{R}^{m \times n}$ loses rank:

$$ \text{rank}(J(\theta)) < m $$

At a singular configuration, the robot loses one or more degrees of freedom in the task space. Mathematically, this means the mapping $\dot{\theta} \to \dot{x}_e$ is no longer surjective, and there exists a task space direction along which the end-effector cannot move.

For a hyper-redundant robot, singularities can be classified into:

  1. Boundary Singularities: Occur when the robot is fully stretched out or folded back on itself. In these configurations, the end-effector is at the boundary of its physical workspace, and motion in the direction normal to the boundary is physically impossible.
  2. Internal Singularities: Occur within the workspace when two or more joint axes align, restricting motion in certain directions. For a hyper-redundant robot, because $n \gg m$, the robot has many internal degrees of freedom. This allows the robot to perform self-motions to escape or avoid internal singularities while keeping the end-effector at its desired position.

To quantify a configuration's distance from a singularity, Tsuneo Yoshikawa introduced the manipulability index $w(\theta)$:

$$ w(\theta) = \sqrt{\det(J(\theta) J(\theta)^T)} $$

Let us analyze the mathematical properties and physical meaning of $w(\theta)$. Consider the set of all joint velocities in the unit sphere:

$$ \|\dot{\theta}\|^2 = \dot{\theta}^T \dot{\theta} \le 1 $$

Assuming $J(\theta)$ has full row rank $m$, the minimum-norm joint velocity that achieves a task velocity $\dot{x}_e$ is:

$$ \dot{\theta} = J^+ \dot{x}_e = J^T (J J^T)^{-1} \dot{x}_e $$

Substituting this into the unit sphere inequality:

$$ \dot{\theta}^T \dot{\theta} = \left( J^T (J J^T)^{-1} \dot{x}_e \right)^T \left( J^T (J J^T)^{-1} \dot{x}_e \right) \le 1 $$
$$ \dot{x}_e^T (J J^T)^{-T} J J^T (J J^T)^{-1} \dot{x}_e \le 1 $$
$$ \dot{x}_e^T (J J^T)^{-1} \dot{x}_e \le 1 $$

This inequality defines a hyper-ellipsoid in the task space $\mathbb{R}^m$, known as the manipulability ellipsoid. The eigenvalues and eigenvectors of the symmetric matrix $J J^T \in \mathbb{R}^{m \times m}$ define the principal axes and orientations of this ellipsoid.

Let the singular value decomposition of $J(\theta)$ be:

$$ J = U \Sigma V^T $$

where $U \in \mathbb{R}^{m \times m}$ and $V \in \mathbb{R}^{n \times n}$ are orthogonal matrices, and $\Sigma \in \mathbb{R}^{m \times n}$ contains the singular values $\sigma_1 \ge \sigma_2 \ge \dots \ge \sigma_m \ge 0$. The matrix $J J^T$ is:

$$ J J^T = (U \Sigma V^T)(V \Sigma^T U^T) = U \Sigma \Sigma^T U^T $$

The determinant is:

$$ \det(J J^T) = \det(U \Sigma \Sigma^T U^T) = \det(U) \det(\Sigma \Sigma^T) \det(U^T) = \det(\Sigma \Sigma^T) = \prod_{i=1}^m \sigma_i^2 $$

Therefore, the manipulability index $w(\theta)$ is:

$$ w(\theta) = \sqrt{\prod_{i=1}^m \sigma_i^2} = \prod_{i=1}^m \sigma_i $$

The volume of the manipulability ellipsoid is proportional to the product of its semi-axes, which are the singular values $\sigma_i$. Hence, the manipulability index $w(\theta)$ is directly proportional to the volume of the ellipsoid.

  • When $w(\theta)$ is large, the robot can generate high task-space velocities in all directions with relatively small joint velocities.
  • When $w(\theta) = 0$, at least one singular value is zero, indicating a loss of rank. The ellipsoid collapses along the corresponding direction, and the robot is in a singular configuration.

For a hyper-redundant snake robot, keeping the configuraton far from singularities is essential. The high-dimensional self-motion manifold allows the robot to perform shape adjustments (self-motions) to maximize $w(\theta)$ while keeping the end-effector stationary.

2.5 Alternative Manipulability Measures: Condition Number and Minimum Singular Value

While Yoshikawa's manipulability index $w(\theta)$ is a widely used scalar measure for singularity proximity, it has certain limitations in control design. Because $w(\theta)$ is the product of all singular values, it can remain relatively large even if one of the singular values is very close to zero, provided that the other singular values are exceptionally large. This can lead to situations where the control system fails to recognize that the robot is approaching a singularity along a specific direction.

To address this, two alternative manipulability measures are commonly used:

  1. Minimum Singular Value ($\sigma_{\min}(J)$): The value of $\sigma_{\min}(J)$ represents the distance of the Jacobian matrix from the space of rank-deficient matrices in terms of the spectral norm. It defines the worst-case velocity transmission capability of the robot. If $\sigma_{\min}(J) \to 0$, the robot is approaching a singularity, regardless of how large the other singular values are. Mathematically, it measures the radius of the smallest axis of the manipulability ellipsoid.
  2. Condition Number ($\kappa(J)$): The condition number of the Jacobian matrix is defined as the ratio of the maximum singular value to the minimum singular value:
    $$ \kappa(J) = \|J\|_2 \|J^+\|_2 = \frac{\sigma_{\max}(J)}{\sigma_{\min}(J)} $$
    The condition number ranges from $1$ to $\infty$. A configuration where $\kappa(J) = 1$ is called isotropic. In an isotropic configuration, the manipulability ellipsoid is a perfect sphere, meaning the robot can move its end-effector with equal ease in all directions. If $\kappa(J) \to \infty$, the robot is in a singular configuration. In control systems, minimizing the condition number (or maximizing its reciprocal $\kappa^{-1}(J) \in [0, 1]$) is a robust way to ensure uniform velocity capability and avoid numerical instability in the pseudoinverse calculation.

    A high condition number indicates that command inputs along the weakest axis will be mapped to extremely large joint velocities, while inputs along the strongest axis require virtually no joint motion. This asymmetry can lead to severe joint tracking errors in discrete-time controllers and degrades the numerical accuracy of standard ODE integrators (such as Euler or Runge-Kutta) used in real-time simulation.

From a force transmission perspective, we can define the force manipulability ellipsoid:

$$ F^T (J J^T) F \le 1 $$

where $F \in \mathbb{R}^m$ is the force/torque vector applied at the end-effector, mapped from the joint torques $\tau = J^T F$. The eigenvalues of $J J^T$ are the squared singular values $\sigma_i^2$. This reveals a fundamental duality between velocity and force transmission:

The Force-Velocity Duality: In any given direction in the task space, a high capacity for velocity transmission (large $\sigma_i$) corresponds to a low capacity for force transmission (since $1/\sigma_i$ is small), and vice-versa. Therefore, a robot configuration that is highly agile in one direction is mechanically weak in terms of force output in that same direction. Managing this trade-off is crucial when a snake robot transition from locomotion (requiring agility) to manipulation or bracing against environment features (requiring force).

Section 3: Redundancy Resolution via the Jacobian Pseudoinverse

3.1 Velocity-Level Redundancy Resolution as a Constrained Optimization Problem

For a kinematically redundant robot ($n > m$), the differential kinematic relationship $J(\theta) \dot{\theta} = \dot{x}_e$ represents an underdetermined system of linear equations. To select a unique joint velocity vector $\dot{\theta}$ from the infinite set of valid solutions, we formulate the selection as a constrained optimization problem.

Let us define a quadratic cost function that minimizes the weighted norm of the joint velocities:

$$ g(\dot{\theta}) = \frac{1}{2} \dot{\theta}^T W \dot{\theta} $$

where $W \in \mathbb{R}^{n \times n}$ is a symmetric, positive-definite weighting matrix. The weighting matrix $W$ allows us to penalize the movement of specific joints. For instance, we can assign larger weights to joints near the base of the robot to restrict their motion, or to joints with smaller actuator limits.

The optimization problem is formulated as:

$$ \text{minimize} \quad g(\dot{\theta}) = \frac{1}{2} \dot{\theta}^T W \dot{\theta} $$
$$ \text{subject to} \quad J(\theta) \dot{\theta} = \dot{x}_e $$

We solve this problem using the method of Lagrange multipliers. Let $\lambda \in \mathbb{R}^m$ be the vector of Lagrange multipliers. The Lagrangian function is:

$$ L(\dot{\theta}, \lambda) = \frac{1}{2} \dot{\theta}^T W \dot{\theta} + \lambda^T \left( J(\theta) \dot{\theta} - \dot{x}_e \right) $$

To find the optimal joint velocity vector, we compute the partial derivatives of $L(\dot{\theta}, \lambda)$ with respect to $\dot{\theta}$ and $\lambda$ and set them to zero:

$$ \frac{\partial L}{\partial \dot{\theta}} = W \dot{\theta} + J^T \lambda = 0 \quad \text{--- (Equation 1)} $$
$$ \frac{\partial L}{\partial \lambda} = J \dot{\theta} - \dot{x}_e = 0 \quad \text{--- (Equation 2)} $$

Since $W$ is positive-definite, it is invertible. From Equation 1, we solve for $\dot{\theta}$:

$$ \dot{\theta} = -W^{-1} J^T \lambda \quad \text{--- (Equation 3)} $$

Substituting Equation 3 into the constraint (Equation 2):

$$ J \left( -W^{-1} J^T \lambda \right) = \dot{x}_e $$
$$ - (J W^{-1} J^T) \lambda = \dot{x}_e $$

Since $J$ has full row rank $m$ and $W^{-1}$ is positive-definite, the matrix $(J W^{-1} J^T) \in \mathbb{R}^{m \times m}$ is symmetric, positive-definite, and invertible. Solving for $\lambda$:

$$ \lambda = -(J W^{-1} J^T)^{-1} \dot{x}_e $$

Substituting this back into Equation 3 yields the optimal joint velocity solution:

$$ \dot{\theta} = W^{-1} J^T (J W^{-1} J^T)^{-1} \dot{x}_e $$

This defines the weighted pseudoinverse $J_W^+ \in \mathbb{R}^{n \times m}$:

$$ J_W^+ = W^{-1} J^T (J W^{-1} J^T)^{-1} $$

yielding:

$$ \dot{\theta} = J_W^+ \dot{x}_e $$

3.2 The Moore-Penrose Pseudoinverse and Null-Space Projection

In the unweighted case where $W = I$ (the identity matrix), all joints are penalized equally. The cost function reduces to the squared Euclidean norm of the joint velocities:

$$ g(\dot{\theta}) = \frac{1}{2} \|\dot{\theta}\|^2 $$

Under this condition, the weighted pseudoinverse $J_W^+$ simplifies to the standard Moore-Penrose pseudoinverse $J^+$:

$$ J^+ = J^T (J J^T)^{-1} $$

The joint velocity solution is:

$$ \dot{\theta} = J^+ \dot{x}_e $$

Proof of Minimality of the Moore-Penrose Solution

Let $\dot{\theta}$ be any joint velocity vector satisfying $J \dot{\theta} = \dot{x}_e$. We decompose $\dot{\theta}$ into two components:

$$ \dot{\theta} = \dot{\theta}_p + \dot{\theta}_n $$

where:

$$ \dot{\theta}_p = J^+ \dot{x}_e $$
$$ \dot{\theta}_n = (I - J^+ J) \dot{\theta} $$

Let us verify the properties of these two components:

  1. First, verify that $\dot{\theta}_p$ satisfies the tracking constraint:
    $$ J \dot{\theta}_p = J J^+ \dot{x}_e = J J^T (J J^T)^{-1} \dot{x}_e = I_m \dot{x}_e = \dot{x}_e $$
  2. Second, verify that $\dot{\theta}_n$ lies in the null space of $J$ (i.e., $J \dot{\theta}_n = 0$):
    $$ J \dot{\theta}_n = J (I - J^+ J) \dot{\theta} = (J - J J^+ J) \dot{\theta} $$
    Substituting $J^+ = J^T (J J^T)^{-1}$:
    $$ J J^+ J = J \left( J^T (J J^T)^{-1} \right) J = (J J^T)(J J^T)^{-1} J = I_m J = J $$
    Therefore:
    $$ J \dot{\theta}_n = (J - J) \dot{\theta} = 0 $$
    This confirms that $\dot{\theta}_n \in \mathcal{N}(J)$.
  3. Third, show that $\dot{\theta}_p$ and $\dot{\theta}_n$ are orthogonal:
    $$ \dot{\theta}_p^T \dot{\theta}_n = \left( J^+ \dot{x}_e \right)^T \left( (I - J^+ J) \dot{\theta} \right) = \dot{x}_e^T (J^+)^T (I - J^+ J) \dot{\theta} $$
    Expanding the transpose of the pseudoinverse:
    $$ (J^+)^T = \left( J^T (J J^T)^{-1} \right)^T = (J J^T)^{-T} J = (J J^T)^{-1} J $$
    Substituting this back:
    $$ (J^+)^T (I - J^+ J) = (J J^T)^{-1} J (I - J^T (J J^T)^{-1} J) $$
    $$ = (J J^T)^{-1} J - (J J^T)^{-1} J J^T (J J^T)^{-1} J $$
    $$ = (J J^T)^{-1} J - (J J^T)^{-1} I_m J = 0 $$
    Thus, $\dot{\theta}_p^T \dot{\theta}_n = 0$.

Now, we calculate the squared Euclidean norm of $\dot{\theta}$:

$$ \|\dot{\theta}\|^2 = \|\dot{\theta}_p + \dot{\theta}_n\|^2 = (\dot{\theta}_p + \dot{\theta}_n)^T (\dot{\theta}_p + \dot{\theta}_n) = \dot{\theta}_p^T \dot{\theta}_p + 2 \dot{\theta}_p^T \dot{\theta}_n + \dot{\theta}_n^T \dot{\theta}_n $$

Since the cross-product term is zero:

$$ \|\dot{\theta}\|^2 = \|\dot{\theta}_p\|^2 + \|\dot{\theta}_n\|^2 $$

Because $\|\dot{\theta}_n\|^2 \ge 0$, it follows that:

$$ \|\dot{\theta}\|^2 \ge \|\dot{\theta}_p\|^2 $$

with equality holding if and only if $\dot{\theta}_n = 0$. This completes the proof that $\dot{\theta}_p = J^+ \dot{x}_e$ is the unique solution that minimizes the Euclidean norm of the joint velocities.

Null-Space Projection and the General Redundancy Resolution Solution

The orthogonality between the tracking solution and the null-space components allows us to formulate the general solution to the redundancy resolution problem:

$$ \dot{\theta} = J^+ \dot{x}_e + (I - J^+ J) q_0 $$

where $q_0 \in \mathbb{R}^n$ is an arbitrary joint velocity vector representing a secondary objective, and $P_{\text{null}} = (I - J^+ J) \in \mathbb{R}^{n \times n}$ is the null-space projection operator.

Let us verify that this general solution satisfies the primary tracking constraint for any choice of $q_0$:

$$ J \dot{\theta} = J \left( J^+ \dot{x}_e + (I - J^+ J) q_0 \right) = J J^+ \dot{x}_e + J(I - J^+ J) q_0 = \dot{x}_e + 0 = \dot{x}_e $$

The projection matrix $P_{\text{null}}$ filters out any components of $q_0$ that would cause the end-effector to move, leaving only the "self-motion" components.

The operator $P_{\text{null}} = I - J^+ J$ possesses two key mathematical properties:

  1. Symmetry:
    $$ P_{\text{null}}^T = (I - J^+ J)^T = I - (J^+ J)^T = I - J^T (J^+)^T $$
    Substituting $(J^+)^T = (J J^T)^{-1} J$:
    $$ P_{\text{null}}^T = I - J^T (J J^T)^{-1} J = I - J^+ J = P_{\text{null}} $$
  2. Idempotency:
    $$ P_{\text{null}}^2 = (I - J^+ J)(I - J^+ J) = I - 2 J^+ J + J^+ J J^+ J $$
    Recall that $J^+ J J^+ = J^+$. Multiplying by $J$ on the right:
    $$ J^+ J J^+ J = J^+ J $$
    Substituting this back:
    $$ P_{\text{null}}^2 = I - 2 J^+ J + J^+ J = I - J^+ J = P_{\text{null}} $$

An operator that is both symmetric and idempotent is an orthogonal projection operator. Thus, $P_{\text{null}}$ projects vectors orthogonally onto the null space of the Jacobian.

3.3 Singularity-Robust Pseudoinverse (Damped Least-Squares)

While the Moore-Penrose pseudoinverse provides the minimum-norm joint velocity solution, it suffers from severe numerical instability in the vicinity of kinematic singularities. When the robot configuration $\theta$ approaches a singularity, at least one of the singular values $\sigma_i$ of the Jacobian approaches zero. Since the pseudoinverse contains terms scaling as $1/\sigma_i$, the joint velocities calculated via $\dot{\theta} = J^+ \dot{x}_e$ grow boundlessly. Physically, this leads to actuator saturation, structural vibration, and potential mechanical failure.

To address this issue, we can relax the exact tracking constraint using a multi-objective optimization problem. We define the cost function:

$$ \text{minimize} \quad E(\dot{\theta}) = \frac{1}{2} \|J(\theta) \dot{\theta} - \dot{x}_e\|^2 + \frac{1}{2} k^2 \|\dot{\theta}\|^2 $$

where $k > 0$ is a damping factor. This formulation represents a trade-off: the first term minimizes the tracking error, while the second term (the damping term) penalizes large joint velocities. This approach is mathematically equivalent to Tikhonov regularization or the Levenberg-Marquardt algorithm.

Let us derive the solution by expanding the quadratic terms:

$$ E(\dot{\theta}) = \frac{1}{2} (J \dot{\theta} - \dot{x}_e)^T (J \dot{\theta} - \dot{x}_e) + \frac{1}{2} k^2 \dot{\theta}^T \dot{\theta} $$
$$ E(\dot{\theta}) = \frac{1}{2} \left( \dot{\theta}^T J^T J \dot{\theta} - 2 \dot{\theta}^T J^T \dot{x}_e + \dot{x}_e^T \dot{x}_e \right) + \frac{1}{2} k^2 \dot{\theta}^T \dot{\theta} $$

Differentiating $E(\dot{\theta})$ with respect to the joint velocity vector $\dot{\theta}$ and setting it to zero:

$$ \frac{\partial E}{\partial \dot{\theta}} = J^T J \dot{\theta} - J^T \dot{x}_e + k^2 \dot{\theta} = 0 $$
$$ (J^T J + k^2 I_n) \dot{\theta} = J^T \dot{x}_e $$

Solving for $\dot{\theta}$ yields:

$$ \dot{\theta} = (J^T J + k^2 I_n)^{-1} J^T \dot{x}_e $$

Although this formula is mathematically correct, it requires inverting an $n \times n$ matrix, which is computationally expensive for hyper-redundant robots with a large number of links $n \gg m$. To improve computational efficiency, we use the matrix identity:

$$ (J^T J + k^2 I_n)^{-1} J^T = J^T (J J^T + k^2 I_m)^{-1} $$

Proof of the Damped Pseudoinverse Identity

Let us prove this identity by showing that multiplying both sides by the corresponding inverse terms yields the same result. Let:

$$ X = (J^T J + k^2 I_n)^{-1} J^T \quad \text{and} \quad Y = J^T (J J^T + k^2 I_m)^{-1} $$

We multiply $X$ on the left by $(J^T J + k^2 I_n)$ and $Y$ on the right by $(J J^T + k^2 I_m)$:

$$ (J^T J + k^2 I_n) X (J J^T + k^2 I_m) = J^T (J J^T + k^2 I_m) = J^T J J^T + k^2 J^T $$

Now, performing the same operations for $Y$:

$$ (J^T J + k^2 I_n) Y (J J^T + k^2 I_m) = (J^T J + k^2 I_n) J^T = J^T J J^T + k^2 J^T $$

Since both expressions result in $J^T J J^T + k^2 J^T$, the identity is proven.

Using this identity, the singularity-robust pseudoinverse solution can be written as:

$$ \dot{\theta} = J^T (J J^T + k^2 I_m)^{-1} \dot{x}_e = J^* \dot{x}_e $$

where $J^* = J^T (J J^T + k^2 I_m)^{-1}$ is the singularity-robust pseudoinverse. This formulation only requires inverting an $m \times m$ matrix (typically $6 \times 6$), which is computationally efficient.

Physically, the damped least-squares solution behaves as if virtual linear springs are attached between the end-effector and the target trajectory, while virtual dampers are attached to all joints in the joint space. The damping factor $k$ regulates the stiffness of these virtual joint dampers. Choosing $k$ requires balancing tracking accuracy and joint velocity limits: if $k$ is too small, joint velocities still exceed physical limits near singularities; if $k$ is too large, the tracking error becomes unacceptable even when the robot is far from singularities.

To minimize tracking error in non-singular regions while ensuring stability near singularities, we can dynamically adjust the damping factor $k^2$ based on the manipulability index $w(\theta)$:

$$ k^2 = \begin{cases} 0 & \text{if } w(\theta) \ge w_0 \\ k_0^2 \left( 1 - \frac{w(\theta)}{w_0} \right)^2 & \text{if } w(\theta) < w_0 \end{cases} $$

where $w_0$ is a user-defined threshold and $k_0$ is the maximum damping factor applied at the singularity.

3.4 Formulation of Secondary Objectives

To utilize the null-space projection term, we design the secondary vector $q_0$ using potential functions. Let $H(\theta)$ be a scalar potential function representing a secondary objective we wish to minimize. We set:

$$ q_0 = -k_{\text{sec}} \nabla H(\theta) $$

where $k_{\text{sec}} > 0$ is a scalar gain, and $\nabla H(\theta) \in \mathbb{R}^n$ is the gradient of $H$ with respect to the joint angles:

$$ \nabla H(\theta) = \begin{bmatrix} \frac{\partial H}{\partial \theta_1} & \frac{\partial H}{\partial \theta_2} & \dots & \frac{\partial H}{\partial \theta_n} \end{bmatrix}^T $$

This choice of $q_0$ performs gradient descent on $H(\theta)$ within the null space, driving the joint configuration towards local minima of $H(\theta)$ without affecting the end-effector trajectory. Conversely, to maximize a potential function $w(\theta)$ (such as manipulability), we perform gradient ascent:

$$ q_0 = k_{\text{sec}} \nabla w(\theta) $$

We now formulate three critical secondary objectives for hyper-redundant snake robots:

1. Joint Limit Avoidance

Physical snake robots have mechanical limits on their joint angles. Let the upper and lower limits for joint $i$ be $\theta_{i,\max}$ and $\theta_{i,\min}$, respectively. To prevent joints from reaching these limits, we define a potential function $H(\theta)$ that penalizes proximity to the boundaries.

A standard approach uses a normalized squared distance potential:

$$ H(\theta) = \frac{1}{2N} \sum_{i=1}^N \left( \frac{\theta_i - \bar{\theta}_i}{\theta_{i,\max} - \theta_{i,\min}} \right)^2 $$

where $\bar{\theta}_i$ is the midpoint of the joint range:

$$ \bar{\theta}_i = \frac{\theta_{i,\max} + \theta_{i,\min}}{2} $$

The gradient of this potential function with respect to joint $\theta_i$ is:

$$ \frac{\partial H}{\partial \theta_i} = \frac{1}{N} \frac{\theta_i - \bar{\theta}_i}{(\theta_{i,\max} - \theta_{i,\min})^2} $$

While simple to compute, this potential function remains finite at the limits. To create a strict barrier, we can use a reciprocal barrier potential function:

$$ H(\theta) = \sum_{i=1}^N \frac{(\theta_{i,\max} - \theta_{i,\min})^2}{4(\theta_{i,\max} - \theta_i)(\theta_i - \theta_{i,\min})} $$

This potential function has the following properties:

  • At the midpoint $\theta_i = \bar{\theta}_i$, the potential is $H_i(\bar{\theta}_i) = 1$.
  • As joint $\theta_i$ approaches either limit ($\theta_{i,\max}$ or $\theta_{i,\min}$), the denominator approaches zero, causing the potential to go to infinity ($H_i \to \infty$).

Let us derive the gradient of this barrier potential with respect to $\theta_i$:

$$ \frac{\partial H}{\partial \theta_i} = \frac{\partial}{\partial \theta_i} \left[ \frac{(\theta_{i,\max} - \theta_{i,\min})^2}{4} \left( (\theta_{i,\max} - \theta_i)(\theta_i - \theta_{i,\min}) \right)^{-1} \right] $$

Using the chain and product rules:

$$ \frac{\partial H}{\partial \theta_i} = -\frac{(\theta_{i,\max} - \theta_{i,\min})^2}{4} \cdot \frac{\frac{\partial}{\partial \theta_i} \left[ (\theta_{i,\max} - \theta_i)(\theta_i - \theta_{i,\min}) \right]}{\left( (\theta_{i,\max} - \theta_i)(\theta_i - \theta_{i,\min}) \right)^2} $$

Computing the derivative of the term in brackets:

$$ \frac{\partial}{\partial \theta_i} \left[ (\theta_{i,\max} - \theta_i)(\theta_i - \theta_{i,\min}) \right] = -(\theta_i - \theta_{i,\min}) + (\theta_{i,\max} - \theta_i) = \theta_{i,\max} + \theta_{i,\min} - 2\theta_i $$

Substituting this back:

$$ \frac{\partial H}{\partial \theta_i} = \frac{(\theta_{i,\max} - \theta_{i,\min})^2}{4} \cdot \frac{2\theta_i - \theta_{i,\max} - \theta_{i,\min}}{\left( (\theta_{i,\max} - \theta_i)(\theta_i - \theta_{i,\min}) \right)^2} $$

Alternatively, we can use a logarithmic barrier function, which is commonly used in interior-point optimization methods:

$$ H_{log}(\theta) = -\sum_{i=1}^N \ln\left( \frac{\theta_{i,\max} - \theta_i}{\theta_{i,\max} - \theta_{i,\min}} \right) - \sum_{i=1}^N \ln\left( \frac{\theta_i - \theta_{i,\min}}{\theta_{i,\max} - \theta_{i,\min}} \right) $$

The gradient of this logarithmic barrier function with respect to $\theta_i$ is:

$$ \frac{\partial H_{log}}{\partial \theta_i} = \frac{1}{\theta_{i,\max} - \theta_i} - \frac{1}{\theta_i - \theta_{i,\min}} $$

When $\theta_i = \bar{\theta}_i$ (at the joint midpoint), this gradient becomes zero:

$$ \frac{\partial H_{log}}{\partial \theta_i} = \frac{1}{\theta_{i,\max} - \frac{\theta_{i,\max}+\theta_{i,\min}}{2}} - \frac{1}{\frac{\theta_{i,\max}+\theta_{i,\min}}{2} - \theta_{i,\min}} = \frac{2}{\theta_{i,\max}-\theta_{i,\min}} - \frac{2}{\theta_{i,\max}-\theta_{i,\min}} = 0 $$

This property is ideal: when the joints are centered, the gradient is zero, generating no null-space velocity and leaving the primary task tracking completely unaffected. As a joint approaches its limits, the corresponding gradient term grows rapidly, pushing the joint away from the limit.

Using either barrier gradient in the null-space projection term:

$$ q_0 = -k_{\text{limit}} \nabla H(\theta) $$

effectively prevents the joint coordinates from reaching their physical limits.

2. Singularity Avoidance

To keep the robot far from singular configurations, we maximize Yoshikawa's manipulability index $w(\theta) = \sqrt{\det(J(\theta) J(\theta)^T)}$ by performing gradient ascent:

$$ q_0 = k_{\text{sing}} \nabla w(\theta) $$

To calculate $\nabla w(\theta)$, we need the partial derivatives $\frac{\partial w(\theta)}{\partial \theta_i}$. Let $M(\theta) = J(\theta) J(\theta)^T \in \mathbb{R}^{m \times m}$. Thus, $w(\theta) = \sqrt{\det(M(\theta))}$. Using the chain rule:

$$ \frac{\partial w(\theta)}{\partial \theta_i} = \frac{1}{2\sqrt{\det(M)}} \frac{\partial \det(M)}{\partial \theta_i} = \frac{1}{2w(\theta)} \frac{\partial \det(M)}{\partial \theta_i} $$

According to Jacobi's formula, the derivative of the determinant of a matrix $M$ with respect to a scalar parameter $\theta_i$ is:

$$ \frac{\partial \det(M)}{\partial \theta_i} = \det(M) \text{tr}\left( M^{-1} \frac{\partial M}{\partial \theta_i} \right) $$

Substituting this back:

$$ \frac{\partial w(\theta)}{\partial \theta_i} = \frac{\det(M)}{2w(\theta)} \text{tr}\left( M^{-1} \frac{\partial M}{\partial \theta_i} \right) = \frac{w(\theta)}{2} \text{tr}\left( (J J^T)^{-1} \frac{\partial (J J^T)}{\partial \theta_i} \right) $$

Next, we expand the derivative of the product $J J^T$:

$$ \frac{\partial (J J^T)}{\partial \theta_i} = \frac{\partial J}{\partial \theta_i} J^T + J \left( \frac{\partial J}{\partial \theta_i} \right)^T $$

Using the properties of the trace operator ($\text{tr}(A+B) = \text{tr}(A) + \text{tr}(B)$ and $\text{tr}(A^T) = \text{tr}(A)$):

$$ \text{tr}\left( (J J^T)^{-1} \frac{\partial (J J^T)}{\partial \theta_i} \right) = \text{tr}\left( (J J^T)^{-1} \frac{\partial J}{\partial \theta_i} J^T \right) + \text{tr}\left( (J J^T)^{-1} J \left( \frac{\partial J}{\partial \theta_i} \right)^T \right) $$

Since $(J J^T)^{-1}$ is symmetric:

$$ \text{tr}\left( (J J^T)^{-1} J \left( \frac{\partial J}{\partial \theta_i} \right)^T \right) = \text{tr}\left( \left[ (J J^T)^{-1} J \left( \frac{\partial J}{\partial \theta_i} \right)^T \right]^T \right) = \text{tr}\left( \frac{\partial J}{\partial \theta_i} J^T (J J^T)^{-1} \right) $$

Using the cyclic permutation property of the trace ($\text{tr}(ABC) = \text{tr}(CAB)$):

$$ \text{tr}\left( \frac{\partial J}{\partial \theta_i} J^T (J J^T)^{-1} \right) = \text{tr}\left( (J J^T)^{-1} \frac{\partial J}{\partial \theta_i} J^T \right) $$

Thus, the two terms are identical:

$$ \text{tr}\left( (J J^T)^{-1} \frac{\partial (J J^T)}{\partial \theta_i} \right) = 2 \text{tr}\left( (J J^T)^{-1} \frac{\partial J}{\partial \theta_i} J^T \right) $$

Substituting this result back into the derivative of $w(\theta)$ yields:

$$ \frac{\partial w(\theta)}{\partial \theta_i} = w(\theta) \text{tr}\left( (J J^T)^{-1} \frac{\partial J}{\partial \theta_i} J^T \right) $$

This provides a closed-form analytical expression for the gradient of the manipulability index. It depends on the partial derivative of the Jacobian matrix, $\frac{\partial J}{\partial \theta_i}$.

3.5 Advanced Null-Space Formulations: Analytical Derivatives of the Geometric Jacobian

To evaluate the analytical gradient of the manipulability index without relying on finite differences, we must derive the analytical derivative of the geometric Jacobian matrix, $\frac{\partial J_g}{\partial \theta_j}$.

Let $J_{g, i}$ represent the $i$-th column of the geometric Jacobian $J_g \in \mathbb{R}^{6 \times n}$:

$$ J_{g, i} = \begin{bmatrix} z_{i-1} \times (p_e - p_{i-1}) \\ z_{i-1} \end{bmatrix} $$

We want to compute the partial derivative $\frac{\partial J_{g, i}}{\partial \theta_j}$ for all $i, j \in \{1, 2, \dots, n\}$. We analyze this by considering the topological structure of the serial kinematic chain:

  1. Case 1: $j > i$ (Perturbation is downstream of the joint axis):

    If joint $j$ is downstream of joint $i$, a change in the joint angle $\theta_j$ does not affect the orientation of the joint axis $z_{i-1}$ or the position of the joint origin $p_{i-1}$. However, it does affect the position of the end-effector $p_e$. Thus:

    $$ \frac{\partial z_{i-1}}{\partial \theta_j} = 0 \quad \text{and} \quad \frac{\partial p_{i-1}}{\partial \theta_j} = 0 $$
    Applying these derivatives to the column vector:
    $$ \frac{\partial J_{g, i}}{\partial \theta_j} = \begin{bmatrix} z_{i-1} \times \frac{\partial p_e}{\partial \theta_j} \\ 0_{3\times1} \end{bmatrix} $$
    Recall that the derivative of the end-effector position with respect to joint $\theta_j$ is the linear velocity column of the Jacobian:
    $$ \frac{\partial p_e}{\partial \theta_j} = z_{j-1} \times (p_e - p_{j-1}) $$
    Substituting this back:
    $$ \frac{\partial J_{g, i}}{\partial \theta_j} = \begin{bmatrix} z_{i-1} \times \left( z_{j-1} \times (p_e - p_{j-1}) \right) \\ 0_{3\times1} \end{bmatrix} \quad \text{for } j > i $$
  2. Case 2: $j \le i$ (Perturbation is upstream of the joint axis):

    If joint $j$ is upstream of (or equal to) joint $i$, a rotation of joint $j$ rotates the entire downstream kinematic chain, including the axis $z_{i-1}$, the position $p_{i-1}$, and the end-effector position $p_e$, as a rigid body about the axis $z_{j-1}$.

    For any vector $v$ that is rigidly attached to the chain downstream of joint $j$, its derivative with respect to $\theta_j$ is:
    $$ \frac{\partial v}{\partial \theta_j} = z_{j-1} \times v $$
    Applying this rule to the unit vector $z_{i-1}$ and the relative position vectors:
    $$ \frac{\partial z_{i-1}}{\partial \theta_j} = z_{j-1} \times z_{i-1} $$
    $$ \frac{\partial p_{i-1}}{\partial \theta_j} = z_{j-1} \times (p_{i-1} - p_{j-1}) $$
    $$ \frac{\partial p_e}{\partial \theta_j} = z_{j-1} \times (p_e - p_{j-1}) $$
    We derive the derivative of the linear velocity term $J_{P, i} = z_{i-1} \times (p_e - p_{i-1})$ using the product rule:
    $$ \frac{\partial J_{P, i}}{\partial \theta_j} = \frac{\partial z_{i-1}}{\partial \theta_j} \times (p_e - p_{i-1}) + z_{i-1} \times \left( \frac{\partial p_e}{\partial \theta_j} - \frac{\partial p_{i-1}}{\partial \theta_j} \right) $$
    Substituting the derivatives:
    $$ \frac{\partial J_{P, i}}{\partial \theta_j} = (z_{j-1} \times z_{i-1}) \times (p_e - p_{i-1}) + z_{i-1} \times \left[ z_{j-1} \times (p_e - p_{j-1}) - z_{j-1} \times (p_{i-1} - p_{j-1}) \right] $$
    Using the linearity of the cross product:
    $$ \frac{\partial J_{P, i}}{\partial \theta_j} = (z_{j-1} \times z_{i-1}) \times (p_e - p_{i-1}) + z_{i-1} \times \left[ z_{j-1} \times (p_e - p_{i-1}) \right] $$
    Thus, the column derivative is:
    $$ \frac{\partial J_{g, i}}{\partial \theta_j} = \begin{bmatrix} (z_{j-1} \times z_{i-1}) \times (p_e - p_{i-1}) + z_{i-1} \times \left[ z_{j-1} \times (p_e - p_{i-1}) \right] \\ z_{j-1} \times z_{i-1} \end{bmatrix} \quad \text{for } j \le i $$

These expressions provide the exact analytical derivatives of the geometric Jacobian. This avoids the numerical errors associated with finite difference approximations, ensuring stable control updates when maximizing manipulability in the null space.

3. Obstacle Avoidance

To prevent the snake robot's body from colliding with workspace obstacles, we implement artificial potential fields. Let $x_{\text{obs}} \in \mathbb{R}^3$ be the coordinates of an obstacle.

Because a snake robot has a distributed body, we must protect the entire structure from collisions rather than just the end-effector. We select a set of $K$ control points distributed along the robot's body. Let $x_k(\theta) \in \mathbb{R}^3$ represent the position of the $k$-th control point (for example, at the center of mass of link $k$).

For each control point $x_k$ and obstacle $x_{\text{obs}}$, the distance is:

$$ d(x_k, x_{\text{obs}}) = \|x_k(\theta) - x_{\text{obs}}\| $$

We define a repulsive potential $U_{\text{obs}, k}(\theta)$ that increases as the control point approaches the obstacle:

$$ U_{\text{obs}, k}(\theta) = \begin{cases} \frac{1}{2} \eta \left( \frac{1}{d(x_k(\theta), x_{\text{obs}})} - \frac{1}{\rho_0} \right)^2 & \text{if } d(x_k(\theta), x_{\text{obs}}) \le \rho_0 \\ 0 & \text{if } d(x_k(\theta), x_{\text{obs}}) > \rho_0 \end{cases} $$

where $\eta > 0$ is a scaling gain and $\rho_0 > 0$ is the barrier's influence distance. The total obstacle potential is:

$$ U_{\text{obs}}(\theta) = \sum_{k=1}^K U_{\text{obs}, k}(\theta) $$

To minimize this potential, we perform gradient descent in the null space:

$$ q_0 = -k_{\text{obs}} \nabla U_{\text{obs}}(\theta) $$

We calculate the gradient $\nabla U_{\text{obs}, k}(\theta)$ using the chain rule:

$$ \nabla_{\theta} U_{\text{obs}, k} = \left( \frac{\partial x_k(\theta)}{\partial \theta} \right)^T \nabla_{x_k} U_{\text{obs}, k} = J_k^T(\theta) \nabla_{x_k} U_{\text{obs}, k} $$

where:

  • $J_k(\theta) = \frac{\partial x_k(\theta)}{\partial \theta} \in \mathbb{R}^{3 \times n}$ is the position Jacobian of control point $x_k$. Note that since $x_k$ is located on link $k$, its position depends only on the first $k$ joint variables. Thus, columns $k+1$ to $N$ of $J_k(\theta)$ are zero vectors.
  • $\nabla_{x_k} U_{\text{obs}, k}$ is the gradient of the potential with respect to the Cartesian coordinates of $x_k$:
    $$ \nabla_{x_k} U_{\text{obs}, k} = \frac{\partial}{\partial x_k} \left[ \frac{1}{2} \eta \left( \frac{1}{\|x_k - x_{\text{obs}}\|} - \frac{1}{\rho_0} \right)^2 \right] $$
    Letting $d = \|x_k - x_{\text{obs}}\|$:
    $$ \nabla_{x_k} U_{\text{obs}, k} = \eta \left( \frac{1}{d} - \frac{1}{\rho_0} \right) \frac{\partial}{\partial x_k} \left( \frac{1}{\|x_k - x_{\text{obs}}\|} \right) $$
    Since:
    $$ \frac{\partial}{\partial x_k} \left( \frac{1}{\|x_k - x_{\text{obs}}\|} \right) = -\frac{x_k - x_{\text{obs}}}{d^3} $$
    We have:
    $$ \nabla_{x_k} U_{\text{obs}, k} = -\eta \left( \frac{1}{d} - \frac{1}{\rho_0} \right) \frac{x_k - x_{\text{obs}}}{d^3} $$

Substituting this back into the joint-space gradient:

$$ \nabla_{\theta} U_{\text{obs}, k} = -J_k^T(\theta) \eta \left( \frac{1}{d(x_k, x_{\text{obs}})} - \frac{1}{\rho_0} \right) \frac{x_k(\theta) - x_{\text{obs}}}{d^3(x_k, x_{\text{obs}})} $$

The total gradient is:

$$ \nabla_{\theta} U_{\text{obs}}(\theta) = -\sum_{k=1}^K J_k^T(\theta) \eta \left( \frac{1}{d(x_k, x_{\text{obs}})} - \frac{1}{\rho_0} \right) \frac{x_k - x_{\text{obs}}}{d^3} $$

Thus, the obstacle avoidance null-space vector is:

$$ q_0 = k_{\text{obs}} \sum_{k=1}^K J_k^T(\theta) \eta \left( \frac{1}{d(x_k, x_{\text{obs}})} - \frac{1}{\rho_0} \right) \frac{x_k - x_{\text{obs}}}{d^3} $$

In practical implementations, to find the closest point $x_k$ on a cylindrical link segment $[p_{i-1}, p_i]$ to a spherical obstacle $x_{\text{obs}}$, we project the obstacle position orthogonally onto the line segment representing the link axis. Let $u = \frac{p_i - p_{i-1}}{\|p_i - p_{i-1}\|}$ be the unit direction vector of the link. The projection parameter $t$ is:

$$ t = \frac{(x_{\text{obs}} - p_{i-1})^T (p_i - p_{i-1})}{\|p_i - p_{i-1}\|^2} $$

We clamp $t$ to the range $[0, 1]$ to ensure the point lies within the physical link boundaries:

$$ t^* = \max\left(0, \min(1, t)\right) $$

The closest point on the link axis to the obstacle is:

$$ x_k(\theta) = p_{i-1} + t^* (p_i - p_{i-1}) $$

By evaluating the Jacobian $J_k(\theta)$ of this dynamically selected closest point, the obstacle avoidance vector $q_0$ pushes the link away from the obstacle.

4. Hierarchical Redundancy Resolution (Multi-Task Framework)

When a hyper-redundant robot must perform multiple secondary tasks simultaneously (e.g., tracking a trajectory while avoiding obstacles and avoiding joint limits), simply summing the null-space vectors $q_0 = q_{0, \text{obs}} + q_{0, \text{limit}} + q_{0, \text{sing}}$ can cause conflicts. For instance, the joint limit avoidance task might push a link into an obstacle, or vice versa.

To resolve this, we utilize a hierarchical redundancy resolution framework based on task priorities. Let the tasks be ordered by priority, where Task 1 is the primary end-effector tracking task, Task 2 is obstacle avoidance (highest secondary priority), and Task 3 is joint limit avoidance.

The joint velocity vector is computed recursively:

$$ \dot{\theta}_1 = J_1^+ \dot{x}_{1, d} $$
$$ \dot{\theta}_k = \dot{\theta}_{k-1} + (J_k P_{k-1})^+ \left( \dot{x}_{k, d} - J_k \dot{\theta}_{k-1} \right) \quad \text{for } k = 2, 3, \dots $$

where $J_k$ is the Jacobian of the $k$-th task, $\dot{x}_{k, d}$ is the desired velocity for the $k$-th task, and $P_{k-1}$ is the orthogonal projector onto the intersection of the null spaces of all higher-priority tasks from $1$ to $k-1$:

$$ P_i = P_{i-1} - (J_i P_{i-1})^+ (J_i P_{i-1}) $$

with $P_0 = I$. This recursive formulation ensures that lower-priority tasks are executed entirely within the null spaces of all higher-priority tasks. As a result, the robot will prioritize avoiding obstacles over avoiding joint limits, and both tasks are guaranteed not to interfere with the primary tracking of the end-effector.

Diagram 1: Lateral Undulation Traveling Wave Gait

Locomotion (v_f) Wave Propagation (v_w) Sinusoidal Reference Path: y(x,t) = A sin(kx - ωt)

Figure 1: Lateral undulation uses backward-propagating lateral bending waves (v_w) to generate forward propulsion (v_f) through interaction with the environment.

Diagram 2: Obstacle-Aided Locomotion Contact Force Resolution

F_n F_f F_p F_n F_f F_p F_n F_f F_p F_n F_f F_p Motion Direction Normal Contact Force (F_n) Tangential Friction (F_f) Net Propulsive Force (F_p)

Figure 2: Obstacle-aided locomotion resolves contact forces normal (F_n) and tangential (F_f) to the snake body at obstacle pins. The vector sum produces a net propulsive force (F_p) driving the robot forward.

Diagram 3: Sidewinding Locomotion Gait (Dual-Wave Phase Relation)

TOP VIEW (HORIZONTAL WAVE & SAND TRACKS) SIDE VIEW (VERTICAL WAVE & GROUND CLEARANCE) Sidewinding Direction PHASE SHIFT Δφ = 90° (π/2) Horizontal Wave: y(t) = A sin(ωt - kx) | Vertical Wave: z(t) = B cos(ωt - kx)

Figure 3: Sidewinding gait combines horizontal (lateral) and vertical bending waves with a 90° phase shift, lifting segments over the ground and laying them down in diagonal static contact tracks.

Diagram 4: Kinematic Model & D-H Parameters of a Modular Segment

Z_i-1 X_i-1 Y_i-1 Z_i (Yaw) X_i Y_i Z_i+1 X_i+1 Y_i+1 Link Length a_i-1 Link Length a_i θ_i (Yaw) θ_i-1 (Pitch) D-H Parameters Table Link θ_i d_i a_i α_i i - 1 (Pitch) θ_i-1 0 a_i-1 90° i (Yaw) θ_i 0 a_i 90° Modular Connection: Alternating Orthogonal Joint Coordinate Frames

Figure 4: Kinematic structure of a modular 3D snake robot segment showing coordinate frame assignments. Joint axes (Z_i) alternate by 90° (α_i = 90°) to provide pitch and yaw degrees of freedom.

4. Numerical Worked Example: 12-Link Planar Snake Robot

To bridge the theoretical framework of kinematic redundancy resolution with physical intuition, we present a comprehensive, step-by-step numerical worked example for a planar hyper-redundant snake robot. Planar snake robots represent a classic class of underactuated or redundant systems where the coordination of multiple degrees of freedom (DoFs) is required to achieve target end-effector trajectories. In this example, we consider a robot consisting of $N = 12$ rigid, homogeneous links connected by $N = 12$ revolute joints. The robot moves in a 2D horizontal plane, meaning the workspace dimension is $m = 2$ (representing the $x$ and $y$ Cartesian coordinates of the end-effector), which results in a high degree of kinematic redundancy ($N - m = 10$).

4.1. Link Geometry and Configuration Profile

Let each link have an identical length of $L_i = 0.1\text{ m}$ for all $i = 1, 2, \dots, 12$. The total physical length of the snake robot is therefore $L_{total} = 1.2\text{ m}$. The position of the base (the tail or head, designated as joint 0) is anchored at the origin of the global coordinate frame, $P_0 = [x_0, y_0]^T = [0, 0]^T$. The configuration of the robot is fully specified by the joint angle vector $\theta = [\theta_1, \theta_2, \dots, \theta_{12}]^T \in \mathbb{R}^{12}$, where $\theta_i$ represents the relative angle of link $i$ with respect to link $i-1$.

To simulate a realistic, snake-like posture, we define the joint angles using a discretized spatial sinusoidal shape profile. This configuration profile approximates the body shape of a snake during lateral undulation, where joint angles alternate in a wave-like pattern. Mathematically, the joint angles are defined as:

$$ \theta_i = A \sin\left(\frac{2\pi}{8} i\right) \quad \text{for } i = 1, 2, \dots, 12 $$
where the amplitude of the joint oscillation is chosen as $A = 0.4\text{ rad}$ (approximately $22.92^\circ$). The spatial frequency parameter is selected such that a full wave cycle is distributed over 8 links. Evaluating this expression yields the numerical values for the joint vector $\theta$ shown in Table 4.1.

Joint Index ($i$) Relative Angle $\theta_i$ (rad) Relative Angle $\theta_i$ (deg) Absolute Orientation $\phi_i$ (rad) Absolute Orientation $\phi_i$ (deg)
1 0.282843 16.21 0.282843 16.21
2 0.400000 22.92 0.682843 39.12
3 0.282843 16.21 0.965685 55.33
4 0.000000 0.00 0.965685 55.33
5 -0.282843 -16.21 0.682843 39.12
6 -0.400000 -22.92 0.282843 16.21
7 -0.282843 -16.21 0.000000 0.00
8 0.000000 0.00 0.000000 0.00
9 0.282843 16.21 0.282843 16.21
10 0.400000 22.92 0.682843 39.12
11 0.282843 16.21 0.965685 55.33
12 0.000000 0.00 0.965685 55.33

4.2. Forward Kinematics Derivation

For a planar open-chain kinematic mechanism, the absolute orientation of link $i$ relative to the global positive $x$-axis is denoted by $\phi_i$. Since joint angles are relative rotations between successive links, the absolute orientation of any link $i$ is the cumulative sum of the relative joint angles from the base up to that link:

$$ \phi_i = \sum_{j=1}^{i} \theta_j $$
Letting $P_i = [x_i, y_i]^T$ denote the Cartesian coordinates of the distal end of link $i$ (which also acts as the location of joint $i$), the recursive forward kinematics equations are:
$$ x_i = x_{i-1} + L_i \cos(\phi_i) $$
$$ y_i = y_{i-1} + L_i \sin(\phi_i) $$
Given $P_0 = [0, 0]^T$ and $L_i = 0.1\text{ m}$, we propagate the coordinates of each joint link step-by-step using these relations:

  • Link 1: $\phi_1 = 0.282843\text{ rad}$.
    $$ x_1 = 0 + 0.1 \cos(0.282843) = 0.096027\text{ m} $$
    $$ y_1 = 0 + 0.1 \sin(0.282843) = 0.027909\text{ m} $$
    $P_1 = (0.096027, 0.027909)$
  • Link 2: $\phi_2 = 0.682843\text{ rad}$.
    $$ x_2 = 0.096027 + 0.1 \cos(0.682843) = 0.173605\text{ m} $$
    $$ y_2 = 0.027909 + 0.1 \sin(0.682843) = 0.091009\text{ m} $$
    $P_2 = (0.173605, 0.091009)$
  • Link 3: $\phi_3 = 0.965685\text{ rad}$.
    $$ x_3 = 0.173605 + 0.1 \cos(0.965685) = 0.230490\text{ m} $$
    $$ y_3 = 0.091009 + 0.1 \sin(0.965685) = 0.173253\text{ m} $$
    $P_3 = (0.230490, 0.173253)$
  • Link 4: $\phi_4 = 0.965685\text{ rad}$.
    $$ x_4 = 0.230490 + 0.1 \cos(0.965685) = 0.287375\text{ m} $$
    $$ y_4 = 0.173253 + 0.1 \sin(0.965685) = 0.255497\text{ m} $$
    $P_4 = (0.287375, 0.255497)$
  • Link 5: $\phi_5 = 0.682843\text{ rad}$.
    $$ x_5 = 0.287375 + 0.1 \cos(0.682843) = 0.364954\text{ m} $$
    $$ y_5 = 0.255497 + 0.1 \sin(0.682843) = 0.318597\text{ m} $$
    $P_5 = (0.364954, 0.318597)$
  • Link 6: $\phi_6 = 0.282843\text{ rad}$.
    $$ x_6 = 0.364954 + 0.1 \cos(0.282843) = 0.460980\text{ m} $$
    $$ y_6 = 0.318597 + 0.1 \sin(0.282843) = 0.346505\text{ m} $$
    $P_6 = (0.460980, 0.346505)$
  • Link 7: $\phi_7 = 0.000000\text{ rad}$.
    $$ x_7 = 0.460980 + 0.1 \cos(0) = 0.560980\text{ m} $$
    $$ y_7 = 0.346505 + 0.1 \sin(0) = 0.346505\text{ m} $$
    $P_7 = (0.560980, 0.346505)$
  • Link 8: $\phi_8 = 0.000000\text{ rad}$.
    $$ x_8 = 0.560980 + 0.1 \cos(0) = 0.660980\text{ m} $$
    $$ y_8 = 0.346505 + 0.1 \sin(0) = 0.346505\text{ m} $$
    $P_8 = (0.660980, 0.346505)$
  • Link 9: $\phi_9 = 0.282843\text{ rad}$.
    $$ x_9 = 0.660980 + 0.1 \cos(0.282843) = 0.757007\text{ m} $$
    $$ y_9 = 0.346505 + 0.1 \sin(0.282843) = 0.374414\text{ m} $$
    $P_9 = (0.757007, 0.374414)$
  • Link 10: $\phi_{10} = 0.682843\text{ rad}$.
    $$ x_{10} = 0.757007 + 0.1 \cos(0.682843) = 0.834585\text{ m} $$
    $$ y_{10} = 0.374414 + 0.1 \sin(0.682843) = 0.437514\text{ m} $$
    $P_{10} = (0.834585, 0.437514)$
  • Link 11: $\phi_{11} = 0.965685\text{ rad}$.
    $$ x_{11} = 0.834585 + 0.1 \cos(0.965685) = 0.891470\text{ m} $$
    $$ y_{11} = 0.437514 + 0.1 \sin(0.965685) = 0.519758\text{ m} $$
    $P_{11} = (0.891470, 0.519758)$
  • Link 12: $\phi_{12} = 0.965685\text{ rad}$.
    $$ x_{12} = 0.891470 + 0.1 \cos(0.965685) = 0.948356\text{ m} $$
    $$ y_{12} = 0.519758 + 0.1 \sin(0.965685) = 0.602002\text{ m} $$
    $P_{12} = (0.948356, 0.602002)$

The position of the end-effector (distal end of the 12th link) is therefore:

$$ x_e = \begin{bmatrix} x_e \\ y_e \end{bmatrix} = P_{12} = \begin{bmatrix} 0.948356 \\ 0.602002 \end{bmatrix} \text{ meters} $$
This final Cartesian coordinate vector represents the static forward kinematics solution for the given configuration $\theta$.

4.3. Analytical Jacobian Matrix Formulation

The analytical Jacobian $J(\theta) \in \mathbb{R}^{2 \times 12}$ relates joint velocity space $\dot{\theta}$ to the Cartesian velocity of the end-effector $\dot{x}_e$:

$$ \dot{x}_e = J(\theta) \dot{\theta} $$
To find the elements of $J(\theta)$, we write the coordinates of the end-effector as functions of the joint angles:
$$ x_e = \sum_{j=1}^{12} L_j \cos(\phi_j) = \sum_{j=1}^{12} L_j \cos\left( \sum_{k=1}^{j} \theta_k \right) $$
$$ y_e = \sum_{j=1}^{12} L_j \sin(\phi_j) = \sum_{j=1}^{12} L_j \sin\left( \sum_{k=1}^{j} \theta_k \right) $$
We take partial derivatives of these positions with respect to the relative joint angles $\theta_i$. By applying the chain rule, a change in joint angle $\theta_i$ affects the absolute orientation $\phi_j$ of all subsequent links $j \ge i$. Therefore, we have:
$$ J_{1,i} = \frac{\partial x_e}{\partial \theta_i} = -\sum_{j=i}^{12} L_j \sin(\phi_j) $$
$$ J_{2,i} = \frac{\partial y_e}{\partial \theta_i} = \sum_{j=i}^{12} L_j \cos(\phi_j) $$
These expressions have a clear physical interpretation. The column vector $J_i = [J_{1,i}, J_{2,i}]^T$ represents the linear velocity of the end-effector produced by a unit angular velocity at joint $i$. Geometrically, it is perpendicular to the vector pointing from joint $i-1$ (the axis of rotation) to the end-effector. Mathematically, it corresponds to the cross product $\hat{z} \times (P_e - P_{i-1})$, where $\hat{z}$ is the joint rotation axis unit vector perpendicular to the planar motion.

Evaluating these partial sums using the numerical absolute orientations $\phi_j$ and $L_j = 0.1\text{ m}$ yields the following analytical Jacobian matrix:

$$ J = \begin{bmatrix} -0.602002 & -0.574093 & -0.510993 & -0.428749 & -0.346505 & -0.283405 & -0.255497 & -0.255497 & -0.255497 & -0.227588 & -0.164488 & -0.082244 \\ 0.948356 & 0.852329 & 0.774751 & 0.717866 & 0.660980 & 0.583402 & 0.487375 & 0.387375 & 0.287375 & 0.191349 & 0.113771 & 0.056885 \end{bmatrix} $$

4.4. Moore-Penrose Pseudoinverse Calculation

When a robot is kinematically redundant ($N > m$) and the Jacobian $J$ is of full row rank, the system of equations $J \dot{\theta} = \dot{x}_e$ has infinitely many solutions. The Moore-Penrose pseudoinverse $J^+ \in \mathbb{R}^{12 \times 2}$ is the unique operator that yields the joint velocity vector minimizing the Euclidean norm $||\dot{\theta}||_2$. This minimum-norm solution is formulated as:

$$ J^+ = J^T (J J^T)^{-1} $$
Let us compute the components of this pseudoinverse step-by-step. First, we compute the symmetric matrix product $J J^T \in \mathbb{R}^{2 \times 2}$. The elements of this matrix are computed as:
$$ [J J^T]_{1,1} = \sum_{i=1}^{12} J_{1,i}^2 = (-0.602002)^2 + (-0.574093)^2 + \dots + (-0.082244)^2 = 1.618765 $$
$$ [J J^T]_{1,2} = [J J^T]_{2,1} = \sum_{i=1}^{12} J_{1,i} J_{2,i} = (-0.602002)(0.948356) + \dots + (-0.082244)(0.056885) = -2.522138 $$
$$ [J J^T]_{2,2} = \sum_{i=1}^{12} J_{2,i}^2 = (0.948356)^2 + (0.852329)^2 + \dots + (0.056885)^2 = 4.041640 $$
Thus, the inner product matrix $J J^T$ is:
$$ J J^T = \begin{bmatrix} 1.618765 & -2.522138 \\ -2.522138 & 4.041640 \end{bmatrix} $$

Next, we calculate the determinant of $J J^T$:

$$ \det(J J^T) = (1.618765)(4.041640) - (-2.522138)^2 = 6.542465 - 6.361180 = 0.181289 $$
Because the determinant is strictly positive and far from zero, the matrix $J J^T$ is non-singular, confirming that the robot is not in a singular configuration. We can analytically compute the inverse $(J J^T)^{-1}$ using the standard formula for a $2 \times 2$ matrix:
$$ (J J^T)^{-1} = \frac{1}{\det(J J^T)} \begin{bmatrix} [J J^T]_{2,2} & -[J J^T]_{1,2} \\ -[J J^T]_{2,1} & [J J^T]_{1,1} \end{bmatrix} $$
$$ (J J^T)^{-1} = \frac{1}{0.181289} \begin{bmatrix} 4.041640 & 2.522138 \\ 2.522138 & 1.618765 \end{bmatrix} = \begin{bmatrix} 22.293922 & 13.912259 \\ 13.912259 & 8.929205 \end{bmatrix} $$

Now, we compute the Moore-Penrose pseudoinverse $J^+ = J^T (J J^T)^{-1}$ by multiplying the $12 \times 2$ transpose matrix $J^T$ by the $2 \times 2$ inverse matrix. For each link $i$:

$$ J^+_{i,1} = J_{1,i} \cdot 22.293922 + J_{2,i} \cdot 13.912259 $$
$$ J^+_{i,2} = J_{1,i} \cdot 13.912259 + J_{2,i} \cdot 8.929205 $$
Applying this mapping to all 12 rows yields:
$$ J^+ = \begin{bmatrix} -0.227212 & 0.092857 \\ -0.940965 & -0.376311 \\ -0.613505 & -0.191158 \\ 0.428631 & 0.445099 \\ 1.470767 & 1.081357 \\ 1.798227 & 1.266510 \\ 1.084473 & 0.797341 \\ -0.306752 & -0.095579 \\ -1.697978 & -0.988500 \\ -2.411732 & -1.457668 \\ -2.084271 & -1.272515 \\ -1.042136 & -0.636258 \end{bmatrix} $$

4.5. Minimum-Norm Velocity Solution

Suppose the desired end-effector velocity is specified as $\dot{x}_e = [v_x, v_y]^T = [0.2, -0.1]^T\text{ m/s}$. The minimum-norm joint velocity vector $\dot{\theta}_{min} \in \mathbb{R}^{12}$ is given by:

$$ \dot{\theta}_{min} = J^+ \dot{x}_e $$
Evaluating the matrix-vector product for each joint $i$:
$$ \dot{\theta}_{min, i} = J^+_{i,1} (0.2) + J^+_{i,2} (-0.1) $$
Evaluating this for all joints yields the joint velocities in Table 4.2:

Joint Index ($i$) Pseudoinverse Row ($J^+_i$) Minimum-Norm Velocity $\dot{\theta}_{min, i}$ (rad/s)
1 $[-0.227212, 0.092857]$ -0.054728
2 $[-0.940965, -0.376311]$ -0.150562
3 $[-0.613505, -0.191158]$ -0.103585
4 $[0.428631, 0.445099]$ 0.041216
5 $[1.470767, 1.081357]$ 0.186018
6 $[1.798227, 1.266510]$ 0.232994
7 $[1.084473, 0.797341]$ 0.137161
8 $[-0.306752, -0.095579]$ -0.051793
9 $[-1.697978, -0.988500]$ -0.240746
10 $[-2.411732, -1.457668]$ -0.336580
11 $[-2.084271, -1.272515]$ -0.289603
12 $[-1.042136, -0.636258]$ -0.144801

This minimum-norm velocity vector strictly satisfies the linear kinematic constraint:

$$ J \dot{\theta}_{min} = \begin{bmatrix} -0.602002 & -0.574093 & \dots & -0.082244 \\ 0.948356 & 0.852329 & \dots & 0.056885 \end{bmatrix} \begin{bmatrix} -0.054728 \\ -0.150562 \\ \vdots \\ -0.144801 \end{bmatrix} = \begin{bmatrix} 0.2 \\ -0.1 \end{bmatrix} = \dot{x}_e $$
However, relying solely on $\dot{\theta}_{min}$ can cause physical control issues over time. Since the optimization only minimizes instantaneous joint velocities, the joints may eventually drift toward physical limits, or the robot might take on a highly contorted shape that increases singularity risk. To address this, we must incorporate a secondary control objective that runs in the null space of the primary task.

4.6. Secondary Objective and Null-Space Projection

To exploit the redundant DoFs, we introduce a secondary control task to pull the joints toward their zero home position, $\theta_{home} = [0, 0, \dots, 0]^T\text{ rad}$. This helps maintain joint centering and prevents drift. Let this objective be defined as a potential function optimization where we minimize $H(\theta) = \frac{1}{2} (\theta - \theta_{home})^T (\theta - \theta_{home})$. The joint velocity vector that descends along the gradient of this potential function is defined as:

$$ q_0 = -k_p \nabla_\theta H(\theta) = -k_p (\theta - \theta_{home}) $$
With a proportional gain of $k_p = 1.5$, the components of the secondary task velocity vector $q_0$ are computed as $q_{0,i} = -1.5 \theta_i$:
$$ q_0 = \begin{bmatrix} -0.424264 & -0.600000 & -0.424264 & 0.000000 & 0.424264 & 0.600000 & 0.424264 & 0.000000 & -0.424264 & -0.600000 & -0.424264 & 0.000000 \end{bmatrix}^T \text{ rad/s} $$

Directly applying $q_0$ would disrupt the primary end-effector tracking because $q_0$ is not generally in the null space of the Jacobian. To prevent this interference, we project $q_0$ onto the null space of $J$ using the orthogonal projection operator $(I - J^+ J) \in \mathbb{R}^{12 \times 12}$:

$$ \dot{\theta}_{null} = (I - J^+ J) q_0 = q_0 - J^+ (J q_0) $$
This formulation shows that we first compute the end-effector velocity that $q_0$ would produce, $J q_0$, then compute the minimum-norm joint velocities that would produce that same end-effector velocity, $J^+ (J q_0)$, and subtract it from $q_0$. The result is a self-motion profile that moves the joints without moving the end-effector.

Let us calculate these terms. First, we compute the $2 \times 1$ velocity vector $J q_0$:

$$ J q_0 = \begin{bmatrix} \sum_{i=1}^{12} J_{1,i} q_{0,i} \\ \sum_{i=1}^{12} J_{2,i} q_{0,i} \end{bmatrix} = \begin{bmatrix} (-0.602002)(-0.424264) + \dots + (-0.082244)(0) \\ (0.948356)(-0.424264) + \dots + (0.056885)(0) \end{bmatrix} = \begin{bmatrix} 0.705946 \\ -0.690204 \end{bmatrix} \text{ m/s} $$
This indicates that the unprojected vector $q_0$ would cause a drift velocity of $0.705946\text{ m/s}$ in the $x$-direction and $-0.690204\text{ m/s}$ in the $y$-direction at the end-effector.

Next, we compute the correction term $J^+ (J q_0) \in \mathbb{R}^{12}$, which is the mapping of this Cartesian drift back into joint velocity space:

$$ J^+ (J q_0) = \begin{bmatrix} -0.227212(0.705946) + 0.092857(-0.690204) \\ -0.940965(0.705946) - 0.376311(-0.690204) \\ \vdots \\ -1.042136(0.705946) - 0.636258(-0.690204) \end{bmatrix} = \begin{bmatrix} -0.224490 \\ -0.404539 \\ -0.301163 \\ -0.004619 \\ 0.291925 \\ 0.395301 \\ 0.215252 \\ -0.150582 \\ -0.516415 \\ -0.696464 \\ -0.593088 \\ -0.296544 \end{bmatrix} \text{ rad/s} $$

We then compute the projected null-space joint velocity vector $\dot{\theta}_{null} = q_0 - J^+ (J q_0)$:

$$ \dot{\theta}_{null} = \begin{bmatrix} -0.424264 - (-0.224490) \\ -0.600000 - (-0.404539) \\ -0.424264 - (-0.301163) \\ 0.000000 - (-0.004619) \\ 0.424264 - (0.291925) \\ 0.600000 - (0.395301) \\ 0.424264 - (0.215252) \\ 0.000000 - (-0.150582) \\ -0.424264 - (-0.516415) \\ -0.600000 - (-0.696464) \\ -0.424264 - (-0.593088) \\ 0.000000 - (-0.296544) \end{bmatrix} = \begin{bmatrix} -0.199774 \\ -0.195461 \\ -0.123101 \\ 0.004619 \\ 0.132339 \\ 0.204699 \\ 0.209013 \\ 0.150582 \\ 0.092151 \\ 0.096464 \\ 0.168824 \\ 0.296544 \end{bmatrix} \text{ rad/s} $$

We can verify that this velocity profile has no effect on the end-effector by calculating its product with $J$:

$$ J \dot{\theta}_{null} = \begin{bmatrix} J_{1,1} & \dots & J_{1,12} \\ J_{2,1} & \dots & J_{2,12} \end{bmatrix} \begin{bmatrix} -0.199774 \\ -0.195461 \\ \vdots \\ 0.296544 \end{bmatrix} = \begin{bmatrix} 0.000000 \\ 0.000000 \end{bmatrix} \text{ m/s} $$
This matches our expectations. Because the product is zero, the projection has isolated the joint motion so it operates entirely in the null space.

4.7. Synthesis of the Combined Velocity Controller

Finally, we combine the minimum-norm velocities and the null-space projection velocities to get the total command joint velocity vector $\dot{\theta}$:

$$ \dot{\theta} = \dot{\theta}_{min} + \dot{\theta}_{null} = J^+ \dot{x}_e + (I - J^+ J) q_0 $$
Evaluating this sum for each joint:
$$ \dot{\theta}_i = \dot{\theta}_{min, i} + \dot{\theta}_{null, i} $$
The individual components of this final control vector are detailed in Table 4.3.

Joint ($i$) Primary $\dot{\theta}_{min, i}$ (rad/s) Null Space $\dot{\theta}_{null, i}$ (rad/s) Total Joint Velocity $\dot{\theta}_i$ (rad/s)
1 -0.054728 -0.199774 -0.254502
2 -0.150562 -0.195461 -0.346023
3 -0.103585 -0.123101 -0.226686
4 0.041216 0.004619 0.045835
5 0.186018 0.132339 0.318357
6 0.232994 0.204699 0.437694
7 0.137161 0.209013 0.346173
8 -0.051793 0.150582 0.098789
9 -0.240746 0.092151 -0.148595
10 -0.336580 0.096464 -0.240116
11 -0.289603 0.168824 -0.120779
12 -0.144801 0.296544 0.151743

We can verify that this combined joint velocity vector $\dot{\theta}$ satisfies the primary end-effector tracking command by computing the Cartesian velocity $J \dot{\theta}$:

$$ J \dot{\theta} = J \left( \dot{\theta}_{min} + \dot{\theta}_{null} \right) = J J^+ \dot{x}_e + J(I - J^+ J) q_0 $$
Since $J J^+ = I_m$ for a full row-rank Jacobian, and $J(I - J^+ J) = J - J J^+ J = J - J = 0$, this simplifies to:
$$ J \dot{\theta} = I_m \dot{x}_e + 0 = \dot{x}_e = \begin{bmatrix} 0.2 \\ -0.1 \end{bmatrix} \text{ m/s} $$
This numerical result demonstrates the decoupling of the control layers. The primary task tracking is maintained with zero error, while the secondary task operates in the null space. This joint coordination pattern allows the snake robot to track path trajectories while using its internal degrees of freedom to adapt its body shape.

6. Locomotion Gaits and Obstacle-Aided Motion

Unlike wheeled or legged robots, snake robots rely on internal shape deformation to interact with the environment and generate forward motion. By mimicking the biological mechanics of real snakes, roboticists have developed gaits that leverage friction forces and contact dynamics. In this section, we analyze these locomotion gaits, starting with lateral undulation, and explore the mechanics of obstacle-aided motion.

6.1. Lateral Undulation and the Hirose Serpenoid Curve

Lateral undulation is the most common form of snake locomotion. It is characterized by a continuous wave of lateral bending that propagates from the head to the tail. In 1972, Shigeo Hirose identified that biological snakes optimize their muscle activation and energy consumption by following a specific geometric backbone curve. This curve, where the curvature changes sinusoidally along the arc length, is known as the Hirose Serpenoid Curve.

For a continuous snake body, let $s$ denote the arc length coordinate along the backbone ($0 \le s \le s_{max}$). The curvature $\kappa(s)$ at any point along the serpenoid curve is defined as:

$$ \kappa(s) = \frac{d\phi}{ds} = -\frac{\alpha \pi}{L} \sin\left(\frac{\pi s}{L}\right) $$
where $\alpha$ is the initial winding angle (which dictates the maximum angle the body makes with the average direction of motion), $L$ represents the wave length along the body, and $\phi(s)$ is the angle of the tangent to the curve at $s$. Integrating the curvature equation with respect to arc length gives the tangent angle profile $\phi(s)$:
$$ \phi(s) = \alpha \cos\left(\frac{\pi s}{L}\right) $$
To find the Cartesian coordinates $(x(s), y(s))$ of the snake's backbone in the horizontal plane, we integrate the trigonometric components of this tangent profile:
$$ x(s) = \int_0^s \cos\left(\alpha \cos\left(\frac{\pi \sigma}{L}\right)\right) d\sigma $$
$$ y(s) = \int_0^s \sin\left(\alpha \cos\left(\frac{\pi \sigma}{L}\right)\right) d\sigma $$
These integrals cannot be solved in terms of elementary functions. Instead, they are evaluated using Jacobi-Anger expansions and Bessel functions of the first kind:
$$ \cos(\alpha \cos\psi) = J_0(\alpha) + 2 \sum_{k=1}^{\infty} (-1)^k J_{2k}(\alpha) \cos(2k\psi) $$
$$ \sin(\alpha \cos\psi) = 2 \sum_{k=0}^{\infty} (-1)^k J_{2k+1}(\alpha) \cos((2k+1)\psi) $$
where $J_n(\alpha)$ is the $n$-th order Bessel function of the first kind.

For a discrete snake robot with $N$ rigid links, the continuous serpenoid curve is implemented by coordinating the joints. Shigeo Hirose derived the joint coordination equation that causes the discrete link chain to approximate the serpenoid shape over time:

$$ \theta_i(t) = A \sin(\omega t + (i-1)\beta) + \gamma $$
where the parameter roles are:

  • $A$ (Joint Amplitude): This parameter dictates the maximum relative angle between adjacent links. Physically, it scales the height of the lateral wave, controlling the stride length and lateral profile. Larger values of $A$ increase the transverse width of the gait.
  • $\omega$ (Temporal Frequency): This parameter represents the angular frequency of the joint control signals, governing how quickly the wave travels along the body. The forward speed of the robot scales linearly with $\omega$ under steady-state conditions.
  • $\beta$ (Spatial Phase Difference): This parameter defines the phase shift between consecutive joints. It controls the number of complete wave cycles, $n_w$, along the snake's body:
    $$ n_w = \frac{N \beta}{2\pi} $$
    A typical value is $\beta \approx 30^\circ$ to $45^\circ$, which distributes 1 to 1.5 full wave cycles along a 12-link robot.
  • $\gamma$ (Steering Bias): This parameter introduces a constant angular offset across the joints. A non-zero bias ($\gamma \ne 0$) bends the average shape of the body, allowing the robot to travel along a curved path.

6.2. Derivation of Forward Velocity Under Anisotropic Friction

Locomotion via lateral undulation relies on anisotropic friction between the robot's body and the ground. This means the friction coefficient perpendicular to the link axis (normal direction, $c_N$) must be significantly larger than the coefficient parallel to the link axis (tangential direction, $c_T$). If $c_N > c_T$, the lateral forces generated by the traveling wave resolve into a net forward force.

Let us model the continuous snake body as a curve $r(s, t) = [x(s, t), y(s, t)]^T$. We assume the snake propagates a wave backward along its body with speed $c = \frac{\omega L}{\pi}$ relative to the skin. The position coordinates of the body in the frame moving forward at velocity $v_x$ are:

$$ x(s, t) = s \cos\alpha \cdot J_0(\alpha) - v_x t $$
$$ y(s, t) = \alpha \frac{L}{\pi} \sin\left(\omega t - \frac{\pi s}{L}\right) $$
Differentiating with respect to time yields the velocity of each segment:
$$ v_y(s, t) = \frac{\partial y}{\partial t} = A_y \omega \cos\left(\omega t - \frac{\pi s}{L}\right) $$
where $A_y = \alpha \frac{L}{\pi}$ is the lateral amplitude. Let $\phi(s, t) = \alpha \cos\left(\omega t - \frac{\pi s}{L}\right)$ be the local orientation angle. The tangential and normal velocities of the body segment are:
$$ v_t = (v_x \cos\phi + v_y \sin\phi) $$
$$ v_n = (-v_x \sin\phi + v_y \cos\phi) $$
Using a viscous friction model, the forces per unit length in the tangential and normal directions are:
$$ f_t = -c_T v_t = -c_T (v_x \cos\phi + v_y \sin\phi) $$
$$ f_n = -c_N v_n = -c_N (-v_x \sin\phi + v_y \cos\phi) $$
To find the net propulsive force along the forward direction $x$, we project the normal and tangential forces onto the $x$-axis and integrate along the body length $L_{body}$:
$$ F_x = \int_0^{L_{body}} \left( f_n \sin\phi - f_t \cos\phi \right) ds $$
$$ F_x = \int_0^{L_{body}} \left( [ -c_N ( -v_x \sin\phi + v_y \cos\phi ) ] \sin\phi - [ -c_T ( v_x \cos\phi + v_y \sin\phi ) ] \cos\phi \right) ds $$
$$ F_x = \int_0^{L_{body}} \left( (c_N \sin^2\phi - c_T \cos^2\phi) v_x - (c_N - c_T) \sin\phi \cos\phi \cdot v_y \right) ds $$
At a steady-state forward velocity, the net force in the forward direction must balance to zero ($F_x = 0$):
$$ v_x \int_0^{L_{body}} (c_N \sin^2\phi - c_T \cos^2\phi) ds = (c_N - c_T) \int_0^{L_{body}} v_y \sin\phi \cos\phi \, ds $$
Assuming a small winding angle $\alpha \ll 1$, we can approximate the trigonometric functions using Taylor series expansions:
$$ \sin\phi \approx \phi, \quad \cos\phi \approx 1 - \frac{1}{2}\phi^2 $$
$$ \sin^2\phi \approx \phi^2, \quad \cos^2\phi \approx 1 - \phi^2 $$
Integrating these approximations over a complete wave cycle yields:
$$ \frac{1}{L_{body}} \int_0^{L_{body}} \phi^2 ds = \frac{\alpha^2}{2} $$
Substituting these average values back into the force balance equation:
$$ v_x \left( c_N \frac{\alpha^2}{2} - c_T \left(1 - \frac{\alpha^2}{2}\right) \right) \approx (c_N - c_T) \left( \frac{1}{L_{body}} \int_0^{L_{body}} v_y \phi \, ds \right) $$
Evaluating the term on the right-hand side:
$$ \frac{1}{L_{body}} \int_0^{L_{body}} v_y \phi \, ds = \frac{1}{L_{body}} \int_0^{L_{body}} \left[ A_y \omega \cos(\psi) \right] \left[ \alpha \cos(\psi) \right] ds = \frac{1}{2} A_y \omega \alpha = \frac{\alpha^2 L \omega}{2\pi} $$
Solving this expression for the steady-state forward velocity $v_x$ yields:
$$ v_x \approx \frac{(c_N - c_T) \alpha^2 \frac{L \omega}{2\pi}}{c_T + (c_N - c_T)\frac{\alpha^2}{2}} $$
For typical systems, the tangential friction is low, and the second term in the denominator is small compared to $c_T$. This allows us to simplify the forward velocity relation to:
$$ v_x \approx \left(\frac{c_N - c_T}{c_T}\right) \frac{\alpha^2 L \omega}{4\pi} = \left(\frac{c_N}{c_T} - 1\right) \frac{\alpha^2 \lambda f}{2} $$
where $\lambda = 2L$ is the spatial wavelength and $f = \frac{\omega}{2\pi}$ is the temporal frequency.

This equation highlights three key physical characteristics of lateral undulation:

  • Friction Anisotropy Requirement: The forward velocity is proportional to the factor $(\frac{c_N}{c_T} - 1)$. If the friction is isotropic ($c_N = c_T$), the term becomes zero, and the robot cannot generate forward thrust regardless of joint effort.
  • Quadratic Relationship with Amplitude: The velocity scales with the square of the winding angle ($\alpha^2$). Increasing the wave amplitude yields a non-linear increase in forward thrust, though this also increases lateral clearance requirements.
  • Linear Scaling with Frequency: The velocity is linear with respect to the temporal wave frequency $f$. This provides a straightforward way to regulate speed during path tracking.

6.3. Alternative Locomotion Gaits

While lateral undulation is effective on flat surfaces with anisotropic friction, it is less efficient on low-friction terrains or in tight spaces. To handle these environments, snake robots use alternative gaits.

1. Sidewinding Locomotion

Sidewinding is a 3D gait designed for traversing low-friction or loose terrains, such as desert sand, where lateral undulation would cause excessive slip. This gait is generated by combining horizontal (yaw) and vertical (pitch) waves with a $90^\circ$ phase shift.

Mathematically, the control signals for a robot with alternating pitch and yaw joints are defined as:

$$ \theta_{yaw, i}(t) = A_{yaw} \sin(\omega t + (i-1)\beta_{yaw}) $$
$$ \theta_{pitch, i}(t) = A_{pitch} \sin\left(\omega t + (i-1)\beta_{pitch} + \psi\right) $$
where $\psi = \frac{\pi}{2}$ rad ($90^\circ$) is the phase offset.

This phase shift divides the robot's body segments into two alternating functional groups:

  • Static Contact Segments: Segments at the peaks of the vertical wave are pressed down into the ground. These segments act as anchors, using static friction to support the lateral pushing motion of the horizontal wave without slipping.
  • Dynamic Transition Segments: Segments at the troughs of the vertical wave are lifted off the ground. These segments move laterally to form the next anchoring contact point.

Because the contact segments remain stationary relative to the ground, sidewinding minimizes sliding friction. This makes the gait highly energy-efficient and prevents the robot from sinking into loose, granular media like sand.

2. Concertina Locomotion

Concertina locomotion is a low-speed, high-force gait used in narrow, high-resistance spaces, such as pipes, tunnels, or channels. It mimics the way biological snakes squeeze through tight crevices by wedging sections of their body against surrounding walls.

The gait operates in a four-stage sequence:

  1. Posterior Anchoring: The rear segments of the robot fold into a tight, high-amplitude wave. This shape wedges the segments against the walls of the channel, creating a high-friction anchor point.
  2. Anterior Extension: With the posterior anchored, the straight front segments of the robot extend forward into the open space.
  3. Anterior Anchoring: Once extended, the front segments fold to form a new anchor point against the walls.
  4. Posterior Pull: The rear anchor is released, and the posterior segments are pulled forward toward the front anchor, resetting the cycle.

This gait leverages the difference between static and kinetic friction. By keeping one section of the body stationary while another section moves, the robot can generate high axial forces. This allows it to climb vertically inside pipes or pull heavy payloads through restricted spaces.

3. Rectilinear Locomotion

Rectilinear locomotion is a straight-line gait used by heavy-bodied snakes (such as pythons and boas). It allows the robot to travel forward without lateral undulations, making it ideal for narrow, linear passages where lateral clearance is unavailable.

Rather than bending laterally, the robot propagates vertical (pitch) waves along its body. It relies on anisotropic scale friction, which is achieved by designing the underside of the robot with oriented micro-structures or passive scales. These scales provide low resistance when sliding forward and high resistance when sliding backward.

As the vertical wave travels from head to tail, the lifted segments move forward, while the grounded segments push backward. The backward-directed forces are resisted by the high scale friction, producing a net forward force that propels the robot along a straight path.

6.4. Obstacle-Aided (Push-Point) Locomotion Mechanics

On flat ground, lateral undulation relies on anisotropic skin friction to generate forward motion. However, on slippery surfaces (where friction is low) or in complex terrains, this approach becomes inefficient. In these environments, snake robots can use obstacle-aided locomotion (also known as push-point locomotion). This technique leverages passive obstacles in the environment, such as pegs, rocks, or trees, to propel the body forward.

Let us formulate the force balance equations for a snake robot in contact with $M$ discrete obstacles. At each contact point $j \in \{1, \dots, M\}$, the obstacle exerts a normal force $f_{N,j}$ perpendicular to the robot's body curve, and a tangential friction force $f_{T,j}$ parallel to the body curve. Let $\hat{n}_j$ and $\hat{t}_j$ represent the normal and tangential unit vectors at contact point $j$. The force vector $\vec{F}_j$ exerted by obstacle $j$ on the robot is:

$$ \vec{F}_j = f_{N,j} \hat{n}_j + f_{T,j} \hat{t}_j $$
The tangential force is governed by Coulomb friction, which is limited by the normal force:
$$ |f_{T,j}| \le \mu f_{N,j} $$
where $\mu$ is the friction coefficient between the robot's skin and the obstacle.

The equations of motion for the system, including environmental contact forces, are formulated as:

$$ \mathbf{M}(\theta)\ddot{X} + \mathbf{C}(\theta, \dot{\theta})\dot{X} + \mathbf{G}(\theta) = \mathbf{B}\tau_{act} + \sum_{j=1}^{M} \mathbf{J}_j(\theta)^T \vec{F}_j $$
where $\mathbf{M}(\theta)$ is the mass-inertia matrix, $\mathbf{C}(\theta, \dot{\theta})$ represents Coriolis and centrifugal terms, $\mathbf{G}(\theta)$ is the gravitational vector, $\tau_{act}$ is the vector of joint torque commands, and $\mathbf{J}_j(\theta)$ is the contact Jacobian mapping end-effector/joint velocities to the $j$-th contact point velocity.

To generate forward motion, the normal forces $f_{N,j}$ must resolve into a net positive force along the forward direction of locomotion, $\hat{x}$. Projecting the contact forces onto the $\hat{x}$ axis gives:

$$ F_{prop} = \sum_{j=1}^{M} \left( f_{N,j} (\hat{n}_j \cdot \hat{x}) + f_{T,j} (\hat{t}_j \cdot \hat{x}) \right) $$
Because the obstacles are unilateral constraints, they can only push against the robot's body ($f_{N,j} \ge 0$). They cannot pull on it. To maximize forward propulsion, the robot must control its shape so that the normal vectors $\hat{n}_j$ at the contact points align with the forward direction of travel ($\hat{n}_j \cdot \hat{x} > 0$).

This force resolution is shown in the diagram below:

Contact Point j Normal Force (f_N) (from passive peg) Tangential Friction (f_T) Robot Body Passive Obstacle (Peg) Motion Direction (\hat{x})

Figure 6.1: Force resolution at a contact point during obstacle-aided locomotion.

The primary control challenge in obstacle-aided locomotion is generating joint torques $\tau_{act}$ that produce the desired contact forces $f_{N,j}$ while maintaining contact with the obstacles. If a joint pushes too hard or in the wrong direction, the body may slip off the obstacle, causing a loss of propulsion.

This control problem can be formulated as a constrained optimization task:

$$ \min_{\tau_{act}, f_N} \quad \mathcal{J} = \tau_{act}^T \mathbf{W}_\tau \tau_{act} + (F_{prop} - F_{des})^2 $$
subject to:
$$ f_{N,j} \ge 0, \quad \forall j = 1, \dots, M $$
$$ |f_{T,j}| \le \mu f_{N,j}, \quad \forall j = 1, \dots, M $$
$$ \tau_{min} \le \tau_{act} \le \tau_{max} $$
By solving this optimization at each control cycle, the robot can adjust its internal joint torques to match the current terrain. This allows it to navigate complex environments, such as forests or rubble, by actively utilizing obstacles for propulsion rather than trying to avoid them.

6.5. Comprehensive Gaits Comparison

Selecting the appropriate gait depends on the specific terrain and task requirements. Table 6.1 compares the five primary gaits discussed.

Gait Type Speed Terrain Suitability Energy Efficiency Slip Characteristics Controller Complexity
Lateral Undulation High Flat ground with anisotropic friction (mats, grass) Medium High (on low-friction or isotropic surfaces) Low (simple phase-locked sinusoids)
Sidewinding Very High Loose sand, desert terrain, slopes High Very Low (uses static contact points) Medium (requires 3D joint synchronization)
Concertina Low Narrow channels, pipes, vertical climbs Low Low (relies on wall wedging) Medium-High (requires contact force control)
Rectilinear Very Low Extremely narrow tunnels, straight line corridors Low Medium (relies on scale-ground friction) Medium (requires coordinated vertical waves)
Obstacle-Aided Medium-High Complex terrains with pegs, rocks, forest debris Very High Very Low (uses obstacles as positive supports) High (requires tactile feedback and optimization)

7. Hardware Design, Actuation, and Control Architectures

Translating hyper-redundant kinematics and gaits into physical systems requires specialized hardware design. Snake robots must pack high-torque actuators, sensors, and power systems into a compact, narrow form factor.

7.1. Modular Joint Design

Modern snake robots are built using a modular design. Each module is a self-contained unit containing an actuator, control electronics, sensors, and structural housing. These modules are typically connected in an alternating pitch-yaw configuration:

Module i-1 Horizontal Yaw Joint Module i Vertical Pitch Joint Module i+1 Horizontal

Figure 7.1: Alternating pitch-yaw modular configuration.

This alternating arrangement allows the robot to achieve full 3D motion while keeping the individual modules identical. This simplifies manufacturing, assembly, and field repairs.

The primary hardware requirements for each joint module are:

  • Actuation: Joints use high-torque brushless DC (BLDC) motors or digital servo motors. These are paired with Harmonic Drive Gears (strain wave gearing). Harmonic drives are chosen because they offer high gear ratios (e.g., 50:1 to 100:1) and near-zero backlash in a compact, lightweight package, which is critical for precise joint position control.
  • Structural Materials: Module housings are typically fabricated from lightweight, high-strength materials. Carbon fiber tubes are used for the main links to minimize weight, while CNC-machined aircraft-grade aluminum (such as 6061-T6 or 7075-T6) is used for the high-stress joint linkages.
  • Waterproofing: To operate in wet, muddy, or underwater environments, modules require robust waterproofing. This is achieved using dual O-ring seals on the rotating output shafts, waterproof rubber bellows (gaiters) over the joint gaps, and IP67/IP68-rated sealed housings.

7.2. Power Distribution Systems

Powering a robot with 12 to 20 high-torque actuators presents a significant electrical engineering challenge. There are two primary configurations for power distribution:

  • Tethered Power: An external power supply delivers high-voltage DC (e.g., 48V) to the robot via a tether cable. This approach is common in laboratory environments because it keeps the robot lightweight (no onboard battery weight) and allows for unlimited runtime. However, the physical cable adds drag and can easily tangle.
  • Untethered (Autonomous) Power: The robot runs on onboard Lithium-Polymer (LiPo) batteries. To maintain balance and avoid concentrated heavy points, battery packs are distributed across multiple modules along the body. A high-voltage power bus is run through the entire link chain to minimize resistive ($I^2 R$) power losses. Each module then uses a local buck regulator to step down the bus voltage to the level required by its actuators and control electronics.

7.3. Centralized vs. Distributed Control Architectures

The control architecture of a snake robot must coordinate the high-dimensional joint inputs without causing excessive latency. Roboticists use either centralized or distributed control systems, as shown in Table 7.1.

Architecture Description Advantages Disadvantages
Centralized Control A single high-performance computer (e.g., single-board computer) calculates the kinematics and gait profiles, then sends joint angle targets directly to each motor driver. Simplifies implementation of global algorithms like Jacobian pseudoinverse tracking. High bus bandwidth requirements; vulnerable to single-point communication failures.
Distributed Control A master controller coordinates high-level path planning, while local microcontrollers (e.g., ARM Cortex-M4) in each module handle joint position control and local sensor processing. Modular scalability; lower bus bandwidth; robust to failures in individual links. More complex firmware synchronization; harder to coordinate global feedback loops.

7.4. Central Pattern Generators (CPGs)

To implement distributed control for rhythmic gaits, roboticists often use **Central Pattern Generators (CPGs)**. CPGs are networks of coupled neural oscillators that generate coordinated rhythmic outputs without requiring sensory input.

A common mathematical model for a CPG is based on the Hopf Bifurcation Oscillator. The dynamics of a single oscillator node $i$ are defined by the set of coupled non-linear differential equations:

$$ \dot{x}_i = (a_i - (x_i^2 + y_i^2)) x_i - \omega_i y_i + \sum_{j=1}^{N} w_{ij} x_j $$
$$ \dot{y}_i = (a_i - (x_i^2 + y_i^2)) y_i + \omega_i x_i + \sum_{j=1}^{N} w_{ij} y_j $$
where the variables and parameters are defined as:

  • $x_i, y_i$: State variables of the oscillator. The value of $x_i(t)$ represents the output pattern used to command joint $i$.
  • $a_i$: Amplitude convergence parameter. If $a_i > 0$, the state variables converge to a stable limit cycle with radius $r_i = \sqrt{a_i}$. If $a_i \le 0$, the system converges to a static point at the origin.
  • $\omega_i$: Natural frequency of the oscillator. This parameter determines the speed of the output wave.
  • $w_{ij}$: Coupling weights that connect node $i$ to node $j$. These weights enforce phase-locking between adjacent modules, ensuring the wave propagates smoothly along the body.

The joint command angle $\theta_i(t)$ is mapped from the oscillator state:

$$ \theta_i(t) = K_i x_i(t) + \gamma_i $$
where $K_i$ is a scaling gain and $\gamma_i$ is the steering bias.

CPGs are useful for snake robot control because they naturally generate smooth, continuous joint trajectories. If the operator changes a control parameter (such as frequency or amplitude), the CPG transitions to the new limit cycle smoothly, without causing sudden joint jerks that could damage the actuators. CPGs can also integrate sensory feedback. By adding feedback terms directly to the differential equations, the phase and amplitude of the oscillators can automatically adapt to external forces or terrain variations.

7.5. Sensor Fusion and Environmental Feedback

To navigate unstructured environments, snake robots must actively sense their surroundings and their own physical state. This requires combining data from several types of sensors:

  • Inertial Measurement Units (IMUs): Incorporating an IMU into each module allows the robot to track its local orientation (pitch, roll, and yaw) and angular velocity relative to gravity. By combining the data from all modules, the control system can reconstruct the 3D shape of the entire robot.
  • Joint Encoders: High-resolution magnetic encoders track the actual joint angles. Discrepancies between the commanded joint angle and the measured joint angle can be used to estimate external resistive torque.
  • Contact Force and Torque Sensors: Tactile force sensors or current-monitoring systems measure the physical forces acting on the sides of the modules. During obstacle-aided locomotion, these sensors identify where the body is contacting pegs or walls, allowing the controller to adjust its pushing forces.
  • Tactile Micro-Switches: Simple contact switches distributed around the module shells detect the presence of obstacles. This binary contact data helps the robot coordinate push-point locomotion without requiring complex force calculations.

7.6. Advanced Case Studies

The practical implementation of these design principles is illustrated by two prominent research projects.

1. Hirose's ACM-R5

Developed by Shigeo Hirose at the Tokyo Institute of Technology, the ACM-R5 is a landmark amphibious snake robot designed for both land and underwater locomotion.

Key design features include:

  • Passive Wheel Rings: Each module is wrapped with a ring of passive wheels. On land, these wheels enforce non-holonomic constraints, providing the anisotropic friction (high lateral resistance, low longitudinal resistance) needed for efficient lateral undulation.
  • Waterproofing: The ACM-R5 uses a robust waterproofing system. Flexible rubber bellows cover the joints, and double-lip seals protect the drive shafts, allowing the robot to swim in water by propagating lateral waves.
  • Modular Architecture: The robot is highly modular, with each joint containing its own battery, motor, and controller, communicating via a CAN bus network.

2. CMU Modular Snake Robots

The Biorobotics Laboratory at Carnegie Mellon University (CMU), led by Howie Choset, has developed a family of modular snake robots designed for search-and-rescue, industrial inspection, and surgical applications.

Key features include:

  • High Packing Density: The CMU modules pack a motor, gear train, control board, camera, and sensors into a cylinder just 5 cm in diameter.
  • Virtual Chassis Framework: The control system uses a virtual chassis coordinate frame. This frame aligns with the average orientation of the snake's body, simplifying 3D locomotion planning and teleoperation by allowing the operator to command the robot in standard directions (e.g., forward, turn) regardless of its current wave shape.
  • Multi-Gait Capabilities: By coordinating the pitch-yaw joints, the CMU robots can transition between lateral undulation, sidewinding, concertina climbing, and rolling. Rolling allows the robot to move sideways like a rigid cylinder, which is useful for quickly crossing flat, open ground.