0
$\begingroup$

I'm working on an assignment where I need to derive Velocity Kinematics for 5 DOF Youbot kuka robotic arm manipulator. I want to Calculate the Joint Velocities and Angular Accelerations of 5 DOF Youbot kuka robotic arm. I'm working on Matlab code:

clear all close all clc syms q1 q2 q3 q4 q5 fx fy fz real

% length and offset of each link [x,y,z] (m) l = [[0.046, 0, 0.147]; [0.155, 0, 0]; [0.135, 0, 0]; [0, 0, 0]; [0, 0, 0.218]];

% mass of each link (kg) m = [0.961, 1.39, 1.318, 0.821, 0.769, 0.687, 0.199];

% Compute symbolic homogenous transform matrices based on KUKA YouBot q = [q1, q2, q3, q4, q5]; [H, Hs] = CompH(q, l); o = H(1:3,4); % Compute symbolic Jacobian (velocity Jacobian only) J = jacobian(o,q);

% Test jacobian by applying an angular velocity and computing linear % velocity of end effector cur_q = [0, 0, 0, pi/2, 0]; q_dot = [0, 0, 0, 0, 0]';

% Compute point of center of gravity for each link cHs = CompCOGH(q, l); o_cg_01 = cHs{1}(1:3,4); o_cg_02 = cHs{2}(1:3,4); o_cg_03 = cHs{3}(1:3,4); o_cg_04 = cHs{4}(1:3,4); o_cg_05 = cHs{5}(1:3,4);

% Gravity vector gc = [0, 0, 9.82]';

% Compute Jacobians for each center of gravity J1 = jacobian(o_cg_01, q); J2 = jacobian(o_cg_02, q); J3 = jacobian(o_cg_03, q); J4 = jacobian(o_cg_04, q); J5 = jacobian(o_cg_05, q);

% Compute torque needed based on each link's center of graivity and mass t_cg = J1' * m(2) * gc; t_cg = t_cg + J2' * m(3) * gc; t_cg = t_cg + J3' * m(4) * gc; t_cg = t_cg + J5' * (m(5)+m(6)+m(7)) * gc;

% Test jacobian by adding our advanced torque computation above to our % original computation of the torque based on the end effector jacobian. F = [fx;fy;fz];

torque = t_cg + J'*F;

and the function code:

function cHs = cHs(q, l) [H, Hs] = CompH(q, l);

T01c = ScrewZ(q(1),l(1,3)/2)*ScrewX(-pi/2, l(1, 1)/2); T02c = Hs{1}*ScrewZ(q(2) - pi/2,l(2,3)/2)*ScrewX(0, l(2, 1)/2); T03c = Hs{2}*ScrewZ(q(3),l(3,3)/2)*ScrewX(0, l(3, 1)/2); T04c = Hs{3}*ScrewZ(q(4) + pi/2,l(4,3)/2)*ScrewX(pi/2, l(4, 1)/2); T05c = Hs{4}*ScrewZ(q(5),l(5,3)/2);

cHs = {T01c, T02c, T03c, T04c, T05c};

end

I don't know where I made a mistake in the Matlab code.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.