06-01-2022 02:27 PM
Using the BNO055 I find it gives the different heading reading depending on the orientation when I power up.
I'm using NDOF (OPR MODE = 0xC0) & I've calibrated until I get 3 is all the cal status bits (CALIB_STAT = 0xFF). I then save the OFFSET & RADIUS reg to non-volatile ram (regs 0x55 thru to 0x6A). I then power the unit up point in one direction & get (say) 160 degees. I then power off, rotate thru 90 degees & power up again. I then move it back to the original direction & it read 114 degees
I staying in the same place & keeping the pitch & roll very close to 0 degees.
06-05-2022 03:04 PM
Hi Digisolve,
Do you know what the surrounding magnetic field environment is like?
06-06-2022 10:58 AM
I have run tests outside in an open garden in daylight. There are a few houses about 20 meters away. There are no overhead power lines
The units is fully calibrated in this location & the offset & raduis data is saved. When I power the unit up & restore the cal data I heading is unreliable power up in different positions & then tun to the same point.
e.g. if I power up point in direction A i get A degrees. when I power up at 90 degres then turn to direction A I no longer get A degrees.
This is my start & calibration load functions:
#define BNO055_CAL_DATA_START BNO055_ACCEL_OFFSET_X_LSB_ADDR
#define BNO055_CAL_DATA_SIZE (BNO055_MAG_RADIUS_MSB_ADDR - BNO055_CAL_DATA_START + 1)
void bno055_init(void)
{
Delay(TICK_100MS);
COMPASS_RESET = 0;
Delay(TICK_10MS);
COMPASS_RESET = 1;
Delay(7*TICK_100MS); // wait compass POR
/* switch back to page 0 */
BNO055_I2C_Write(BNO055_PAGE_ID_ADDR, PAGE0);
// Delay(TICK_10MS);
/* read chip IDs (for debug only)*/
BNO055_I2C_Read(BNO055_CHIP_ID_ADDR);
BNO055_I2C_Read(BNO055_ACCEL_REV_ID_ADDR);
BNO055_I2C_Read(BNO055_MAG_REV_ID_ADDR);
BNO055_I2C_Read(BNO055_GYRO_REV_ID_ADDR);
BNO055_I2C_Read(BNO055_SW_REV_ID_LSB_ADDR);
BNO055_I2C_Read(BNO055_SW_REV_ID_MSB_ADDR);
BNO055_I2C_Read(BNO055_BL_REV_ID_ADDR);
/* Wait till restart */
while(BNO055_I2C_Read(BNO055_SELFTEST_RESULT_ADDR) != 0x0F )
{
Delay(TICK_10MS);
}
/* Set to config mode */
BNO055_I2C_Write(BNO055_OPR_MODE_ADDR, BNO055_OPERATION_MODE_CONFIG);
/* Set to normal power mode */
BNO055_I2C_Write(BNO055_PWR_MODE_ADDR, BNO055_POWER_MODE_NORMAL);
/* Set the output units */
BNO055_I2C_Write(BNO055_UNIT_SEL_ADDR, 0x00);
// use external clock //
BNO055_I2C_Write(BNO055_SYS_TRIGGER_ADDR, 0x80);
Delay(TICK_10MS);
while(BNO055_I2C_Read(BNO055_SYS_CLK_STAT_ADDR) & 1)
{
Delay(TICK_10MS);
}
if((BNO055_I2C_Read(BNO055_SYS_TRIGGER_ADDR) & 0x80) == 0)
while(1); // !!! EXTERNAL CLOCK SELECTION FAILED
/* Set the axis map (P2)*/
BNO055_I2C_Write(BNO055_AXIS_MAP_CONFIG_ADDR, xyz_table[XYZ_MODE].map);
BNO055_I2C_Write(BNO055_AXIS_MAP_SIGN_ADDR, xyz_table[XYZ_MODE].sign);
// Load calibration Profile //
if(inhibit_profile == TRUE)
{
inhibit_profile = FALSE;
}
else
{
BNO055_Load_Calibration_Profile();
}
/* Set the requested operating mode (see section 3.3) */
BNO055_I2C_Write(BNO055_OPR_MODE_ADDR, OPERATION_MODE);
Delay(TICK_10MS);
}
void BNO055_Load_Calibration_Profile(void)
{
S16 profile_data[sizeof(NvBuff.CompassProfile)/sizeof(NvBuff.CompassProfile[0])];
U8 flash_loop ;
for(flash_loop = 0; flash_loop < sizeof(profile_data)/sizeof(profile_data[0]); flash_loop++)
{
profile_data[flash_loop] = NvBuff.CompassProfile[flash_loop];
}
BNO055_I2C_Write(BNO055_OPR_MODE_ADDR, BNO055_OPERATION_MODE_CONFIG);
Delay(TICK_10MS);
BNO055_I2C_WriteArray(BNO055_CAL_DATA_START, (U8*)profile_data, sizeof(profile_data));
BNO055_I2C_Write(BNO055_OPR_MODE_ADDR, OPERATION_MODE);
Delay(TICK_10MS);
}
06-14-2022 03:12 PM
Please can I get some feedback. My client is chasing me daily. Thank you
06-27-2022 07:45 AM
Hi Digisolve,
After you call BNO055_Load_Calibration_Profile(), you need to wait calibration status to reach 3.