Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Door Rotation Matrix/Change of Basis Plus Translation

  1. Jul 15, 2015 #1
    I think I'm having a really big block over a really small hangup, so forgive me. I'm on an internship and this is my first time working with rotations/change of basis in a real world scenario.

    I'm creating a calculator that gives torque in a door mechanism, after a given roll and pitch of the vehicle. It's for the torque in a door check mechanism, but the general torque at the axis of rotation (along door hinges) will suffice for this calculator. I am using rotation matrices to find the component of gravity into and out of the door, then multiplying that against the distance from the axis to the CG to find the torque created by gravity.

    I'm setting up the matrices in Excel.

    What I've got currently is Rx*Ry*Rz, where Rx is the roll transformation, Ry is the pitch and Rz is the yaw. That successive matrix is then multiplied against the gravity vector. The calculator gives accurate values for the gravity at the center of mass after the pitch and roll, but since I haven't accounted for the distance from the axis to the CG, the Rz matrix has no effect on the gravity.

    I feel like I need to add a translation or inertia matrix in there somewhere. The door is being treated as a point mass at the center of gravity.

    [1 0 0;0 cos(α) -sin(α);0 sin(α) cos(α)]*[cos(β) 0 sin(β);0 1 0;-sin(β) 0 cos(β)]*[cos(γ) -sin(γ) 0;sin(γ) cos(γ) 0; 0 0 1]
    Gravity Vector
    where α=roll angle, β=pitch angle, γ=yaw angle, W=weight

    Thanks SO much with any direction anyone might be able to help with. I've spent hours staring by it at myself, but no one on my team has used linear algebra in decades...
  2. jcsd
  3. Jul 15, 2015 #2


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    It looks like your pitch, roll and yaw matrices are all expressed relative to a fixed basis. That makes the maths simple but are you sure that's what you want? If you do it that way then it's true that yaw has no effect on gravity.

    An alternative way to do it, that seems more intuitive to me, is to specify an order for applying the transformations, transform the axes as well as the vector at each step, and then apply each transformation relative to a transformed set of axes.

    Say the order of application you choose is pitch (rot around x axis) then roll (rot around y axis) then yaw (rot around z axis).
    Say the vector that represents the centralised door hinge is v, which lies in the x-y plane.
    Then when you apply pitch you rotate v, and the y and z axes around the x axis, to get v' and new y', z' axes.
    Next apply roll: rotate v', and the x and z' axes around the y' axis, to get v'' and new x', z'' axes.
    Finally apply yaw: rotate v'' around the z'' axis, to get v'''.

    Because z'' is no longer vertical, the yaw transformation will affect the direction of gravity for the hinge.

    The matrices you use for these transformations will be more complex. The pitch matrix is unchanged. The roll matrix will depend on both the angles of pitch and roll. The yaw matrix will depend on all three angles.
  4. Jul 20, 2015 #3
    I think I see what you're saying. I'm kicking myself for not saving my notebook from my dynamics class.

    Originally I had aligned the y axis with the bottom edge of the door, the z axis with the hinge/front edge of the door. The origin being at the front bottom corner. My thought was that I would just translate the door's weight vector through the pitch, roll and yaw. I didn't take into consideration the position vector of the CG. So my yaw transformation doesn't affect the weight vector because I'm applying the transformation ABOUT the Z axis TO the z axis, rather than a vector positioned away from it. Does this seem like I've pinpointed the right problem?

    Attached Files:

  5. Jul 20, 2015 #4


    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    From the diagrams, it looks like you've got the right idea Cora.
    I find it helps to think about it from the point of view of an aeroplane pilot and what the controls of the aeroplane do. The aeroplane will usually have some nonzero pitch and roll relative to the Earth's up-down direction and some Yaw relative to say the East-West direction. But those coordinates are not relevant to the incremental impact of the controls of the attitude of the plane.

    The important axes that determine the effect of the plane's controls are where x points from aft to fore, y points from one wingtip to the other and z is perpendicular to those two in the direction from wheels to roof. The elevators (tail flaps) control pitch by pulling back/pushing forward on the yoke ('steering stick'), the ailerons (small flaps on the wings) control roll by pushing the yoke to either side, and the rudder controls yaw via foot pedals.

    All adjustments made to those control surfaces are relative to the aeroplane's transformed axes, not to the Earth-based axes. If you're flying upside down (eg in the middle of a barrel roll or a loop-the-loop) and you want to fly further from the ground, you need to pitch down relative to the plane's axes by pushing forward on the yoke.

    To confuse things though, at least some of the plane's instruments give indicators of configuration relative to the Earth rather than to the plane's axes. I'm pretty sure the attitude indicator shows pitch relative to gravity, but I'm not sure about roll. It's just as well commercial airlines don't spend much time flying upside down!
  6. Jul 20, 2015 #5
    Hi Cora,

    first you have to change the order of you matrices in the product, your rotation matrix ##R## has to be ##R=R_z R_y R_x## (first roll, then pitch, then yaw; the rightmost matrix corresponds to the first transformation, i.e. to the roll).

    To compute the torque, you need 2 vectors: a vector ##\mathbf a## parallel to the axis of rotation of the door, and a vector ##\mathbf r## from the axis of rotation of the door to its center of mass. The to compute the torque about this axis you need to compute the cross product of ##T\mathbf r## and ##m\mathbf g## (##m## is the mass of the door and ##\mathbf g## is the gravity vector), and then take the orthogonal projection of ##m T\mathbf r \times \mathbf g## onto the vector ##T\mathbf a##.

    And https://www.physicsforums.com/threads/door-rotation-matrix-change-of-basis-plus-translation.823423/members/andrewkirk.265790/ [Broken] is right, yaw does not change the magnitude of the torque.
    Last edited by a moderator: May 7, 2017
  7. Jul 21, 2015 #6
    Thanks for talking that through. I figured I was missing at least one position vector. What is the variable T?
    Last edited by a moderator: May 7, 2017
  8. Jul 21, 2015 #7
    Sorry, it was a typo, it should be ##R##.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook