



Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!




Identify applicable funding agency here. If none, delete this.
Fig. 1. A0-
Fig. 2. A1-
1 clc; clear; close all; 2 3 % Par metros 4 L1 = 17; L2 = 10; L3 = 8; 5 6 % Coordenadas iniciales y finales 7 pos0 = input(’Introduce la p o s i c i n inicial [x y z ]: ’); 8 posf = input(’Introduce la p o s i c i n final [x y z]: ’); 9 10 % Interpolaci n 11 N = 100; 12 x_vals = linspace(pos0(1), posf(1), N); 13 y_vals = linspace(pos0(2), posf(2), N); 14 z_vals = linspace(pos0(3), posf(3), N); 15 16 % Inicializar vectores de articulaciones 17 q1 = zeros(1, N); 18 q2 = zeros(1, N); 19
20 % Cinem tica inversa en cada paso 21 for i = 1:N 22 x = x_vals(i); 23 y = y_vals(i); 24 z = z_vals(i); 25 26 q1(i) = atan2d(y, x); 27 r = sqrt(xˆ2 + yˆ2) - L2; 28 h = z - L1; 29 q2(i) = atan2d(h, r); 30 end 31 32 % Simulaci n 33 figure; 34 for i = 1:N 35 % Base 36 x0 = 0; y0 = 0; z0 = 0; 37 x1 = 0; y1 = 0; z1 = L1; 38 39 % Fin de L 40 x2 = cosd(q1(i)) (^) * L2; 41 y2 = sind(q1(i)) (^) * L2; 42 z2 = z1; 43 44 % Fin de L 45 x3 = x2 + cosd(q1(i)) (^) * cosd(q2(i)) (^) * L3; 46 y3 = y2 + sind(q1(i)) (^) * cosd(q2(i)) (^) * L3; 47 z3 = z2 + sind(q2(i)) (^) * L3; 48 49 % Dibujar 50 plot3([x0 x1], [y0 y1], [z0 z1], ’k-’, ’ LineWidth’, 3); hold on; 51 plot3([x1 x2], [y1 y2], [z1 z2], ’b-’, ’ LineWidth’, 3); 52 plot3([x2 x3], [y2 y3], [z2 z3], ’r-’, ’ LineWidth’, 3); 53 scatter3(x3, y3, z3, 80, ’m’, ’filled’); 54 55 xlim([-25 25]); ylim([-25 25]); zlim([0 30]); 56 xlabel(’X’); ylabel(’Y’); zlabel(’Z’); 57 title(’Cinem tica Inversa del Brazo R o b t i c o 2 DOF’); 58 view(45, 30); grid on; hold off; 59 pause(0.05); 60 end
Listing 1. Simulaci´on cinem´atica de un brazo rob´otico
Fig. 3. Simulacion
103 float x = xStart + t (^) * (xDest - xStart); 104 float y = yStart + t (^) * (yDest - yStart); 105 float z = zStart + t (^) * (zDest - zStart); 106 107 // CINEM TICA INVERSA 108 float q1 = atan2(y, x) (^) * 180.0 / PI; 109 float r = sqrt(x (^) * x + y (^) * y) - L2; 110 float h = z - L1; 111 float q2 = atan2(h, r) (^) * 180.0 / PI; 112 113 // Motor a pasos 114 long targetSteps = long((q1 / 360.0) (^) * stepsPerRev); 115 stepper.moveTo(targetSteps); 116 while (stepper.distanceToGo() != 0) { 117 stepper.run(); 118 } 119 120 // Servo 121 int servoAngle = constrain(int(q2), 0, 180); 122 servoQ2.write(servoAngle); 123 124 delay(20); 125 } 126 }
Listing 2. C´odigo Arduino con AccelStepper y Servo
Fig. 4. DISE ˜NO
Fig. 5. prototipo brazo robotico
Fig. 6. prototipo brazo robotico
Fig. 7. prototipo brazo robotico
[1] Bruno Siciliano, Lorenzo Sciavicco, Luigi Villani, Giuseppe Ori- olo. Robotics: Modelling, Planning and Control. Springer, 2010. [2] John J. Craig. Introduction to Robotics: Mechanics and Control. Pearson Education, 4th Edition, 2017. [3] Mark W. Spong, Seth Hutchinson, M. Vidyasagar. Robot Modeling and Control. Wiley, 2006. [4] Saeed B. Niku. Introduction to Robotics: Analysis, Control, Appli- cations. Wiley, 3rd Edition, 2020. [5] Richard M. Murray, Zexiang Li, S. Shankar Sastry. A Mathematical Introduction to Robotic Manipulation. CRC Press, 1994. [6] The MathWorks, Inc. Robotics Toolbox Documentation. Disponible en: https://www.mathworks.com/help/robotics/.