How to Fix one angle(range) in serial manipulator of a five degree freedom robot and Calculate the work space?

I created a function. Now i am getting the value when i am giving the joint angles on. Now i have to give the joint angles as a range ( 0 to 90deg) then and i have to see the orientation plot in matlab.
function position_orientation = forward_kinematics_five_dof(joint_angles) % ============================================================================= % forward_kinematics calculates the position and orientation of the end-effector % for a 5 DOF open kinematic serial chaing. % ---------------------------------------- % Input: joint_angles = [theta1 theta2 theta3 theta5 theta5] % 1x5 vector of joint angles measured in degrees % ---------------------------------------- % Output: position_orientation = [nx ny nz ox oy oz ax ay az Px Py Pz] % 1x12 vector containing components of unit vectors, (a,n,o) % that define the x,y, and z axies of the end-effector (orientation) % and componented of a vector P that defines the position % ============================================================================= joint_angles = (pi/180).*joint_angles; % convert to radians theta1 = joint_angles(1); theta2 = joint_angles(2); theta3 = joint_angles(3); theta4 = joint_angles(4); theta5 = joint_angles(5); % link lengths [millimeters]: a1 = 0; a2 = 170; a3 = 170.4318; a4 = 1; a5 = 0; % joint offsets [meters]: d1 = 195; d2 = 0; d3 = 0; d4 = 0; d5 = 125; % angles between sucessive joints [radians]: alpha1 = -pi/2; alpha2 = 0; alpha3 = 0; alpha4 = -pi/2; alpha5 = 0; % transformation matricies between sucessive frames: A1 = [cos(theta1) -sin(theta1)*cos(alpha1) sin(theta1)*sin(alpha1) a1*cos(theta1); sin(theta1) cos(theta1)*cos(alpha1) -cos(theta1)*sin(alpha1) a1*sin(theta1); 0 sin(alpha1) cos(alpha1) d1 ; 0 0 0 1] ; A2 = [cos(theta2) -sin(theta2)*cos(alpha2) sin(theta2)*sin(alpha2) a2*cos(theta2); sin(theta2) cos(theta2)*cos(alpha2) -cos(theta2)*sin(alpha2) a2*sin(theta2); 0 sin(alpha2) cos(alpha2) d2 ; 0 0 0 1] ; A3 = [cos(theta3) -sin(theta3)*cos(alpha3) sin(theta3)*sin(alpha3) a3*cos(theta3); sin(theta3) cos(theta3)*cos(alpha3) -cos(theta3)*sin(alpha3) a3*sin(theta3); 0 sin(alpha3) cos(alpha3) d3 ; 0 0 0 1] ; A4 = [cos(theta4) -sin(theta4)*cos(alpha4) sin(theta4)*sin(alpha4) a4*cos(theta4); sin(theta4) cos(theta4)*cos(alpha4) -cos(theta4)*sin(alpha4) a4*sin(theta4); 0 sin(alpha4) cos(alpha4) d4 ; 0 0 0 1] ; A5 = [cos(theta5) -sin(theta5)*cos(alpha5) sin(theta5)*sin(alpha5) a5*cos(theta5); sin(theta5) cos(theta5)*cos(alpha5) -cos(theta5)*sin(alpha5) a5*sin(theta5); 0 sin(alpha5) cos(alpha5) d5 ; 0 0 0 1] ; % total transformation matrix: A = A1*A2*A3*A4*A5;

Answers (0)

Asked:

on 21 Jan 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!