## Monday, November 23, 2009

### Metrigear Vector: accelerometer orientation

Last time I described modeling some MetriGear Vector test data. The data were from two accelerometers which appeared to be misaligned relative to the radial and tangential axes of the test rig.

What I'll do here is a bit of a restatement of a previous post. Yet since I have real data to chew on here it's worth starting from the beginning.

Suppose we have two acceleration components, a1 and a2. We know these accelerometers are oriented at a right angle (90°) relative to each other, and that they're perpendicular to the principal axis of the spindle. However, we aren't sure of the orientation of the spindle with respect to the end of the crank. This orientation can be described by an angle Δφ.

We wish to derive acceleration components ar, a radial acceleration component toward the center of the pedal's orbit, and at, an acceleration component in the direction of the pedal's motion. Then we can write a relation:

a1 = ar cos Δφat sin Δφ ,
a2 = ar sin Δφ + at cos Δφ ,

so if Δφ = 0, then a1 = ar, and a2 = at.

What we want is the opposite: based on a measure of a1 and a2, we want to solve for ar and at. This is a simple algebra problem: two equations, two unknowns:

ar = a1 cos Δφ + a2 sin Δφ ,
at = a1 sin Δφa2 cos Δφ .

One way of looking at this is it is just a change in sign of Δφ from the previous equations, which makes sense: undo the rotation of misaligment.

We can then take the time-average of these quantities. We assume Δφ is constant, so no need to average that. We use angled brackets ("<>") to signify a time-average:

<ar> = <a1> cos Δφ + <a2> sin Δφ ,
<at> = <a1> sin Δφ<a2> cos Δφ ,

Now we can assert that the average value over time of at goes to zero, while the average value of ar over time is positive:

<at> = 0,
<ar> > 0.

So, using the first of these relationships:

<a1> sin Δφ<a2> cos Δφ = 0.

That's simple enough:

tan Δφ = <a2> / <a1> ,

where we handle the case where cos Δφ = 0. There's only one issue left: that equation has two possible solutions for Δφ, separated by 180°. But here's where we use the other constraint, that <ar> > 0. Only one of these two solutions will meet this condition.

So now having solved for Δφ, it's straightforward to extract ar and at from a1 and a2.

Next time I'll apply this transformation to the MetriGear Vector test data, which may require a bit of care.

Ron said...

Dan,

Do you do Twitter? I'm trying to add a list of thinkers so here's an invitation to you to join. So far its been a great too for me to share information.