Pitch angle is an angular rotation around the front to back axis (x-axis). Roll angle is an angular rotation around the side to side axis (y-axis). Yaw (heading) angle is an angular rotation around the vertical axis (z-axis). The accelerometer measures linear acceleration based gravitational velocity. With the help of accelerometer output pitch and roll can be calculated. Equations below show the calculation of pitch and roll angle.
Pitch = arctan(acc_x/((acc_x) ^2 + (acc_z) ^2)
Roll = arctan(acc_y/(acc_y) ^2 + (acc_z) ^2)
Where pitch and roll output are in radians, after converting it into degrees the range of -90 to 90 degrees.
Comments