# Rodrigues’ rotation formula?

1. Jul 29, 2011

### NGM

Hi

1. The problem statement, all variables and given/known data

I have some questions about rotation that I’m hoping for some help/advice on. The background to my query is that I have a data set derived from a rotating accelerometer (a HOBO pendant G) that lists x-axis, y-axis and z-axis angles recorded every 30 seconds. I can, therefore, easily derive how the each of the three axes has changed over each 30 second period.

However, I’m interested in obtaining a single value of angular rotation over each 30 second period and from the background reading that I’ve done so far, it seems like Rodrigues' rotation formula might be most appropriate. I am not interested in the direction of movement, just a single angle to describe the motion from one position to the next so that I can calculate an angular velocity over each 30 second period.

2. Relevant equations

Is the Rodrigues’ rotation formula most appropriate or could other methods be more appropriately used?

Given my level of maths, the review of Rodrigues’ rotation formula on Wikipedia, does not help me understand how to implement the calculations. Does anyone known of a more straightforward breakdown in any books or on any webpages?

Many thanks for any help/advice offered!
Nick

2. Jul 29, 2011

### Mike Pemulis

It might be simpler than that. You just want the angle between two known vectors, right? Are you familiar with the dot product of two vectors? There are two alternative formulas for the dot product. See if you can manipulate these formulas to give you what you want.

3. Aug 1, 2011

### NGM

Many thanks for your suggestion. I’m not sure, however, that the dot product would be appropriate because the values are not vectors. At least I don’t think that they are??? The x-axis, y-axis and z-axis values are only changes in the three orthogonal axes angles of the accelerometer itself (or can these be considered vectors?) like the roll, pitch and yaw used in aeronautics.

4. Aug 1, 2011

### Mike Pemulis

Hmm, maybe I don't understand you as well as I thought. Can you describe in a little more detail what the accelerometer is actually doing, how it takes data, and what you mean by "x-axis, y-axis, and z-axis angles?"

5. Aug 1, 2011

### NGM

Sorry, I’ve probably not done a very good job of explaining this!

The accelerometer output provides an orientation/tilt (in degrees) in three dimensions at each pre-determined time interval. The output is not a Cartesian xyz coordinate output. The values that I get are not calibrated in relation to a level plane, but using the basic made up example below it is easy to assess that 5 degrees of rotation has occurred from one position to the next over a 30 second period.

X Tilt, ° Y Tilt, ° Z Tilt, °
08/01/2010 13:00.0 45 45 45
08/01/2010 13:00.5 50 45 45

In the real world, however, I don’t get changes in a single axis, I get changes in three axes. Hence some maths needed!
Real example of the slip rotation e.g.

X Tilt, ° Y Tilt, ° Z Tilt, °
08/02/2010 15:26.0 116.7 151.0 77.0
08/02/2010 15:26.5 51.3 53.1 121.7

Not sure if this next bit is helpful, but maybe out of interest: I used the accelerometers to measure motion of a rotating body in a glacial setting. The motion is sticky-slip in that for extended periods of time (typically greater than 12 hours) the rotation is very low / zero (what I would call sticky), it then gradually increases over a 3-6 hour period and finally ‘slips’ with rapid rotation over a 30 second period, as in the example above.

Many thanks for taking the time to reply!

6. Aug 1, 2011

### Mike Pemulis

Okay, I understand you a little better now. (Also, your research sounds cool. Do you have a website?)

From what you said about pitch, roll, and yaw, would I be right to guess that your three angles are Euler angles? Here's the Wikipedia: http://en.wikipedia.org/wiki/Euler_angles

If so, you will notice that it is very important to precisely specify what your angles mean; there are many possibilities. What order are the rotations done in? Are they all done with respect to a fixed coordinate system, or are some of them embedded in the rotating body?

For example, think of an aircraft. What do pitch, roll, and yaw mean, exactly? Are all the angles defined with respect to up/down, latitude and longitude, or are some of the rotations (like "roll") defined to be about axes embedded in the body of the aircraft? And what order are they done in? If I roll then yaw, I'm facing a different direction than if I yaw then roll.

If you are using Euler angles, I need to think a little more about how to define a single angular displacement. It doesn't seem trivial, but maybe it's possible.

If it's not Euler angles, I have another guess for how your setup works. An accelerometer measures the magnitude and direction of its proper acceleration vector ("proper" meaning, includes gravity, so an accelerometer sitting on Earth at rest it will say, "acceleration = 9.8 m/s2 straight down"). A spring with a mass on the end which can rotate freely about a pivot can function as an accelerometer, because we can observe which direction the spring is pulled, and how far it stretches. Your three angles are obtained in this way: the accelerometer has an x, y, z coordinate system embedded in its body, and the angles between each axis, and the spring, are measured. For example, if the y axis is pointing straight down at some time, your y-angle is 0.

Also, can we assume that the actual acceleration of the glacier is always very small compared to gravity, so that the spring would aways point straight down? Or does it move fast enough to actually swing the spring around?

If this second way is actually how your experiment works, then defining angular displacement is very easy.

Which one is correct? Or am I totally off base?

Last edited: Aug 1, 2011
7. Aug 2, 2011

### NGM

Thanks again for taking the time to reply.

I believe that it’s the second option of the accelerometer measuring in relation to gravity that is correct. I can also get an output for each x-, y- and z-axis in g, although I had assumed that the angles output was easier to work with (???).

Yes, I think that it's appropriate to assume that that the measured acceleration is always small compared with acceleration due to gravity.

In a previous post I wrote:
‘The values that I get are not calibrated in relation to a level plane’
But I must be wrong with this assertion based on the gravity point. I was trying to highlight that the initial position / output values of the accelerometer are based on a random starting position of the accelerometer.

