1. Position Analysis The program you write will acquire an input that includes t
ID: 3778402 • Letter: 1
Question
1. Position Analysis The program you write will acquire an input that includes the link lengths and the relative angles of each link. This will be our starting point for the position analysis. Position analysis can be achieved through vector addition, or through a scalar analysis of the robot. The project will require you to use scalar analysis so that you have the opportunity to work with the linear equations and matrices that are developed in the analysis. The position of any point, P, is a function of the length of the links and the absolute angles of the links that lead up to that point. Assuming the base of the robot to have coordinates (0, 0), the GX, y) coordinates for any point are obtained from the equation: ricos01 cos 62 r3cos03+...+ ricos0, (la) risine rzsino2 r3sino3+...+ risine (la) Since we are working with computers, this equation works better in matrix form: cos0 sino cos02 sin62 7's] (2) coso sin0. cos0i sinoExplanation / Answer
MATLAB CODE
% Program to do position analysis of robot
clear all; % Clearing the workspace
clc; % clearing the command window
% get the number of links in the robot
N = input('Enter the number of links in the robot: ');
% input the lengths of the links
for i =1:N
fprintf('Enter the length of %d th Link',i);
L(i) = input(': ');
end
% input the relative angles of the links
r = 0;
for i =1:N
fprintf('Enter the relative link angle of %dth Link',i);
r = r + input(': '); % converting relative angle to absolute angle
R(i) = r;
end
% computing the position of each joints of links
for i=1:N
P = L(1:i)*[cosd(R(1:i))' sind(R(1:i))'];
% Printing the result
fprintf('The position of joint %d is (x,y) = (%f,%f) ',i,P(1),P(2));
end
SAMPLE OUTPUTS
Enter the length of 1 th Link: 1
Enter the length of 2 th Link: 1
Enter the length of 3 th Link: 1
Enter the length of 4 th Link: 1
Enter the relative link angle of 1th Link: 90
Enter the relative link angle of 2th Link: 90
Enter the relative link angle of 3th Link: 90
Enter the relative link angle of 4th Link: 90
The position of joint 1 is (x,y) = (0.000000,1.000000)
The position of joint 2 is (x,y) = (-1.000000,1.000000)
The position of joint 3 is (x,y) = (-1.000000,0.000000)
The position of joint 4 is (x,y) = (0.000000,0.000000)
Enter the number of links in the robot: 4
Enter the length of 1 th Link: 1
Enter the length of 2 th Link: 1
Enter the length of 3 th Link: 1
Enter the length of 4 th Link: 1
Enter the relative link angle of 1th Link: 0
Enter the relative link angle of 2th Link: 0
Enter the relative link angle of 3th Link: 0
Enter the relative link angle of 4th Link: 0
The position of joint 1 is (x,y) = (1.000000,0.000000)
The position of joint 2 is (x,y) = (2.000000,0.000000)
The position of joint 3 is (x,y) = (3.000000,0.000000)
The position of joint 4 is (x,y) = (4.000000,0.000000)
Enter the number of links in the robot: 4
Enter the length of 1 th Link: 1
Enter the length of 2 th Link: 1
Enter the length of 3 th Link: 1
Enter the length of 4 th Link: 1
Enter the relative link angle of 1th Link: 90
Enter the relative link angle of 2th Link: 0
Enter the relative link angle of 3th Link: 0
Enter the relative link angle of 4th Link: 0
The position of joint 1 is (x,y) = (0.000000,1.000000)
The position of joint 2 is (x,y) = (0.000000,2.000000)
The position of joint 3 is (x,y) = (0.000000,3.000000)
The position of joint 4 is (x,y) = (0.000000,4.000000)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.