Handle custom relative orientation between BHI260AP and BMM150

Dear Community,

I included BHI260AP + BMM150 magnetometer in my custom PCB design. 

Due to space constraints, I mounted the two devices in opposite layers (BHI260 AP top, BMM150 bottom)

The relative orientation of the two devices is the following:

Top layer (top view): you can see the BHI260AP with the pin 1 indicated in blue

 

Bottom layer (top view: seen from top): you can see the BMM150 with the pin 1 indicated in green

 

My question is: how to take into consideration this aspect? where can I configure it?

Thank you very much,

best regards

Gianluca

 

 

 

 

 

Best reply by BSTRobin

Hi Gianlucamilani,

Sorry for the delayed reply.
Axis mapping can be set through the following software code. In order to know the axis mapping matrix, you must also know what your target coordinates are? In this way, the physical coordinates of the sensor can be mapped to the target coordinates to generate a matrix.
struct bhy2_orient_matrix acc_matrix = {1, 0, 0, 0, 1, 0, 0, 0, 1};
struct bhy2_orient_matrix gyro_matrix = {1, 0, 0, 0, 1, 0, 0, 0, 1};
struct bhy2_orient_matrix mag_matrix = {1, 0, 0, 0, -1, 0, 0, 0, -1};
bhy2_set_orientation_matrix(BHY2_SENSOR_ID_ACC, acc_matrix, &bhy2);
bhy2_set_orientation_matrix(BHY2_SENSOR_ID_GYRO, gyro_matrix, &bhy2);
bhy2_set_orientation_matrix(BHY2_SENSOR_ID_MAG, mag_matrix, &bhy2);

View original
6 replies
Resolved