Intermittent time differences between data packets

Post here to get support
Post Reply
mansson
Beginner
Posts: 1
Joined: Mon Apr 08, 2019 9:41 am

Intermittent time differences between data packets

Post by mansson » Mon Apr 08, 2019 11:56 am

Hi!

Me and my friend are trying to create a swarm of 5 Crazyflie 2.1 using the lighthouse deck and 1 CrazyRadio PA. However, I am having issues with intermittent time differences between each data packet received while logging a flight (state and reference of the drone). So, say I log at a period of 20 ms, the time difference between each received packet is instead either 15.6 ms or 31.2 ms, see figure below. This to me looks like some kind of polling rate since they correspond to 64 Hz and 32 Hz, but I cannot find why this happens.

The thing is, my friend does not have this problem when running the exact same python script on his computer. It looks like he somehow has a higher polling rate (?) since the time difference centers around the set period with only smaller and more random offsets. He's running a Surface Pro 4 i5 and I have an Asus Zenbook UX305CA (m3-6y30, 8 GB RAM). We're both using PyCharm and Windows 10. The most obvious difference is the CPU and mine is a really slow one, but it seems unreasonable to me that it wouldn't be able to handle this rather small amount of data.

What we've tried so far:
  • Different drivers for the radio (libusb-win32 1.2.6.0 and libusbk 3.0.7.0)
  • Different USB ports
  • Different logging periods (like 35 ms gives a similar behavior)
time_test_20.jpg
Logging 20 ms
Figure of the time difference between each received packet when logging with a period of 20 ms.


I hope I've explained the issue well enough. Any ideas why this happens and how to fix it?



tobias
Bitcraze
Posts: 1911
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Intermittent time differences between data packets

Post by tobias » Wed Apr 10, 2019 7:50 am

This is a strange issue indeed. As you say, this shouldn't require much CPU but it sounds a lot like a performance issue. It would have been interesting to try it on linux on the same computer but I guess that is not an viable option. Possibly by running a "live CD"? Could also be related to the USB hardware which might be different on the computers.

Could you try running the same test but over USB connected directly to the Crazyflie?

Post Reply