Sunteți pe pagina 1din 41

Robotics

TOOLBOX
Lab Manual

Contents
1. LAB-01
Introduction
Downloading toolbox
Linking toolbox with matlab

2. LAB-02
Rotation matrix
Homogenous matrix

3. LAB-03
Inter conversion of euler angles & homogenous matrix
3

Inter conversion of RPY angles & homogenous matrix


Converting homogenous matrix into rotation matrix

4. LAB-04
3D representation of rotation & Homogenous matrix

5. LAB-05
Creating links
Creating robot object

6. LAB-06
Plotting robot object
Animation of robot

7. LAB-07
DH Matrix
Forward kinematics

8. LAB-08
Inverse kinematics

9. LAB-09

Joint trajectory
Joint position
Joint velocity
Joint acceleration

1.

LAB-01:

Introduction :
This Toolbox provides many functions that are useful in robotics
including such things as kinematics, dynamics, and trajectory
generation. The toolbox is useful for simulation as well as
analyzing results from experiments with real robots.
The Toolbox is based on a very general method of representing the
kinematics and dynamics of serial-link manipulators. These
parameters are encapsulated in Matlab objects. Robot objects can
be created by the user for any serial-link manipulator and a
number of examples are provided for well know robots such as
the Puma 560 and the Stanford arm. The toolbox also provides
functions for manipulating data types such as vectors,
transformations and unit-quaternions which are necessary to
represent 3-dimensional position and
orientation.
How to obtain the toolbox:
5

The Robotics Toolbox is freely available from the Toolbox home page
at
http://www.petercorke.com
The web page requests some information from you regarding
such as your country, type of organization and application.
The file is available in zip format (.zip). Download it and unzip it.
Linking toolbox with matlab
Copy the unzip folder (rvctools) into the MATLAB toolbox in
directory //C.

i.e

C:\program files\ MATLAB\R2013a\toolbox

Now run your Matlab , click on the setpath button then add your
robot folder that you have already copied in the Matlab toolbox
and save it.(see fig 1 & 2)

Figure 1

Figure 2

Now ensure that robot folder is open in your matlab as shown below
(Figure 3) ,repeat this step each time using robot toolbox.

Figure 3

Type startup_rvc()in matlab command window,you will get the


confirmation as;
Robotics, Vision & Control: (c) Peter Corke 1992-2011
http://www.petercorke.com- Robotics Toolbox for Matlab
(release 9.9).
7

You have successfully linked robot toolbox with your matlab,now you can
easily solve robotics problems using matlab,but each time you have to
open robot toolbox in your matab as already mention in above figure(3).

2.

LAB-02:

Rotation matrix:
In linear algebra, a rotation matrix is a matrix that is used to perform a
rotation in Euclidean space. For example the matrix:

rotates points in the xy-Cartesian plane counter-clockwise through an


angle about the origin of the Cartesian coordinate system. To
perform the rotation using a rotation matrix R, the position of each
point must be represented by a column vector v, containing the
coordinates of the point. A rotated vector is obtained by using the
matrix multiplication Rv.
8

Rotation about X axis :


R = rotx(theta) is a rotation matrix representing a rotation of theta radians
about the x-axis.
R = rotx(theta, deg) as above but theta is in degrees.

Example: Rotation of 60 degree about x-axis;

>> R=rotx(60,'deg')
R x=
1.0000

0 0.5000 -0.8660
0 0.8660 0.5000

Rotation about Y axis :


R = roty(theta) is a rotation matrix representing a rotation of theta radians
about the y-axis.
R = roty(theta, deg) as above but theta is in degrees.

Example: Rotation of 60 degree about y-axis;

>> Ry=roty(60,'deg')
Ry =
0.5000

0 0.8660

0 1.0000
-0.8660

0
0 0.5000

Rotation about Z axis :


R = rotz(theta) is a rotation matrix representing a rotation of theta radians about
the z-axis.
R = rotz(theta, deg) as above but theta is in degrees.

Example: Rotation of 60 degree about z-axis;


Rz=rotz(60,'deg')
Rz =
0.5000 -0.8660

