%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PARAMETERS Returns a data structure containing the parameters of the example 2 DOF planar robot. Author: Arturo Gil. Universidad Miguel Hern�ndez de Elche. email: arturo.gil@umh.es date: 03/03/2012 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0002 % PARAMETERS Returns a data structure containing the parameters of the 0003 % example 2 DOF planar robot. 0004 % 0005 % Author: Arturo Gil. Universidad Miguel Hern�ndez de Elche. 0006 % email: arturo.gil@umh.es date: 03/03/2012 0007 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0008 0009 % Copyright (C) 2012, by Arturo Gil Aparicio 0010 % 0011 % This file is part of ARTE (A Robotics Toolbox for Education). 0012 % 0013 % ARTE is free software: you can redistribute it and/or modify 0014 % it under the terms of the GNU Lesser General Public License as published by 0015 % the Free Software Foundation, either version 3 of the License, or 0016 % (at your option) any later version. 0017 % 0018 % ARTE is distributed in the hope that it will be useful, 0019 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0020 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0021 % GNU Lesser General Public License for more details. 0022 % 0023 % You should have received a copy of the GNU Leser General Public License 0024 % along with ARTE. If not, see <http://www.gnu.org/licenses/>. 0025 function robot = parameters() 0026 0027 robot.name='Example 2DOF planar arm'; 0028 0029 %kinematic data DH parameters 0030 robot.DH.theta='[q(1) q(2)]'; 0031 robot.DH.d='[0 0]'; 0032 robot.DH.a='[1 1]'; 0033 robot.DH.alpha='[0 0]'; 0034 0035 %number of degrees of freedom 0036 robot.DOF = 2; 0037 0038 %rotational: R, translational: T 0039 robot.kind=['R' 'R']; 0040 0041 %Jacobian matrix 0042 robot.J=[]; 0043 0044 0045 %Function name to compute inverse kinematic 0046 robot.inversekinematic_fn = 'inversekinematic_2dofplanar(robot, T)'; 0047 robot.directkinematic_fn = 'directkinematic(robot, q)'; 0048 0049 %minimum and maximum rotation angle in rad 0050 robot.maxangle =[deg2rad(-180) deg2rad(180); %Axis 1, minimum, maximum 0051 deg2rad(-180) deg2rad(180)]; %Axis 2, minimum, maximum 0052 0053 %maximum absolute speed of each joint rad/s or m/s 0054 robot.velmax = []; %empty, not available 0055 0056 robot.accelmax=robot.velmax/0.1; % 0.1 is here an acceleration time 0057 0058 % end effectors maximum velocity 0059 robot.linear_velmax = 0; %m/s, example, not available 0060 0061 0062 %base reference system 0063 robot.T0 = eye(4); 0064 0065 %INITIALIZATION OF VARIABLES REQUIRED FOR THE SIMULATION 0066 %position, velocity and acceleration 0067 robot=init_sim_variables(robot); 0068 robot.path = pwd; 0069 0070 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0071 %GRAPHICS 0072 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0073 %read graphics files 0074 robot.graphical.has_graphics=1; 0075 robot.graphical.color = [25 20 40]; 0076 %for transparency 0077 robot.graphical.draw_transparent=0; 0078 %draw DH systems 0079 robot.graphical.draw_axes=1; 0080 %DH system length and Font size, standard is 1/10. Select 2/20, 3/30 for 0081 %bigger robots 0082 robot.graphical.axes_scale=1; 0083 %adjust for a default view of the robot 0084 robot.axis=[-2.2 2.2 -2.2 2.2 0 2.2] 0085 robot = read_graphics(robot); 0086 0087 0088 %INITIALIZATION OF VARIABLES REQUIRED FOR THE SIMULATION 0089 %position, velocity and acceleration 0090 robot.q=[0 0]'; 0091 robot.qd=[0 0]'; 0092 robot.qdd=[0 0]'; 0093 robot.time = []; 0094 0095 robot.q_vector=[]; 0096 robot.qd_vector=[]; 0097 robot.qdd_vector=[]; 0098 0099 0100 robot.last_target=directkinematic(robot, robot.q); 0101 robot.last_zone_data = 'fine'; 0102 0103 0104 0105 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0106 % DYNAMIC PARAMETERS 0107 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0108 robot.has_dynamics=1; 0109 0110 %consider friction or not 0111 robot.dynamics.friction=0; 0112 0113 %link masses (kg) 0114 robot.dynamics.masses=[1 1]; 0115 0116 %COM of each link with respect to own reference system 0117 robot.dynamics.r_com=[-0.5 0 0; %(rx, ry, rz) link 1, w/r to reference system 1 0118 -0.5 0 0];%(rx, ry, rz) link 2 0119 0120 %link masses 0121 m1 = robot.dynamics.masses(1); 0122 m2 = robot.dynamics.masses(2); 0123 0124 L1 = robot.DH.a(1); 0125 L2 = robot.DH.a(2); 0126 0127 0128 %Inertia matrices of each link 0129 % Ixx Iyy Izz Ixy Iyz Ixz, or each row 0130 robot.dynamics.Inertia=[0 0 m1*L1/3 0 0 0; 0131 0 0 m2*L2/3 0 0 0]; 0132 0133 0134 %Inertia of the rotor 0135 robot.motors.Inertia=[0 0]; 0136 %Reduction ration motor/joint speed 0137 robot.motors.G=[1 1]; 0138 0139 0140 %Viscous friction factor of the motor 0141 robot.motors.Viscous = [0 0]; 0142 %Coulomb friction of the motor 0143 %Tc+, Tc- 0144 robot.motors.Coulomb = [0 0; 0145 0 0]; 0146 0147 %Obtained from motor catalog under practicals/inverse_dynamics 0148 % R(Ohm) L(H) Kv (V/rad/s):speed constant Kp (Nm/A):torque constant Max_current (A) 0149 robot.motors.constants=[0.345 0.273e-3 2.3474e-05 84.9e-3 139];%these correspond to Maxon, 167132; 0150 0151 0152 0153 0154