Hi again,

In my app, I am only interested in pitch and roll - not in yaw.

The accelerometer can measure static pitch and roll (because of the
gravity) - but not static yaw.
Acceleration caused by movements are just unwanted noise in my app and
is filtered away by a usual digital Lowpass filter.

The Gyro cannot measure static pitch and roll and not static yaw
either, It can only measure angular velocity - changes in pitch, roll
and yaw.
To convert angular velocity to angle, you have to use digital
integration. But, because small errors would cause the computed angles
to slowly drift away, you have to filter the slow variations away -
that is done by a digital highpass filter. You can say that is
actually to opposite working filters, but it is the correct way.

And now the computed gyro signal cannot be used for detecting static
pitch, roll and yaw because the static part is filtered away. But then
it can be combined with the lowpass filtered accelerometer, simply
adding the two signals, to get fast and correct detection of pitch and
roll. That means if you make a sudden rotation of the device the
signal should change from one level to the other with a small rise
time and no overshoot. in signal terms the frequency response of the
transfer function is linear from DC to around 5 hz.

When you are interested in yaw, but not pitch and roll, you have to
replace the accelerometer with the magnetic sensor. As mentioned by
gjs, it cannot help you overcome magnetic interference. But it should
be possible to get a much smoother and faster response by using
magnetic sensor and gyro in combination than by using the magnetic
sensor alone.

I have spend a lot of time on Kalmann filters, whithout producing
results worth the efforts. What you see in my keyboard app is the
first shot of the 'complementary filter design' sketched above - and
it only took me a few hours to implement. All right  - it is not
perfect yet - for instance I need to take into account the variations
in sample frequencies among the different sensors and also from device
to device and from time to time. Never the less it was a great
improvement from using the accelerometer alone. The same app runs on
devices, only having an accelerometer. So if you have got two devices,
and only one of them has a gyro, you can see and feel the
difference.

Hardy Henneberg
http://www.maxikeys.com

On Nov 11, 3:30 am, gjs <garyjamessi...@gmail.com> wrote:
> Hi,
>
> I am only suggesting you use integration ( sum & 'average' last N
> measurement over some short period of time ) for the compass/azimuth -
> however you decide to get that data - just to smooth the data, so
> these filtered reading don't jump around so much (this has got little
> or nothing to do with accuracy of the sensors).
>
> Then you might use the gyroscope &/or acceleration to detect relative
> movement of the device, is it currently still or moving, to alter the
> integration you are doing with the compass/azimuth, eg to reset or
> change value of N mentioned. Kalman Filters are often mentioned here
> as a solutionhttp://en.wikipedia.org/wiki/Kalman_filter
>
> If you want high accuracy you will probably need to use external high
> accuracy IMU / compass sensor devices. Even then you won't necessarily
> get around external magnetic interference.
>
> Regards
>
> On Nov 10, 10:17 pm, Ferro Francesco <ferro.france...@gmail.com>
> wrote:
>
>
>
>
>
>
>
> > I know what is an integration and How to do it. What I don't know it's what
> > do I do with the result? How can i combine is with the compass value ?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to