0.8660 0.5000

1.0000

Homogenous matrix:
A system is equivalent to a matrix equation of the form

where A is an m n matrix, x is a column vector with n entries,


and 0 is the zero vector with m entries.
10

Homogenous translation:
T = transl(x, y, z) is a transform (4 4) representing a pure translation.
Example:
>> t=transl(4,8,9)
t= 1

rotation:
Rotation about X axis:
T = trotx(theta) is a transformation (4 4) representing a rotation of theta
radians about the x-axis.
T = trotx(theta, deg) as above but theta is in degrees.
Rotation about Y axis
T = troty(theta) is a transformation (4 4) representing a rotation of theta
radians about the y-axis.
T = troty(theta, deg) as above but theta is in degrees.
Rotation about Z axis
T = trotz(theta) is a transformation (4 4) representing a rotation of theta
radians about the z-axis.
T = trotz(theta, deg) as above but theta is in degrees.
11

Convert rotation and translation to transform :


TR = rt2tr(R, t) is a transformation matrix (M M ) formed from an
orthonormal rotation matrix R (N N ) and a translation vector t (N 1)
where M=N+1.
OR
TR=trotz(theta)*transl(x,y,z).

Lab-02 Task:
1) Find a rotation matrix R represents a rotation of 450 about x followed
by - 600 about(new y1(j1)),compare this result with your manual
result.
2) Show that Rx*RY RY*RX
3) Find a homogeneous transformation matrix T of frame that is
translated 4 units along x-axis, 1.4 units along y-axis followed by
rotation of 660 about z-axis.

12

3.

LAB-03:

Inter conversion of Euler angles & matrix


Euler angles
Euler angles represent a sequence of three elemental rotations, i.e.
rotations about the axes of a coordinate system. For instance, a first
rotation about z by an angle , a second rotation about x by an angle ,
and a last rotation again about z, by an angle . These rotations start from
a known standard orientation.

Convert transform to Euler angles


eul = tr2eul(T, options) are the ZYZ Euler angles expressed as a row vector
corresponding to the rotational part of a transform T. The 3 angles
eul=[PHI,THETA,PSI] correspond to sequential rotations about the Z, Y and Z
axes respectively.
eul = tr2eul(R, options) are the ZYZ Euler angles expressed as a row
vector corresponding to the orthonormal rotation matrix R.
If R or T represents a trajectory (has 3 dimensions), then each row of eul
corresponds to a step of the trajectory.
Options
deg Compute angles in degrees (radians default)
flip Choose first Euler angle to be in quadrant 2 or 3.

Convert Euler angles to rotation matrix

13

R = eul2r(phi, theta, psi, options) is an orthonornal rotation matrix equivalent


to the specified Euler angles. These correspond to rotations about the Z, Y, Z
axes respectively. If phi, theta, psi are column vectors then they are
assumed to represent a trajectory and R is a three dimensional matrix, where
the last index corresponds to rows of phi, theta, psi.
R = eul2r(eul, options) as above but the Euler angles are taken from
consecutive columns of the passed matrix eul = [phi theta psi].

Options
deg Compute angles in degrees (radians default)

Convert Euler angles to transform

T = eul2tr(phi, theta, psi, options) is a transformation equivalent to the


specified Euler angles. These correspond to rotations about the Z, Y, Z
axes respectively. If phi, theta, psi are column vectors then they are assumed
to represent a trajectory and R is a three dimensional matrix, where the last
index corresponds to rows of phi, theta, psi.
T = eul2tr(eul, options) as above but the Euler angles are taken from
consecutive columns of the passed matrix eul = [phi theta psi].
Options

deg Compute angles in degrees (radians default)

Inter conversion of RPY angles & homogenous matrix


Roll-pitch-yaw angles to rotation matrix
14

R = rpy2r(rpy, options) is an orthonormal rotation matrix equivalent to the


