07-29-2019 10:06 AM
Dear moderators and engineers!
I have encountered problems when using BSXLite to generate quaternions on BMX160, as described below. Previously considering BMI160+BMM150, the problem was the same. Later, because BOSCH sales staff suggested using BMX160, the problem also exists. I think it is a simple link that has a problem. Please help me check it out:
Chip: BMX160,
MCU: Cortex M3,
Language: C programming,
Compiler Environment: MDK5
System situation: BLE-Stack
1. The main functions initialization
...
2. void my_bsx_init() Functions achieve as follows:
3. Operate Algorithm library, updataing value of sensors. Program will run to this function per 30mS
My Bsx step process Functions achieve as below:
4. Get quaternion, Program will call follows functions to take quaternion
Finally no changes with quaternion
Solved! Go to Solution.
08-02-2019 07:27 AM
Dear Marko Njirjak and Moderator
Thanks for your help!
Yes, I have got a meaningful quaternion. Different sensor range settings may cause some errors (such as the sampling frequency you mentioned), and I am trying more.
If you have any suggestions for sensor settings, please let me know, this will be beneficial to my debugging.
Thank you very much for your help!
Andy
08-02-2019 09:01 PM
Dear coder,
here are the settings that I use in my project.
//Accelerometer
bmi.accel_cfg.power = BMI160_ACCEL_NORMAL_MODE;
bmi.accel_cfg.bw = BMI160_ACCEL_BW_NORMAL_AVG4;
bmi.accel_cfg.range = BMI160_ACCEL_RANGE_2G;
bmi.accel_cfg.odr = BMI160_ACCEL_ODR_100HZ;
//Gyroscope
bmi.gyro_cfg.odr = BMI160_GYRO_ODR_100HZ;
bmi.gyro_cfg.range = BMI160_GYRO_RANGE_500_DPS;
bmi.gyro_cfg.bw = BMI160_GYRO_BW_NORMAL_MODE;
bmi.gyro_cfg.power = BMI160_GYRO_NORMAL_MODE;
//Magnetometer
bmm.settings.preset_mode = BMM150_PRESETMODE_REGULAR;
APP_ERROR_CHECK(bmm150_set_presetmode(&bmm));
bmm.settings.pwr_mode = BMM150_FORCED_MODE;
APP_ERROR_CHECK(bmm150_set_op_mode(&bmm));
bmi.aux_cfg.aux_odr = 6; // I believe this is 25Hz, but an 8 works OK too (100Hz)
bmi160_config_aux_mode(&bmi);
Kind regards,
Marko Njirjak
08-13-2019 03:28 AM
Really Thanks! I am know basic applications of Quatrnion I think.