Robotics CITS3241Exercise Sheet 3: Playing with Denavit-Hartenberg MatricesA three link 'Puma' style robot has the following link parameters
Write a MATLAB m file function [T] = DHtrans(theta, offset, length, twist)that takes the four Denavit-Hartenberg link parameters and constructs a transformation matrix representing the coordinate frame at the end of the link. Remember the D-H transformation is
T = rotz(theta) * trans(0,0,offset) * trans(length,0,0) * rotx(twist);
= [ cos(theta) -sin(theta)*cos(twist) sin(theta)*sin(twist) length*cos(theta)
sin(theta) cos(theta)*cos(twist) -cos(theta)*sin(twist) length*sin(theta)
0 sin(twist) cos(twist) offset
0 0 0 1 ];
Use the function DHtrans() and the plotframe() function you wrote last week to construct a function function puma3dof(theta1, theta2, theta3)This function takes the three joint angles, calculates the forward kinematics of the Puma arm and plots a stick diagram of the arm along with the link coordinate frames displayed using plotframe. Your function will need to specify the appropriate D-H parameters for a Puma arm. Choose link lengths/joint offset values of say, 3, so that the coordinate frame plots are not larger than the link lengths. As before you will need to initialise and 'hold' a set of 3D axes within which you will do your plotting. Write a small function that calls your puma3dof function in a loop that
varies the three joint angles to give you an animation of its motion.
When writing your code it would probably be nice to construct a
'link' structure that stores the angle, offset, length and twist
values for each link of your robot.
A 'Stanford Arm' style robot has the following link parameters
Remember the Stanford arm consists of a vertical rotary axis, followed by a horizontal rotary axis, followed by a final translation axis that extends in and out.
Write a function
stanford3dof.m(theta1, theta2, d3)
This function takes the two joint angles and the prismatic extension
of the last link, and calculates the forward kinematics of the
Stanford Arm. Again you should plot a stick diagram of the arm along
with the link coordinate frames displayed using plotframe.
Work out the zero position of the arm - it will help you understand your results! Note: To write this function you should only have to modify puma3dof.m by a very small amount. Some example images of what you should getPortfolio NoteSave listings of DHtrans, puma3dof and stanford3dof. They will be required for your portfolio. |
|
Copyright © 2002-2007 School of Computer Science & Software Engineering, The University of Western Australia. |
![]() |