specified roll, pitch, yaw angles which correspond to rotations about the X,
Y, Z axes respectively. If rpy has multiple rows they are assumed to
represent a trajectory and R is a three dimensional matrix, where the last index
corresponds to the rows of rpy.
R = rpy2r(roll, pitch, yaw, options) as above but the roll-pitch-yaw angles
are passed as separate arguments. If roll, pitch and yaw are column vectors
they are assumed to represent a trajectory and R is a three dimensional
matrix, where the last index corresponds to the rows of roll, pitch, yaw.
Options
deg

Compute angles in degrees (radians default)

zyx Return solution for sequential rotations about Z, Y, X axes

Roll-pitch-yaw angles to transform

T = rpy2tr(rpy, options) is a transformation equivalent to the specified roll,


pitch, yaw angles which correspond to rotations about the X, Y, Z axes
respectively. If rpy has multiple rows they are assumed to represent a
trajectory and T is a three dimensional matrix, where the last index corresponds
to the rows of rpy.
T = rpy2tr(roll, pitch, yaw, options) as above but the roll-pitch-yaw angles are
passed as separate arguments. If roll, pitch and yaw are column vectors they
are assumed to represent a trajectory and T is a three dimensional matrix,
where the last index corresponds to the rows of roll, pitch, yaw.

Options
15

deg

Compute angles in degrees (radians default)

zyx Return solution for sequential rotations about Z, Y, X axes

Convert a transform to roll-pitch-yaw angles


rpy = tr2rpy(T, options) are the roll-pitch-yaw angles expressed as a row
vector corresponding to the rotation part of a transform T. The 3 angles
rpy=[R,P,Y] correspond to sequential rotations about the X, Y and Z axes
respectively.
rpy = tr2rpy(R, options) are the roll-pitch-yaw angles expressed as a row vector
corresponding to the orthonormal rotation matrix R.
If R or T represents a trajectory (has 3 dimensions), then each row of rpy
corresponds to a step of the trajectory.
Options
deg

Compute angles in degrees (radians default)

zyx Return solution for sequential rotations about Z, Y, X axes.

Converting homogeneous matrix into rotation matrix


Return rotational submatrix of a transforma tion
R = t2r(T) is the orthonormal rotation matrix component of transformation
matrix T.
Convert transform to rotation and translation
[R,t] = tr2rt(TR) split a transformation matrix (N N ) into an orthonormal
rotation matrix R (M M ) and a translation vector t (M 1), where
N=M+1.
16

A transform sequence TR (N N K ) is split into rotation matrix sequence


R (M M K ) and a translation sequence t (K M ).
Lab-03 Task:
1) Find the rotation matrix R representing a roll of /4 followed by a
yaw of /2 followed by a pitch of /2.
2) Find Euler angles for above rotation R.
3) Find the Homogeneous matrix T corresponding to the set of Euler
angles{/2, 0,/4}.
4) Extract Rotation matrix & translation matrix from above
homogeneous matrix T,

17

4.

Lab-04:

3D representation of rotation & Homogenous matrix:

Draw a coordinate frame :


trplot(T, options) draws a 3D coordinate frame represented by the transform T
(4 4).
H = trplot(T, options) as above but returns a handle.
trplot(H, T) moves the coordinate frame described by the handle H to the
pose T (4 4).
trplot(R, options) draws a 3D coordinate frame represented by the
orthonormal rotation matrix R (3 3).
H = trplot(R, options) as above but returns a handle.
trplot(H, R) moves the coordinate frame described by the handle H to the
orientation R.
Options
color, C

The color to draw the axes, MATLAB colorspec C

noaxes

Dont display axes on the plot

axis, A
Set dimensions of the MATLAB axes to A=[xmin xmax ymin
ymax zmin zmax]
frame, F The frame is named F and the subscript on the axis labels is F.
text opts, opt A cell array of MATLAB text properties
18

handle, H Draw in the MATLAB axes specified by the axis handle H


view, V Set plot view parameters V=[az el] angles, or auto for view toward
origin of coordinate frame
length, s Length of the coordinate frame arms (default 1)
arrow

Use arrows rather than line segments for the axes

width, w

Width of arrow tips (default 1)

thick, t

Thickness of lines (default 0.5)

