cancel
Showing results for 
Search instead for 
Did you mean: 

Orientation string when MEMS on bottom layer

JDave.4
Associate III

Hello,

In my application, I must place the MEMS in the bottom layer. When looking from top layer, the pin mark is in the upper right as shown below. What would be correct string for gyro and accelerometer into X-CUBE-MEMS algorithms? Thanks.

0693W00000GXUjfQAH.png

1 ACCEPTED SOLUTION

Accepted Solutions
BSaraiva
Associate II

JDave, I wanted to check this post for any answers just to see how others are addressing this subject.

I don't have a direct answer because I don't know what you mean by "correct string", but any 3D sensor application must be implemented with a 3D rotation matrix concept. In a proper system, your sensor can be pretty much in any position (even inclined at weird angles from your horizontal reference), and there will always be a rotation matrix to bring the dynamic values into your preferred reference system.

On a separate subject, may I suggest that you include part numbers on your question? Nowhere in your post we know which sensor you are actually referring to.

Regards

Bruno

View solution in original post

6 REPLIES 6
JDave.4
Associate III

Any ideas?

BSaraiva
Associate II

JDave, I wanted to check this post for any answers just to see how others are addressing this subject.

I don't have a direct answer because I don't know what you mean by "correct string", but any 3D sensor application must be implemented with a 3D rotation matrix concept. In a proper system, your sensor can be pretty much in any position (even inclined at weird angles from your horizontal reference), and there will always be a rotation matrix to bring the dynamic values into your preferred reference system.

On a separate subject, may I suggest that you include part numbers on your question? Nowhere in your post we know which sensor you are actually referring to.

Regards

Bruno

The part number is LSM6DS3, I have already provided axis info for this product. Orientation string is used as input to the motion algorithms in the X-CUBE-MEMS. Since the IC mounted at bottom side, it needs to be adjusted. I am not sure how to modif them. Any comments?

 diKnobs.AccOrientation[0] = 'e';

 diKnobs.AccOrientation[1] = 'n';

 diKnobs.AccOrientation[2] = 'u';

 diKnobs.GyroOrientation[0] = 'e';

 diKnobs.GyroOrientation[1] = 'n';

 diKnobs.GyroOrientation[2] = 'u';

BSaraiva
Associate II

Ok, understood. I don't particularly like these "magic macros" solutions. When you have a chance, do spend some time learning about rotation matrix, and all that comes with IMU orientation. And try to follow a widely used orthogonal reference for your project, otherwise in the future it will become a mess to integrate with other "more professional" projects. NED is one that is common.

But for now, making things simple: just visualize the readings from your accelerometers. You want approximately +1g in your vertical axis when the product is sitting level. If you get the opposite value, probably changing the magic letter will do the trick (you are probably aware that e, n, u stand for east, north and up, so d for down will be an option).

Good luck!

JDave.4
Associate III

It is easy to determine positive axes for acc. but what about gyro? They need to be correctly aligned with acc. otherwise the algorithm may not work properly.

Correct: the gyro must have exactly the same orientation that you use for the accelerometer.