### IMU logs: X and Y accel, which one is pitch and which is roll?

Quick stupid question, but is the X accel the pitch or roll?  I'm trying to tune out some vibration and have great X accel, and Z accel, but my Y accel is bad.  I did a bit of search on google and the DIY forms and didn't see an answer.

#### Replies

• Your question can be interrupted in many ways (its not clear) however here is what I understood :).

Answer1: if you move nose-up/down of the ardupilot, you will experience change in Acc-x (that means pitch fluctuation can be visible on the x-axis)....... similarly the y-axis will show fluctuation in roll. (please note that x-axis is facing forward, y-axis to the right and z-axis down .......... and from acceleration point of view....... if gravity vector is compensated..... acc_x provides fwd/back motion..... acc_y provides sideway motion.....acc_z provides up/down motion info)

Answer2: Please note that gyro provides relative angular rate (so roll is gyro_x, pitch is gyro_y and yaw is gyro_z),

"Extra info": To calculate the absolute roll-pitch from accelerometer, here is the simple math:

pitch_fromacc = -1*atan2(accl_x,sqrt(accl_y*accl_y +  accl_z* accl_z));

roll_fromacc = atan2(accl_y,sqrt(accl_x*accl_x +  accl_z* accl_z));

for absolute yaw, one need magnetormeter as accelerometer has got gravity

I would recommend to do imu calibration again from the GCS (seems calibration error as well)

• My understand is that Y is acceleration fore/aft.  X is side/side, and Z is up/down.

Accel is not angular, and therefore is not pitch , or roll, or yaw.

Now, the Gyros... I believe Y is roll, X is pitch, and Z is yaw.

• Looking at some code is it possible that accel X is both pitch and roll, accel Y is yaw and Z is altitude?