Presentation is loading. Please wait.

Presentation is loading. Please wait.

Making a Point: Elementary (around Z?) Rotations in 2D …

Similar presentations


Presentation on theme: "Making a Point: Elementary (around Z?) Rotations in 2D …"— Presentation transcript:

1 Making a Point: Elementary (around Z?) Rotations in 2D …
r = |r| = |r1| = |r2| x1 = r cos a y1 = r sin a r is magnitude r = |r| r Rotation of coordinates Rotation of vector x2 y2 1 x1 y1 cos q - sin q sin q 0 cos q 0 = x2 y2 1 cos q sin q - sin q 0 cos q 0 = x1 y1 Notice the difference in their matrix representation!

2 Rotation Kinematics (ref. R.N. Jazar)
Consider a rigid body B with a fixed point O. Rotation about the fixed point will be the only possible motion of the body. We represent the rigid body by body coordinate frame B, that rotates in another coordinate frame G, as shown in the Figure 2.1 (left). We will develop a rotation algebra based on trans­formation matrices to determine the orientation of B in fixed frame G, and relate the coordinates of a body point P in both frames. P xP Xp Figure 2.1 Rigid body B has an affixed local coordinate frame Oxyz origi­nally coincident with a global “G” coordinate frame OXYZ. (Point O is the common origin of both coordinate frames). NOTE: You will notice that we are rotating point P (and thus its attached frame B) and NOT the coordinate system G which remains fixed. This is an important factor when considering where the term with “negative” sine must be allocated in the rotation matrix representation (see next slide for reference).

3 Rotation Kinematics (ref. R.N. Jazar)
If the rigid body B attached to P rotates a degrees about the Z-axis of the G frame, then the coordinates of any point P of the rigid body in the local and global coordinate frames are related by the following equation Gr = RZ,a Br, that is: Gr = = Rz,a Br = cos a - sin a sin a 1 x y z X Y Z Similarly, a rotation of b degrees about the Y-axis, and g degrees about the X-axis of the global frame relate the local and global coordinates of point P by the following equations Gr = RY,b Br and Gr = RX,g Br respectively, that is: Gr = = RY,b Br = cos b sin b - sin b 1 x y z X Y Z and Gr = = RX,g Br = cos g - sin g sin g 1 x y z X Y Z

4 Computer exercise #1: Rotation Kinematics (ref. R.N. Jazar)
Successive rotation about global axes: Find the final position of the corner P(5,30,10) of the “robot” shown in the Figure on the left after a 30deg rotation about the Z-axis, followed by a 30deg about the X-axis, and followed by a 90deg about the Y-axis. X2 Y2 Z2 cos 30 - sin 30 sin 30 1 5 30 10 -10.68 28.48 10.0 = = X3 Y3 Z3 cos 30 - sin 30 sin 30 1 -10.68 19.66 22.90 -10.68 28.48 10.0 = = = X4 Y4 Z4 -10.68 19.66 22.9 cos 90 sin 90 - sin 90 1 10.68

