Fundamentos_de_robotica_industrial.docx

  • Uploaded by: Omar Matute
  • 0
  • 0
  • July 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Fundamentos_de_robotica_industrial.docx as PDF for free.

More details

  • Words: 862
  • Pages: 8
TRABAJO DE ROBOTICA INDUSTRIAL Por: Omar Matute Ordoñez LINEA RECTA close all robot = load_robot('ABB', 'IRB1200') % or load any other robot with: %robot = load_robot %NOA matrix initial point T1=[1 0 0 0.5; 0 1 0 -0.3; 0 0 1 0.7; 0 0 0 1] %NOA matrix end point T2=[1 0 0 0.5; 0 1 0 0.4; 0 0 1 0.7; 0 0 0 1] %distancia entre puntos consecutivos delta = 0.02; punto_inicial = T1(1:3,4); punto_final = T2(1:3,4); v=(punto_final-punto_inicial); v=delta*v/norm(v); %vector normalizado en la direcci€n de la recta distancia = sqrt((punto_final-punto_inicial)'*(punto_final-punto_inicial)); %Generaci€n de puntos en la trayectoria num_points = floor(distancia/delta); puntos = punto_inicial; for i=1:num_points, puntos=[puntos i*v+punto_inicial]; end puntos=[puntos punto_final]; figure, hold on, grid, plot3(puntos(1,:),puntos(2,:),puntos(3,:)), title('Trajectory in space'), xlabel('X (m)'), ylabel('Y (m)') qs=[]; for i=1:length(puntos), T1(1:3,4)=puntos(1:3,i); qinv = inversekinematic(robot, T1); %select the joint coordinates in qinv which are closest to the %current joint position robot.q q=select_closest_joint_coordinates(qinv, robot.q); qs=[qs q]; robot.q=q;%update robot.q here end drawrobot3d(robot, qs(:,1)) %adjust_view(robot) drawrobot3d(robot, qs(:,end)) %Now, animate the robot in 3D animate(robot, qs); figure, hold, plot(qs(1,:), 'r'),plot(qs(2,:), 'g'), plot(qs(3,:), 'b'), plot(qs(4,:), 'c'), plot(qs(5,:), 'm.'), plot(qs(6,:), 'y.'), legend('q_1 (rad)','q_2 (rad)','q_3 (rad)', 'q_4 (rad)', 'q_5 (rad)', 'q_6 (rad)' ), title('Joint trajectories'), xlabel('Step number')

CIRCULO %Compute points in line close all %%robot = load_robot('mitsubishi','pa-10'); robot=load_robot('ABB','IRB1200') % or load any other robot with: %robot = load_robot %NOA matrix initial point T1=[1 0 0 0.5; 0 1 0 -0.3; 0 0 1 0.7; 0 0 0 1] %NOA matrix end point T2=[1 0 0 0.5; 0 1 0 0.4; 0 0 1 0.7; 0 0 0 1] %distancia entre puntos consecutivos delta = 0.02; pos=[0 0 0]'; radius=0.5; distancia = 2*pi*radius; punto_inicial = T1(1:3,4); punto_final = T2(1:3,4); v=(punto_final-punto_inicial); v=delta*v/norm(v); %vector normalizado en la direcciÛn de la recta distancia = sqrt((punto_final-punto_inicial)'*(punto_final-punto_inicial)); %GeneraciÛn de puntos en la trayectoria num_points = floor(distancia/delta); puntos = pos; for i=1:50, tita = linspace(0, 2*pi,50); cir = radius*[cos(tita); sin(tita)]; hp =[cir(1,i)+pos(1), cir(2,i)+pos(2),0]'; v=(hp-pos); v=delta*v/norm(v); %vector normalizado en la direcciÛn de la recta puntos =[puntos i*v+pos]; pos=hp; end puntos=[puntos hp]; figure, hold on, grid, plot3(puntos(1,:),puntos(2,:),puntos(3,:)), title('Trajectory in space'), xlabel('X (m)'), ylabel('Y (m)') qs=[]; for i=1:length(puntos), T1(1:3,4)=puntos(1:3,i); qinv = inversekinematic(robot, T1); %select the joint coordinates in qinv which are closest to the

