in the file
Objective: This lab focuses on validating the inverse kinematic through the offline-programing process using the Mitsubishi RV-2AJ robot. clc clear all addpath('C:\Users\ylee24\OneDrive - Metropolitan State University of Denver (MSU Denver)\Y Drive\Robotics\RV-2AJ_YL'); % % q(1) = 40.47; % q(2) = 75.25; % q(3) = 70.74; % q(4) = 34.01; % q(5) = 40.47; q = zeros(1,5); q = q*pi/180; robot.DH.theta= '[q(1) q(2)-pi/2 q(3) q(4)-pi/2 q(5)]'; robot.DH.d='[0.3 0 0 0 0.072]'; robot.DH.a='[0 0.250 0.160 0 0]'; robot.DH.alpha= '[-pi/2 0 0 -pi/2 0]'; px = 240;py = 0; pz = 200; q = ik(robot,px,py,pz); q = q*180/pi; %the limits for the joints are as followed: % J1 (-150 to +150) % J2 (-60 to +120) % J3 (-110 to +120) % J4 - % J5 (-90 to +90) % J6 (-200 to +200) %Check errors if (q(1)>150 || q(1)<-150), fprintf('too="" much="" in="" j1="" rotation\n');end="" if="" (q(2)="">120 || q(2)<-60), fprintf('too="" much="" in="" j2="" rotation\n');end="" if="" (q(3)="">120 || q(3)<-110), fprintf('too="" much="" in="" j3="" rotation\n');end="" if="" (q(4)="">90 || q(4)<-90), fprintf('too="" much="" in="" j5="" rotation\n');end="" if="" (q(4)="">200||q(5)<-200),fprintf('too much in j6 rotation\n');end % t = eye(4,4); % for i = 1:5 % a = dhcal(robot,q,i); % t = t*a; % end % % fprintf('x: %.2f mm\n', t(1,4)*1000); % fprintf('y: %.2f mm\n', t(2,4)*1000); % fprintf('z: %.2f mm\n', t(3,4)*1000); % % q = q*180/pi; % robotstatus = rv2ajcmd(q); % % newstr = extractbefore(robotstatus(end),"a"); % fprintf(append(newstr,'\n')); much="" in="" j6="" rotation\n');end="" %="" t="eye(4,4);" %="" for="" i="1:5" %="" a="DHCal(robot,q,i);" %="" t="T*A;" %="" end="" %="" %="" fprintf('x:="" %.2f="" mm\n',="" t(1,4)*1000);="" %="" fprintf('y:="" %.2f="" mm\n',="" t(2,4)*1000);="" %="" fprintf('z:="" %.2f="" mm\n',="" t(3,4)*1000);="" %="" %="" q="q*180/pi;" %="" robotstatus="rv2ajCMD(q);" %="" %="" newstr="extractBefore(robotStatus(end),"A");" %="">-200),fprintf('too much in j6 rotation\n');end % t = eye(4,4); % for i = 1:5 % a = dhcal(robot,q,i); % t = t*a; % end % % fprintf('x: %.2f mm\n', t(1,4)*1000); % fprintf('y: %.2f mm\n', t(2,4)*1000); % fprintf('z: %.2f mm\n', t(3,4)*1000); % % q = q*180/pi; % robotstatus = rv2ajcmd(q); % % newstr = extractbefore(robotstatus(end),"a"); % fprintf(append(newstr,'\n'));>-90),>-110),>-60),>-150),>