1. Introduction
This paper is broadly about
poses and/or
rigid motions, and how they can be represented by
unit dual quaternions. A pose is a description of a frame of reference with respect to a fixed frame of reference, and consists of an
orientation, and a
position. A rigid motion consists of a
rotation followed by a
translation. From a mathematical point of view, these can be considered to be the same thing, and so we use these terms interchangeably (but see [
1] for a different point of view).
Along with poses and/or rigid motions, we have the notion of
screws. First we have rates of change of poses/rigid bodies, which are angular and translational velocities, and are described by
twists. Second we have descriptions of how to change the inertia of the rigid body, the
wrench, that is, the torque and the force applied to the body. For more reading on rigid body kinematics and dynamics, including screw theory, we refer the reader to [
2,
3,
4,
5].
The notion of the dual quaternion, and its use to represent poses and rigid motions, seems to go back to McAulay [
6], inspired by the earlier work by Clifford [
7]. The notion of using dual quaternions to represent twists may be found in [
8,
9]. A basic introduction to dual quaternions may be found in [
10,
11], the latter also covering twists. Many authors have used dual quaternions to represent hierarchies of poses, that is, chains of manipulators [
9,
10,
12,
13,
14]. Papers on representing kinematics or dynamics via dual quaternions include [
8,
15,
16,
17,
18,
19,
20]. Dual quaternions have also found great use in computer graphics [
21,
22].
(The reader should be aware that [
8,
17] have incorrect formulas for the logarithm and exponential of dual quaternions—the correct formulas may be found in [
23], and [
24] for the exponential.)
The purpose of this paper is to introduce the notion of using Lie derivatives for dual quaternions. We show that these can be used to essentially automate the creation of rather complex formulas, which are required for forward kinematics, and for dynamic equations of motion.
The authors have successfully used these formulas, combine with the algorithm described in [
25], to create software for controlling a cable-driven parallel robot, which was built by the Dynamic Systems Test Branch of the Software, Robotics, and Simulation Division (ER5) at the NASA Johnson Space Center. Because of Export Administration Regulations we are unable to provide many more details.
The paper is quite heavy with mathematical formulas. For this reason, the proofs of most of the statements, and many of the comments of a mathematical nature, relegated to the
Appendix A.
2. Notation
Rotations can be represented by unit quaternions [
26,
27], which we briefly describe here. A
quaternion is a quadruple of real numbers, written as
, with the algebraic operations
. Its
conjugate is
, its
norm is
, its
normalization is
, its
real part is
, and its
imaginary part is
. It is called a
unit quaternion if
, a
real quaternion if
, and a
vector quaternion if
. If
, the multiplicative inverse is given by
. (Note that many sources use the word “pure” instead of “vector” in this context).
We identify three dimensional vectors with vector quaternions, by identifying , , and with the three standard unit vectors. A unit quaternion Q represents the rotation which takes the direction to . A rotation by angle a about an axis , where , has two unit quaternion representations: . Composition of rotations corresponds to multiplication of unit quaternions.
We can represent quaternions as four dimensional vectors, and give it the inner product
A dual quaternion is a pair of quaternions, written as , with the extra algebraic operation . We call the primary part of , and the dual part of .
The
conjugate dual quaternion of
is
. Conjugation reverses the order of multiplication:
There is another conjugation for dual quaternions:
, but we have no cause to use it in this paper, except in Equation (
7) below.
A unit dual quaternion is a dual quaternion such that , equivalently, that Q is a unit quaternion and . A vector dual quaternion is a dual quaternion such that both A and B are vector quaternions.
If
is a dual quaternion with
, then its multiplicative inverse can be calculated using the formula
If
is a unit dual quaternion, then there is a computationally much faster formula (see [
8]):
We set
for the set of invertible dual quaternions (that is,
where
),
for the set of dual quaternions,
for the set of unit dual quaternions, and
for the set of vector dual quaternions.
A rigid motion of the form
where here
is a translation, can be represented by the unit dual quaternion
Composition of rigid motions corresponds to multiplication of unit dual quaternions, where the notation
means to apply first the rigid motion represented by
, and then by
, that is, the dual quaternion acts by left multiplication. If
is a 3-vector, and
is the image of
under the action of the rigid motion
, then
but generally it is easier to use the formula
For a dual quaternion, it is not really possible to mix its primary and dual parts additively. For example, for a unit dual quaternion that represents a rigid motion, the primary part is unitless, whereas the dual has units of length. For this reason, when measuring how large such a dual quaternion is, everything must be with respect to a characteristic length scale
l. (For example, for a parallel robot, the characteristic length might be the width of the workspace of the end effector). The
size of a dual quaternion is defined to be
A
twist is the pair of vectors
that describes the rate of change of pose or rigid motion, where
is the angular velocity, and
is the translational velocity. One can think of the twist
as a rigid motion function of time
t:
It has two possible meanings, depending upon whether the twist is understood to be with respect to the fixed frame, or with respect to the moving frame. If it is understood to be with respect to the moving frame, we have the formula
and if it is understood to be with respect to the fixed frame
Then this twist can be represented by a vector dual quaternion [
8,
15]
where if we understand it to be with respect to the moving frame, we have the formula
and if we understand it to be with respect to the fixed frame
In this paper, unless otherwise stated, we always understand the twist to be with respect to the moving frame.
We make the identification
using the basis
and similarly, we make the identification
using the basis
,
,
,
,
,
. With these identifications, we can define the dot product between two dual quaternions by transferring the usual definition of dot product on
, that is
In this way, every dual quaternion
can be written in component form as
and every vector dual quaternion
as
Finally, we give a few extra formulas. Let
denote the twist with respect to the moving frame, and
denote the twist with respect to the fixed frame. From Equations (
14) and (
15) we obtain
Since in any algebra we have
we obtain the surprisingly simple formula for the change of frame for acceleration:
Note that this does not generalize to higher derivatives, for example, the formula for change of frame for jerk is
6. Lie Derivatives
The notion of the Lie derivative, sometimes in our context called the directional derivative, is a combination of two ideas that may be found in the literature. First is the concept of a Lie derivative with respect to a vector field [
28]. Secondly, the definition of the Lie algebra is that it is the vector space of vector fields that are invariant under left multiplication by elements of the Lie group [
29]. In this way, we can define the Lie derivative of a function with respect to an element of the Lie algebra. One place in the literature where they are combined is in [
30] (Equation (
5), Chapter II).
These standard abstract definitions can be made more concrete in our special case where the Lie group is the set of unit dual quaternions, and the Lie algebra is the set of vector dual quaternions.
Suppose one has a quantity that is a function of pose , and whose range is any vector space. (But for intuition, consider the case when the range is the real numbers, and think of the vector valued case as the formulas below simply being applied component wise).
Then we usually think of the derivative of as the Jacobian with respect to the components of . But it really makes more sense to compute the derivative with respect to the components of the perturbation of . The latter is the Lie derivative.
The definition is this. Given a differentiable function
g whose domain is the unit dual quaternions,
, and whose codomain is any vector space over the real numbers, we can extend it arbitrarily to a differentiable function whose domain is an open neighborhood of
in
. Given a unit dual quaternion
and a vector dual quaternion
, we define the
Lie derivative of
in the direction of
to be
Since
isn’t necessarily a unit dual quaternion, it is not obvious that the definition of the directional Lie derivative doesn’t depend upon how the domain of
g was extended from
, but it is, as is shown in Lemma A2 below.
Given a generic function
g whose domain is the invertible dual quaternions,
, and whose codomain is any vector space over the real numbers, we define its Jacobian to be the dual quaternion
where the partial derivative
is interpreted using the identification of
with the
components of
as described in (
17).
If the domain of
g is the vector dual quaternions,
, we have Equation (
42) except with 8 replaced by 6.
We have the following formula, which is useful for explicitly calculating the Lie derivative if an extension of
g to an open neighborhood of
in
is known:
where the notation
means the
component of
, as described in (
17).
We define the
partial Lie derivatives to be
and its
full Lie derivative to be the vector dual quaternion (or if the range of
g is a vector space, the tensor product of a vector dual quaternion with a vector)
so that for all vector dual quaternions
it satisfies:
To gain some intuition, write
Since we have that
we see that
represents a change in pose by an infinitesimal translation
and an infinitesimal rotation
, measured in the moving frame of reference. Thus
is a vector dual quaternion giving twice the change in
g with respect to an infinitesimal rotation, plus
times twice the change of
g with respect to an infinitesimal translation.
One important property of the Lie derivative is that if
represents a pose, with twist
, then by Equation (
41), with
r replaced by
t, we see that
The Lie derivative satisfies various rules, which easily follow from either Equation (
41) or (
43), which are also useful for explicitly calculating the Lie derivative when
g is known.
If
is linear in
, then
The product rule: if * is any binary operator which is bilinear over the real numbers, such as the product of real numbers, the inner product, the cross product, or the dual quaternion product, then
Let
be a constant position vector, and
be a constant direction. Let
and
be their corresponding values with respect to the moving frame. Then
To simplify the writing of application software, Using these rules, one can create a software library in C++ that performs automatic Lie differentiation. Since the domain, and hence range, of the Lie derivative can be any vector space, the sensible way to do this is using templates to allow for a variety of different data types. Note also that the product rule (
51) has to be implemented for every product that is used, and similarly the chain rule (
52) for every function
h that is used.
7. Applications to Parallel Robots
To aid our description, we show the example of a cable-driven parallel robot in
Figure 1 and
Figure 2. In
Figure 1, we show the end effector in green, controlled by eight cables shown in red, which go around pulleys shown in green. Each cable, and how it is attached to the pulley, is shown in
Figure 2.
Suppose that the position of the end effector of a parallel robot is given by
n actuators, described by quantities
For example, for a cable-driven parallel robot, these represent the lengths of the cables, and typically
. The numbers
only need to be determined up to a fixed number. Thus, for example, in
Figure 2, the number
could represent the length of cable from the end effector attachment point, to the small cross marked at the top of the pulley.
For the Gough or Stewart Platforms [
4], we have
, and
is simply the distance between the end effector attachment point and the ground attachment point.
Let us also denote the force exerted by the actuators by
defined so that the rate of change of work performed through the actuators is given by
Suppose we have a function , which calculates the required actuator values, ℓ, from the pose of the end effector frame. This is the inverse kinematics function.
We also define the
matrix
by
or more explicitly, by
From Equation (
49) we obtain
There is also a (
) matrix
that maps the actuator forces to the wrench dual quaternion:
This can be computed by balancing the force and torque exerted upon the end-effector. But it can also be computed with the following important identity:
9. The Examples of a Stewart Platform, and a Cable-Driven Parallel Robot
As an example, let us consider parallel robots such as cable-driven robots, or Stewart Platforms. In this case, the end effector has certain ’attachment points’ on it,
,
,
where the cables or legs attach, the cables or legs are attached at the other end to
, and unit vectors
,
,
which are directions the cables or legs come into the end effector, all of these being measured in the end effector’s frame of reference. Note that for
Then
or representing vectors as columns, we have
For calculating the second Lie derivative of
, we need only know the first Lie derivative of
. Note that in the simple case that the attachment point of the cable to the frame is fixed in the fixed frame (for example, as in a Stewart Platform), we have
and therefore
Let us also describe a more complicated situation, which matches the cable-driven parallel robot the NASA Johnson Space Center described in the introduction. For simplicity of notation, we drop the subscripts
k. See
Figure 2 for reference. Let us suppose that the cable attaches via an assembly, which is free to rotate about an axis parallel to the unit vector
, and passing through the point
. Attached to the assembly, at a fixed distance
w from the fixed point
, by a rod perpendicular to
, is the center of a pulley of radius
p, which rotates in the plane containing the axis of rotation and the point on the end effector
. A cable passes over the pulley in the
direction from the center of the pulley. All of the vectors are expressed in the moving frame of reference.
We work in the
coordinate system in which the origin is
. Let
be the coordinates of the center of the pulley. Then
where
The cable length, up to an additive constant, is
To avoid singularities, the optimal way to compute the inverse tangent, at least with the configuration shown in
Figure 2, is to use
, where the commonly available
function solves for
where
,
,
,
.
The various required quantities are
The Lie derivatives of these quantities can be calculated using the automatic Lie differentiation described at the end of
Section 6. The only second Lie derivative required is that of
ℓ, and since we have Equation (
67), no automatic second Lie differentiation is required.
10. Forward Kinematics
In robotics, there are several ways to find the pose of the end effector. One method is to use an optical system, but this is not very accurate. Another is to use a proprioceptive sensor, where the pose is found by integrating the acceleration and angular velocity of the end effector, but this is subject to drift. It would be extremely helpful if the end effector could be computed from the numbers . These numbers lengths can be found easily and with high sampling frequency using, for example, encoders.
Let the
set of admissible actuator values,
, be the range of the function
. Then the
forward kinematics function is
which is a left inverse to
. Because of possible measurement errors,
should produce decent answers even if the actuator values are merely close to
.
The methods described here are essentially the Newton-Raphson Method, and are all iterative methods. Given a guess
, we create a new guess
:
and iterate until some criterion is met. We measure
, and see when it is smaller than some preset value, like
.
Here we merely describe the method. In
Appendix A, we explain why they work.
We would also like to mention a different approach to using dual quaternions to solve forward kinematics problems in [
33], although we don’t think it will cover the more complicated situation described in
Section 9.
10.1. Forward Kinematics for Stewart Platforms
First we describe how to solve the exact-constrained problem, that is, when . This would be the case for a Stewart Platfom. Typically this is solved by writing the pose using Euler angles, which provides a way to represent the pose using a 6-vector. However, in the opinion of the authors, this becomes a rather complicated set of equations, resulting in quite lengthy code.
Our algorithm is
This is easy to code, certainly simpler than methods which use Euler angles.
10.2. Forward Kinematics for Over-Constrained Parallel Robots
Next we focus on the over-constrained problem, that is, when the number of actuators n is greater than 6.
This problem has been solved by many others, for example, [
33,
34]. But we feel that this is more easily solved using dual quaternions. For example, using the programming language C++, one can quickly build classes representing dual quaternions, and then these formulas can be applied without any real thought.
We compute
and
The algorithm is
10.3. Results of Simulations for Forward Kinematics
The software used to check these algorithms described here is currently proprietary, and so we cannot give too many details. We hope to get permission to release the software at a later date, and make it available to everyone.
To test the simple Stewart Platform algorithm, we created 10,000 random poses. The orientation of each pose had an angle no greater than from the identity pose. For each pose, the cable lengths were calculated. The Newton-Raphson Method was then applied to the cable lengths, with a random initial guess pose.
All runs were successful. The average number of required iterations was about 4.8. The run time for each forwards kinematics calculation was a little under 100 microseconds, using a fairly modern but low-end laptop. Increasing the allowed angle to gave a failure rate of 2 in 10,000.
The Newton-Raphson Method for the over-constrained robot given by the more complicated situation described in
Section 9 was more delicate. In particular, since it is minimizing a loss function rather than directly solving the problem, it is possible that it might find local minima of the loss function which didn’t correspond to the solution.
For the first test, we created 1000 random poses, and computed their cable lengths. The Newton-Raphson Method was applied, with a random initial guess pose, and was allowed up to 50 iterations. If the loss function of the final answer was greater than , the Newton-Raphson Method was applied again.
All poses were found, but the average number of times the Newton-Raphson had to be applied was about 80. The average time to find a pose was about 5 ms.
For the second test, we again created 1000 random poses and computed their cable lengths. Then the Newton-Raphson was applied, with an initial guess that was 1% different from the original pose. Again success was measured by computing the loss function. But there were no second chances.
All poses were found, the average number of iterations required was 4.2, and the average time taken was a little under 100 microseconds.
Increasing the allowable difference between the initial guess and the original pose to 5% resulted in only about 88% of the runs being successful.
Note that in all these trials, since the poses were randomly created, it is quite likely that some of the poses were non-feasible for the parallel robots under consideration. (For example, it might be impossible to maintain that pose while keeping the cables under tension, or moving to that pose might require crossing cables).
When using this algorithm, to find the initial pose, we suggest to use the first method of trying 1000 different initial guesses, and choosing the pose with the lowest loss function. But thereafter, sample the cable lengths often, and use the previously measured pose as the initial guess. In our numerical simulations, the pose changes by about 0.3% per time step (about 1 ms), and the algorithm has never failed to solve the forward kinematics problem.
11. Dynamics of the End Effector
The dynamics equations of motion of rigid bodies is well known. But in this section, we also consider the additional effect of overcoming inertia from the actuators. Furthermore, we feel that it is nice to see this stated and derived in the context of dual quaternions.
Let us suppose that the kinetic energy of the parallel robot is given by
where
is a
positive definite matrix, which depends only upon
, and which we call the
effective mass of the parallel robot.
We define the
no-load forces to be the actuator forces if there is no end effector present:
where
is a positive definite
matrix denoting what we shall call the
effective no-load mass of the actuators. This might be caused by, for example, the reflected moment of inertia of the motor that drives each actuator, in which case
is simply a constant multiple of the identity. Since
is part of the kinetic energy, it follows that
is a positive semi-definite matrix.
If
is the mass of the end effector,
is the moment of inertia tensor of the end effector about its center of mass, and
is the center of mass of the end effectors, all measured with respect to the moving frame, then
that is
Theorem 1. If the kinetic energy satisfies Equation (84) with Equation (87) holding, and the potential energy v is calculated in the usual manner from the mass of the end effector in a constant gravitational field whose value is measured with respect to the moving frame, then the equation of motion iswhereand The various terms in Equation (
89) can be interpreted as follows.
and are inertial resistance to change of angular and translational velocities.
is the centripetal force required to rotate and move at the same time.
is the precession torque (so that if the moment of inertia is not isotropic, then the body spins in a counter-intuitive manner, see, for example, [
35]).
is the wrench required to move the actuators, where the no-load forces may be computed using
is the force due to gravity.
All terms containing
are corrections required since the center of gravity isn’t necessarily the same as the origin of the moving frame of reference. They could be derived by first finding the equations of motion when
, and then applying Equations (
27) and (
28).
Numerical Verification of the Dynamics Equations
The way we numerically verified these equations was by running a simulated motion, and then calculating the work done in three ways. The first method was to integrate the inner product of the twist and the wrench on the end effector. The second method was to integrate the sum of the actuator force times the rate of change of the length of the actuator. The third method was to calculate the total kinetic energy using Equation (
86), and the potential energy using the standard mass times gravity time height formula. The numerical simulations gave the same results for all three methods up to machine precision.