Mechanisms and Robotics Laboratory Exercises - Day 2 Mapping - 2: Multiple Rotations of a frame Problem No. 2 • Certain rotations are carried out about the axis of the fixed frame, first rotation about x-axis by 45o then about y-axis by 30o and finally about x-axis by 60o . Obtain the equivalent rotation matrix. Solution Rotations are in order X-Y-X about the fixed axes; hence it is a case of fixed angle representation. R = Rx (60o) RY (30o) Rx (45o) 1 0 0 πππ 30o 0 π ππ30o R = 0 πππ 60o −π ππ60o 0 1 0 0 π ππ60o πππ 60o −π ππ30o 0 πππ 30o 0.866 R = 0.433 −0.25 0.354 −0.177 0.919 0.354 −0.884 −0.306 1 0 0 0 πππ 45o −π ππ45o 0 π ππ45o πππ 45o MATLAB Code: clc clear all t1=input('Enter the link angle with x1=') t2=input('Enter the link angle with y=') t3=input('Enter the link angle with x2=') Rx1=[1 0 0; 0 cosd(t1) -sind(t1); 0 Ry=[cosd(t2) 0 sind(t2); 0 Rx2=[1 0; 0 0 R = Rx2*Ry*Rx1 1 sind(t1) cosd(t1)] 0; -sind(t2) 0 cosd(t3) -sind(t3); 0 cosd(t2)] sind(t3) cosd(t3)] Homogeneous Transformation Homogeneous Transformation Matrices ο ππ»π π. π π. π π. π π π π. π π. π π. π π π = π. π π. π π. π π π π π π π ο± The matrix is divided into four subparts and these sub-matrices are as shown below. π 3π3 ο± π 1π3 ο± Here π ο± π· 3π1 ο± π 1π1 ο± π 1π3 π· 3π1 π 1π1 3π3 is rotation matrix. is translation matrix. is a non-zero scaling factor. is a perspective vector. Translation Matrices πππππ 1 = 0 0 0 ππ₯ 0 1 0 0 πππππ 1 = 0 0 0 0 ππ₯ 0 0 1 0 0 1 ππ₯ , ππ¦ , ππ§ 0 0 ππ₯ 1 0 ππ¦ 0 1 ππ§ 0 0 1 πππππ ππ§ πππππ 1 = 0 0 0 ππ¦ 0 1 0 0 0 0 0 ππ¦ 1 0 0 1 1 = 0 0 0 0 1 0 0 0 0 0 0 1 ππ§ 0 1 Homogeneous Transformation Matrices οΆ When we want to describe a generalized transformation by a single matrix that combines the effects of translation and rotation, we define a vector by adding 1. π₯ 1 0 0 0 π¦ π= π§ π ππ‘π₯ π = 0 πΆπ −ππ 0 0 ππ πΆπ 0 1 0 0 0 1 πΆπ π ππ‘π§ π = ππ 0 0 −ππ πΆπ 0 0 0 0 1 0 0 0 0 1 πΆπ π ππ‘π¦ π = 0 −ππ 0 0 1 0 0 ππ 0 0 0 πΆπ 0 0 1 Homogeneous Transformation Matrices 1 0 π ππ‘π₯ π = 0 πΆπ 0 ππ 0 0 πΆπ π ππ‘π¦ π = 0 −ππ 0 πΆπ π ππ‘π§ π = ππ 0 0 0 0 −ππ 0 πΆπ 0 0 1 1 0 πππππ π₯ π = 0 0 0 1 0 0 0 π 0 0 1 0 0 1 0 ππ 0 1 0 0 0 πΆπ 0 0 0 1 1 0 πππππ π¦ π = 0 0 0 1 0 0 0 0 0 b 1 0 0 1 1 0 πππππ π§ π = 0 0 0 1 0 0 0 0 0 0 1 c 0 1 −ππ πΆπ 0 0 0 0 1 0 0 0 0 1 Post-Multiplication Vs. Pre-Multiplication Composite Rotations οΆIf the mobile coordinate frame M is to be rotated by an amount Ο about the Kth unit vector of the fixed coordinate frame F, then pre-multiply R by Rk(Ο) οΆIf the mobile coordinate frame M is to be rotated by an amount Ο about its own Kth unit vector, then post-multiply R by Rk(Ο) Problem No. 3 • Frame A having a Point [2 4 6]T is rotated about the x-axis by an angle of 60o followed by a translation of [7 5 7]T about the new frame. Obtain the transformation matrix T. Solution rotx(60)*trans(a,b,c)*[2,4,6,1]’ Solution Rotx(60) trans_abc 1.0000 0 0 0 0.5000 -0.8660 0 0.8660 0.5000 0 0 0 9.0000 -6.7583 14.2942 1.0000 0 0 0 1.0000 1 0 0 0 0 1 0 0 0 0 1 0 7 5 7 1 2 4 6 1 Forward kinematics-1: 2 DOF Planar manipulator Problem No. 4 Obtain the position and orientation of the tool point P with respect to the base for the 2 DOF, RP planar manipulator shown in figure. Consider joint angle 45 degrees and link (L1) length 500 mm and extension 200mm. • Solution: • [x’,y’,z’] = Rotz (q1)*Transx(L1)*Rotz(90)* Rotx(90)* Transz(d1)* [0,0,0]’ Link i θ 1 θ1 2 d ο‘ a Home 90 L1 90 d1 Ans: π= πΏ1 + π2 . πΆπ1 πΏ1 + π2 . ππ1 0 494.9747 494.9747 0 1.0000 Forward kinematics-1: 3 dof Cylindrical manipulator Cylindrical arm Problem No. 5 L1 = 700 mm L2 = 600 mm theta1 = 45 d2 = 100 mm d3 = 200 mm Cylindrical arm Problem No. 5 Solution: Solution: [x’,y’,z’] = [Rotz(q1).Transz(L1)].[Transz(d2).Rotx(-90).transz(L2)].Transz(d3).[0,0,0]’ Link i θ d 1 θ1 L1 2 d2, L2 3 d3 ο‘ a Home -90 − πΏ2 + π3 . ππ1 [x’,y’,z’] = πΏ2 + π3 . πΆπ1 πΏ1 + π2 3 dof Articulated manipulator Problem No. 6 Develop workspace points in MATLAB for articulated manipulator whose joint angles are 45, 30 and -40, link lengths L1 = 100mm, L2=L3=300 mm. Link i θ d ο‘ 1 θ1 L1 90 2 θ2 3 θ3 a Home L2 90 L3 90 Solution P = [rotz(q1)*transz(L1)*rotx(90)]*[rotz(q2)*transx(L2)]*[rotz(q3)*transx(L3)*rotz(90)rotx(90)]*origin π»ππ = [rotz(q1)*transz(L1)*rotx(90)] π»ππ = [rotz(q2)*transx(L2)] π»ππ = [rotz(q3)*transx(L3)*rotz(90)rotx(90)] Link i θ d ο‘ 1 θ1 L1 90 2 θ2 3 θ3 πΆ1 πΏ2 πΆ2 + πΏ3 πΆ23 π = π1 πΏ2 πΆ2 + πΏ3 πΆ23 πΏ3 π23 + πΏ2 π2 + πΏ1 a Home L2 90 L3 90