3d

Plot in 3D using anaglyph graphics

anaglyph, A
Specify anaglyph colors for 3d as 2 characters for left
and right (default colors rc):

red

g
b
c
m

green
blue
cyan
magenta

dispar, D Disparity for 3d display (default 0.1)


text Enable display of X,Y,Z labels on the frame
labels, L

Label the X,Y,Z axes with the 1st, 2nd, 3rd character of the string L

rgb Display X,Y,Z axes in colors red, green, blue respectively


Examples:
>> T0=trotx(0) % no rotation mean base matrix
>> trplot(T0,

'frame',

'F0','color','r')

>> T1=troty(0.6)
>> hold on

19

>> trplot(T1,

'frame',

'F1','color','g')

Lab-04 Task:
1) If the coordinate frame 01X1Y1Z1 is obtained from the coordinate frame
O0X0Y0Z0 by a rotation of /2 about the x-axis followed by a rotation of
/2 about the fixed y-axis, find the rotation matrix R representing the
composite transformation. Sketch the initial and final frames.
2) Find the Homogeneous matrix T corresponding to the set of Euler
angles{-/2, 0,/4}. Sketch matrix T relative to base frame use
arrow to find the direction of X1 relative to X0 .
20

5.

Lab-05:

Links
The links are the rigid members connecting the joints. The joints (also
called axes) are the movable components of the robot that cause relative
motion between adjacent links.
Creating links:
L

link

link([alpha,

a,

theta,

d])

link([alpha,

a,

theta,

d,

link(q)

sigma])

show(L)

The link function constructs a link object. The object contains kinematic
and dynamic parameters as well as actuator and transmission parameters.
The first form returns a default object, while the second and third forms
initialize the kinematic model based on Denavit and Hartenberg
parameters.
The second last form given above is not a constructor but a link method that
returns the link transformation matrix for the given joint coordinate. The
argument is given to the link object using parenthesis. The single argument
is taken as the link variable q and substituted for or D for a revolute or
prismatic link respectively.
The Denavit and Hartenberg parameters describe the spatial relationship
between this link and the previous one.
alpha

i-1

link twist angle


21

Ai-1

link length

theta

link rotation angle

Di

Di

link offset distance

sigma

joint type; 0 for revolute, 1 for prismatic

Ai

Examples
>> L = link([-pi/2, 0.02, 0, 0.15]) %creating link object
L =
-1.570796

0.020000 0.000000 0.150000 R

>> show(L)
alpha
A

= 0.02

theta
D

= -1.5708

= 0

= 0.15

sigma

= 0

>> L(0.6)
angle

%Return link transformation matrix for given

ans =

0.8253

-0.0000

-0.5646

0.0165

0.5646

0.0000

0.8253

0.0113

-1.0000

0.0000

0.1500
22

1.0000

Creating robot object:


r

robot

robot(rr)

r
r
r

=
=
=

robot(link ...)
robot(DH ...)
robot(DYN ...)

robot is the constructor for a robot object. The first form creates a default
robot, and the second form returns a new robot object with the same value
as its argument. The third form creates a robot from a cell array of link
objects which define the robots kinematics and optionally dynamics. The
fourth and fifth forms create a robot object from legacy DH and DYN format
matrices.
Since Matlab does not support the concept of public class variables
methods have been written to allow robot object parameters to be
referenced (r) or assigned (a) as given by the following table

Method

Operation

robot.n

robot.link
robot.name

r+a
r+a

Returns
number of joints
cell array of link objects
robot name string
23

robot.manuf

r+a

robot manufacturer string

robot.comment

r+a

robot.gravity
direction

robot.mdh
modified.

general comment string


3-element vector defining gravity

DH convention: 0 if standard, 1 if

Determined from the link objects.


robot.base

r+a

transform defining base of robot

robot.tool

r+a

transform defining tool of robot

robot.dh

legacy DH matrix

robot.dyn

legacy DYN matrix

robot.q

r+a

joint coordinates

robot.qlim

r+a

joint coordinate limits, n

2 matrix