5 Rotation Kinematics (ref. J. Craig)
X-Y-Z Fixed Angles (describing the orientation of frame B): Sometimes called “roll-pitch-yaw” angles (roll around the x-axis, pitch around the y-axis and . The word “fixed” relates to the fact that the rotations are specified about a fixed reference frame (G): Gr = RXYZ,gba Br = Rz,g RY,b RX,a Br = R Br R = cos g - sin g sin g 1 cos b sin b - sin b cos a - sin a sin a c g c b c g s b s a - s g c a c g s b c a + s g s a r r r13 r r r33 r r r23 R = s g c b s g s b s a + c g c a s gs b c a - c g s a = - s b c b s a c b c a atan2(x, y) computes arctan(y/x) using the signs of both x and y to identify the quadrant in which the angle lies. In the formula above “s” stands for “sin” and “c” stands for “cos”.

6 Rotation Kinematics (Cont’d)
X-Y-Z Fixed Angles (describing the orientation of frame B) – (Cont’d): The inverse problem of extracting the rotation angles can be done using the formulas: cb = sqrt((r11)2 + (r21)2 b = atan2(-r31, cb) g = atan2(r21/c b, r11/c b) a = atan2(r32/c b, r33/c b) Degenerate solutions take place when b =  90o: If b = +90.0o, then g = 0.0 and a = atan2(r12,r22) If b = -90.0o, then g = 0.0 and a = - atan2(r12,r22) atan2(x, y) computes arctan(y/x) using the signs of both x and y to identify the quadrant in which the angle lies. in the formula above “c” stands for “cos”.

7 Computer Exercise # 2: X-Y-Z Fixed Angles
X-Y-Z Fixed Angles: Consider a rigid body rotating 20o around the X axis, followed by a 15o around the Y axis and ending with a 35o around the Z axis. Evaluate the rotation matrix and the position of vector r = [10, 20, 15]t after the three rotations. First do it step by step and then using the overall formula. Once the overall rotation matrix is evaluated find the corresponding rotation angles. Solution: cos 35 - sin 35 sin 35 1 cos 15 sin 15 - sin 15 1 1 10 20 15 cos 35 - sin 35 sin 35 1 cos 15 sin 15 - sin 15 1 10.000 Rr = = cos 20 - sin 20 sin 20 cos 20 cos 35 - sin 35 sin 35 1 4.5140 Rr = = Rr = c 35 c 15 c 35 s 15 s 20 - s 35 c 20 s 35 s 15 s 20 + c 35 c 20 s 35 c 15 c 15 s 20 - s 15 c 35 s 15 c 20 + s 35 s 20 s 35 s 15 c 20 - c 35 s 20 c 15 c 20 10 20 15 4.5140 = 10 20 15 = b = beta= (180/pi)*atan2(-r31, sqrt((r11)2 + (r21)2) = (180*pi/15)*atan2(-( ), sqrt((0.7912)2 +(0.5540)2) = deg a = alpha = (180*pi/35)*atan2(r21/c b, r11/c b) = deg g = gamma = atan2(r32/c b, r33/c b) = deg

8 Computer exercise #3: Rotation Kinematics (ref. R.N. Jazar)
Time dependent global rotation: Consider a rigid body B continuously turning about the Y-axis of the fixed G frame at a rate of 0.3 rad/s. Consider point P(1,0,0) and find its coordinates after 1 second and then after 2 seconds. ANSWER: We have: = X Y Z x y z cos 0.3t sin 0.3t - sin 0.3t 1 x*cos 0.3t + z*sin 0.3t - x*sin 0.3t + z*cos 0.3t Every point of B will move parallel to the X-Z plane on a circle with radius: X2 + Y2 = R where R is given by: R2 = (x*cos(0.3t) +z*sin(0.3t))2 + (-x*sin(0.3t) + z*cos(0.3t))2 = x2 + z2. After t= 1sec P is at: After t= 2sec P is at: = X Y Z 1 cos 0.6 sin 0.6 - sin 0.6 0.825 -0.565 = X Y Z 1 cos 0.3 sin 0.3 - sin 0.3 0.955 -0.296

9 Derivatives: Position and Velocity
Let’s review the concept of derivative with respect to time. We will be very pragmatic. Assume that we “locate” a moving point in space by means of a vector r(t), changing with time “t”. In Physics they teach us that given the position of a point as a function of time r(t), then its velocity can be expressed as the “derivative” of position r(t) with respect to time, that is: v(t) = derivative of r(t) with respect to time written r’(t) = d(r(t))/dt (this is just the “notation”) We are interested in the derivative of functions sin(at) and cos(at) as follows: If r(t) = sin(kt), then the derivative is r’(t) = k*cos(kt), where k is a constant (a number or a letter) If r(t) = cos(kt), then the derivative is r’(t) = - k*sin(kt), where k is a constant (a number or a letter) If r(t) = k, then the derivative is r’(t) = 0, that is, the derivative of any constant (number or letter) is zero. In the case of a matrix we take the derivative of each one of its terms as follows: If R(t) = then its derivative is: R’(t) = Notice that the common constant “k” was taken outside as a constant multiplying all terms of the matrix. sin kt -cos kt -sin kt cos kt b a d c cos kt sin kt -cos kt - sin kt k*

10 Computer Example: Position and Velocity
Consider now point P on the rigid body B rotating about the fixed axis Y at a rotation speed of 0.3 rad/s. Find the global velocity GvP of point P on the rigid body by taking a time derivative of cos 0.3t sin 0.3t - sin 0.3t 1 X Y Z x y z x*cos 0.3t + z*sin 0.3t GrP= = = y - x*sin 0.3t + z*cos 0.3t That is: x*cos 0.3t + z*sin 0.3t - x*sin 0.3t + z*cos 0.3t y d(GrP) dt d dt GvP= = Therefore, the global expression of its “velocity” vector is: -sin 0.3t cos 0.3t - cos 0.3t 0.3* -x*sin 0.3t + z*cos 0.3t - x*cos 0.3t - z*sin 0.3t 0.3* x y z GvP= = Which allows us to calculate the velocity at any time for any vector r = [x y z]t on the rigid body.


Download ppt "Making a Point: Elementary (around Z?) Rotations in 2D …"

Similar presentations


Ads by Google