Dear Community,

The question first: Is there a way to set the sampling rate of the sensors? I do not mean the reading frequency but the rate the sensors provide new values.

Based on the XDK-Example "StreamSensorDataOverUsb" (XDK Workbench), I implemented code to read accelerometer (raw data, BMA280), gyroscope (raw data, BMG160) and magnetometer (raw data, BMM150) at a frequency of about 1000 Hz and even a little more which is good for my purpose. 

But when I checked the output, I realized that the magnetic field value updates very rarely. Reading at 1000 Hz, I got only 12 value updates within the 1000 values which is far away from the specified sampling rate of 300 Hz. In my application, there should be large and fast oscillations.

The following table shows the number of value updates per second of the different sensorcis:

Sensor value updates per second 
(reading with ~1000 Hz)
Accelerometer BMA280 about 850
Gyroscope BMG160 about 400
Magnetometer BMM150 about 12

 

Certainly, the number of value updates can not be seen equivalent to the sampling rate, but I expected similar to the accelerometer a number of value updates close to 300 per second.

I also used a different code (from xdk2mam) as a starting point. Here, I got the following number of value updates per second:

Sensor value updates per second 
(reading with ~1000 Hz)
Accelerometer BMA280 about 850
Gyroscope BMG160 about 980
Magnetometer BMM150 about 12

 

Surprisingly, the gyroscope (same sensor used, also raw data read!) provided a higher update rate than the accelerometer and furthermore a significantly higher update rate for the gyroscope itself (980 instead of 400). Still, the magnetometer results in about 12 updates per second.

So the question again:

Is there a way to set the sampling rate? Or why do different codes provide different sampling rates?

0 (0 Voti)
RE: Magnetometer Sampling Rate & Precision
Risposta
10/07/19 9.03 come risposta a Burnum Wieland.

Hello Burnum,

Please use datalogger application for configuring the sensor from SD card.

From the demo page of XDK, please direct to IoT Marketplace https://xdk.bosch-connectivity.com/demos
In IoT Marketplace, you can find Data Logger Firmware. https://rb-iot-marketplace.bosch.com/boschiotcustomermarketplace/en/EUR/Industry-4-0/Data-Logger-Firmware/p/405862100105/

The Data Logger firmware has 2 versions,

  1. Trial version : the software package is free and the sensor data can be logged for 30 minutes only
  2.  Full version : the software package is EUR 59.00 and the sensor data can be logged till 24 hours

Thank you,

Padmapriya G

0 (0 Voti)
RE: Magnetometer Sampling Rate & Precision
Risposta
10/07/19 10.47 come risposta a Padmapriya G.

Hello Padmapriya,

Thank you for your fast answer. However, I prefer using my own software code. So far, I really like the XDK, but would like to get a higher resolution of the magnetometer. Looking at the different results of the gyroscope provided above, I assume there should be an easy solution to modify the sampling rate directly without your additional software. I would really appreciate to get your support for this! 

Furthermore, to download the data logger, it seems that I must register first but "Registration is only allowed for entrepreneurs and freelancers, as this offer is only for commercial customers" wich I am actually not and I can not provide the recommendes fields "company name" and "VAT ID".

Thank you for your support.

+1 (1 Voto)
RE: Magnetometer Sampling Rate & Precision
Risposta
24/07/19 8.09 come risposta a Burnum Wieland.

Hello Burnum,

Sorry to hear that you are not able to register and use datalogger.

In StreamSensorDataOverUsb application, you cannot configure the sensor.

To do so, navigate to SDK/Common/source/Sensor/Sensor.c -> Sensor_Enable(). In this function you can modify the function or call functions from Platform/Sensors/include

For example,

To set magentometer data rate,

  1. Include header file "BCDS_Magnetometer.h" in Sensor.c
  2. In function Sensor_Enable() -> after Magnetometer_init() -> call Magnetometer_setDataRate() with parameter as input
  3. Compile and flash the code

Reference:

http://xdk.bosch-connectivity.com/xdk_docs/html/group___s_e_n_s_o_r_s.html

 

0 (0 Voti)