After the D-H Convention with the D-H parameter table for an open serial- chain robotic system is introduced, all the possible homogeneous transforma- tions will form a closed loop along both the inside and outside robot bodies.
Each link has also been assigned with an attached coordinate frame and in to- taln+ 1 frames are assigned inside the robot body, including the base frame, if the robot has n joints. We often use A and H to denote a homogeneous transformation inside the body and outside the body, respectively, to distin- guish them as different representations. However, either Aij or Hji describes both the relative position and orientation of frameiwith respect to framej.
Therefore, they are all unique and collectively form theSE(3) =R3×SO(3) multiplicative group to represent every 6 d.o.f. rigid motion.
In a robotic task/path planning phase, it is often required to determine a trajectory, along which the robotic hand or end-effector frame travels from a starting point to an ending or destination point. To uniquely represent either the starting or the ending point of the trajectory, we can now easily adopt a 4 by 4 homogeneous transformation matrix to do so. IfH01 is the position and orientation at the starting point with respect to the base andH02 is the position and orientation at the ending point with respect to the base, too, then,
H12=H10H02= (H01)−1H02
represents the “difference” of both the positions and orientations between frame #1 and frame #2.
In order to sample the trajectory into N uniform sampling points, we have to take position and orientation into separate consideration due to the uncommon natures between them, i.e., the former is additive in nature and the latter is multiplicative in nature. Forthe position part, if the trajectory is a straight line, we may first find the difference between the last columns of H02andH01, i.e.,p21(0)=p20−p10, and then to determine the sampling interval Δp0 = p
21(0)
N . Finally, at the i-th sampling step (0 ≤ i ≤ N), the position vector of the robotic hand with respect to the base is determined by
p(i)0 =p10+iãΔp0=p10+ i
N(p20−p10). (4.5)
Obviously,p(i)0 is started atp10wheni= 0 and ended atp20 wheni=N.
If the trajectory is a curve, then it is ideal to describe the path by a 3D parametric equation in the form
⎧⎨
⎩
x=x(t) y=y(t) z=z(t)
with each coordinate referred to the base as a function of timetor the other parameters, such as an arc length, etc. The robotic hand position vector at thei-th sampling point will become straightforward:
p(i)0 =
⎛
⎝x(ti) y(ti) z(ti)
⎞
⎠.
For instance, if the path is specified as an ellipse on the y-z plane of the base with its center at (xc yczc) and semi-axesaandb, then,
p(i)0 =
⎛
⎝ xc
yc+acos(ωti) zc+bsin(ωti)
⎞
⎠,
where ω is the angular frequency to determine how fast the robotic hand travels along the elliptic path.
If the desired path is difficult to describe with an explicit function form, we may use a numerical solution. First, find a few desired discrete points on the path, and then apply the internal function spline(ã ã ã) or pchip(ã ã ã) in MATLABT M to make a more detailed and smoother new curve by certain interpolations for each of the three coordinates versus timet. The new curve is better to have the same number of the sampling pointsN so that thei-th position p(i)0 will just be the i-th x, y and z values of the new curve. For example,
t = 0:5; % The Original Scale for 6 Known Points x = [4 5 7 5 3 2]; % The X-Coordinates of the 6 Known Points y = [10 9 7 4 2 3]; % The Y-Coordinates
z = [8 6 4 2 4 6]; % The Z-Coordinates
tt = 0:0.1:5; % Make As Detail As N=51 Sampling Points x1 = spline(t,x,tt); % Call the spline(.) Internal Function y1 = spline(t,y,tt);
z1 = spline(t,z,tt);
x2 = pchip(t,x,tt); % Call the pchip(.) Internal Function y2 = pchip(t,y,tt);
z2 = pchip(t,z,tt);
plot3(x,y,z,x1,y1,z1,x2,y2,z2), grid
% Make a 3D Plot for Comparison
In MATLABT M, the spline function provides a piecewise polynomial form of the cubic spline interpolation to the input data values at the pointt, while the pchip function offers a piecewise polynomial form of a certain shape- preserving piecewise cubic Hermite interpolation to the input values at the point t. Thus, the former has more overshooting and oscillation than the latter. In the above program, six original points with their 3D coordinates are known. Then, in each of the three coordinate versus time profiles, we make a 10 times more detailed scale towardsN = 51. The six known points are interpolated by spline and by pchip functions respectively, and the results are plotted in Figure 4.3 to compare each other among the three curves. If the sampling is also required to haveN= 51 points along the entire desired path, then the position vectorp(i)0 attijust takes the three coordinate values at the i-th point of either (x1 y1 z1)T by the spline or (x2 y2 z2)T by the pchip in the above program.
2
3 4
5
6 7
0 2 4 6 8 10
2 3 4 5 6 7 8
Spline
Original
Pchip Z
X Y
Fig. 4.3 A curved path before and after the spline and pchip interpolations
In contrast, forthe orientation part, we have to first find the “difference”
of the orientations between frame 1 and frame 2, i.e.R21=R01R20. Then, using thek−φprocedure, as introduced in Chapter 2, to convert the “difference”
R12into the equivalentkandφusing equations (2.9) and (2.11), and further to sample the angleφintoN intervals. Namely,Δφ= Nφ, and then using its forward conversion to determineR(i)1 by substituting the same unit vectork but a different angleiΔφ=Ni φinto equation (2.8). Therefore, the orientation of the hand frame with respect to the base at thei-th sampling point on the trajectory is given by
R(i)0 =R10R(i)1 . (4.6) It can also be verified thatR(i)0 matchesR10wheni= 0 and reachesR20 when i=N.
x0
y0
z0
x1
z1
y1
x2
z2
y2
O
O1
O2
p01
p02
p12
Fig. 4.4 Example of the position and orientation path planning
As a numerical example, let two coordinate frames #1 and #2 be placed near the base, as shown in Figure 4.4. Using the procedure of finding both position and orientation between two frames, as discussed and illustrated in the last chapter, we can readily determine the following two homogeneous transformations:
H01=
⎛
⎜⎝
0 −1 0 1.0
0 0 1 2.0
−1 0 0 2.0
0 0 0 1
⎞
⎟⎠ and H02=
⎛
⎜⎝
1 0 0 −1.0 0 0 −1 3.0
0 1 0 1.0
0 0 0 1
⎞
⎟⎠
for frames #1 and #2 with respect to the base frame #0, respectively, where the position vectors are defined in meters. Now we split the path-planning from frame #1 to frame #2 into two portions. For the position portion, p21(0)=p20−p10= (−2.0 1.0 −1.0)T. If we want the path to be a straight line and sampled into 10 even intervals, thenN = 10, andΔp0=p21(0)/N = (−0.2 0.1 −0.1)T. Thus, at the 4th sampling point, i.e.i= 4 for instance, p(4)0 =p10+ 4Δp0= (0.2 2.4 1.6)T that is referred to the base.
For the orientation portion, let us first find the “difference” of the orien- tations between frames #2 and #1, i.e.,
R12=R01R20=
⎛
⎝ 0 0 −1
−1 0 0
0 1 0
⎞
⎠
⎛
⎝1 0 0 0 0 −1
0 1 0
⎞
⎠=
⎛
⎝ 0 −1 0
−1 0 0
0 0 −1
⎞
⎠.
This rotation matrix happens to be symmetric, but is not equal to the identity I, and is exactly the same as the example in Chapter 2. We have found that φ = 1800 and k = (√22 −√22 0)T. Thus, for each step of rotation, Δφ=φ/N = 180 about the same axisk. At the 4th sampling point,i= 4,
R(4)1 =I+ sin(4×180)K+ (1−cos(4×180))K2
=
⎛
⎝ 0.6545 −0.3455 −0.6725
−0.3455 0.6545 −0.6725 0.6725 0.6725 0.3090
⎞
⎠
such that
R(4)0 =R10R1(4)=
⎛
⎝ 0.3455 −0.6545 0.6725 0.6725 0.6725 0.3090
−0.6545 0.3455 0.6725
⎞
⎠.
This is the orientation at the 4th sampling point as frame #1 is traveling towards frame #2, which is referred to the base. Finally, the homogeneous transformation matrix H0(4) at the 4th sampling point is augmenting R0(4) andp(4)0 together, i.e.,
H0(4)=
⎛
⎜⎝
0.3455 −0.6545 0.6725 0.2 0.6725 0.6725 0.3090 2.4
−0.6545 0.3455 0.6725 1.6
0 0 0 1
⎞
⎟⎠.
The above trajectory sampling procedure is often referred to as theCarte- sian Motionplanning, because the path sampling is taken in Cartesian space.
The counterpart of the Cartesian motion is theJoint Motionplanning.
In the joint motion path-planning, we only need to apply the I-K (inverse kinematics) algorithm for a given robot arm at the starting point with H01
and the ending point with H02 of the desired trajectory. If the I-K solution for all joint positions based on H01 is qI and that based onH02 is qII, the difference between the ending and starting joint positions becomes
q(2−1)=qII−qI.
Then, we determine how much each joint should move in each sampling in- terval by
Δq= q(2−1) N = 1
N(qII−qI).
Finally, all the joint positions of the robot at the i-th sampling point (0 ≤ i≤N) is given as
q(i)=qI+iãΔq=qI+ i
N(qII−qI). (4.7) While the joint motion planning looks simple, when you implement the above algorithm, you have to make sure that each joint angle difference is the minimum in absolute value. For example, if one joint angle is currently at θi = 900, and to move toθi = 2200. Often, in most computer programs, either the starting or the destination joint angle is solved by the two-dummy elements arc-tangent, i.e.,θi=atan2(y, x) for somey andx, which gives the angle solution in the range of (−1800, 1800]. Therefore, the above destination after I-K calculation in a computer program will give θi = −1400, instead of 2200, though they are considered as the same angles. Now, we need an if-then or a subroutine in the program to determine the minimum difference in absolute value. Namely, 2200−900 = 1300, while−1400−900 =−2300. Clearly, the first one is smaller than the second one in absolute value and the computer program should make sure to moveθi from 900 to−1400 or 2200 counterclockwise, instead of clockwise, in order to ensure that each joint of the robot will have the shortest joint motion. The following short MATLABT M program is a typical way to minimize the difference.
dq = qd - qs; % Find the Difference Between the Starting qs
% and the Destination qd Joint Positions for j = 1:6 % 6 Joints Totally
if dq(j) > pi
dq(j) = dq(j)-2*pi;
end
if dq(j) < -pi
dq(j) = dq(j)+2*pi;
end end
Since any robotic system can understand only the ”joint language”, the above joint motion planning appears to be very simple and straightforward in terms of formulation and computation. However, the drawback is unnatural- looking when the robot moves and is also unable to follow a desired trajectory, because the joint motion planning cannot meet or satisfy any requirement that is specified in Cartesian space.
As a comparative study, we summarize the advantages and disadvantages between the Cartesian motion and joint motion into Table 4.2.
Table 4.2 A comparison between Cartesian and joint motions
Type of Motion Cartesian Motion Joint Motion
No. of Inverse Kinematics N+ 1 2
Traj. Tracking Accuracy Very High Unable to Offer Computational Complexity High Very Low
Singularity Chance Possible Never Body Move Appearance Excellent Uncontrollable
In this comparison table, the number of inverse kinematics means how many times the I-K algorithm of a given robot is required to be repeatedly computed. In general application cases, people often apply the Cartesian motion for a main task that requires a desired trajectory-tracking while using the joint motion just for the Leaving-Home trip before being ready to start the main task as well as the Back-Home trip after the main task is completed.
Traditionally, almost every robotic system has its Home position defined as a long idle configuration for the robot. In addition, the singularity in Table 4.2 means a special configuration, where the robot loses one or more degree(s) of freedom. The singularity case often makes the I-K algorithm diverge, for instance, some denominator in the I-K algorithm vanishes. In the next sections, we will give more detailed analysis of the singularity issue and also a discussion on its avoidance approaches through an introduction to the third type of motion planning, called theDifferential Motionfor a robotic system.