Gyro data sampling rate is inconsistent and fall after 2500 samples

I am using C++ sdk in C# UWP app. On first connect to metawear sensor and start getting gyro stream with setting ODR_100HZ.
I observe the sampling rate 90 to 95 for first 2500 samples.
After 2500 samples the rate suddenly fall below 30 and then stay between 15 to 25.
In Callback function I am not consuming any memory.

Any suggestion how to make sampling rate consistent at ODR_100HZ?


Comments

  • edited June 2016
    I suspect it has to do with the connection interval that Windows uses, see this thread.  What you can do is reduce the max connection interval to 7.5ms on the first connect then reconnect the board to your windows device so the two BTLE radios will negotiate a lower connection interval.  Changing the connection interval is handled in the settings module:

    mbl_mw_settings_set_connection_parameters(cppBoard, 7.5f, 7.5f, 0, 6000);
  • Settings connection does not change the result. Rate falls below 30 after 2500 or 2600 samples.
  • Did you remember to disconnect and reconnect after the changing the connection interval?

    Also, what Bluetooth adapter is your PC using?
  • Yes, after changing the connection interval, I disconnect and then reconnect the board.

    I am running application on Raspberry Pi 2 Model B with OS Windows 10 IoT Core.
    And using USB Bluetooth CSR V4.0 dongle.
  • I restart the Raspberry Pi board couple of times and also unplug and plug the usb bluetooth dongle, and ran application again. Now it start giving gyro sampling rate between 90-100, I tested for 60,000 and more samples.
  • Eric,

    Connecting two metawear boards and also setting connection interval for both
     mbl_mw_settings_set_connection_parameters(cppBoard, 7.5f, 7.5f, 0, 6000);.

    With ODR_100HZ config for both boards, 
    getting gyro sampling for one board at rate 90-100 and for 2nd board at rate between 16-18.

    Also with ODR_50HZ config for both boards, 
    getting gyro sampling for one board at rate 47-50 and for 2nd board at rate between 16-18.

    Even with config ODR_200HZ getting same result as 90-100 and 16-18.

    Any suggestion how to get same sampling rate for both boards for ODR_100HZ?

This discussion has been closed.