Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

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

  1. #1

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

    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.
    Click image for larger version. 

Name:	IMG_20191210_181336.jpg 
Views:	10 
Size:	47.5 KB 
ID:	18409

    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

  2. #2
    Hello,

    @Paul, @mjs513, @KurtE, @Frank B
    Kindly can you please answer for above thread?

    Thanks,
    Ankit

  3. #3
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,366
    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);

  4. #4
    Needs to adjust line:
    Code:
    filter.update(gx, gy, gz, ay, ax, az, my, mx, mz);
    Is this valid change?

  5. #5
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    5,366
    Quote Originally Posted by ankit.vadict View Post
    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.

  6. #6
    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.

    Click image for larger version. 

Name:	1.png 
Views:	8 
Size:	465.1 KB 
ID:	18587

    #####################################
    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.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	IMG_20191231_191040.jpg 
Views:	2 
Size:	96.7 KB 
ID:	18584  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •