Beruflich Dokumente
Kultur Dokumente
this.a1=0; %fijo
this.alpha1=pi/2; %fijo
1. Cdigo del brazo_RRR this.d2=0;
this.alpha2=0;
Para el presente proyecto se cre en this.d3=0;
this.alpha3=0;
primer lugar la clase Robot_RRRR this.d4=0;
que representa un robot de 4 grados this.alpha4=0;
de libertad (articulaciones rotativas) end
function
en donde se mantuvo como set_dimensions(this,L1,L2,L3,L4)
condicin que la estructura final del %Metodo para asignar las
dimensiones
brazo sea paralela al piso (Ver figura this.LL1=L1;
1). this.LL2=L2;
this.LL3=L3;
this.LL4=L4;
%Ponemos Los parametros DH q faltan
this.d1=L1;
this.a2=L2;
this.a3=L3;
this.a4=L4;
end
function
q=cinematica_inversa(this,xc,yc,zc)
%%%%%%%%%%%%%%%%
classdef robot_RRRR<handle %Angulo "theta 1"
properties q1_star=atan2(yc,xc);
%PARAMETROS MECANICOS %Angulo "theta3"
LL1 r2=xc^2+yc^2;
LL2 r1=sqrt(r2);
LL3 r=r1-L4;
LL4 s=zc-L1;
%PARAMETROS D.H num=r^2+s^2-L2^2-L3^2;
d1 den=2*L2*L3;
a1 D=num/den;
alpha1 if(abs(D)>1)
d2 error('POSICION IMPOSIBLE DE
a2 ALCANZAR')
alpha2 end
d3 q3_star=atan2(-sqrt(1-
a3 D^2),D);
alpha3 q2_star=atan2(s,r)-...
d4
a4 atan2(L3*sin(q3_star),L2+L3*cos(q3_st
alpha4 ar));
end q4_star=-1*(q2_star +
methods q3_star);
% CONSTRUCTOR %Vector de ANgulos
function this= robot_RRRR()
q=[q1_star q2_star q3_star this.alpha1=pi/2; %fijo
q4_star]; this.d2=0;
end this.alpha2=0;
function this.d3=0;
A1=compute_matrix_A1(this,theta1) this.alpha3=0;
%Metodo para hallar A1 this.d4=0;
this.alpha4=0;
A1=matriz_homogenea_DH(theta1,... end
this.d1,this.a1,this.alpha1);
end Cinemtica Inversa del Robot_RRR
function
A2=compute_matrix_A2(this,theta2) A continuacin se presenta la cinemtica
%Metodo para hallar A2 inversa con la condicin que la estructura
final del brazo se mantenga en posicin
A2=matriz_homogenea_DH(theta2,...
horizontal
this.d2,this.a2,this.alpha2);
function
end
q=cinematica_inversa(this,xc,yc,zc)
matlab.
Resultados de los ajustes
Servo1:
Servo2:
Servo3:
Servo 4