Crazyflie-LPS anchor synchronization in TWR protocol

All discussions related to the Loco Positioning system
Post Reply
alexpic
Beginner
Posts: 13
Joined: Thu Sep 28, 2017 9:04 am

Crazyflie-LPS anchor synchronization in TWR protocol

Post by alexpic »

Hi everybody,
I’m studying the communication between Crazyflie and LPS anchor in TWR protocol, and i have just a simple question: how are sychronized the crazyflie and the anchors? I’ve seen that the crazyflie generates the times of poolTx, answerRX and finalTx, and uses the payload of the report to generate poolRx, answerTx and final Rx, but how can it? What kind of synchronization is used?
Thanks for the help!!!! :D
Alex
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Crazyflie-LPS anchor synchronization in TWR protocol

Post by arnaud »

Hi Alex,
The protocol is documented in the wiki: https://wiki.bitcraze.io/doc:lps:lpp#two_way_ranging
The UWB radios are able to measure with a great precision when a packet leaves the radio and when it is received. The TX and RX timestamps are measured by the anchor and communicated back to the Crazyflie in the last packet of the sequence.

There is no synchronization, per se, in TWR. The anchors listens for requests and answer when requested to follow the defined sequence. The Crazyflie is responsible for sending the messages running the ranging sequence (and to follow time-slots when TDMA is enabled).
I hope this answers your question.
alexpic
Beginner
Posts: 13
Joined: Thu Sep 28, 2017 9:04 am

Re: Crazyflie-LPS anchor synchronization in TWR protocol

Post by alexpic »

Hi Arnaud,
Thank you for your reply!!
The TX and RX timestamps are measured by the anchor and communicated back to the Crazyflie in the last packet of the sequence.
So all the times (so the timestamps) are managed by the anchor, and those times (pollTx, pollRx, answeTx, answerRx, finalTx and final Rx) are sent the crazyflie with the payload of the last signal, the report, right?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Crazyflie-LPS anchor synchronization in TWR protocol

Post by arnaud »

Half of the time are measured by the anchor and half of the time are measured by the Crazyflie. this is why we need the last "report" packet that contains the anchor-measured timestamps. The Crazyflie needs to know all the timestamps since it is the one that measures the range.
alexpic
Beginner
Posts: 13
Joined: Thu Sep 28, 2017 9:04 am

Re: Crazyflie-LPS anchor synchronization in TWR protocol

Post by alexpic »

Hi Arnaud,
now all is more clear! Thank you for the help!!! :D
Alex
Post Reply