机械臂(3)——使用MATLAB建立机械臂模型
2017-08-09 23:05
330 查看
最近准备研究下机械臂的你运动分析,本文记录相关过程。
研究机械臂必不可少的就是建立模型进项测试分析,不可能直接用实物测试。本文将采用MATLAB进行建立模型,已经安装好机器人工具箱
1、首先要搞清楚Link类,类中包含了方法、属性,下面为官方函数说明,可自行翻译成中文
% A Link object holds all information related to a robot link such as
% kinematics parameters, rigid-body inertial parameters, motor and
% transmission parameters.
% Methods::
% A link transform matrix
% RP joint type: 'R' or 'P'
% friction friction force
% nofriction Link object with friction parameters set to zero
% dyn display link dynamic parameters
% islimit test if joint exceeds soft limit
% isrevolute test if joint is revolute
% isprismatic test if joint is prismatic
% display print the link parameters in human readable form
% char convert to string
%
% Properties (read/write)::
%
% theta kinematic: joint angle
% d kinematic: link offset
% a kinematic: link length
% alpha kinematic: link twist
% sigma kinematic: 0 if revolute, 1 if prismatic
% mdh kinematic: 0 if standard D&H, else 1
% offset kinematic: joint variable offset
% qlim kinematic: joint variable limits [min max]
%-
% m dynamic: link mass
% r dynamic: link COG wrt link coordinate frame 3x1
% I dynamic: link inertia matrix, symmetric 3x3, about link COG.
% B dynamic: link viscous friction (motor referred)
% Tc dynamic: link Coulomb friction
%-
% G actuator: gear ratio
% Jm actuator: motor inertia (motor referred)
%
% Examples::
%
% L = Link([0 1.2 0.3 pi/2]);
% L = Link('revolute', 'd', 1.2, 'a', 0.3, 'alpha', pi/2);
% L = Revolute('d', 1.2, 'a', 0.3, 'alpha', pi/2);
%
% Notes::
% - This is a reference class object.
% - Link objects can be used in vectors and arrays.
其中我们D-H参数相关的属性有
% theta kinematic: joint angle 关节角度
% d kinematic: link offset 偏距
% a kinematic: link length 长度
% alpha kinematic: link twist 扭角
其D-H参数确定方法在上一篇博客中,请自行查看
2、SerialLink类。
% A concrete class that represents a serial-link arm-type robot. The
% mechanism is described using Denavit-Hartenberg parameters, one set
% per joint.
%
% Methods::
%
% plot display graphical representation of robot
% plot3d display 3D graphical model of robot
% teach drive the graphical robot
% getpos get position of graphical robot
%-
% jtraj a joint space trajectory
%-
% edit display and edit kinematic and dynamic parameters
%-
% isspherical test if robot has spherical wrist
% islimit test if robot at joint limit
% isconfig test robot joint configuration
%-
% fkine forward kinematics
% A link transforms
% trchain forward kinematics as a chain of elementary transforms
%-
% ikine6s inverse kinematics for 6-axis spherical wrist revolute robot
% ikine inverse kinematics using iterative numerical method
% ikunc inverse kinematics using optimisation
% ikcon inverse kinematics using optimisation with joint limits
% ikine_sym analytic inverse kinematics obtained symbolically
%-
% jacob0 Jacobian matrix in world frame
% jacobn Jacobian matrix in tool frame
% jacob_dot Jacobian derivative
% maniplty manipulability
% vellipse display velocity ellipsoid
% fellipse display force ellipsoid
% qmincon null space motion to centre joints between limits
%-
% accel joint acceleration
% coriolis Coriolis joint force
% dyn show dynamic properties of links
% friction friction force
% gravload gravity joint force
% inertia joint inertia matrix
% cinertia Cartesian inertia matrix
% nofriction set friction parameters to zero
% rne inverse dynamics
% fdyn forward dynamics
%-
% payload add a payload in end-effector frame
% perturb randomly perturb link dynamic parameters
% gravjac gravity load and Jacobian
% paycap payload capacity
% pay payload effect
%-
% sym a symbolic version of the object
% gencoords symbolic generalized coordinates
% genforces symbolic generalized forces
% issym test if object is symbolic
%
% Properties (read/write)::
%
% links vector of Link objects (1xN)
% gravity direction of gravity [gx gy gz]
% base pose of robot's base (4x4 homog xform)
% tool robot's tool transform, T6 to tool tip (4x4 homog xform)
% qlim joint limits, [qmin qmax] (Nx2)
% offset kinematic joint coordinate offsets (Nx1)
% name name of robot, used for graphical display
% manuf annotation, manufacturer's name
% comment annotation, general comment
% plotopt options for plot() method (cell array)
% fast use MEX version of RNE. Can only be set true if the mex
% file exists. Default is true.
%
% Properties (read only)::
%
% n number of joints
% config joint configuration string, eg. 'RRRRRR'
% mdh kinematic convention boolean (0=DH, 1=MDH)
% theta kinematic: joint angles (1xN)
% d kinematic: link offsets (1xN)
% a kinematic: link lengths (1xN)
% alpha kinematic: link twists (1xN)
%
% Overloaded operators::
% R1*R2 concatenate two SerialLink manipulators R1 and R2
%
% Note::
% - SerialLink is a reference object.
% - SerialLink objects can be used in vectors and arrays
3、两个类了解后便可建立我哦们的模型,首先列出自己所用机器人的D-H参数表
4、根据D-H表列出
L1 = Link('d', 0, 'a', 3, 'alpha', -pi/2);
L2 = Link('d', 0, 'a', 6.4, 'alpha',0);
L3 = Link('d', 0, 'a', 5.5, 'alpha', 0);
L4 = Link('d', 2.5, 'a', 5.5, 'alpha', 0);
armbot=SerialLink([L1,L2,L3,L4]); %SerialLink 机器人
armbot.name = 'ArmBot';
armbot.comment = 'shaynerain';
armbot.display(); %打印
theta = [0,0,0,0];
armbot.plot(theta); %显示
本篇至此
研究机械臂必不可少的就是建立模型进项测试分析,不可能直接用实物测试。本文将采用MATLAB进行建立模型,已经安装好机器人工具箱
1、首先要搞清楚Link类,类中包含了方法、属性,下面为官方函数说明,可自行翻译成中文
% A Link object holds all information related to a robot link such as
% kinematics parameters, rigid-body inertial parameters, motor and
% transmission parameters.
% Methods::
% A link transform matrix
% RP joint type: 'R' or 'P'
% friction friction force
% nofriction Link object with friction parameters set to zero
% dyn display link dynamic parameters
% islimit test if joint exceeds soft limit
% isrevolute test if joint is revolute
% isprismatic test if joint is prismatic
% display print the link parameters in human readable form
% char convert to string
%
% Properties (read/write)::
%
% theta kinematic: joint angle
% d kinematic: link offset
% a kinematic: link length
% alpha kinematic: link twist
% sigma kinematic: 0 if revolute, 1 if prismatic
% mdh kinematic: 0 if standard D&H, else 1
% offset kinematic: joint variable offset
% qlim kinematic: joint variable limits [min max]
%-
% m dynamic: link mass
% r dynamic: link COG wrt link coordinate frame 3x1
% I dynamic: link inertia matrix, symmetric 3x3, about link COG.
% B dynamic: link viscous friction (motor referred)
% Tc dynamic: link Coulomb friction
%-
% G actuator: gear ratio
% Jm actuator: motor inertia (motor referred)
%
% Examples::
%
% L = Link([0 1.2 0.3 pi/2]);
% L = Link('revolute', 'd', 1.2, 'a', 0.3, 'alpha', pi/2);
% L = Revolute('d', 1.2, 'a', 0.3, 'alpha', pi/2);
%
% Notes::
% - This is a reference class object.
% - Link objects can be used in vectors and arrays.
其中我们D-H参数相关的属性有
% theta kinematic: joint angle 关节角度
% d kinematic: link offset 偏距
% a kinematic: link length 长度
% alpha kinematic: link twist 扭角
其D-H参数确定方法在上一篇博客中,请自行查看
2、SerialLink类。
% A concrete class that represents a serial-link arm-type robot. The
% mechanism is described using Denavit-Hartenberg parameters, one set
% per joint.
%
% Methods::
%
% plot display graphical representation of robot
% plot3d display 3D graphical model of robot
% teach drive the graphical robot
% getpos get position of graphical robot
%-
% jtraj a joint space trajectory
%-
% edit display and edit kinematic and dynamic parameters
%-
% isspherical test if robot has spherical wrist
% islimit test if robot at joint limit
% isconfig test robot joint configuration
%-
% fkine forward kinematics
% A link transforms
% trchain forward kinematics as a chain of elementary transforms
%-
% ikine6s inverse kinematics for 6-axis spherical wrist revolute robot
% ikine inverse kinematics using iterative numerical method
% ikunc inverse kinematics using optimisation
% ikcon inverse kinematics using optimisation with joint limits
% ikine_sym analytic inverse kinematics obtained symbolically
%-
% jacob0 Jacobian matrix in world frame
% jacobn Jacobian matrix in tool frame
% jacob_dot Jacobian derivative
% maniplty manipulability
% vellipse display velocity ellipsoid
% fellipse display force ellipsoid
% qmincon null space motion to centre joints between limits
%-
% accel joint acceleration
% coriolis Coriolis joint force
% dyn show dynamic properties of links
% friction friction force
% gravload gravity joint force
% inertia joint inertia matrix
% cinertia Cartesian inertia matrix
% nofriction set friction parameters to zero
% rne inverse dynamics
% fdyn forward dynamics
%-
% payload add a payload in end-effector frame
% perturb randomly perturb link dynamic parameters
% gravjac gravity load and Jacobian
% paycap payload capacity
% pay payload effect
%-
% sym a symbolic version of the object
% gencoords symbolic generalized coordinates
% genforces symbolic generalized forces
% issym test if object is symbolic
%
% Properties (read/write)::
%
% links vector of Link objects (1xN)
% gravity direction of gravity [gx gy gz]
% base pose of robot's base (4x4 homog xform)
% tool robot's tool transform, T6 to tool tip (4x4 homog xform)
% qlim joint limits, [qmin qmax] (Nx2)
% offset kinematic joint coordinate offsets (Nx1)
% name name of robot, used for graphical display
% manuf annotation, manufacturer's name
% comment annotation, general comment
% plotopt options for plot() method (cell array)
% fast use MEX version of RNE. Can only be set true if the mex
% file exists. Default is true.
%
% Properties (read only)::
%
% n number of joints
% config joint configuration string, eg. 'RRRRRR'
% mdh kinematic convention boolean (0=DH, 1=MDH)
% theta kinematic: joint angles (1xN)
% d kinematic: link offsets (1xN)
% a kinematic: link lengths (1xN)
% alpha kinematic: link twists (1xN)
%
% Overloaded operators::
% R1*R2 concatenate two SerialLink manipulators R1 and R2
%
% Note::
% - SerialLink is a reference object.
% - SerialLink objects can be used in vectors and arrays
3、两个类了解后便可建立我哦们的模型,首先列出自己所用机器人的D-H参数表
i | theta | d | a | alpha |
1 | theta1 | 0 | 3 | -pi/2 |
2 | theta2 | 0 | 6.4 | 0 |
3 | theta3 | 0 | 5.5 | 0 |
4 | theta4 | 2.5 | 5.5 | 0 |
L1 = Link('d', 0, 'a', 3, 'alpha', -pi/2);
L2 = Link('d', 0, 'a', 6.4, 'alpha',0);
L3 = Link('d', 0, 'a', 5.5, 'alpha', 0);
L4 = Link('d', 2.5, 'a', 5.5, 'alpha', 0);
armbot=SerialLink([L1,L2,L3,L4]); %SerialLink 机器人
armbot.name = 'ArmBot';
armbot.comment = 'shaynerain';
armbot.display(); %打印
theta = [0,0,0,0];
armbot.plot(theta); %显示
本篇至此
相关文章推荐
- Matlab之用最小二乘建立模型预测值以下例子使用1960,1970,1990和2000的人口估计1980的人口。分别用了直线估计和抛物线估计
- Matlab/Simulink——使用SimMechanics建立单摆模型
- [置顶] 【DRP】使用PowerBuilder建立数据库物理模型,并导入Oracle数据库
- 使用PowerDesigner建立数据库模型
- 使用PowerDesigner建立数据库模型
- 使用Gensim建立bow TFIDF LSI模型对文本相似度计算
- 如何重覆使用ECO建立的企業邏輯模型
- matlab虚拟现实之建立simulink虚拟现实工具箱的使用
- 使用visio 2010建立sql server数据模型——手动画、利用逆向工程
- 关于weka的使用————模型的建立
- 使用PowerDesigner建立数据库模型
- Matlab2010下使用FULLBNT工具箱建立复杂的动态贝叶斯网络
- 使用matlab训练mnist模型
- 用命令行建立空白的simulink模型(mdl文件)(Matlab)
- 【大数据部落】如何使用rjags R2jags来建立贝叶斯模型
- 【Keras】使用Keras建立模型并训练等一系列操作
- 使用分析服务多维模式建立简单的分析模型
- 五、建立语言模型几种方法及使用
- 使用SQL Server Analysis Services Tabular Model建立分析模型