Set - 05 - 2023ht30061 Akash Gonjari - Robotics Lab Exam
Set - 05 - 2023ht30061 Akash Gonjari - Robotics Lab Exam
(Assignment)
By
Name: Akash Sanjay Gonjari
P = transz(d1)*transx(L1)*rotz(θ2)*transx(L2)*rotz(θ3)*transx(L3)*rotz(90)*rotx(90)*O
The code for function file for finding the tool point of the above manipulator is as below
P =
transz(D1)*transx(L1)*rotz(theta2)*transx(L2)*rotz(theta3)*transx(L3)*rotz(90)*rotx(90)
*O;
P0 = O;
P1 = transz(D1)*O;
P2 = transz(D1)*transx(L1)*O;
P3 = transz(D1)*transx(L1)*rotz(theta2)*transx(L2)*O;
end
For the function manipulatortoolpoint ,
• O (origin)
• L1 (Length of link, constant)
• L2 (Length of link, constant)
• L3 (Length of link, constant)
• D1 (displacement, variable)
• theta2 (rotation angle, variable)
• theta3 (rotation angle, variable)
• P0 (Origin)
• P1 (Intermediate Point)
• P2 (Intermediate Point)
• P3 (Intermediate Point)
• P (Tool Point)
To use the above defined function, we use the below program script
clc
clear all
X = [P0(1),P1(1),P2(1),P3(1),P(1)];
Y = [P0(2),P1(2),P2(2),P3(2),P(2)];
Z = [P0(3),P1(3),P2(3),P3(3),P(3)];
plot3(X,Y,Z,'--rs','LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor','g',...
'MarkerSize',10)
hold on
Matlab Screenshots
Figure
1: Function file
Figure 2: Program Script
Result:
Given robot is a Planar Manipulator. We take the plane of operation of the robot is XY Plane (X-
Horizontal, Y-Vertical).
P = rotz(90)*rotx(90)*transz(d1)*rotz(90)*rotx(-90)*rotz(θ2)*transx(L2)*rotx(90)*O
Px = d1 + L2cos(θ2)
Py = L2sin (θ2)
Note:
• The manipulator, due to its geometry can work only in the XY plane (Planar manipulator)
• The manipulator, due to its geometry is assumed to be operating in the First and Fourth Quadrant
only
• In the first quadrant, the calculated value of θ2 is correct.
• In the fourth quadrant, actual θ2 will be 360 + θ2 obtained from equation 1
The function file for calculating D1 and θ2 for a given tool point and L2 for above manipulator is as below
• θ2
• D1
To use the above defined function, we use the below program script
[theta2,d1] = planar_inv(L2,px,py)
O = [0,0,0,1]';
P = rotz(90)*rotx(90)*transz(d1)*rotx(-90)*rotz(-
90)*rotz(theta2)*transx(L2)*rotx(90)*O;
P0 = O;
P1 = rotz(90)*rotx(90)*transz(d1)*rotx(-90)*rotz(-90)*O;
X = [P0(1),P1(1),P(1)];
Y = [P0(2),P1(2),P(2)];
plot(X,Y,'--rs','LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor','g',...
'MarkerSize',10)
hold on
Matlab Screenshots
Figure 6: Function
Figure 7: Program
Figure 8: Command Window with results
Result:
Figure 11: Plots for various inputs on the same plot (inputs mentioned in square boxes)
Tutorial screenshots
Problem 1: