FXOS8700CQ(Accelerometer and Magnetometer) and FXAS21002C(Gyroscope) Axis Mapping

Status
Not open for further replies.
Hello,

We are using both the ICs FXOS8700CQ(Accelerometer and Magnetometer) and FXAS21002C(Gyroscope) for measuring roll, pith and yaw.
In our PCB both the ICs Axis(X-Axis and Y-Axis) mapping is not match with each ICs. Both ICs have is in different direction to each other.
Here I am attaching the mapping of direction which we have mapped from ICs datasheet.
IMG_20191210_181336.jpg

In Teensy Prop Shield direction of the axis are matched but in our schematic it is not there. We are getting the data from NXP MotionSense library for the ICs which I mentioned above. But is it right data? If it is not right than how we can get the right data?
Is it mandatory to match the axis for both the ICs?

Kindly help me to solve the issue.

Thanks,
Ankit
 
The axes are match because of the orientation of the of FXOS8700CQ. In otherwords it rotated on the prop shield so that the axes are aligned. In your picture the 8700CQ would have to be rotated 90deg clockwise and the axes would be aligned.

If the axes are not aligned you are probably not getting the right angle data.

If you are using the orientation example you would have to adjust this line:
Code:
    // Update the SensorFusion filter
    filter.update(gx, gy, gz, ax, ay, az, mx, my, mz);
 
Needs to adjust line:
Code:
filter.update(gx, gy, gz, ay, ax, az, my, mx, mz);

Is this valid change?

You can try:
Code:
filter.update(gx, gy, gz,   ay, -ax, -az,  my, -mx, -mz);
to be honest not sure about magnetometer may have to change the sign on that as well to maintain a right hand rule. changing the gyro might be easier.
Code:
filter.update(-gy, gx, gz,   ax, ay, az,  mx, my, mz);
give it a try and see.
 
Hey, we have tried that change for YAW. However, we are also having an issue with the Raw-Pitch behaviour. For the purpose for which our sensor is designed, the mounting is going to be vertical and while testing keeping the Hardware vertical, we are facing constraint with the linearity in Roll and Pitch values.

1.png

#####################################
Position Roll Pitch
Default 176.87 160.36
FrontSide Up 178.14 146.56
BackSide Up 5.16 167.55
RightSide Up 191.08 157.56
LeftSide Up 165.88 153.49
#####################################

We are seeing much deviation in Roll in "BackSide Up" when it seems that the Pitch is crossing 90. We are considering Roll as 0-360 and Pitch as 0-180 here. Please suggest what can be done in library to target this concern.
 

Attachments

  • IMG_20191231_191040.jpg
    IMG_20191231_191040.jpg
    96.7 KB · Views: 102
Status
Not open for further replies.
Back
Top