Inaccurate sampling rate with python SDK

Hallo folks,

I'm working with python SDK on a project and getting inaccuarte sampling rate.
Just to make the problem reproducible I've used two MetaMotionC boards with the accelerometer sensor on and run the multi_device.py example ( I changed the sampling rate -odr- and the sleep time only). I did several runs of the code for each device using different sampling rate and time. I've got below results which deviate strongly from the sampling rate and I don't know why.

Any help/explanation will be highly appreciated.

Comments

  • Try the packed signal instead:
    https://mbientlab.com/cppdocs/0/accelerometer.html#high-frequency-stream

    You might also want to add a second delay after setting the connection parameters.

  • Thank you Eric for the reply. I've tested your suggestions (added 1 sec sleep after the board configuration) and got results below which show no changes on sampling rate behaviour:

    I've noticed that only with 10Hz the number of samples is "correct".
    Below are the specs of the boards and developing environment.
    ...........................................................................
    OS Specs
    Host OS: Win10 Pro 64bit, Version 1803
    In Virtualbox I've installed (Debian 9.4.0)
    installed python sdk in Virtualbox (Debian 9.4.0)
    I'm using USB Bluetooth 4.0 dongle (CSR8510A10) - LogiLink Bluetooth 4.0 Adapter BT0037
    ...........................................................................
    MetaMotionC Specs
    Model No. 6
    Firmware 1.3.6
    Hardware 0.1
    ...........................................................................

  • edited November 2018

    Run your tests for more than a few seconds. If you are only going to be recording for under 30s, then log the data.

  • edited November 2018

    I logged for three seconds just for reference to simplify the problem and to have better overview here.
    I've run the tests with two MetaMotionC boards and regardless of the sampling time, sampling rate or sampling method (streaming or logging) we observed between 2% or 3% data loss (sometimes even more).
    We want to sample data for 20 Minutes from miltiple sensors and it will have a big impact on our project in case we lose 3% of the data.
    I know that There is a +/- 1% error on the output data rate accuracy (see link below) however we are experiencing more than 1% error on the output data rate accuracy.
    https://mbientlab.com/community/discussion/comment/6929#Comment_6929

  • Unfortunately I don't have any MMC with firmware 1.3.6. The two that I do are running firmware 1.4.2 and both are within the 1% margin.

    Try upgrading one of the boards to 1.4.2 and see if that fixes the issue.

This discussion has been closed.