Data rate of sensor data over USB
Risposta
04/10/19 10.48

Hi,

I have modified the example project 'StreamSensorDataOverUsb', for transmitting the sensor data over USB to PC.

The portion of the code (in AppController.h),

#define APP_CONTROLLER_TX_DELAY       UINT32_C (1000) 

was changed to

#define APP_CONTROLLER_TX_DELAY       UINT32_C (100)  

for transmitting the data @ 10 Hz (10 samples per second)

But, the data rate I got is less than 10 Hz - Recorded data for 101sec, and obtained only 984 data packets instead of 1010 packets.

Please help me solve this.

 

 

0 (0 Voti)
RE: Data rate of sensor data over USB
Risposta
04/10/19 13.06 come risposta a Nimmy Mathew.

Hello Nimmy,

on a first sight i am not able to find an explanation for this behavior.

Have you done any other modifications to the program?

Maybe you could add an automatic incrementing integer counter to your data packets. This way you can exactly check if packets are missing.

I hope this was helpfull.

Best regards,

Christian

0 (0 Voti)
RE: Data rate of sensor data over USB
Risposta
09/10/19 6.05 come risposta a Christian Köhler.

Hi Christian,

Thank you for the reply.

We have tried putting packet count in each packet but no packets were found missing.

Is there any other methods to check the data rate of the XDK?

 

Thanks & regards,

Nimmy Mathew

 

 

0 (0 Voti)
RE: Data rate of sensor data over USB
Risposta
09/10/19 7.54 come risposta a Nimmy Mathew.

Hello Nimmy,

now we have the information that no packets are actually missing. I think with this information we can work on the problem step by step.

One possible reason for the unexpected number of packets could be the function "printf". This is a really generic function so it takes some time to execute. Corresponding on the number of sensors you read data from and so the number of printf calls this could be responsible for the delay.

I think the next step would be to include the header "Serval_Clock.h" in your program. In this header you can find the function "Clock_getTimeMillis()". This function returns the current time since the XDK was started in milliseconds. You could print out these values in every loop execution and compare the values to see how long it takes for the XDK to execute the loop.

This should give you more information about your system behavior.

Best regards,

Christian

0 (0 Voti)