Friday, April 11, 2014

Using rcv tools box to calculate a kinematic for robot arm.

1. RCV tool (Peter corke: Robotics, vision and control) - fundamental algorithms in matlab
2. DH-parameters
Fig 1. Definition of standard Denavit and Hartenberg link parameters. The colors red and blue denote all things associated with links j−1 and j respectively. The numbers in circles represent the order in which the elementary transforms are applied.
A link can be specified by two parameters, its length aj and its twist αj . Joints are also described by two parameters. The link offset dj is the distance from one link coordinate frame to the next along the axis of the joint. The joint angle θj is the rotation of one link with respect to the next about the joint axis.
Following this convention the first joint, joint 1, connects link 0 to link 1. Link 0 is the base of the robot. Commonly for the first link d1=α1=0 but we could set d1>0 to represent the height of the shoulder joint above the base.
The final joint, joint Nconnects link N−1 to link N. Link Nis the tool of the robot and the parameters dN
and aN specify the length of the tool and its x-axis offset respectively.
Table 1. Denavit - Hartenberg parameters: their physical meaning, symbol and formal definition.
The transformation from link coordinate frame {j−1} to frame {j} is defined in terms of elementary rotations
and translations as. 
The parameters αj and aj are always constant. For a revolute joint θj is the joint variable and dj is constant, while for a prismatic joint dj is variable, θj is constant and αj=0. In many of the formulations that follow we use generalized joint coordinates. 
Within the Toolbox, it represents a robot link with a Link object which is created by: 
 >> L = Link([0, 0.1, 0.2, pi/2, 0])
where the elements of the input vector are given in the order θk , dj , aj , αj.  The optional fifth element σj
indicates whether the joint is revolute (σi=0) or prismatic (σi=0). If not specified a revolute joint is assumed.
one of the most common parameters and methods is the link transform (Eq. 1). 
ex. L.A(θ)
3. Forward kinematics 
with the end-effector pose as a function of joint coordinates. Using homogeneous transformations this is simply the product of the individual link transformation matrices given by Eq. 2 which for an N-axis manipulator is
 3. A 2-link robot
Fig. 2. Two-link robot. 
We have a DH parameters which we use to create a vector of Link object 
L(1) = Link([0 0 1 0]) (theta =q1, d=0, a =1, alpha =0)
L(2) = Link([0 0 1 0]) (theta =q2, d=0, a =1, alpha =0)
and therefore we construct  a SerialLink
two_link = SerialLink(L, 'name', 'two_link);
Common parameters and methods of SerialLink object are: 
two_link.n ( number of joints)
two_link.fkine([pi/2 pi/2]) (forward kinematic) 
ex. 
>> two_link.fkine([pi/4 pi/4])

ans =

    0.0000   -1.0000         0    0.7071
    1.0000    0.0000         0    1.7071
         0         0        1.0000            0
         0         0                 0    1.0000
and we plot it. 

>> two_link.plot([0 0])
>> two_link.plot([pi/4 -pi/4])
Fig. 3. The two-link robot in two different poses,a the pose (0, 0); b the pose (pi/4,pi/4)

No comments: