4

I am currently collecting accelerometer and attitude data using smartphone sensors. Data is collected at 100Hz over 2.5 seconds. Of which there are 250 accelerometer points and 250 points representing the attitude of the device. I am looking to convert the attitude/accelerometer data to gyroscope Data. For example, 1 of the 250 segments look like;

For example,

Accelerometer

  • AccX = 0.08458628
  • AccY = -0.0586758144
  • AccZ = 0.273877382

Attitude

  • Pitch = 0.111681767
  • Roll = -0.8779668
  • Yaw = 1.91596484

How can I calculate the corrected gyroscope data from this data?

lfs
  • 41
  • 3

1 Answers1

1

Accelerometers are capable of measuring the acceleration they experience relative to free-fall. Accelerometers are used to measure the upwards acceleration that counters gravity when at rest, its a hoax that it measures the acceleration due to gravity. This acceleration is measured as 1 g (g = 9.8 m/s2) on the z-axis, when both pitch and roll angles are zero, but when the sensor is tilted either the x-axis or the y-axis experiences a component of the upward acceleration, whose magnitude depends on the tilt angle. Now, moving to gyroscope, analysing the gyroscope reading means to determine the roll, pitch and yaw axis of a device with respect to its initial position. Now, coming to your question, in your case as we have obtained the acceleration readings from the accelerometer, we can apply the below mentioned formula to obtain gyroscope readings from accelerometer readings.

(Here, $\phi$ = roll and $\theta$ = pitch)

$$\tan \phi_{xyz} = \left(\frac{G_{py}}{G_{pz}}\right)$$

$$\tan \phi_{xyz} = \left(\frac{-G_{px}}{G_{py}\sin \phi + G_{pz} \cos \phi}\right) = \frac{-G_{px}}{\sqrt{G^2_{py}+G^2_{px}}}$$

If you are curious enough to know more about these formulas and the source from which I obtained these formulas you can open the link below and have a look at the document.

Tilt Sensing Using a Three-Axis Accelerometer

Here, Pitch equation is defined always to be positive, so the range of the equation is [-90, 90] and roll equation provides [-180, 180] range. When the pitch angle is 90º, the roll axis is directly aligned with the axis of gravity, thus we cannot measure the roll angle in this case. Also, the roll equation is undefined when both Gx and Gz are equal to zero.

Hope this cleared your doubt. If any further doubts persists, feel free to write.

user7083
  • 570
  • 3
  • 19