View metadata, citation and similar papers at core.ac.uk brought to you by CORE

provided by LSBU Research Open

TUTORIAL Active Versus Passive Transformations in Robotics

BY J.M. SELIG

here are two main ways to keep track of where θ is the angle of . The effect of such a rotation motions. Most current texts on robotics use the passive on point p is the matrix product: approach, where the rigid body has a coordinate frame T embedded in it, and then its position and orientation is given p = Rz(θ)p. by the coordinate transformation from the world frame to a frame moving with the body. When there are several bodies The coordinates of the new point p will be and when bodies also carry several different frames, it can be hard to account for all the different frames. x cos θ − y sin θ In the lesser-known active view, there is a single fixed p = x sin θ + y cos θ . coordinate frame. The position and orientation of a rigid z body is specified by the transformation, which moves the body from its home position to its current position. This Notice that the z-coordinate is unchanged because we are active view is completely equivalent to the traditional pas- rotating around the z-axis. sive view, so readers familiar with the traditional approach A can be modeled by vector addition. Suppose need not change their habits. However, newcomers to the we want to translate by a translation vector t; the effect on subject may find it simpler to learn robotics using the active our point p will be view since there is a greater emphasis on the bodies and their and, consequently, less emphasis on coordinate p = p + t. frames and changes of coordinates. This article presents the active view and relates it to the In robotics, it is common to combine rotations and transla- traditional passive view. The idea is to show that the active tion into 4 × 4 matrices: view is straightforward to teach and learn but is entirely equivalent to the standard passive approach. R t M = . 01 Transformation of Points Let us begin with familiar material, rigid body transforma- This is a partitioned matrix with R a 3 × 3 tions of points. As mentioned previously, we have a single and t a three-dimensional (3-D) column vector corresponding fixed coordinate frame. Now consider a point p in our to the translation; note that the 0 in the bottom left corner coordinate system that will have components (x, y, z) and, really represents a row of three zeros. This representation of a hence, will be represented by a column vector rigid transformation is sometimes called the homogeneous representation because of connections with projective geometry, x but projective geometry will not be considered here. p = y . To model the effect of such a transformation on a point, z we need to change our representation of points. From now on, a point with coordinates (x, y, z) will be represented by A rotation around the z-axis can be modeled by a 3 × 3 a four-dimensional (4-D) column vector: matrix:   x cos θ − sin θ 0  y  p R (θ) = sin θ cos θ 0 , p˜ =   = . z z 1 001 1

MARCH 2006 1070-9932/06/$20.00©2006 IEEE IEEE Robotics & Automation Magazine 79 So the effect of a rigid body transformation can be written as x the matrix product p = y , z Rp + t p˜ = M p˜ = . relative to the fixed frame and also relative to home position 1 of the body frame since these are the same. Now, when the body moves, the point becomes p, but in the body frame, So far, everything has been active; the points moved! In the coordinates have not changed. the passive view, the points stay still and the coordinate In the passive approach, we need to be able to distinguish frames move. between the different coordinate frames. We have to intro- To relate the two views, think of a rigid body with a duce a new layer of notation to express the fact that the vec- coordinate frame embedded in it. To begin with, that is in tor p could be given in coordinates relative to the fixed frame the home position, our fixed frame and the frame in the f p or the body frame bp. body coincide. After the transformation, the body has a Extending these conventions to the 4-D vectors in the new position and orientation, and, therefore, so does its obvious way, we have in the fixed coordinate frame embedded frame (see Figure 1). Suppose that p is a point in the body. In the home f p˜ = M f p˜ . position, it has the coordinates What we want here however, is the coordinate transforma- tion relating coordinates in the two frames. Notice that the point p is in exactly the same position relative to the body z' frame that p was relative to the fixed frame. In coordinates, this means that bp = f p. Substituting this into the previous z equation, we get p' − bp˜ = M 1 f p˜ . p y' So the relationship between an active transformation and a passive one is that the coordinate transformation is the inverse y of the corresponding active transformation. Notice that this explanation is very prejudiced towards the x x' active view. The above could also be expressed by saying that the active transformation is the inverse of the corresponding Figure 1. Two coordinate frames. passive transformation. Finally, notice that the inverse of these partitioned matrices is easy to find. If the original transformation was R t M = , z 01 z then its inverse will be T T − R −R t M 1 = , 01 y y x − x where RT = R 1 is the transpose of the rotation matrix, and p this is the inverse of R since rotational matrices are orthogonal, i.e., they satisfy the relation RRT = I.