robot.islimit
r
joint limit vector, for each joint set to -1,
0 or 1 depending if below low limit, OK, or greater than upper limit
robot.offset

r+a

joint coordinate offsets

robot.plotopt

r+a

options for plot()

robot.lineopt

r+a

line style for robot graphical links

robot.shadowopt

r+a

line style for robot shadow links

24

Example:
>> L1 = link([ pi/2 0

0])

L1 =
1.570796 0.000000 0.000000 0.000000 R
>> L2 = link([ 0

(std)

0 0.5 0])

L2 =
0.000000 0.000000 0.500000 0.000000 R

(std)

>> R=robot({L1,l2})
R=
noname (2 axis, RR)
grav = [0.00 0.00 9.81]

alpha

theta

standard D&H parameters

R/P

1.570796 0.000000 0.000000 0.000000 R

(std)

0.000000 0.000000 0.500000 0.000000 R

(std)

>> R.link
ans =
[1x1 link]

[1x1 link]

>> R.tool
ans =
25

>> R.base
ans =
1

>> R.n

% return number of joints

ans =
2
Serial-link robot class
A concrete class that represents a serial-link arm-type robot. The
mechanism is described using Denavit-Hartenberg parameters, one set per
joint.
Create a SerialLink robot object
R = SerialLink(links, options) is a robot object defined by a vector of Link
objects.

26

R = SerialLink(dh, options) is a robot object with kinematics defined by the


matrix dh which has one row per joint and each row is [theta d a alpha] and
joints are assumed revolute. An optional fifth column sigma indicate revolute
(sigma=0, default) or prismatic (sigma=1).
R = SerialLink(options) is a null robot object with no links.
R = SerialLink([R1 R2 ...], options) concatenate robots, the base of R2 is
attached to the tip of R1.
R = SerialLink(R1, options) is a deep copy of the robot object R1, with all
the same properties.
Options
name, NAME

set robot name property to NAME

comment, COMMENT

set robot comment property to COMMENT

manufacturer, MANUF set robot manufacturer property to MANUF


base, T

set base transformation matrix property to T

tool, T

set tool transformation matrix property to T

gravity, G set gravity vector property to G


plotopt, P set default options for .plot() to P
plotopt3d, P
nofast

set default options for .plot3d() to P

dont use RNE MEX file

Examples
Create a 2-link robot
L(1)

Link([ 0 0

L(2)

Link([0 0 2 0]);

0]);: DH PARAMETERS TABLE FOR THE


TABLE
27

twolink

0 -90

d2

0 90

d3

0 0

2
*

0 -90

0 90

0 0

name,

two

5
*

6
*

SerialLink(L,

link);

Lab-05 Task:
1. Create three links of your own choice,then make a robot object from it
using:
a)Robot function b) SerialLink function. Name your robot
Three_Link_manipulator for both of the above functions.Check its
name and number of joints using options to show that you have
created your robot accurately.

2. Create 6 links for the given DH parameters.Build Stanford Arm


for the given DH parameters table with name stanfordArm.use appropriate
and d.
28

6.

LAB-06:

Ploting robot object:


>>plot(robot,q)
>>plot(robot,q,arguments...)

plot is overloaded for robot objects and displays a graphical


representation of the robot given the kinematic information in robot. The
robot is represented by a simple stick figure polyline where line segments
join the origins of the link coordinate frames. Where q is a matrix
representing joints coordinates.

Examples: To plot two Pumas in the same figure window.

>> puma560 % create p560 robot object


>> puma_copy=p560; % duplicate the robot
29

>> p560_copy.base=transl([-0.5 0.5 0]); % translate the base of duplicate


>> puma_copy.name='puma_copy'; % give it a name
>> plot(p560,qr)
for p560
>> hold on

% plot the original robot, qr is build in ready position


% hold the existing plot

>> plot(puma_copy,qr) % plot the translated robot

Animation of robot:
drivebot(robot)
Pops up a window with one slider for each joint. Operation of the sliders
will drive the graphical robot on the screen. Very useful for gaining an
understanding of joint limits and robot workspace.

