from
Task Space control of RPRP manipulator
by Sumit Tripathi
Forward and inverse kinematics of RPRP manipulator with task space control to trace trajectories.
|
| rprp_trace(t,x,flag)
|
%Sumit Tripathi
function joint_dot = rprp_trace(t,x,flag)
global theta1_g d1_g theta2_g d2_g w;
global x_ee_g y_ee_g T;
d1_g = x(1);
d2_g = x(2);
theta1_g = x(3);
theta2_g = x(4);
x_c = 0;
y_c = 0;
R = sqrt((x_ee_g)^2 + (y_ee_g)^2);
x = x_c + R*cos(w*t);
y = y_c + R*sin(w*t);
xdot=-R*w*sin(w*t);
ydot=R*w*cos(w*t);
J = [ cos(theta1_g), cos(theta1_g + theta2_g), -d1_g*sin(theta1_g)-d2_g*sin(theta1_g + theta2_g), -d2_g*sin(theta1_g + theta2_g);
sin(theta1_g), sin(theta1_g + theta2_g), d1_g*cos(theta1_g)+d2_g*cos(theta1_g + theta2_g), d2_g*cos(theta1_g + theta2_g)];
Ji = pinv(J);
NullSpace=eye(4)-Ji*J;
if flag==1
joint_dot=Ji*[xdot;ydot] + NullSpace*[1;1;1;1];
elseif flag==2
joint_dot=Ji*[xdot;ydot];
else
joint_dot=[0;0;0;0];
end
return;
|
|
Contact us at files@mathworks.com