Direct Kinematics

TagsKinematics

Practical Tips and Tricks

💡
COMMON MISTAKE: remember that frame ii includes the tranformation induced by joint ii. Concretely, there are four moves you make between frames: you translate according to previous xi1x_{i-1}, you rotate according to previous xi1x_{i-1}, you rotate according to new ziz_i, you translate according to new ziz_i. All four transformations are contained in a frame shift

DH tips and tricks

Remember that you need to align the x axis to point at the next joint, and you do this by rotating the zz.

Ordering of rotation

Follow the order of rotations as specified by the joints; failure to do so can yield a bogus result

Importance of θ,d\theta, d

These θ,d\theta, d are free parameters, meaning that they will be used to make the robot legal. This will be painfully apparent if you have a world frame whose xx doesn’t line up with the next joint. This is where the θ\theta comes in.

If you are given axes → Derive DH parameters

If you are given axes, the derivation should be simple. Just propagate the frames using the four step method. At a given point ii:

  1. Using previous xi1x_{i-1}, find translation from the previous frame to the new frame along axis xi1x_{i-1}. Note that this may NOT be the final location of the frame because we have another translation later
  1. Using previous xi1x_{i-1}, find rotation along this axis that takes zi1z_{i-1} to ziz_i. Often, this is some multiple of 90 degrees. Remember to use right hand rules
  1. Using the current ziz_i, find the rotation along ziz_i that takes xi1x_{i-1} to xix_i. Rembmer right hand rule. Also remember that prismatic joints may have a twist.
  1. Using current ziz_i, find the translation along ziz_i that takes us from where we are, to the next frame. Remember that revolute joints may have a displacement.

If done right, you should be able to traverse the whole robot through these cyclical sequence of translations and rotations. Note that the first two steps are interchaneable, and so are the last two steps.

If you are given DH parameter → derive axes

This is actually the more tricky variant of this problem because it requires you to work backwards. There’s a degree of dynamic problem solving in place, although there are some tips and tricks.

The general method is to build up the axes systematically. If you do it correctly, everything will be self-consistent. Building up the axes sysematically means doing the following:

  1. Propagate the new origin using ai1a_{i-1}, the previous frame, and the previous xi1x_{i-1}.
  1. Find the new ziz_i using αi1\alpha_{i-1} and the previous zi1z_{i-1}
  1. Find the new xix_i using did_i and θi\theta_i

If you are given nothing

