From 653e9cebd7623972fd8bd4c69696e467585e4365 Mon Sep 17 00:00:00 2001
From: Ramasamy The sensor data obtained from the driving system (gyroscope) given by (Gx, Gy, Gz)
+represents the calibrated angular rotation rate of the device in the 3-axes. Since
+the calibrated gyroscope data provides the rate of change of angle in each axis,
+the integration of the data acquired in each axis provides the orientation measure
+of the device. During integration of the gyroscope data the noise present in each
+instance of the measured data gets added up resulting in measured orientation
+affected by drift. First the measured gyroscope data is converted to a quaternion
+equivalent Qdriv [14, 15]. The initial value for the Qdriv is assigned based on the
+computed Qaid initial value (15). The quaternion differential which denotes the
+increment in rotation is computed by quaternion based multiplication [7, 9] of Qdriv
+with gyroscope sensor data as shown in (16). The symbol ⊙ denotes quaternion
+based multiplication in the following equations. Equation (17) represents the integration of the quaternion difference value with
+the driving system quaternion to yield the measured quaternion value for that time
+instant [1]. The value 'dt' represents the sampling interval for the gyroscope sensor
+and 'Π' denotes the mathematical constant and denotes the ratio of a circle's
+circumference to its diameter and is approximately equal to 3.14159. The driving
+system quaternion is then normalized as shown in equation (18).3.3. Orientation Computation Based on Driving System
+
@@ -278,6 +291,13 @@ the same time they are computationally more efficient than using rotation matrix
--
2.7.4
From 30e4720a900b2d4896eb8f5ed9681ad4c6527b3c Mon Sep 17 00:00:00 2001
From: Ramasamy
The orientation computed using the driving system sensor data is affected due to +the drift (from the integration of angular rates), the orientation computed using +the aiding system sensor data is not accurate (measurements are affected due to gravity). +To compensate for the deficiencies in the measurements of each system, the quaternion +orientation computations are combined using sensor fusion to obtain corrected/more +accurate device orientation data. The Quaternion error Qerr is computed in (19), as +described in [1].
+We introduce the equations (20) and (21) to compute the Euler error from the +quaternion error and then using this Euler error to compensate for drift on the driving +system orientation quaternion. First, the quaternion error Qerr is converted to the Euler +angle representation Eerr based on (20). The quaternion representation of orientation +error is converted to Euler angles representation using the function quat2euler() for +which information can be found in [9].
+The driving system quaternion is then compensated for the Euler angle error Eerr and +normalized as per (21) and (22) to correct for drift observed in the driving system sensor +data.
+The quaternion Qdriv that is derived in (22) is now compensated for drift and corrected +for dynamic bias as shown in (6). The dynamic bias correction used in (6) is determined +using Kalman filtering as explained below. Based on [1], linear Kalman filtering is used +based on the error state equation, given in (23). The first three elements of the error +state vector are the Eerr values on the 3-axes (Φerr, Θerr, Ψerr) and the +next three elements are the bias compensation (Bx, By, Bz) that is mentioned in (6).
+The variance in the gyroscope angular rate measurements denoted by Qwn over a windowed +period is computed in (24). The random driving process noise variance Qwb is computed in +(25), where the noise standard deviation Ïw and time constant Ïw are obtained from the +gyroscope sensor datasheet. Based on [1], the overall process noise covariance Q is +derived from the computed Qwn and Qwb as shown in (26).
+The variance in the aiding system orientation (roll, pitch and yaw) measurements are +used to compute the measurement noise covariance R [1] which is shown in (27). The aiding +system orientation in terms of Euler angles Eaid can be obtained by converting the +quaternion obtained in (14) to its equivalent Euler angles.
+The equations (28), (29) and (30) are used to determine the transformation matrix F, +apriori state vector error Δx- and prediction covariance P- based in [1].
+The accelerometer and magnetometer data are normalized based on equations (3) +
The accelerometer and magnetometer data are normalized based on equations (3) and (4) to obtain the calibrated accelerometer data (Ax, Ay, Az) and magnetometer -data (Mx, My, Mz).
+data (Mx, My, Mz).The measurement update system is used to determine the bias value that would be +deducted from the Gyroscope values (6). The equations (31), (32) and (33) are used to +compute the Kalman gain K, aposteriori state error computation Δx+(i) and +aposteriori prediction covariance P+, as shown in [4]. In equation (33), I denotes the +identity matrix H denotes the measurement matrix (identity matrix is used here) and the +apriori prediction covariance estimate P- (33).
The bias compensation (Bx, By, Bz) obtained from Δx+(i) is used for removing +dynamic bias from the calibrated gyroscope values as shown in (6). The corrected +orientation that is determined using the above sensor fusion method, is obtained from +(22) by using the conversion function quat2euler [9] as shown in (34). This estimated +orientation is used in Section 3 to compute Gravity virtual sensor data.
+When the device tilt values (pitch,roll) are changed from (0,0) to (0,Π/2), phone is rotated around x-axis, the y-axis gets aligned to earth's gravitational field -after rotation instead of the z-axis. When this rotation is applied to the equations +after rotation instead of the z-axis. When this rotation is applied to the equations given above, the values (GRx,GRy,GRz) are converted from (0,0,G) to (0,G,0) due to the shift in the axis which experiences the gravitational field (G is measure of Earth's gravity).
-- 2.7.4 From b560d96dcf4f5a1217c295cb809ed279af737786 Mon Sep 17 00:00:00 2001 From: RamasamyWhen the device tilt values (pitch,roll) are changed from (0,0) to (0,Π/2), -phone is rotated around x-axis, the y-axis gets aligned to earth's gravitational field +phone is rotated around y-axis, the x-axis gets aligned to earth's gravitational field after rotation instead of the z-axis. When this rotation is applied to the equations -given above, the values (GRx,GRy,GRz) are converted from (0,0,G) to (0,G,0) due to the +given above, the values (GRx,GRy,GRz) are converted from (0,0,G) to (G,0,0) due to the shift in the axis which experiences the gravitational field (G is measure of Earth's gravity).
Linear Acceleration virtual sensor data provides the measure of the acceleration of -a device after removing the Gravity components on the 3-axes. Accurate linear -acceleration data are calculated by subtracting gravity components from the 3-axes -calibrated accelerometer data.
+Accurate linear acceleration data are calculated by subtracting gravity components +from the 3-axes calibrated accelerometer data as shown in (38), (39) and (40). As shown +in (38) the rotation of the device on y-axis (GRy) reflects on the accelerometer x-axis +sensor data (Ax). The linear acceleration measurement on x-axis (LAx) directly +corresponds to the accelerometer x-axis sensor data (Ax) meaning linear motion along +x-axis is directly measured on the accelerometer x-axis.
[1] Gebre-Egziabher, H., Rhayward, R. C. & Powell, J. D. Design -of Multi-Sensor Attitude Determination Systems. IEEE Transactions on -Aerospace and Electronic Systems, (Volume: 40, Issue: 2), 627 - 649 (2004)
+[1] Gebre-Egziabher, H., Rhayward, R. C. & Powell, J. D. Design of Multi-Sensor +Attitude Determination Systems. IEEE Transactions on AESS, 40(2), 627 - 649 (2004)
-[2] Abyarjoo1, F., Barreto1, A., Cofino1, J. & Ortega, F. R., Implementing -a Sensor Fusion Algorithm for 3D Orientation Detection with Inertial/Magnetic -Sensors. The International Joint Conferences on CISSE (2012)
+[2] Abyarjoo1, et al. Implementing a Sensor Fusion Algorithm for 3D Orientation +Detection with Inertial/Magnetic Sensors. The International Joint Conferences on CISSE +(2012)
[3] Marcard, T. V., Design and Implementation of an attitude estimation system to -control orthopedic components. Chalmers University. Master thesis published on -the university link http://publications.lib.chalmers.se/records/fulltext/125985.pdf(2010)
+control orthopedic components. Chalmers University. Master thesis published on the +university link http://publications.lib.chalmers.se/records/fulltext/125985.pdf(2010) -[4] Welch, G., Bishop, G. An introduction to the Kalman Filter: SIGGRAPH (2001)
+[4] Welch, G. & Bishop, G. An introduction to the Kalman Filter. SIGGRAPH 2001
-[5] Grewal, M. S., Weill, L. R., Andrews, A. P., Global Positioning Systems, -Inertial Navigation, and Integration (John Wiley & Sons., 2001)
+[5] Grewal, M. S., et al. Global Positioning Systems, Inertial Navigation, and +Integration (John Wiley & Sons., 2001)
+ +[6] Greenberg, M. J., Euclidean and non-Euclidean geometry: Development and History +(Freeman, 1980)
+ +[7] Conway, J. H & Smith, D. A. On Quaternions and Octonions: Their Geometry, +Arithmetic, and Symmetry (Peters, 2003)
+ +[8] Zill, D. G & Cullen, M. R. "Definition 7.4: Cross product of two vectors". +Advanced engineering mathematics (Jones & Bartlett Learning, 2006)
+ +[9] NASA Mission Planning and Analysis Division. Euler Angles, Quaternions, and +Transformation Matrices. Document Link- +http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19770024290.pdf. Last Accessed +- July 2014.
+ +[10] Android Sensor Fusion Library. Source code link: +https://android.googlesource.com/platform/frameworks/native/+/b398927/services/sensorservice/. +Last Accessed - July 2014.
+ +[11] GNU Octave High Level Interpreter. Software Link: http://www.gnu.org/software/octave/. +Last Accessed - July 2014.
+ +[12] Tizen OS - https://www.tizen.org/. Last Accessed - July 2014.
+ +[13] Marins, J. L., et al. An Extended Kalman Filter for Quaternion-Based Orientation +Estimation Using MARG Sensors. IEEE/RSJ International Conference on Intelligent Robots and +Systems (2001)
+ +[14] Favre, J., et al. Quaternion-based fusion of gyroscopes and accelerometers to improve +3D angle measurement. ELECTRONICS LETTERS, 25th May 2006, Vol. 42 No. 11
+ +[15] Sabatini, A.M., Quaternion based attitude estimation algorithm applied to signals +from body-mounted gyroscopes. ELECTRONICS LETTERS, 13th May 2004, Vol. 40 No. 10