Robotics Lab Mannual

41
Robotics TOOLBOX Lab Manual 1

description

robotics

Transcript of Robotics Lab Mannual

RoboticsTOOLBOXLab Manual

ContentsLAB-01 Introduction Downloading toolbox Linking toolbox with matlabLAB-02 Rotation matrix Homogenous matrixLAB-03 Inter conversion of euler angles & homogenous matrix Inter conversion of RPY angles & homogenous matrix Converting homogenous matrix into rotation matrixLAB-04 3D representation of rotation & Homogenous matrixLAB-05 Creating links Creating robot objectLAB-06 Plotting robot object Animation of robotLAB-07 DH Matrix Forward kinematicsLAB-08 Inverse kinematicsLAB-09 Joint trajectory Joint position Joint velocity Joint acceleration

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: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 matlabCopy 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 2Now ensure that robot folder is open in your matlab as shown below (Figure 3) ,repeat this step each time using robot toolbox.

Figure 3Type 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).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).

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.

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 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 -0.8660 0 0.5000Rotation 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 0.8660 0.5000 0 0 0 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.

Homogenous translation:T = transl(x, y, z) is a transform (4 4) representing a pure translation. Example: >> t=transl(4,8,9)t = 1 0 0 4 0 1 0 8 0 0 1 9 0 0 0 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.

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.ORTR=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*RX3) 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.

LAB-03: Inter conversion of Euler angles & matrix

Euler anglesEuler 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

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 matrixRoll-pitch-yaw angles to rotation matrix 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 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 matrixReturn rotational submatrix of a transformation 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. 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,

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, CThe color to draw the axes, MATLAB colorspec CnoaxesDont display axes on the plotaxis, ASet dimensions of the MATLAB axes to A=[xmin xmax ymin ymax zmin zmax]frame, FThe frame is named F and the subscript on the axis labels is F.text opts, opt A cell array of MATLAB text propertieshandle, HDraw in the MATLAB axes specified by the axis handle Hview, VSet plot view parameters V=[az el] angles, or auto for view toward origin of coordinate framelength, sLength of the coordinate frame arms (default 1)arrowUse arrows rather than line segments for the axeswidth, wWidth of arrow tips (default 1)thick, tThickness of lines (default 0.5)3dPlot in 3D using anaglyph graphicsanaglyph, ASpecify anaglyph colors for 3d as 2 characters for left and right (default colors rc):

r red g green b blue c cyan m magenta dispar, D Disparity for 3d display (default 0.1) textEnable display of X,Y,Z labels on the framelabels, LLabel the X,Y,Z axes with the 1st, 2nd, 3rd character of the string LrgbDisplay X,Y,Z axes in colors red, green, blue respectivelyExamples:>> T0=trotx(0) % no rotation mean base matrix>> trplot(T0, 'frame', 'F0','color','r')>> T1=troty(0.6)>> hold on>> 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 .

Lab-05: LinksThe 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 = linkL = link([alpha, a, theta, d]) L = link([alpha, a, theta, d, sigma]) A = link(q) 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. alphaii-1link twist angleAAiAi-1link lengththetaiilink rotation angleD DiDi link offset distancesigmaiijoint type; 0 for revolute, 1 for prismatic

Examples

>> L = link([-pi/2, 0.02, 0, 0.15]) %creating link objectL = -1.5707960.0200000.0000000.150000R>> show(L)alpha= -1.5708A= 0.02theta= 0D= 0.15sigma= 0>> L(0.6) %Return link transformation matrix for given angleans =

0.8253 -0.0000 -0.5646 0.0165 0.5646 0.0000 0.8253 0.0113 0 -1.0000 0.0000 0.1500 0 0 0 1.0000

Creating robot object:r = robotr = robot(rr) r = robot(link ...) r = robot(DH ...) r = 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 Returnsrobot.n r number of jointsrobot.link r+a cell array of link objectsrobot.name r+a robot name stringrobot.manuf r+a robot manufacturer stringrobot.comment r+a general comment stringrobot.gravity r 3-element vector defining gravity directionrobot.mdh r DH convention:0 if standard, 1 if modified.Determined from the link objects.robot.base r+a transform defining base of robotrobot.tool r+a transform defining tool of robotrobot.dh r legacy DH matrixrobot.dyn r legacy DYN matrixrobot.q r+a joint coordinatesrobot.qlim r+a joint coordinate limits, n2 matrixrobot.islimit r joint limit vector, for each joint set to -1, 0 or 1 depending if below low limit, OK, or greater than upper limitrobot.offset r+a joint coordinate offsetsrobot.plotopt r+a options for plot()robot.lineopt r+a line style for robot graphical linksrobot.shadowopt r+a line style for robot shadow links

Example:>> L1 = link([ pi/2 000]) L1 = 1.5707960.0000000.0000000.000000R(std)>> L2 = link([ 00 0.5 0]) L2 = 0.0000000.0000000.5000000.000000R(std)>> R=robot({L1,l2})R = noname (2 axis, RR)grav = [0.00 0.00 9.81]standard D&H parameters

alpha A theta DR/P1.5707960.0000000.0000000.000000R(std)0.0000000.0000000.5000000.000000R(std)>> R.linkans = [1x1 link] [1x1 link]

>> R.toolans =

1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1>> R.baseans = 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1>> R.n % return number of jointsans = 2 Serial-link robot classA 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 objectR = SerialLink(links, options) is a robot object defined by a vector of Link objects. 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, NAMEset robot name property to NAMEcomment, COMMENT set robot comment property to COMMENTmanufacturer, MANUF set robot manufacturer property to MANUFbase, Tset base transformation matrix property to Ttool, Tset tool transformation matrix property to Tgravity, Gset gravity vector property to Gplotopt, Pset default options for .plot() to Pplotopt3d, Pset default options for .plot3d() to Pnofastdont use RNE MEX file

ExamplesCreate a 2-link robotL(1) = Link([ 0010]);L(2) = Link([0 0 2 0]);TABLE : DH PARAMETERS TABLE FOR THE STANFORD ARM

twolink = SerialLink(L, name, two 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. #da

11*00-90

22*d2090

30d3*00

44*00-90

55*0090

66*000

2. Create 6 links for the given DH parameters.Build Stanford Armfor the given DH parameters table with name stanfordArm.use appropriate and d.

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>> 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) % plot the original robot, qr is build in ready position for p560>> hold on % 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. 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 itLab-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.

Lab-07: DH Matrix:

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(P)*sin(T), a*cos(T)][ sin(T), cos(P)*cos(T), -cos(T)*sin(P), a*sin(T)][ 0, sin(P), cos(P), d][ 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 Denavit-Hartenberg 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 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 0 -19.2820 0.5000 -0.8660 0 126.6025 0 0 1.0000 0 0 0 0 1.0000Lab-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 .

Lab-08: Inverse kinematics:q = ikine(robot, T)q = ikine(robot, T, q0) q = 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 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 Z-axis. 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

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.

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. [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]' %define a time matrix, t. Consists of start time, sample time, end time. pos=jtraj(15,75,t) %Start angle, end angle and return the position values into an array pos plot(t,pos)%plot the resultTo 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)>> 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:

Joint numberStart angleStop angle

11575

2450

330120

42025

56030

6300

Lab-09 Task:The given table shows joint angles of puma560 robot.1) Compute each joint trajectory and plot all in a single window.2) Compute each joint velocity and plot all in a single window.3) Compute each joint acceleration and plot it in a single window.

2