If you start from scratch, know that you can define the axes quite arbitraily. So I would recommend doing the following

  1. Assign axes systematically without worrying about the angles or the lengths (recall: if overlapping zz, pick the xx that yields positive rotation α\alpha
    1. Start with zz first, because their axis is known (they must be through a revolute joint and prismatic joint)
    1. xx always points to the next joint (if it’s not, you’re doing something wrong). Tiebreaker: if the frames overlap, pick xx that creates positive angles.
  1. Label your active angles and shifts. See above in how to derive DH parameters from an axis set.

Remember that an angle θ\theta doesn’t influence any future links, so you won’t have to worry about any weird dependencies. If you are worrying about it, then you’re doing something wrong.

Common confusion is mixing up ai1a_{i-1} with did_i. The first one is along the x axis of the previous frame, which is often zero. The second one is along the z axis of the current frame.

Links

A link connects two joints. A joint can be revolute around the central axis, or it can be prismatic that moves along that central axis (note that it doesn’t affect the link itself, which is always rigid).

There are few properties we need to pay attention to.

Between two links

The two links have their own axes. With two axes, you can narrow down a common normal.

The link length, or ai1a_{i-1} in the diagram, is the length along the common normal from axis i1i-1 to axis ii. Note that the link may be weirdly shaped, but all you care about is this common normal. The common normal is the shortest distance between these axes.

💡
This may NOT be the line that passes between the two joints! This is a common mistake!

If project the axis ii onto axis i1i-1 along the common normal, you’ll get an angle denoted as αi1\alpha_{i-1} above, and it references the link twist. Note that this is the same angle you’d have to twist axis i1i-1 along the common normal to get the joints to align. This also latches onto the theme of all rotations being represented by an axis and an angle.

Two special cases exist:

Connecting links together (DH Parameters)

So we saw how link length and link twist are important parameters for a link. Now, this is a stationary property that doesn’t change with joint angle. So how does joint angle play into it?

Well, if we look at the next link, we realize that the angle between our current common normal and the next common normal is determined by θi\theta_i. And the vertical offsets between the common normals are determined by did_i, the prismatic offset. In revolute joints, θi\theta_i changes but not did_i. Vice versa for prismatic joints. However, it may be the case that revolute joints have a constant offset (because of the hardware), and prismatic joints have a constant rotation. This must be considered in the equations.

These four parameters: ai,αi,θi,dia_i, \alpha_i, \theta_i, d_i tell us how two links behave. These are known as the Denavit-Hartenberg parameters. You can imagine a,αa, \alpha telling us how the link works, and θ,d\theta, d telling us how to orient the next link.

First and last links

With our four parameters, we can define α,a\alpha, a for i=1,2,3,,n1i = 1, 2, 3, …, n-1. But the first and last links are really weird. The first link is base → first joint, and the last link is last joint → end-effector tip.

You could specify the base as something different than the first joint, which would mean that you have non-zero α,a\alpha, a. However, conventionally we assume that the base overlaps with the first joint, which means that the only non-zero property is θ0\theta_0 or d0d_0.

For the last link, we know that there is no extra joint, so dn,θnd_n, \theta_n must be 0. For simplicty, we also assume that the last joint is the end-effector, which means that αn,an=0\alpha_n, a_n = 0 as well. This is just for simplicity.

Notation

Rotational joints are denoted as “spools”. The spools rotate as if you had a pin in the hole that goes through the spool. Primatic joints are denoted as diamonds. They move along the axis that the diamonds pinch.

Attaching Frames to links

In general, for each joint, three of the Denavit-Hartenberg parameters will be fixed and one will be variable.

We can do this by using a fixed convention. First, let’s define the point of the frame of axis i1i-1 as the intersection of the shared normal ai1a_{i-1} and the axis vector.

Direction convention

Let XX point along the common normal to the next axis. Let ZZ point in the direction of the axis. The ZZ direction is actually arbitrary, but it influences how you define YY and the positivity of the angle.

If the axes intersect (like with a sphere joint), you will need to make a choice on the direction that XX points. Choose the direction such that the angle from axis ii to i+1i+1 is positive.

Now, note that this α\alpha is defined as the direction you would need to rotate axis i1i-1 to align with axis ii. This is consistent with using the right hand rule around axis XX.

First and last links

The first and last links are also tricky. As we mentioned above, we should try to set the base as close to the reference frame as possible. In revolute joints, that means setting a0=α0=d1=0a_0 = \alpha_0 = d_1 = 0, meaning that when θ=0\theta = 0, the base frame is the first frame. Simialrlly with prismatic joints, we want to pick something where a0=α0=θ1=0a_0 = \alpha_0 = \theta_1 = 0.

And the last link math is similar; make sure that you set zero offset except for what the joint does. This corresponds to having the last joint be the end-effector.

Example: RRR

If we consider a planar robot with 3 joints, we can see how the parameters come together. You can see how frame 0 is the base, and how frame 1 aligns with frame 0 when θ=0\theta = 0. Because all joints are planar, the α=0\alpha = 0 for all α\alpha, and the aa is just the length of the link. So this is one of the simpler setups.

Good diagram

Propagation of Frames

Now the big question is this: given the DH parameters for the arm, can we derive the different frames?

The trick is that each of the DH parameters specify a particular transformation, and the composition is actually really simple. From frame i1i-1, you want to…

  1. apply a rotation matrix to align the two joints. By construction, this means that you rotate around the x axis by α\alpha degrees
  1. apply a translation to move joint i1i-1 to joint ii. Note that because you’re already aligned on the common normal, so you just have to translate the xx
  1. Apply a rotation (if needed) that represents the rotation of this next joint. Because you’re already aligned this is just a rotation around z
  1. Apply a translation (if needed) that represents the motion of the prismatic joint. Because you’re already aligned, this is just a translation with zz.

This can be written as

Which you can imagine as rotating the previous joint to align with the current one. Then, moving this joint to the current one. These are actions on the xi1x_{i-1}. Then, you rotate and translate around ziz_i, which creates your current xix_i. Remember: first create the z from the x, then the x from the z.

And here’s what the operator looks like

Kinematics of Manipulators

Once you know how to bring us from one frame to another, you can map joint angles to positions and rotations!

Direct Kinematics

This brings us to the concept of direct kinematics, which is mapping joint space coordinates to task space.