Professional Documents
Culture Documents
Lab Report # 3
Name: Tayyab Khalil
Section: A (Electronics)
BSEE 2017-21
Trajectory refers to a time history of position, velocity, and acceleration for each degree
of freedom. The basic problem is to move the manipulator from an initial position to
some desired final position.
We wish to move the tool frame from its current value to a desired final value. In general,
this motion involves both a change in orientation and a change in the position of the tool
relative to the station.
In order to complete this motion, the tool frame must pass through a set of intermediate
positions and orientations. These points are termed as via points. Each of these via points
is actually the position and orientation of the tool frame relative to the station.
In this lab, we use cubic polynomials to obtain the expression for the path followed by
each robot. The general expressions for position, velocity and acceleration of each joint is
given by:
So the basic task is then to find the values of these constants. To find these we apply the
following four constraints:
Applying these constraints into above equations gives the values of these 4 constants:
Plugging these values back into the equation or position gives the final expression:
So, if we know the initial and final desired value along with the time needed for the completion
of path, a time function for position, velocity and acceleration can be found.
Now we apply these concepts onto the Rhino XR-3.
qi = InverseKinematics(w1);
qf = InverseKinematics(w2);
syms t
qt = sym(zeros(1, L));
for i = 1 : L
qt(i) = a(1, i) + a(2, i)*t + a(3, i)*t^2 + a(4, i)*t^3;
end
tk = 0:0.1:tf;
w = zeros(3, length(tk));
qtData = zeros(length(tk), 5);
for i = 1 : length(tk)
qtFK = vpa(subs(qt, tk(i)), 6);
qtData(i, :) = qtFK;
dh = [qtFK; p; d; aL];
arm_matrix = fkine (dh, L);
w(:, i) = arm_matrix (1:3, 4);
end
% Robot Plot
for i = 1 : L
Lk(i) = Link([0 d(i) aL(i) p(i)]);
end
figure(8)
scatter3(w(1, :), w(2, :), w(3, :));
xlabel('X'); ylabel('Y'); zlabel('Z');
title('Trajectory followed by the Tool Tip in 3D space. ')
figure(i)
subplot(3, 1, 1)
fplot(@(t)pos(t), [0 tf])
label1 = ['q[', num2str(i), '] Positional Trajectory'];
xlabel('Time'); ylabel ('Position (degrees)');
title(label1);
subplot(3, 1, 2)
fplot(@(t)vel(t), [0 tf])
label2 = ['q[', num2str(i), '] Velocity Trajectory'];
xlabel('Time'); ylabel ('Velocity (degrees/sec)');
title(label2);
subplot(3, 1, 3)
fplot(@(t)acc(t), [0 tf])
label3 = ['q[', num2str(i), '] Acceleration Trajectory'];
xlabel('Time'); ylabel ('Acceleration (degrees/sec_square)');
title(label3);
end
a = [a0;
a1;
a2;
a3];
end
Here we present the trajectory followed for the end points defined above by each robot
joint.
Each of the 5 figures above describes the motion of the respective joint, all of them being
smooth as clearly seen above.
Robot Motion through Robotics toolbox:
Now we use the robotics toolbox to see the robot moving from the initial
specified position – all angles being to zero – to a desired home position. Here the
robot’s initial and final position are shown:
Figure 4: Visual depiction of the smooth trajectory followed by the robot tool tip in 3D Space.
Results and Discussions:
In this lab, we computed and plotted the trajectories for position, velocity and
acceleration as the Rhino XR-3 is moved from a initial position to a desired final
position.
We started by specifying the tool configuration vectors at initial and final points and
finding the corresponding vectors for joint angles. We then use cubic polynomials to find
the expressions for the position as a function of time. Its derivative can be used to find the
expression for velocity and acceleration as well. These expressions are plotted against
time for each joint to obtain a smooth trajectory.
We then utilize the robotics toolbox to animate the motion of robot joints through the
trajectory defined. We also trace the position of tool tip in 3D space as the robot moves
through the desired path.