%current joint position robot.q q=select_closest_joint_coordinates(qinv, robot.q); qs=[qs q]; robot.q=q;%update robot.q here end drawrobot3d(robot, qs(:,1)) adjust_view(robot) drawrobot3d(robot, qs(:,end)) %Now, animate the robot in 3D animate(robot, qs); figure, hold, plot(qs(1,:), 'r'),plot(qs(2,:), 'g'), plot(qs(3,:), 'b'), plot(qs(4,:), 'c'), plot(qs(5,:), 'm.'), plot(qs(6,:), 'y.'), legend('q_1 (rad)','q_2 (rad)','q_3 (rad)', 'q_4 (rad)', 'q_5 (rad)', 'q_6 (rad)' ), title('Joint trajectories'), xlabel('Step number')





 close all robot=load_robot('ABB','IRB1200') % or load any other robot with: %robot = load_robot %NOA matrix initial point T1=[1 0 0 0.5; 0 1 0 -0.3; 0 0 1 0.7; 0 0 0 1] %NOA matrix end point T2=[1 0 0 0.5; 0 1 0 0.4; 0 0 1 0.7; 0 0 0 1] %distancia entre puntos consecutivos delta = 0.02; pos =[0 0 0]'; radius= 0.5; distancia = 2*pi*radius; %GeneraciÛn de puntos en la trayectoria num_points = floor(distancia/delta); puntos = pos; for i=1:50, tita = linspace(0, 2*pi,50); cir =[2*cos(tita); 0.5*sin(tita)]; hp =[cir(1,i)+pos(1), cir(2,i)+pos(2),0]'; v=(hp-pos); v=delta*v/norm(v); %vector normalizado en la direcciÛn de la recta puntos=[puntos i*v+pos]; pos=hp; end puntos=[puntos hp]; figure, hold on, grid, plot3(puntos(1,:),puntos(2,:),puntos(3,:)),title('Trajectory in space'), xlabel('X (m)'), ylabel('Y (m)') qs=[]; for i=1:length(puntos), T1(1:3,4)=puntos(1:3,i); qinv = inversekinematic(robot, T1); %select the joint coordinates in qinv which are closest to the %current joint position robot.q q=select_closest_joint_coordinates(qinv, robot.q); qs=[qs q]; robot.q=q;%update robot.q here end drawrobot3d(robot, qs(:,1)) %adjust_view(robot) drawrobot3d(robot, qs(:,end)) %Now, animate the robot in 3D animate(robot, qs); figure, hold, plot(qs(1,:), 'r'),plot(qs(2,:), 'g'), plot(qs(3,:), 'b'), plot(qs(4,:), 'c'),plot(qs(5,:), 'm.'), plot(qs(6,:), 'y.'), legend('q_1 (rad)','q_2 (rad)','q_3 (rad)', 'q_4 (rad)', 'q_5 (rad)','q_6 (rad)' ),title('Joint trajectories'), xlabel('Step number')

CUADRADO close all robot = load_robot('ABB', 'IRB1200') % or load any other robot with: %robot = load_robot %NOA matrix initial point T1=[1 0 0 0.5; 0 1 0 -0.3; 0 0 1 0.7; 0 0 0 1]; %NOA matrix end point T2=[1 0 0 0.5; 0 1 0 0.4; 0 0 1 0.7; 0 0 0 1]; T3=[1 0 0 -0.2; 0 1 0 0.4; 0 0 1 0.7; 0 0 0 1]; T4=[1 0 0 -0.2; 0 1 0 -0.3; 0 0 1 0.7; 0 0 0 1]; T=[0.5 0.5 -0.2 -0.2 0.5; -0.3 0.4 0.4 -0.3 -0.3; 0.7 0.7 0.7 0.7 0.7]; %distancia entre puntos consecutivos delta = 0.02; punto_inicial = T(:,1); punto_final = T(:,1); %v=(punto_final-punto_inicial); %v=delta*v/norm(v); %vector normalizado en la direcci€n de la recta distancia = sqrt((punto_final-punto_inicial)'*(punto_final-punto_inicial)); %Generaci€n de puntos en la trayectoria num_points = floor(distancia/delta); puntos = punto_inicial; for j=1:5, punto_inicial = T(:,j); punto_final = T(:,j); v=(punto_final-punto_inicial); v=delta*v/norm(v); %vector normalizado en la direcci€n de la recta for i=1:num_points, puntos=[puntos i*v+punto_inicial]; end puntos=[puntos punto_final]; figure, hold on, grid, plot3(puntos(1,:),puntos(2,:),puntos(3,:)),title('Trajectory in space'), xlabel('X (m)'), ylabel('Y (m)') qs=[]; %punto_inicial = T(:,j+1);

%punto_final = T(:,j+1); end for i=1:length(puntos), T1(1:3,4)=puntos(1:3,i); qinv = inversekinematic(robot, T1); %select the joint coordinates in qinv which are closest to the %current joint position robot.q q=select_closest_joint_coordinates(qinv, robot.q); qs=[qs q]; robot.q=q;%update robot.q here end drawrobot3d(robot, qs(:,1)) %adjust_view(robot) drawrobot3d(robot, qs(:,end)) %Now, animate the robot in 3D animate(robot, qs); figure, hold, plot(qs(1,:), 'r'),plot(qs(2,:), 'g'), plot(qs(3,:), 'b'), plot(qs(4,:), 'c'),plot(qs(5,:), 'm.'), plot(qs(6,:), 'y.'), legend('q_1 (rad)','q_2 (rad)','q_3 (rad)', 'q_4 (rad)', 'q_5 (rad)','q_6 (rad)' ), title('Joint trajectories'), xlabel('Step number')

More Documents from "Omar Matute"