02-20-2023 07:22 AM - edited 02-20-2023 07:23 AM
Hello,
What I Did
I am using BHI260AP & BMM150 together with nRF52840. I upload Bosch_APP30_SHUTTLE_BHI_aux_BMM150.fw.h and the am using the API on GitHub (SHA 5b26dc4802f500f75e1086c2a156e3ecf800560c → Last Commit Before v1.4.1).
1) After I upload the firmware I register the fifo callbacks:
2) Then set the virtual sensor configuration:
For the values:
• sample_rate = 20 Hz
• report_latency_ms = 0
3) To get the measurements and activate callbacks, I call the bhy2_get_and_process_fifo function with a uint8_t array of size 2048 as argument. This call occurs with a frequency of 20Hz.
My Problem
I do not experience a problem on obtaining the correct data at lower rotational speeds or sending it over BLE, but I have 2 problems on the performance of these measurements:
1-When I rotate the sensor around its yaw axis, I observed that ~3 degrees of drift occurs with every full rotation. Measurements do not drift when the module is stationary.
2-I take the measurement at a specific position, then take the module and rotate it arbitrarily. When I place the module again at the same specific position, illogically distant measurements are coming from it.
Therefore, my question is that how can I improve the consistency of my measurements. I tried using higher frequencies for both reading the fifo and sensor sample rate. I also tried using "Geo-magnetic rotation vector wake up" sensor, since geo-referenced rotation data would be better for me. However, these do not seem to be working and I could not manage to obtain consistent measurements.
Thank you for your time.
Solved! Go to Solution.
02-21-2023 07:00 AM
Hi hfozturk,
Before you do the test, sensor calibration status need to reach 3.
I upload example code on STM32 for your reference, enable the following code to view acc, gyro, mag calibration status(*accuracy).
PDEBUG(",ACC,x,%d,y,%d,z,%d,accuracy,%u\r\n",
data.x,
data.y,
data.z,
*accuracy);
03-06-2023 12:04 PM
Hello and thank you for your reply,
Benefiting from the example code you have shared, I have printed the accuracy for the virtual sensors. I have observed that calibration status of sensors reach 3 as I rotate the module. At this step I wonder the following:
•Is there a special calibration process, i.e. a predefined series of movements to calibrate sensors?
•Which virtual sensor is best for my application, where I try to get orientation in terms of quaternions?
•There is an adaptive calibration algorithm running inside. Is there a way to make this calibration more responsive, i.e. converge to a calibration state faster?
03-10-2023 03:29 PM
After trying all rotation vector types (RV, GAMERV and GEORV), I have observed that problem is caused by magnetometer measurements. I plotted the 3D measurements of magnetometer coming from different virtual sensors and was expecting a sphere centered at the origin, but this was not the case. Following are the plots of magnetometer measurements after rotating the module around its axes:
Virtual Sensor: Magnetometer corrected
Virtual Sensor: Magnetometer corrected wake-up
Virtual Sensor: Magnetometer uncalibrated
Virtual Sensor: Magnetometer uncalibrated wake-up
Virtual Sensor: Magnetometer passthrough
In every case, I tried to rotate the module the same as far as I could. As you can see, correction does not seem to work at all and that is why when I use those Virtual Sensors, rotation exhibits illogical behaviour. I would be very happy if you could:
1) Show me what can I do to fix "corrected" measurements
2) Tell me if there is a way and how to make the algorithm use magnetometer data supplied by the user while generating quaternions.
Thank you.
03-20-2023 10:22 AM
Hi hfozturk,
Calibration method for accel, gyro, mag sensor, you could refer the video https://www.youtube.com/watch?v=Bw0WuAyGsnY&t=11s
BHY2_SENSOR_ID_ORI_WU is the right sensor ID for your application.
The calibration algorithm runs in the background, the ODR is higher and the calibration speed is faster.
I suppose you have already done axis mapping, and the following sections of the data sheet.
Due to the use of geomagnetic sensors, it is necessary to consider these points to improve the accuracy after fusion: 1. Structurally avoid generating large magnetic interference, such as using magnetic attraction with large magnetic interference; Generally, it is necessary to perform a magnetic field test on the entire machine, generate a soft magnetic compensation matrix, and write it into the sensor.
In addition to the above, before using fusion data, it is necessary to ensure that the calibration accuracy of acc, gyro, and mag has reached 3.