2021-11-14 02:21 AM
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.
Solved! Go to Solution.
2021-11-16 06:07 AM
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
2021-11-15 06:32 AM
Any ideas?
2021-11-16 06:07 AM
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
2021-11-17 01:41 AM
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';
2021-11-17 01:50 AM
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!
2021-11-17 02:21 AM
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.
2021-11-17 02:41 AM