1
\$\begingroup\$

I'm Using LSM9DSO 9 axis Sensor Which gives output of Accelerometer , gyroscope , Magnetometer Output data. i want to find the angular position of the device using this sensor.

currently i'm trying to find an angle of device of x-axis but data is fluctuate so , i have refer some websites and documents which show that it is find using Accelerometer data also but i have little confuse about to which is better solution to find angular position of device.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ This is rather complicated. You need to tell us a lot more about what you are trying to do. \$\endgroup\$
    – user57037
    Commented Jan 12, 2017 at 8:32
  • \$\begingroup\$ Hello I have implemented to find the pitch and roll using both accelero meter and gyroscope when i am rortating device from 0 to 90 degree but it displayed only from 0 to 82 degree only in both pitch and roll . \$\endgroup\$ Commented Jan 17, 2017 at 12:40

4 Answers 4

3
\$\begingroup\$

Generally you determine angle by using the accelerometer readings. This only works is the unit is not accelerating at the time but you can do a quick sanity check that sqrt(x*x + y *y + z *z) = 1g +/- some error margin. If that is true then you probably aren't accelerating.

For any given axis the amount it is away from pointing straight up will be given by angle = cos-1(reading in g).

If you know how far each axis is from vertical then you can work out your orientation relative to the ground.

If you are accelerating then assuming you knew your orientation before hand you can calculate your current orientation by using the gyro readings to measure the change in orientation. However anything calculated this way will drift away from the correct answer so you will need to correct it once you stop accelerating.

You can use the magnetometer as a sanity check and a method of tracking rotation but it's not very reliable for calculating absolute heading without first being calibrated for your current environment.

All of the readings from an IMU will be very noisy unless you are using a very expensive one, expect to have to average and filter a lot to get smooth results out. In this situation expensive means the price has at least 4 digits before the decimal point.

\$\endgroup\$
3
\$\begingroup\$

You need some kind of algorithm to fuse the acceleration, rotational rate and magnetic field readings. There are several different ways to do this, from simple complementary HP/LP-filters to more advanced quaternion based non-linear Kalman-filters.

I have, with great success, used Sebastian Madgwicks open source AHRS-algorithm with a LSM9DS1 and STM32F405 processor. You can download a paper describing it and some source code from here:

http://x-io.co.uk/open-source-imu-and-ahrs-algorithms/

\$\endgroup\$
3
\$\begingroup\$

Thanks a lot to all for your greater Support. I have found some interesting Reference website. which give the best method to implement both to find meaningful data like, pitch & Roll.

Guide to using accelerometer

Guide to using gyroscope

Hope it's helpful to others

\$\endgroup\$
1
\$\begingroup\$

Consider an I + Q magnetic sensing set of coils. Digitize the output of each coil; knowing the amplitude and the phase, against a reference phase, is an alternative sensor. Use a single wire on the wall, to provide a spot source of Hfield.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.