Another minor issue, and one that should not impact on the rotation calculation, is that I measured movement of surface debris on a glacier, rather than movement of just the glacier itself. The accelerometer will likely have picked up some glacier movement as background noise, but I’m confident that this is a negligible component of the displacement. The obvious suggestion is to have measurements from both the surface debris and the glacier itself, but it’s not feasibly to attach something to a melting surface of ice because the surface will move more than the ice itself.

8. Aug 2, 2011

### Mike Pemulis

Actually the (x, y, z) mode is easier. I was going to say that you need to convert your numbers into (x, y, z) mode by hand, but if your machine does it automatically, so much the better. However, it's pretty easy to do it manually -- if you have a lot of data taken in angles you can still use it. How to do this? Let's call (x, y, z) angles (a, b, c) respectively. So the "spring" of the accelerometer makes angle a with the x-axis, angle b with the y-axis, and angle c with the z-axis. Call the magnitude of the measured acceleration g. Then we just have,

x = g*cos(a)
y = g*cos(b)
z = g*cos(c)

By the definition of the dot product.

At this point, you have a vector consisting of the (x, y, z) components of acceleration at each time interval. To calculate the change in angle, just use the dot product again. I will call the two vectors u and v, where u = (x1, y1, z1) and v = (x2, y2, z2)

u (DOT) v = x1x2 + y1y2 + z1z2

Also, we have

u (DOT) v = |u|*|v|cos(theta)

Where |u| and |v| are the magnitudes of u and v, and theta is the angle between them. Of course, you can calculate the magnitudes using the Pythagorean Theorem. I believe that is the angle you're looking for.

Now, there are a few potential problems.

1. Very important: never base expensive experiments on the assumption that a guy on the Internet is right. I may have misunderstood something about your setup. But from what I understand, the above is correct.

2. From your last paragraph, you said:

Do you mean that the accelerometer picks up vibrations from the surface debris movements? If so, you will probably need to keep track of how large the vibrations are so you can quote an experimental error in your results.

3. It does not seem completely obvious to me that the actual acceleration of the glacier is negligible compared to gravity. You may want to measure this somehow. (If the magnitude is something other than 9.8, for instance). If the acceleration is actually significant, then you want to keep track of it. Without being familiar with your experiment, I can't recommend a specific way to do this.

4. This is a big one. If the accelerometers only measure the direction of gravity, then you are blind to all horizontal movement. This includes sliding in a horizontal direction, and rotations in the horizontal plane. If you want to measure horizontal movement (and your experiment is pretty incomplete unless you don't!) then it seems as if you do need to measure actual acceleration, not just gravity.

What do you think of Problems 3 and 4? We can think about ways to deal with them if you would like. One thing that might be useful to know is how often your accelerometer can read out data? I know you are taking data in intervals of 30s for the purposes of one calculation, but can the machines go faster than that?

9. Aug 2, 2011

### NGM

I do understand how to implement the following parts:

u(DOT)v = x1x2 + y1y2 + z1z2

u(DOT)v = |u|*|v| cos(theta)
and
u(DOT)v / |u|*|v| = cos(theta)

Unfortunately, I don’t follow the initial part relating to using the output values (x, y & z acceleration in g and x, y & z tilt in degrees) from the accelerometer to generate the x, y and z as a vector. Any clarification that you can provide would be appreciated…

1. A good point, but: (a) it’s easy to see if the single output value makes sense in relation to simple user-generated input; and (b) I can also plot the single angular rotation along with each of the three axis rotations for comparison/assessment.
2. Yes, the accelerometer will pick up movement from the glacier. Because I had multiple (five) accelerometers working at the same time in basically the same location, I might be able look at each output series and if all accelerometers move at the same time infer that this is glacier motion, rather than multiple accelerometers independently moving at the same time. However, they might also all move at the same time by other mechanisms e.g. a strong gust of wind initiated movement.
3. To test this you would need to attach an accelerometer to the glacier itself and this would be difficult to effectively achieve. The surface melts by ~10cm a day and anything that you drill into the ice (e.g. to act as a bolt) will conduct heat down to the surrounding ice so that it become loose. Also, the issue horizontal movement is discussed in the next part – the glacier motion would be by horizontal movement, rather than by rotation, which is what the accelerometer should show.
4. Yes, I am blind to any horizontal movement, but the characteristics of the debris are such that horizontal movement is likely to be a minor component. I recently read some work about using time-lapse photography to study glacier surface features and it’s possible that that type of work might help with this problem. However, at the moment no work has been done in this area, so it does stands as a contribution, even if more work in the future will aid understanding.

The data logger capacity was such that a 30s interval meant that it could be left for a few days before needing to be downloaded. The logging interval can actually go down to as low as every 0.01s. However, to download it needs to be removed and this disturbs the surface debris that it is within. Unfortunately, it’s not possible to set the logging interval for low resolution when it was doing very little rotation, which was most of the time along with a high resolution logging interval for when it rotated quickly, which was probably <1 second.

10. Aug 2, 2011

### Mike Pemulis

That first thing IS the vector. So if your readout is something like,

X acceleration: 0.6g
Y acceleration: 0.25g
Z acceleration: -0.35g

Then your vector is just u = (0.6g, 0.25g, -0.35g)

Hmm... all this time I thought the accelerometers embedded in the glacier! What are they actually attached to? The debris?

Okay, as long as you're aware of the issue. It's probably not as important as I thought.

11. Aug 4, 2011

### NGM

Success! Yes, this is now working and returning some interesting results.

In answer to your question about what it’s attached to: yes, it's some debris on top of the glacier.