Angular Velocity from Orthogonal Rotation Matrix

ZachGriffin
Messages
20
Reaction score
0
Hi All,

I have a rigidbody simulation and I'm trying to calculate the local angular velocity of the object using the derivative of it's orthogonal rotation matrix. This is where I'm stuck as I haven't been able to find an example on calculating the time derivative from two matrices at t=n and t=n+1. Would subtracting the corresponding matrix elements give me the derivative? My current workings on paper would suggest that isn't the method.

Once I have the derivative matrix, I'm assuming I multiply that by the inverse of the rotation matrix at t=n+1 which should give me the angular velocity tensor?

Could anyone offer any pointers on calculating the time derivative?

Cheers,

Zach
 
Physics news on Phys.org
If your angular velocity vector (also, a pseudovector) is A
[ 0 -Az Ay ]
| Az 0 -Ax ]
[ -Ay A x 0 ]

Then you can produce a rotation over time t via exp(At) = 1 + At + (A^2)t^2/2! + (A^3)t^3/3! + etc.

So you know that M' = exp(Adt) M
Thus M'/M = e^(Adt)
Thus your answer is (1/dt) * log[M'/M] = A

To compute the logarithm, let Y = M'/M - I where I is the identity matrix
Then log(M'/M) = log(I + Y) = Y - Y^2/2 + Y^3/3 - Y^4/4 + etc.

Note that there is not really any means for you to distiguish a tiny rotation (slowly rotating system) from a full rotation or multiple full rotations (quickly rotating system) by comparing two samples even if they are close in time. The ability to use different choices for the logarithm corresponds to this ambiguity. If M' and M are very close then Y will be near zero and you will get the smallest rotation possible as the answer with the above formula.

If you have trouble understanding any of this then just think about a simpler case where everything takes place in a plane. Then your angular velocity shrinks to
[ 0 -Az ]
| Az 0 ]
which is basically just the imaginary number iAz and exp(iAz t) generates a rotation over time.
 
Last edited:
Thanks very much for the response. The issue with distinguishing between small and large rotations shouldn't be an issue as I'm integrating the simulation at 3000hz and dealing with a vehicle system.

I'll try and work the example below using your technique. If for example, we have two orthogonal matrices M (rotation at t=0, identity matrix in this case) and M' (rotation at t=1) which describe a rotation of 45 degrees around the z axis:

M M'
[ 1 0 0 ] [ 0.707 0.707 0 ]
[ 0 1 0 ] [ -0.707 0.707 0 ]
[ 0 0 1 ] [ 0 0 1 ]

if M'/M = e^(Adt) then M' * M^-1 = e^(Adt)

let Y = M' * M^-1 (M^-1 is still the identity matrix)
so (1/dt) * log(Y) = A

If that's correct then I would calculate the log of Y as in your explanation. Could you explain a little more on taking the log? I'm assuming that its a taylor series? You'll have to excuse my lack of knowledge in that area as I'm self taught.
 
A 45 degree rotation is rather large for 1/3000 second. I'm not sure if the series will converge with that particular matrix.

Anyway, you must use Y = (M'/M) - I
The -I is important because it changes something near identity to something near zero, which means the series converges quickly. It also means if no rotation occurs you get Y = 0 and a final result of 0, i.e. no rotation. BTW I just picked the name "Y" without any rhyme or reason.

Note also you must compute log(I + Y), not logY

Yes, the log can be computed with a Taylor series. log( 1+ x) = x - x^2/2 + x^3/3 - ...
To easily prove the validity of this, differentiate each side and then multiply by 1+x to arrive at the true equation 1=1. There's no reason you can't shove a matrix in for "x".

Anyway, with your example, Y =
[ -0.293 0.707 0 ]
[ -0.707 -0.293 0 ]
[ 0 0 0 ]

And your angular acceleration can be computed via
A = (1/dt) log(1+Y) = (1/dt)( Y - Y*Y/2 + Y*Y*Y/3 - Y*Y*Y*Y/4 + ...)

Your computed A is analagous to computing the slope of a line between two points f(t) and ft+dt) to estimate the derivative.
There are more advanced techniques (like quadratic interpolation) involving more than just two samples to get a better (or different) result.
 
Last edited:
BTW, in two dimensions it is much easier to convert the matrices into a complex number and deal with complex number multiplications from then on.

In three dimensions, quaternions are an excellent choice as they are simpler to use and numerically more stable than matrices.

In every case, though, you will still need to contend with computing a logarithm of a complex number, a quaternion, or a matrix (or for complex numbers it might be an arctangent which is basically the same thing). In every case there is the ambiguity of whether a tiny rotation or a huge rotation occured.
 
Back
Top