Conjugation (a) (b) Before using this active view to look at the forward kinemat- ics of serial manipulators, it is necessary to look a little more Figure 2. Rotation around two different axes. closely at rotations. In general, a rotation in 3-D space is a

80 IEEE Robotics & Automation Magazine MARCH 2006 rotation around an axis. This rotation axis is a fixed line in p = p + λv, space. Let us work out the 4 × 4 matrix that represents a rota- tion of θ radians around a particular line in space. Assume this line is parallel to the z-axis, and suppose (1, 0, 0) is a point where v is a vector in the direction of the line and λ is an on the line [see Figure 2(a)]. The rotation around this line is arbitrary scalar. Since the rotation leaves its axis fixed, clearly equivalent to the following sequence of rigid transfor- we must have Rv = v and hence (I − R)v = 0. mations. First, we translate the line so that it coincides with Therefore, the z-axis, then we rotate around the z-axis, and, finally, we translate the axis back to its starting position. The advantage (I − R)p = (I − R)p. of splitting the rotation up in this way is that we already know the matrices representing each of these transformations. The In theory, this kind of operation on a transformation translations are given by matrices of the form is called a conjugation. That is, a conjugation of a transforma-   tion M by a transformation N is given by the product 100±1 N −1MN. Conjugation is a very useful and common opera-  010 0 tion in group theory. T± =   . 001 0 In robotics, there is another major use of conjugation 000 1 connected with coordinate transformations. Suppose that M is an active transformation expressed in a fixed coordinate Taking the minus sign here gives the translation of the line to frame. Assume that the transformation moves the point f p˜ to the z-axis, it will take the point on the line (1, 0, 0) to the the point f p˜ = M f p˜ . Now, what is the matrix of this origin. Taking the plus sign translates the line (and the point transformation expressed in a different coordinate frame? In on it) back to its original position. The rotation is simply a this new coordinate frame, the coordinates of the points can rotation around the origin be assumed to be np˜ = N −1 f p˜ and np˜ = N −1 f p˜ , where   N is the active transformation that moves the fixed frame to cos θ − sin θ 00 the new one. Clearly,  sin θ cos θ 00 R(θ) =   . − − − 0010 np˜ = N 1 f p˜ = N 1M f p˜ = N 1MN np˜, 0001 so that the transformation that takes the point np˜ to np˜ is To combine the three transformations, we multiply the N −1MN. That is, the effect of a change of coordinates on matrices with the first transformation on the right,

  cos θ − sin θ 01− cos θ z J J  sin θ cos θ 0 − sin θ  4 6 T+R(θ)T− =   . 0010 0001

Suppose we want to compute the of J5 a rotation around some general line in space. Assume that R is the 3 × 3 rotation matrix whose rotation axis is in the direc- D4 tion of the line, and let p = (x, y, z)T be the position vector of some point on the line [see Figure 2(b)]. The 4 × 4 matrix we seek is given in partitioned form by J3

    L2 I p R 0 I −p A(θ) = 01 01 01 J y   2 x J ( − ) 1 = R I R p , 01 where I represents the 3 × 3 identity matrix. Notice that the point on the line we used is not important, any other point on the line would be given by Figure 3. The PUMA robot and its home configuration.

MARCH 2006 IEEE Robotics & Automation Magazine 81 a transformation matrix is a conjugation. Or with the extra coordinate axes with the home positions of Joints 1 and 2. layer of notation, nM = N −1 f MN. Notice that N is We can draw up a short list of the directions of the joints expressed in the original fixed coordinate frame. in the home configuration and convenient points on the joint axes: Forward of Serial Manipulators In this section the forward kinematics of a simple six-revolute Joint vp (6-R) manipulator will be derived using the active viewpoint J1 k0 and without using the traditional Denavit-Hartenberg J2 i0 method. The 6-R manipulator is used here for simplicity; the J3 i L 2k method extends easily to robots with prismatic and even J4 k D3i helical joints. J5 i (L 2 + D4)k The forward kinematics of a robot relates the displacement J6 k D3i of the joints (joint angles for revolute joints) to the position and orientation of the tool or end effector of the robot. The Here, i, j, and k are unit vectors in the x, y, and z directions, inverse kinematics is the inverse problem of finding the set of respectively. The fixed lengths L 2, D3, and D4 are the design joint angles, which will place the end effector of the robot at a parameters of the robot. specified position. Now it is a simple matter to find the A matrices. The first Instead of using the Denavit-Hartenberg parameters of one is simply a rotation around the z-axis: the robot, we use the home position of the joint axes. For   each joint axis, we can find the A matrix representing rota- cos θ1 − sin θ1 00 tions around that joint. Often, in the home position of the  sin θ cos θ 00 A (θ ) =  1 1  . robot, the joints will be aligned with the coordinate axes 1 1 0010 so the rotation matrix part of the transformation will be 0001 easy to write down. To find the translation part, we need to know the coordinates of a single point on the axis, then The second one is also simple, this time a rotation around the we can use the results of the previous section to find the x-axis: full 4 × 4 transformation matrix. We will look at a specific   10 0 0 example later.  0 cos θ − sin θ 0  To find the overall transformation undergone by the A (θ ) =  2 2  . 2 2 0 sin θ cos θ 0 robot’s end effector, we simply multiply the A matrices. This 2 2 00 0 1 can be justified as follows: Begin with the last joint, the one furthest from the base of the robot (sometimes called the distal For A3,we need to know the term (I − R)p. The rotation is joint); a rotation around this joint will not affect the positions again around the x-axis: of any of the joints nearer the base. Next, we can rotate   around the next-to-last joint, again without affecting any joint 100 10 0 nearer the base. Continuing in this sequence, we end by 010− 0 cos θ3 − sin θ3 001 0 sin θ cos θ rotating around the first joint (the proximal joint). Suppose   3 3 that A i(θi) is the matrix representing a rotation around the ith 0 0 joint by an angle of θi, then the above sequence of transfor- × 0 = L 2 sin θ3 , mations can be written as L 2 L 2(1 − cos θ3)

K (θ1,... ,θ6) = A1(θ1)A2(θ2)A3(θ3)A4(θ4)A5(θ5)A6(θ6). so that,   10 0 0 This compound transformation represents the motion under-  0 cos θ − sin θ L sin θ  gone by the robot’s end effector from its home position to the A (θ ) =  3 3 2 3  . 3 3 0 sin θ cos θ L (1 − cos θ ) position when the joint angles are set to θ ,θ,...,θ . 3 3 2 3 1 2 6 00 0 1 Notice that when the joint angles are all zero, the robot will be in its home position. Similarly, we have As a concrete example, we will find the A matrices for a   cos θ − sin θ 0 (1 − cos θ )D PUMA robot (see Figure 3). The first thing we need to do 4 4 4 3  sin θ cos θ 0 − sin θ D  is to fix a convenient coordinate frame and home configu- A (θ ) =  4 4 4 3  , 4 4 0010 ration for the robot. In this case, since the first two joints 0001 meet at right angles, it is sensible to choose the origin of our coordinates at this meeting point and align two of the and also