30

The joint coordinate state is kept with the graphical robot and can be
obtained using the plot function. The initial value of joint coordinates is taken
from the graphical robot.
Examples: To drive a graphical Puma 560 robot

>> puma560

% define the robot

>> plot(p560,qz) % draw it


>> drivebot(p560)

% now drive it

Lab-06 Task:
1) Build SCARA robot from DH table shown below.
2) Name your robot as SCARA ,plot it if all joint variables are
zero.
3) Create a duplicate scara named SCARA_DUPL, and
translate its base -200 units along x-axis and 150 units
along y-axis. Plot SCARA_DUPL with the previous plot in
the same window to observe the translation.(joint variables
are zero).
4) Plot SCARA if 2nd joint is rotated 900 and 3rd joint
translated 8 units.
5) Animate SCARA and observe each joint movements.

31

7.

Lab-07:

DH Matrix:

32

Example:General representation of DH matrix in matlab

>> a = sym('a');

% sym is used to define symbols

>> b = sym('T');

%T= theta

>> c = sym('P');

% p=alpha

>> d = sym('d');

>> A=trotz(b)*transl(0,0,d)*transl(a,0,0)*trotx(c)

A =

[ cos(T), -cos(P)*sin(T),
[ sin(T),
[

0,

sin(P)*sin(T), a*cos(T)]

cos(P)*cos(T), -cos(T)*sin(P), a*sin(T)]


sin(P),

cos(P),

d]
33

0,

0,

0,

1]

%%% Now, to substitute the symbols by numerical values, we can use the
%%% subs function. For example, if we want to set all variables to
%%% zero, we can execute the following substitution:
>> A=subs(A,{c,a,b,d},{0,0,0,0})

A=

[ 1, 0, 0, 0]
[ 0, 1, 0, 0]
[ 0, 0, 1, 0]
[ 0, 0, 0, 1]
Forward kinematics:
T= fkine(robot,q)
fkine computes forward kinematics for the joint coordinate q giving a
transform for the location of the end-effector. robot is a robot object which
contains a kinematic model in either standard or modified DenavitHartenberg notation. Note that the robot object can specify an arbitrary
transform for the base of the robot.
If q is a vector it is interpreted as the generalized joint coordinates, and
fkine returns a transformation for the final link of the manipulator. If q is a
34

matrix each row is interpreted as a joint state vector, and T is a 4* 4 m


matrix where m is the number of rows in q.
Example:Forward kinematics of 2 -link manipulator if joint variables are 600
& 900 .
>> L1=link([ 0 100 0 0 ]);
>> L2=link([ 0 80 0 0 ]);
>> twolink=robot({L1,L2});
>> q=([pi/3 pi/2]);
>> T=fkine(twolink,q)
T =
-0.8660

-0.5000

-19.2820

0.5000

-0.8660

126.6025

1.0000

1.0000

Lab-07 Task:
1) Represent DH matrix A in terms of theta , alpha , a &
d ,using sym command to define symbols.
2) Find DH matrices (A01,A12,A23.A56) for each link in the
given table.Use subs command to replace the link
parameters in the general matrix.
3) Build a robot cylindrical from the given table.
4) Plot the robot cylindrical if joint variables are zero.
5) Find forward kinematics of cylindrical robot for the given
joint variables q=[900 56 -10 300 600 300 ].
6) Plot the robot for above q find the position & orientation
( R P Y ) of the Tool in world frame for above q .
35

8.

Lab-08:

Inverse kinematics:
q

ikine(robot,

T)

ikine(robot,

T,

q0)

ikine(robot,

T,

q0,

M)

ikine returns the joint coordinates for the manipulator described by the
object robot whose endeffector transform is given by T. Note that the
robots base can be arbitrarily specified within the robot object.
If T is a transform then a row vector of joint coordinates is returned. If T is
a transform trajectory of size 4 4 m then q will be an n m matrix where
36

each row is a vector of joint coordinates corresponding to the last subscript of


