Re: Accelerometer + Tilt compensation




"jdhar" <jai.dhar@xxxxxxxxx> wrote in message
news:7d4c1f47-d25f-4ee6-8881-3a50ec75211c@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Why can't you just remove the offset as some calibration step? Once you
do
this it shouldn't effec the accelleration at all... after all it is
independent of position.

What method do you recommend... this is the tricky part in effect.
It's not as simple as reading the (X,Y) values at steady-state, and
then subtracting them to obtain a zero-offset calibrated value. I
still have to deal with the fact that the sensor is rotated, and a
motion in one direction will affect the other (due to rotation).

Basically you have two coordinate systems. Think of two axes, one for the
sensor and one for the vessel. They should be fixed.

Correct.

So any change in position or acceleration of one will have the same
effect
on the other.

Correct.

Therefor you only need to rotate one to the other. Assuming the axis is
orthogonal then there shouldn't be any problem as long as you get your
rotations right.

Basically rotate y axis to y, z to z, then x to x, or vice versa but
don't
mix x to y and so forth.


I personally don't think this would work.. again, think about it this
way... lets say the sensor is mountd perfectly. Then a movemente in
direction X will yield a non-zero X reading (call it X1), and Y will
yield zero. However, if the sensor is rotated even the slightest
amount, a movement in THAT SAME X-direction will now yield non-zero X
AND Y (call them X2 and Y2). Now I need some way to transform (X2,Y2)
to match (X1,Y1). The X2 component needs the Y2 component to determine
the proper translation to X1... so I can't just "rotate y axis to y
and x to x"... unless I am misunderstanding you. In short, I need to
treat the pair as a vector, and not individual axes.

Moreover, this isn't something I can calibrate it; it has to be
applied to each sample that I read.

You must calibrate it out in some way. You must somehow measure the axis
then use that.

You don't realize that rotating the axis will fix it up properly.

Take 2D for example.

The transformation equations are

r = x*cos(t) - y*sin(t)
s = x*sin(t) + y*cos(t)


suppose they are depenent on time(t is angle of rotation between axis)

then

r' = x'*cos(t) - y'*sin(t)
s' = x'*sin(t) + y'*cos(t)

r'' = x''*cos(t) - y''*sin(t)
s'' = x''*sin(t) + y''*cos(t)

So your derivatives transform exactly the same way.


e.g., normally in vector notation it is

Y = R*X
Y' = R*X'
Y'' = R*X''


This means that if you have the inverse matrix R, call it S

then

S*Y = X
S*Y' = X'
S*Y'' = X''

e.g., you can "unrotate" to get back the original system.

It works and I think your making it more complicated than it is.

The only real issue is that in 3D it's a bit harder since you have 3 angles
of rotation that you have to deal with.

In fact, in 3D graphics they almost always use a 4D rotation matrix because
it's much easier to do. The problem is that to get an arbitrary rotation in
3D you have to rotate 3 orthogonal directions. This causes problems because
the order maters. (R = A*B*C != B*C*A)

Another option is quaternions which also handle the rotations in a
relatively simple way.

BUT!!! You have to somehow figure out how "off it is.

This shouldn't be too hard though. Measure the vehicle's position when it is
in the perfered axis along one axis only!! (that is important)

To get one of the angles: (example in 2D)

1. Measure the acceleration along the x axis of the vessel. You will get an
r and s value for the acceleration of the accelerometers.

2. Use the equations given above to solve for the angle

r'' = x''*cos(t) - y''*sin(t)
s'' = x''*sin(t) + y''*cos(t)

y'' = 0 since we only moved the vessel in the x direction.

so

r'' = x''*cos(t)
s'' = x''*sin(t)

or

tan(t) = s''/r''

So you have the angle t when then allows you to "undo" the rotation by the
accelerometer.(just rotate the opposite way)


Its very simple to do for 2D because there is only one angle of rotation. In
3D there are 3 so you have to solve a system of linear equations. It's no
big deal though but just make sure that the get the order of rotations
correct.

(normally one rotates about different axis. Y = A*B*C*X. So X = c*b*a*Y.)


Unless I'm totally misunderstanding your problem. Simple question: Suppose
you could orient your accelerometer perfectly and in any way you want, could
you then eliminate the problem?








.



Relevant Pages

  • Re: newbie: rotating meshes
    ... The problems I noticed, were if you for example rolled the ship, then tried ... not the rolled x axis, which says to me that the math for matrix ... concatenation doesnt rotate the values of the matrix correctly is some ... which meant the y roation rotated the models x axis whereas the z rotation ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: Object rotation
    ... > need to translate back to the origin first, then rotate, then translate to ... For example rotations are ALWAYS around an axis so if you ... then moves on the new x axis after the Z rotation. ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: Euler angles
    ... the direction and angle of the rotation part of your displacement. ... point on the axis. ... the perpendicular components of p3-p1 and q3-q1 are: ...
    (comp.soft-sys.matlab)
  • Re: dotproduct rotations
    ... Reading through the post I assume by "y rotation" above you are reffering to ... axis, it would seem you are trying to find a rotation around the y axis, ... the above code will not return a proper angle unless ... Otherwise the angle returned by the dot product will be ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: Rotating Mesh around X,Y,Z
    ... What I want to do is rotate a mesh ... > around all 3 axis at the same time. ... >> I noticed you are using for the Quaternion rotation. ...
    (microsoft.public.win32.programmer.directx.managed)