82 IEEE Robotics & Automation Magazine MARCH 2006     10 0 0 0 = 0 0 −1 . K 6KK 6K  0 cos θ5 − sin θ5 (L 2 + D4) sin θ5  A5(θ5) =   . 0 sin θ3 cos θ3 (L 2 + D4)(1 − cos θ5) 00 0 1 One textbook that gives more details of the active view of kinematics is [6]. Unfortunately, this book now out of print. Finally, we have   Denavit-Hartenberg Revisited cos θ − sin θ 0 (1 − cos θ )D 6 6 6 3 In this section, the standard approach to the forward kinemat-  sin θ cos θ 0 − sin θ D  A (θ ) =  6 6 6 3  . ics of serial robots will be reviewed. Any standard textbook 6 6 0010 on robotics will give a fuller account of this material. See, for 0001 example, [1]–[5] and [7]. The aim here, however, is to relate This is really all there is to the forward kinematics of serial the standard method to the approach outlined previously. robots. The first step here is to attach a coordinate frame to each However, it is often useful to express things in the tool link of the robot, including the base link. There are detailed frame of the robot. The tool frame is a coordinate frame fixed rules specifying how to do this, but in essence, the frame in in the tool or end effector of the robot (see Figure 4). A com- the ith link is placed so that its z-axis is aligned with the axis mon way to express the forward kinematics of a robot is to of the (i + 1)th joint. The first frame is placed in the base link give the transformation that takes the standard fixed frame, (link 0) and is the world frame. The frame in the last link (link now called the world frame, to the tool frame. This is now easi- 6) is the tool frame. ly done; remember that K = K (θ1,...,θ6) is the transfor- The idea is to give the transformation from the world mation that takes the end effector from its home position to frame to the tool frame. The transformation from frame i to i its current position, so it will also transform the tool frame frame j is usually expressed as jM , so that the coordinates of a from its home position to its current position. So, all we need point p˜, expressed in the two frames satisfies to do is to first transform from the world frame to the home i ˜ = i j ˜. position of the tool frame. This transformation doesn’t depend p jM p on the joint angles, so let’s just label it B. In this style, the for- i ward kinematics can be expressed as So we can think of jM as the active transformation that moves frame i to frame j. 0 = (θ ) (θ ) (θ ) (θ ) (θ ) (θ ) .() 6K A1 1 A2 2 A3 3 A4 4 A5 5 A6 6 B 1 The overall transformation from the world frame to the tool frame can be found by multiplying the transformation 0 The notation 6K is intended to signify the transformation 0 = 0 1 2 3 4 5 . from the initial (0th) frame to the final (6th) frame; see the 6K 1M 2M 3M 4M 5M 6M next section for more details of this notation. In the example above, we could choose the origin of The order of multiplication is, of course, very important. the tool frame for the PUMA to be located at the center For active transformations, the next transformation in a of the wrist. The transformation B would then be a pure sequence would multiply on the left. Here, the next translation:   100 D3  010 0  B =   . z 001L 2 + D4 000 1

As suggested above, a more useful application of the y tool frame is to specify moves in terms of the tool frame. For example, suppose that the z-axis of the tool frame is aligned with an axis in the robot’s gripper; now, we might want to command the robot to move a little way x along this axis or perhaps turn around this axis. Suppose the desired motion is given by the transformation K expressed in the tool frame. In order to express this in the world frame, we simply conjugate by the appropriate transformation; this is the transformation that takes the (0 )−1 tool frame to the world frame, i.e., 6K . Hence, in the world frame, the move is Figure 4. The tool frame attached to the last link of a robot.

