Hi everyone,
I was trying to calculate the distance between Anchors in TDOA2. And I printed the "tof_Ar_to_An_in_cl_An" in UART so I got the value of tof as follows:(distance = Tof * C / tsfreq)
Tof (ctn): 33077 distance:155.189477
Tof (ctn): 33077 distance:155.189477
Tof (ctn): 33073 distance:155.170710
Tof (ctn): 33074 distance:155.175402
Tof (ctn): 33068 distance:155.147251
...(The true distance is 88cm)
The distances didn't make sense.But the right TDOA value(DistanceDiff) can be calculated using tof as above.I am wondering how it works and how can I get the right distance in Anchors.
Thanks!
Wrong tof in TDOA2
Re: Wrong tof in TDOA2
Hi,
This distance includes the antenna delay, this is why it is so big.
When calculating TDoA with the anchor-to-anchor distance, we are not caring about the distance but what we want is the time it takes for a packet from one anchor to another, and this time is the flight time plus antenna delay. This is why it works fine. The current TDoA implementation assumes the antenna delay is the same for all nodes and tags.
With TWR, the Crazyflie is compensating for antenna delay. It represents about 154 meters: https://github.com/bitcraze/crazyflie-f ... deck.c#L86.
To get the right distance you need to apply an antenna delay compensation (ie. substraction).
This distance includes the antenna delay, this is why it is so big.
When calculating TDoA with the anchor-to-anchor distance, we are not caring about the distance but what we want is the time it takes for a packet from one anchor to another, and this time is the flight time plus antenna delay. This is why it works fine. The current TDoA implementation assumes the antenna delay is the same for all nodes and tags.
With TWR, the Crazyflie is compensating for antenna delay. It represents about 154 meters: https://github.com/bitcraze/crazyflie-f ... deck.c#L86.
To get the right distance you need to apply an antenna delay compensation (ie. substraction).