make IMU working correctly

Define your sensors separately like below:

Now focus on this part: 

Connect your drone to PC/Mac, open the MultiWii GUI and make your drone :

1 – Left side up, right side down:
The curves of MAG_ROLLACC_ROLL and GYRO_ROLL will go up immediately.
The curves of MAG_Z and ACC_Z will go down immediately.

2 – Back up, front down:
The curves of MAG_PITCHACC_PITCH and GYRO_PITCH will go up immediately.
The curves of MAG_Z and ACC_Z will go down immediately.

3 – Rotate in clockwise direction:
The curve of GYRO_YAW will go up immediately.

4 – Keep your drone staying on the floor:
The values of MAG_Z and ACC_Z are both positive.

How to make a change ?

For example,

When you are doing “left side up, right side down” for the ROLL test and you see ACC_PITCH moving but not the ACC_ROLL. That means you have to exchange the X and Y axis.

accADC[ROLL]  =  X; accADC[PITCH]  = Y;  —> accADC[ROLL] = Y; accADC[PITCH]  = X;

When you are doing “left side up, right side down” for the ROLL test and you see ACC_ROLL going down but not going up. That means you have to change the sign of the value (change positive to negative or negative to positive by adding or deleting the “-“).

accADC[ROLL]  =  Y; —> accADC[ROLL] = -Y;