DWM1001-DEV Timer Drift Issue

Hi all, I am attempting to synchronize the timers of two DWM1001-DEV devices. In order to do this, I have created an interrupt which gets triggered by a timer (using the code in the on board package example – dwm-timer) in each device. The timer is suppose to go off every 100ms, however, I have discovered that there is significant drift in each device. I have experimented with changing the timer configuration properties, however I have not been able to achieve the accuracy I require. To elaborate, each device drifts more than 1 second after 5 minutes. I would appreciate it if anyone could tell me how to make a more accurate timer? Thank you.

Hi Jason,

Can you tell a bit more about what your firmware looks like?

You are using dwm-timer so I believe that un the user app above PANS ?

How are you expecting to synchronize those two devices using those timers while in PANS, every device is already accurately timed with regards to the initiator superframe ?

Thank you,
Kind regards

Thank you for the reply Yves_Bernard.

To answer your questions:

  1. The code which I have begun with and modifying for my own purpose are the ‘ss_twr_init’ and ‘ss_twr_resp’ examples found here (https://github.com/Decawave/dwm1001-examples/tree/master/examples).

  2. I copied over parts of the dwm-timer example over to the code mentioned above (note: I had to leave out certain functions such as dwm_interrupt_register(&irq) as some functions were not recognized in my environment). This is how I made my first timer interrupt. I have also set up a FreeRTOS software timer, though the performance of such is also inadequate for my needs.

  3. I was hoping that the clock frequencies of each device were similar enough that if they began their timers at around the same time (triggered by a broadcast sent by another device), they would trigger almost simultaneously for a long time.

  4. In regard to the initiator superframe, my understanding of this synchronization method, is that information of the current time interval is being propagated out from the initiator to all others in the network. This is how all members of the network stay synchronized to one another. However, this is not what I want. I need all devices to start their timer interrupts around the same time (triggered by a broadcast from another device), and then only rely on their own timers to remain synchronized with everyone else. The following text will explain why I am looking to achieve this.

I am trying to implement a round robin algorithm for peer-to-peer ranging. So consider 4 devices which will perform this ranging: Devices a, b, c and d. At any time each device can either be an imitator or responder for another device. So at the beginning of the process the following will occur:

timestep 1: Device a initiates b who is in responding state for a.
timestep 2: Device a initiates c who is in responding state for a.
timestep 3: Device a initiates d who is in responding state for a.
timestep 4: Device b initiates a who is in responding state for b.
timestep 5: Device b initiates c who is in responding state for b.

and so on, and so on. Thus, all devices need a way of knowing which state they need to be in for communication to work, and this is why I am trying to set up very accurate timers.

I would appreciate any advice as to how to achieve this. Thank you.