MARCH 2006 IEEE Robotics & Automation Magazine 83 transformation multiplies on the right. This is because each transformations, this simply amounts to ensuring that they i j jM is expressed in frame i. To express kM in frame i, we are all expressed in the same coordinate frame, which is i −1 i j i −1 would conjugate by jM to get jM kM jM . Now that trivial if there is only one frame, and getting the order of both transformations are expressed in frame i, we can multi- multiplication correct. For passive transformations, there ply on the left, and we get are more considerations, certainly the multiplication will be well defined if the transformations are expressed in a i j i −1 i = i j . jM kM jM jM jM kM common frame. However, as we saw above, it is some- times possible to multiply transformations expressed in An alternative way to see this is to look at the effect on a different frames. i ˜ = i j ˜ point p again. Suppose p jM p as before, but now we Mathematically, the active and passive views are j ˜ = j k ˜ have a third frame k so that we also have p kM p. Substi- equivalent. There may be practical differences between j ˜ i ˜ = i j k ˜ tuting for p gives p jM kM p. the two approaches. However, it would seem likely that i Now each transformation matrix jM has the following some ideas are better expressed in one format and others structure: are most easily dealt with in the other. So, there is really nothing to choose between them. In the end, the choice i = (θ ) i . jM Rz j jB is a matter of personal preference and depends on famil- iarity and personal taste. i Here, the matrix jB is the transformation from frame i to frame j when the robot is in its home position, i.e., when the Keywords joint angles are zero. The matrix Rz(θj) gives the rotation Rigid transformations, kinematics. around the jth joint axis. Remember that in this formalism, every joint axis is aligned with the local z-axis. It is only the i jB transformations that involve the Denavit-Hartenberg para- References meters, the design parameters of the robot. [1] J.J. Craig, Introduction to Robotics: Mechanics and Control, 2nd ed. Reading, Finally we can show that the above is equivalent to (1). If MA: Addison-Wesley, 1986. [2] J.K. Davidson and K.H. Hunt, Robots and Screw Theory: Applications of we conjugate the A matrices above to put them into local Kinematics and Statics to Robotics. London, UK.: Oxford Univ. Press, coordinates, we get 2004. [3] K.S. Fu, R.C. Gonzalez, and C.S.G. Lee, Robotics—Control, Sensing, Vision and Intelligence. New York: McGraw-Hill, 1987. R (θ ) = A (θ ) z 1 1 1 [4] P.J. McKerrow, Introduction to Robotics. Reading, MA: Addison Wesley, 0 −1 0 1990. Rz(θ2) = B A2(θ2) B 1 1 [5] R.P. Paul, Robot Manipulators: Mathematics, Programming, and Control. −1 (θ ) = 0 1 (θ ) 0 1 Cambridge, MA: MIT Press, 1981. Rz 3 1B 2B A3 3 1B 2B . [6] J.M. Selig, Introductory Robotics. Englewood Cliffs, NJ: Prentice Hall, . 1992. [7] M.W. Spong and M. Vidyasagar, Robot Dynamics and Control. New −1 (θ ) = 0 1 ···5 (θ ) 0 1 ···5 . York: Wiley, 1989. Rz 6 1B 2B 6B A6 6 1B 2B 6B

We also need the overall transformation from the world frame J.M. Selig graduated from the University of York, U.K., to the tool frame in the robot’s home position; this is clearly in 1980 with a B.Sc. in physics. He went on to study in the Department of Applied Maths and Theoretical Physics = 0 1 2 3 4 5 . B 1B 2B3B 4B 5B 6B at the University of Liverpool and was awarded a Ph.D. in 1984. From 1984–1987, he was a postdoctoral fellow in Now the two versions of the forward kinematics are exactly the design discipline of the Open University, studying equivalent. robot gripping. He joined the Department of Electrical and Electronic Engineering at South Bank Polytechnic in 1987. Concluding Remarks In 1999, he transferred to the School of Computing, Infor- The aim of this article has been to show that the active mation Systems, and Mathematics. His research interests approach is simple to learn and teach. Students (and can be summarized as the applications of modern geometry teachers) often get confused by having many coordinate to problems in robotics. frames. An extra level of notation needs to be introduced to distinguish between objects that are the same but Address for Correspondence: J.M. Selig, Faculty of Business, expressed in different coordinate frames. When perform- Computing and Information Management, London South ing multiplication of transformations, we need to make Bank University, London SE1 0AA, UK. Phone: +44 20 7815 sure that the multiplication is well defined. For active 7461. E-mail: [email protected].

84 IEEE Robotics & Automation Magazine MARCH 2006