Denavit–Hartenberg convention
The Denavit–Hartenberg convention provides a systematic way to describe the geometry of a serial manipulator using a small set of parameters associated with consecutive reference frames.
Moro uses the classic Denavit–Hartenberg convention.
The notation and transformation rules in this section follow the conventions established in Mathematical notation and conventions, Rotations, and Homogeneous transformations.
Classic Denavit–Hartenberg formulation
For two consecutive reference frames \(\{i-1\}\) and \(\{i\}\), the relative pose is described by four parameters:
In Moro, these parameters are always ordered as
The parameters define the homogeneous transformation
Thus, the transformation from frame \(\{i\}\) to frame \(\{i-1\}\) is obtained through the following sequence:
rotate by \(\theta_i\) about \(z_{i-1}\),
translate by \(d_i\) along \(z_{i-1}\),
translate by \(a_i\) along \(x_i\),
rotate by \(\alpha_i\) about \(x_i\).
The resulting homogeneous transformation is
This is the matrix returned by Moro’s dh(a, alpha, d, theta) function.
Important
Moro implements the classic Denavit–Hartenberg convention. Modified Denavit–Hartenberg parameters use a different frame assignment and transformation order.
Assignment of reference frames
The Denavit–Hartenberg convention associates one reference frame with each stage of the serial kinematic chain.
The most important assignment rule is
Therefore:
a revolute joint \(i\) rotates about \(z_{i-1}\),
a prismatic joint \(i\) translates along \(z_{i-1}\).
The \(x_i\) axis is chosen along the common normal between \(z_{i-1}\) and \(z_i\), pointing from \(z_{i-1}\) toward \(z_i\) whenever the geometry determines a unique common normal.
The origin \(O_i\) is normally placed at the intersection between \(x_i\) and \(z_i\).
Finally, \(y_i\) completes a right-handed Cartesian frame:
Geometric meaning of the DH parameters
Once the frames are assigned, the four parameters have a precise geometric interpretation.
Joint angle
The parameter
is the angle from \(x_{i-1}\) to \(x_i\), measured about \(z_{i-1}\) according to the right-hand rule.
A positive value therefore corresponds to a positive rotation about \(+z_{i-1}\).
Joint offset
The parameter
is the signed translation along \(z_{i-1}\).
A positive value corresponds to translation in the \(+z_{i-1}\) direction.
Link length
The parameter
is the signed distance along \(x_i\) between the axes \(z_{i-1}\) and \(z_i\).
It is commonly interpreted as a link-length parameter, although its exact geometric meaning depends on the selected frame assignment.
A positive value corresponds to translation in the \(+x_i\) direction.
Link twist
The parameter
is the angle from \(z_{i-1}\) to \(z_i\), measured about \(x_i\) according to the right-hand rule.
A positive value therefore corresponds to a positive rotation about \(+x_i\).
The four parameters may be summarized as
Revolute and prismatic joints
The variable DH parameter depends on the joint type.
For a revolute joint,
while \(d_i\) remains constant.
For a prismatic joint,
while \(\theta_i\) remains constant.
The geometric parameters \(a_i\) and \(\alpha_i\) are constant for a rigid serial manipulator.
Thus,
The base frame
For the first joint,
is aligned with the axis of joint 1.
The remaining orientation of frame \(\{0\}\) may be chosen conveniently, provided the DH assignment remains consistent.
In particular, \(x_0\) is usually selected using a geometrically meaningful direction or in a way that simplifies the resulting DH table.
The \(y_0\) axis is then determined by the right-hand rule.
The base frame is therefore not always unique.
Note
Different valid choices of the base frame may lead to different DH parameter tables while still describing the same physical robot.
The terminal frame
For an \(n\)-joint manipulator, the axis \(z_{n-1}\) is fixed by the final joint.
The orientation of \(z_n\) is not necessarily constrained by another physical joint, so the final frame \(\{n\}\) usually has some freedom.
When possible, \(z_n\) may be chosen parallel to \(z_{n-1}\) to simplify the final parameters, often producing
The terminal DH frame does not necessarily have to coincide with the physical tool or end-effector frame.
A separate tool frame \(\{E\}\) may be introduced:
Its pose with respect to the base frame is then
Likewise, a world frame \(\{W\}\) may be defined separately from the robot base:
This distinction keeps the kinematic model of the robot separate from application-specific base and tool offsets.
DH parameter tables
A DH table contains one row for each relative transformation between consecutive reference frames.
Moro uses the column order
A generic table therefore has the form
\(i\) |
\(a_i\) |
\(\alpha_i\) |
\(d_i\) |
\(\theta_i\) |
|---|---|---|---|---|
1 |
\(a_1\) |
\(\alpha_1\) |
\(d_1\) |
\(\theta_1\) |
2 |
\(a_2\) |
\(\alpha_2\) |
\(d_2\) |
\(\theta_2\) |
\(\vdots\) |
\(\vdots\) |
\(\vdots\) |
\(\vdots\) |
\(\vdots\) |
\(n\) |
\(a_n\) |
\(\alpha_n\) |
\(d_n\) |
\(\theta_n\) |
The parameters in row \(i\) define
Thus,
The order used in the table intentionally matches the function signature
dh(a, alpha, d, theta)
used by Moro.
Note
Some textbooks use a different column order, such as \((\theta_i,d_i,a_i,\alpha_i)\). The mathematical convention is unchanged as long as each parameter is interpreted consistently.
Forward composition
Once the relative DH transformations have been constructed,
the pose of the final frame with respect to the base frame is
More generally,
This composition follows directly from the homogeneous-transformation convention used throughout Moro.
Sign conventions
The signs of the DH parameters depend on the orientations assigned to the reference-frame axes.
Angles follow the right-hand rule:
\(\theta_i\) is positive about \(+z_{i-1}\),
\(\alpha_i\) is positive about \(+x_i\).
Translations follow the positive directions of their corresponding axes:
\(d_i>0\) means translation along \(+z_{i-1}\),
\(a_i>0\) means translation along \(+x_i\).
DH parameters are not required to be positive.
For example,
is mathematically valid if the selected frame assignment produces a translation in the \(-x_i\) direction.
Similarly, negative values of \(d_i\), \(\theta_i\), and \(\alpha_i\) are valid.
Units
Moro does not impose a specific unit of length.
The parameters
may be expressed in meters, millimeters, or another unit, provided the same unit system is used consistently throughout the model.
The angular parameters
are interpreted in radians by the dh function.
Moro does not automatically convert DH angle values from degrees.
Special geometric cases
The assignment of the \(x_i\) axis depends on the relative geometry of \(z_{i-1}\) and \(z_i\).
Skew axes
If \(z_{i-1}\) and \(z_i\) are neither parallel nor intersecting, they have a unique common normal.
The \(x_i\) axis is selected along this common normal, pointing from \(z_{i-1}\) toward \(z_i\).
In this case,
is the signed distance between the two joint axes along \(x_i\).
Intersecting axes
If \(z_{i-1}\) and \(z_i\) intersect, the common-normal length is zero.
Therefore,
The \(x_i\) axis is chosen perpendicular to the plane defined by the two joint axes, with a direction consistent with the remaining DH frame assignment.
Parallel axes
If \(z_{i-1}\) and \(z_i\) are parallel, infinitely many common normals exist.
The \(x_i\) axis may therefore be selected along a convenient common normal.
A useful choice is usually one that simplifies the DH parameters and the resulting symbolic expressions.
Collinear axes
If \(z_{i-1}\) and \(z_i\) are collinear, then
Depending on the relative direction assigned to the two axes, the twist may be chosen as
or
There is additional freedom in the choice of \(x_i\) in this case.
Non-uniqueness of DH assignments
A Denavit–Hartenberg description of a robot is not necessarily unique.
Different valid frame assignments may produce different parameter tables while describing exactly the same physical mechanism.
What matters is that:
each joint axis is assigned consistently,
the DH geometric rules are respected,
the parameter table matches the selected frames,
the resulting transformations correctly describe the kinematic chain.
When several valid assignments are possible, it is usually convenient to prefer the one that produces the simplest parameters, for example by introducing zeros or simple constant angles where appropriate.
Important
Two different DH tables are not necessarily inconsistent. They may correspond to two different, but equally valid, assignments of reference frames.
Example: planar 2R manipulator
Consider a planar manipulator with two revolute joints and link lengths \(a_1\) and \(a_2\).
Both joint axes are parallel to the \(z\) direction and perpendicular to the plane of motion.
A convenient DH table is
\(i\) |
\(a_i\) |
\(\alpha_i\) |
\(d_i\) |
\(\theta_i\) |
|---|---|---|---|---|
1 |
\(a_1\) |
\(0\) |
\(0\) |
\(q_1\) |
2 |
\(a_2\) |
\(0\) |
\(0\) |
\(q_2\) |
Because both joints are revolute,
The first transformation is
or
Similarly,
so
The pose of the second frame with respect to the base is
After multiplication,
Therefore, the position of the terminal point is
This simple example illustrates the complete DH workflow:
The resulting transformation is the basis for the forward kinematic model discussed in the following section.
Summary of conventions used by Moro
Convention |
Moro |
|---|---|
DH formulation |
Classic Denavit–Hartenberg |
Parameter order |
\((a_i,\alpha_i,d_i,\theta_i)\) |
Row \(i\) defines |
\(T_i^{i-1}\) |
Joint \(i\) axis |
\(z_{i-1}\) |
\(\theta_i\) |
Rotation about \(z_{i-1}\) |
\(d_i\) |
Translation along \(z_{i-1}\) |
\(a_i\) |
Translation along \(x_i\) |
\(\alpha_i\) |
Rotation about \(x_i\) |
Revolute variable |
\(\theta_i=q_i\) |
Prismatic variable |
\(d_i=q_i\) |
Positive angular direction |
Right-hand rule |
Angular units |
Radians |
Length units |
User-defined but consistent |
DH matrix |
|
Forward composition |
\(T_n^0=T_1^0T_2^1\cdots T_n^{n-1}\) |
These conventions are used throughout Moro when describing serial manipulators using Denavit–Hartenberg parameters.