T.
The initial estimate of q for each time step is taken as the solution from the
previous time step. The estimate for the first step in q0 if this is given else
0. Note that the inverse kinematic solution is generally not unique, and
depends on the initial value q0 (which defaults to 0).
For the case of a manipulator with fewer than 6 DOF it is not possible for the
end-effector to satisfy the end-effector pose specified by an arbitrary
transform. This typically leads to nonconvergence in ikine. A solution is to
specify a 6-element weighting vector, M, whose elements
are 0 for those Cartesian DOF that are unconstrained and 1 otherwise.
The elements correspond to translation along the X-, Y- and Z-axes and
rotation about the X-, Y- and Z-axes. For example, a 5-axis manipulator may
be incapable of independantly controlling rotation about the end-effectors Zaxis. In this case M = [1 1 1 1 1 0] would enable a solution in
which the end-effector adopted the pose T except for the end-effector
rotation. The number of non-zero elements should equal the number of robot
DOF.
Example: Inverse kinematics of two link manipulator:
>> L1=link([ 0 100 0 0 ]);
>> L2=link([ 0 80 0 0 ]);
>> twolink=robot({L1,L2});
>> T=trotz(pi/2)*transl(12,0,0);
q=ikine(twolink,T,[0 0],[1 0 0 0 0 1])
q =
-1.5708

3.1416
37

Lab-08 Task:
1) Find the inverse kinematics of cylindrical robot (ref -Lab-07)
If the end effector is -50 unit translated alond x-axis 40 units
along z-axis and have a Roll of 900 .
2) Plot the robot for the joint parameters obtained by inverse
kinematics.
3) Find the inverse kinematics of puma560 if it has to pick a ball
placed at a point -0.7 unit along x-axis & 0.3 units along y=axis
& -0.4 units along z-axis.Plot it in a pose to pick the ball.

9.

Lab-09:

Joint trajectory ,Joint position ,Joint velocity ,Joint acceleration:


[q,qd,qdd] = jtraj(q0, qf, m) is a joint space trajectory q (m N ) where the
joint coordinates vary from q0 (1N ) to qf (1N ). A quintic (5th order)
polynomial is used with default zero boundary conditions for velocity and
acceleration. Time is assumed to vary from 0 to 1 in m steps. Joint velocity
and acceleration can be optionally returned as qd (m N ) and qdd (m N )
respectively. The trajectory q, qd and qdd are m N matrices, with one row per
time step, and one column per joint.
[q,qd,qdd] = jtraj(q0, qf, m, qd0, qdf) as above but also specifies initial and
final joint velocity for the trajectory.
38

[q,qd,qdd] = jtraj(q0, qf, T) as above but the trajectory length is defined by


the length of the time vector T (m 1).
[q,qd,qdd] = jtraj(q0, qf, T, qd0, qdf) as above but specifies initial and final
joint velocity for the trajectory and a time vector.

Example: to plot the trajectory of a single joint moving from 15 to 75


degrees in a total time of 3 seconds with a sample time of 0.5 seconds:
t=[0:0.5:3]'
end time.

%define a time matrix, t. Consists of start time, sample time,

pos=jtraj(15,75,t)
%Start angle, end angle and return the position
values into an array pos
plot(t,pos) %plot the result
To look at the joint velocity & acceleration
[pos vel acc]=jtraj(15,75,t) %note jtaj can return a matrix, the first column
is position, the second column is velocity,& third column is acceleration

>> subplot(3,1,1)
>> plot(t,pos,'color','r')
>> subplot(3,1,2)
39

>> plot(t,vel,'color','g')
>> subplot(3,1,3)
>> plot(t,acc,'color','m')
To examine multiple joints, the start and end angles can be a matrix:

Start
Stop
angle
angle
The given table 1
shows joint
15
75
angles of
puma560 robot.
2
45
0
1) Compute 3
each joint
30
120
trajectory 4
and plot all in a
20
25
5
60
30
single
window.
30
0
2) Compute 6
each joint velocity
and plot all in a single window.
3) Compute each joint acceleration and plot it in a single window.
Lab-09 Task:

Joint
number

40

41

S-ar putea să vă placă și