Using an MMA7361 to measure G forces

michinyon:
I doubt that you have actually tested the response with sustained lateral acceleration. With magnetic
correction, you have two axes of alignment with which to correct the orientation drift. Even so,
you will get a consistent dipping effect if there is sustained lateral acceleration, because the orientation
plane formed by the magnetic field vector and the apparent "down" vector will become tilted.

Since most cars and aircraft do not perform tight continuous turning manoeuvres, this may be
a non-obvious problem.

Anyhow, to get back to the OP's problem. There seems to be clearly something wrong with the
OP's device, or the way that the information is being processed.

If the offset and scale of the different axes is out of spec, this can be corrected for provided you
know what the behavior is, and provided the device is still linear. At the moment, this is being
obscured by the processing using code which we can't see.

The next thing that I would suggest the OP do, is try to obtain the actual A/D values which are being
obtained from the device. Then, imagine the device is a cube, and turn the cube so that each of the
faces of the cube is facing upwards, and write down what the readings are. In other words, take
the readings with the flat side of the module up, and down. And the the short end pointing up, and then
down. And the the long edge of the module pointing up, and then down. It will then become more
clear what the problem is.

The other thing I would do, is try actually observing the voltages with a multimeter.

That is true, I have not tested it for extended lateral accelerations, but I don't see that would be an issue. The magnetometer is 3-axis and the fusion algorithm is takes into account tilt compensation for the magnetometer. Right now I do experience some drift, but that is because I have not properly calibrated the sensors yet. I need to create a jig to constrain the X,Y,Z axis individually so I can rotate them individually through 360 degrees.