# Screw theory

Robots are commonly modeled as a articulated systems of rigid bodies connected by joints. The motion of these interconnected bodies, as well as the forces acting between them, can be calculated by writing down: (1) for each body: its angular velocity, the linear velocity of one of its points, and (2) for each pair of body: the net force and the moment of forces exerted by one body onto the other. As you can guess from reading it, these calculations involve a fair amount of bookkeeping. Fortunately, there is a way we can handle both linear and angular components jointly, and think only in terms of black-box velocities and forces: screw theory.

## Screws

The velocity of a rigid body \(B\) in the world frame \(W\) is fully described by the linear velocity \({}_{W} \bfv_P\) of any point \(P \in B\), and its spatial angular velocity \({}_{W} \bfomega_{WB}\) (the angular velocity from the body frame to the world frame, expressed in the world frame) which is the same at every point of \(B\). Linear velocities satisfy the Varignon formula to calculate the linear velocity \(_{W} \bfv_Q\) at another point \(Q \in B\):

This formula gives a particular structure to the vector field:

If we know the value of this field for a single \(P\), then we know it everywhere!

### Definition

Let us take a step back and call *screw* any vector field that satisfies the
Varignon formula. A screw \(\bfs\) is then fully defined by its
*coordinates* \({}_W \bfs_P = ({}_W \bfm_P, {}_W \bfr)\) taken at point
\(P\) and in frame W:

- The three coordinates \({}_W \bfm_P\) that depend on \(P\) are called the
*moment*of the screw. - The three coordinates \({}_W \bfr\) that don't depend on \(P\) are
called the
*resultant*of the screw.

By definition, the moment of a screw satisfies the Varignon formula:

Although the coordinate vector \({}_W \bfs_P\) of a screw depends on the point \(P\) where it is taken, the screw itself does not depend on the choice of \(P\). There is therefore a distinction to make between the screw itself and its coordinates: \(\bfs\) is the screw itself (an abstract object), \({}_W \bfs\) is the screw expressed in frame \(W\) (still abstract: we could nail a number on the resultant \({}_W \bfr\) but not on the moment yet), and \({}_W \bfs_P\) are the screw coordinates at point \(P\) (a concrete object in \(\mathbb{R}^6\)).

### Twists

Screws are intrinsically related to the motion of rigid bodies in space. A
screw that represents a rigid body motion is called a *twist*. For instance,
*velocity* is the twist with coordinates \({}_W \bft_P = ({}_W \bfv_P,
{}_W \bfomega_{WB})\) where:

- The resultant \({}_W \bfomega_{WB}\) is the spatial angular velocity of
the body,
*i.e.*, the angular velocity of the rotation \(\bfR_{WB}\) from \(B\) to \(W\), expressed in the world frame \(W\). - The moment \({}_W \bfv_P\) is the linear velocity of a given point \(P \in B\), expressed in frame \(W\).

We say that \({}_W \bft\) is *spatial* twist because we express it in an
inertial frame \(W\). Alternatively we could consider the *body* twist
\({}_B \bft\) expressed in the frame of the body itself. We will come back
to that below.

Consider the case of a revolute joint such as the elbow of a humanoid arm:

Imagine the robot is rotating its elbow while keeping all other joints fixed. Then, the linear velocities of the points \(P_1, P_2\) and \(P_3\) on the forearm body satisfy:

which is Varignon’s formula in the special case of a pure rotation, the linear velocity being zero along the rotation axis. This axis is also the central axis of the twist.

Although we have looked at the example of velocities so far, subsequent derivatives such as accelerations or jerks are also twists. Informally, while the derivative of a rigid body transformation is a twist (change of space), the derivative of a twist is a twist. See below for pointers on the formal approach to state this precisely using the Lie algebra of a transformation group.

### Wrenches

A screw that represents the generalized constraint acting on a rigid body is called
a *wrench*. For instance, *force* is the wrench \({}_W \bfw_P = ({}_W \bff,
{}_W \bftau_P)\) where:

- The resultant \({}_W \bff\) is the linear force acting on the body.
- The moment \({}_W \bftau_P\) is the moment of forces acting on the body, taken at point \(P \in B\) and expressed in frame \(W\).

### Duality

Twists and wrenches live in dual spaces: the motion space and the force space. Duality means that there is a scalar product between twists \(\bft\) and wrenches \(\bfw\), which is defined by:

From the Varignon formula, this number does not depend on the point \(P\)
where vector coordinates are taken. When \(\bft\) and \(\bfw\) are the
twist and wrench acting on a single rigid body, their scalar product represents
the instantaneous *power* of the motion.

## Spatial and body screws

When we take the derivative of the motion (or force) of a rigid body \(B\)
in an inertial frame \(W\), a choice appears: we can either express the
resulting screw \(\bfs\) in the inertial frame \({}_W \bfs\), or we can
express it in the body frame \({}_B \bfs\). The former is called a
*spatial* screw and the latter a *body* screw.

### Body screws

Body screws have a number of interesting properties. For one, if we are
choosing inertial frames with zero relative velocities, *e.g.* ground-attached
frames (NB: this is the standard), then the coordinates of our body screws
don't depend on the particular inertial frame \(W\) we pick. Let us
consider the example of the velocity twist \({}_B \bfv_{WB}\), which is the
derivative of the transformation:math:{}_W bfX_B. By definition,

For further digging, this is a particular case of equation (2.45) in Featherstone (2008). It generalizes the derivative of a rotation matrix:

Now, suppose we have a second inertial frame \(C\) such that \(\dot{\bfX}_{CW} = \bfzero\). We have on the one hand:

But on the other hand, the same property that applies to \(W\) applies to \(C\):

Since \(\bfX_{CB}\) is invertible, this means that \({}_B \bfv_{CB} = {}_B \bfv_{WB}\). This shows that the twist coordinates of a body velocity do not depend on the inertial frame they were computed in. While spatial velocity coordinates \({}_W \bfv_{WB}\) depend on both the frame \(W\) and the point \(B\) they are taken at (here we assume the point \(P\) for moment coordinates coincides with the origin of \(B\) to avoid a third parameter), the body velocity is simply \({}_B \bfv_B\).

Note how this property, which applies to twist of transformation groups in general, is in particular true angular velocities (which are twists for the orthogonal group, see pointers on Lie algebra below): a spatial angular velocity is \({}_W \bfomega_{WB}\), the angular velocity from body to world expressed in the world frame, but a body angular velocity is often abbreviated \({}_B \bfomega_B\), the body angular velocity of \(B\).

### Spatial vector algebra

The idea of spatial vector algebra is to perform all calculations using spatial screws. This makes sense from a practical standpoint, as it was shown that expressing all quantities with respect to the same inertial frame yields the minimum amount of calculations. Consequently, several efficient rigid body dynamics libraries and physics simulator are implemented with spatial vector algebra.

## To go further

Twists are elements of the Lie algebra \(se(3)\) which is the tangent space of the special Euclidean group \(SE(3)\) of rigid body transformations. We can integrate twists into transformations via the exponential map, which generalizes for instance the integration of linear velocities into positions, or of angular velocities in \(so(3)\) (also a Lie algebra) into orientations in \(SO(3)\) (also a transformation group). On the integration of angular twists, see also:

- This nice post on numerical integration of angular velocities into body orientations.
- Sample Python code on numerical integration of angular accelerations using a finite approximation of the Magnus expansion.

A reference on spatial vector algebra is Chapter 2 of Featherstone’s Rigid
body dynamics algorithms.
Featherstone does all motion and force calculations with spatial vectors, *i.e.* screws expressed in an
inertial frame, as it yields the minium amount of computation in practice.