User Tools

Site Tools


doc:lps:tdoa:protocol

This is an old revision of the document!


TDoA Anchor protocol V2

This page describes the TDoA anchor protocol V2.

System architecture

The protocol is designed to be used with 8 anchors. In a TDoA system the tag will achieve much better positioning inside the anchor convex hull, so using 8 anchor allows to get a parallelepiped convex hull.

The anchors are addresses from 0 to 7.

Packet scheduling

The protocol is using TDMA to transmit the packets. The anchor 0 is the TDMA master, other anchors are synchronized on it, this means that if Anchor0 fails or cannot be received by an anchor, the anchor will stop transmitting and listen for Anchor0.

The time slots length are 2ms and there is 8 time slots per frame. The frame length is 16ms. Each anchor is allowed to transmit in the the timeslot corresponding to its address. Anchors transmits early in the timeslot.

Packets format

There is only one packet format. This packet is sent at the begining of each time-slot by the anchor allowed to transmit in the timeslot.

typedef struct rangePacket_s {
  uint8_t type;
  uint8_t seqs[NSLOTS];  // Packet sequence number of the timestamps
  uint8_t timestamps[NSLOTS][TS_TX_SIZE];  // Relevant time for anchors
  uint16_t distances[NSLOTS];
} __attribute__((packed)) rangePacket_t;

Assuming the current anchors is of ID anchor_id

  • type is 0x22
  • seqs[i]
    • If i == anchor_id Sequence number of the current packet
    • If i != anchor_id Sequence number of the latest receive packet from anchor i
  • timestamps[i]
    • If i == anchor_id Transmit time of the current packet expressed in current anchor clock
    • If i != anchor_id Receive time of the latest receive packet from anchor i expressed in current anchor clock
  • distances[i]
    • If i == anchor_id Reserved for future use
    • If i != anchor_id Time of flight between current anchor and anchor i in radio timer tick expressed in current anchor clock

Tag implementation

A TDoA tag is simply an UWB sniffer. A sniffer can use the data in the packets together with the packet receive timestamps to calculate its position.

In order to save some electric power, a tag implementation can choose to track the TDMA timeslots and only listen when packets are transmitted. Though this is not a requirement.

Calculating TDoA

For an example of how to calculate TDoA of packets using this protocol you can look at the Crazyflie source code: https://github.com/bitcraze/crazyflie-firmware/blob/tdoa2/src/deck/drivers/src/lpsTdoaTag.c#L110. This section will explain in English and with drawing the theory used to calculate TDoA.

If we consider the 3 last packets sent from anchor 0 and 1:

We can calculate the difference of time of flight (which is the difference of time of arrival, TDoA) by calculating the diffence between δtx and δrx. δrx is measured when receiving packets. δtx can be calculated if we know the time it takes to fly from 0 to 1: Anchor 1 measures the time of arrival of the packet P2 and so knowing the time it took the packet to arrive to 1, we can calculate when it was sent by 0.

doc/lps/tdoa/protocol.1504692619.txt.gz · Last modified: 2017-09-06 12:10 by arnaud