Variance of TDOA2 measurements

All discussions related to the Loco Positioning system
Post Reply
carlos.luis306
Beginner
Posts: 17
Joined: Fri Apr 29, 2016 1:53 pm

Variance of TDOA2 measurements

Post by carlos.luis306 »

Hello everyone,

I have setup 8 UWB nodes in our lab (following the cuboid recommendation) and I'm getting a large variance using the new TDOA2 algorithm. I'm using the latest anchor and crazyflie firmware (both STM32 and NRF51).

I'm attaching a cfclient capture of a static Crazyflie in the middle of our flying arena. For comparison I have included data using TWR and TDOA2.

Basically with TDOA2 we are getting continuous peaks in the measurements, which we assume are due to outliers.

The Crazyflie is placed well within the convex hull of the anchors as well (it is sitting in a chair in the middle of the flying arena).

I just want to confirm with other people if this is the current state of the TDOA estimations, and if the peaks are normal

Thanks!
Attachments
twr.png
Tdoa2.png
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Variance of TDOA2 measurements

Post by kristoffer »

Hi!

I think it looks a bit noisy. I would expect something more like the TWR graph, not as spiky.
tdoa-pos.jpeg
A graph from our system

Would it be possible for you to add a graph with the raw TDoA measurements? You will find them as logs tdoa.dist0-1, tdoa.dist1-2 and so on

It might also be interesting to take a look at the TDoA statistics
tdoa.stRx = nr of received TDoA packets / s
tdoa.stSeq = nr of packets passing the sequence nr check / s
tdoa.stData = nr of packets passing data validity chekcs / s
tdoa.stEst = nr of packets passing outlier detection and actually passed on to the estimator / s

For a 8 anchor system stRx should be close to 500 packets/s without packet loss.
If all is good stEst should be closeish to stRx.

What physical size is your setup?
The current outlier detector is super simple and discards measurements where the TDoA distance is greater than the distance between the anchors (since it is physically impossible). The drawback of this simple approach is that it is pretty generous and that it accepts larger errors for larger setups. We have only tested the outlier detection in our system that is pretty small, maybe it has to be improved?
carlos.luis306
Beginner
Posts: 17
Joined: Fri Apr 29, 2016 1:53 pm

Re: Variance of TDOA2 measurements

Post by carlos.luis306 »

Hi Kristoffer, thanks for your response

I'm including a graph with raw data from the TDOA and the statistics, as you suggested.

Our arena is roughly 8x8x3.4 (WxLxH). However, shouldn't UWB measurements, theoretically, improve with distance? (given that they are within the 200m range of the radio).

Any idea of what might be happening from the raw data? The noisier data comes from dist2-3, dist4-5 and dist5-6. The other 5 seem reasonable.

Thanks for the support!

EDIT: changing node 5 (which seemed to be the common factor in the noisy measurements) to a freshly out of the box node didn't help. Same variables as before are quite noisy

EDIT2: I changed the node configuration to match exactly the one proposed here https://www.bitcraze.io/getting-started ... ng-system/. However I could only mitigate the peaks at dist2-3, the other two noisy signals remain (now in other nodes because of the changed configuration, so it is not a problem of a specific node). My guess is a position-dependant source of noise in our arena, but I fail to see what it is. I removed any object nearby that might obstruct the radio signals, so right now the convex hull of the nodes is just one big empty space with a chair in the middle and the CF2.0 on top. any thoughts?
Attachments
TDOA_stats.png
TDOA_raw.png
carlos.luis306
Beginner
Posts: 17
Joined: Fri Apr 29, 2016 1:53 pm

Re: Variance of TDOA2 measurements

Post by carlos.luis306 »

Progress so far:

I made some iterations on different node position configuration, and finally found one that eliminated the peaks on the raw measurements, as seen in the figure attached.

Image

However, this doesn't seem to improve the large variance I get in the position output from the Kalman filter

Image

Also, I noticed in the new raw measurements that the larger the distance between nodes, the greater the variance of the measured distance (compare the blue and orange lines at the top of the plot with any other line below).

Now I wonder if it has something to do with our node placement (however, TWR works fine, as always), or is it just a limitation on the current TDoA2 implementation. Any suggestions are welcomed :)
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Variance of TDOA2 measurements

Post by kristoffer »

Hi!

So far we have mainly used the TDoA mode in our office flight lab that is pretty small, about 4x4 meters. Yesterday we tried it out in a slightly bigger space, 6x6 meters and got some insights that I want to share with you. It is important to remember that we are learning as we go, this is new territory to us as well.

What we could see was that the system was working in the larger space, but not as good as in the 4x4 set up. We also noticed that we had errors in the estimated position that was shared among all individuals in a swarm (correlated motion, all Crazyflies swaying in the same way at the same time). Further investigations showed that we had outliers in the anchor-anchor measurements.

First a short recap of how the new TDoA implementation works:
The anchors broadcast messages that are received by the tag (on the copter) as well as by all other anchors. The messages contain data that is composed of the TX time, RX of the latest message from all other anchors and finally the calculated distance to all anchors. The anchors record the RX time of the messages and use it, in combination with RX/TX data in the message to continuously calculate the distance to all the anchors.
When the tag receives a message it uses the RX time of the message in combination with the data in the message (RX/TX time and distances) to estimate its current position.

From this it is obvious that errors in the anchor to anchor communication will propagate to the estimated position in the copter.
What we could see was that we had outliers in the calculated anchor-anchor distances (tdoa.dist0-1 and so on), and our interpretation is that it was due to the increased distance and we are close to the useful range and that the quality of the communication was decreased.

So how can we solve the problem?
1. Improve the physical configuration. We found that if the anchors are mounted at a 45 degree angle, facing the center of flight arena we got better results. Also removing as many obstacles as possible to make sure there is free line of sight between anchors should improve the situation. It seems as you already fixed this since your anchor - anchor distances looks good.
2. Outlier detection and removal in the anchors. We have started to look at how to detect and remove outliers in the anchors. Assuming the anchor positions are static it should be possible to remove outliers and not pass the erroneous data on to the rest of the system. The idea is that less but correct data should be more useful than more and faulty data (at least in this case when the error is not nice noise).
3. Higher TX power. It is possible to set the TX power of the radios and indeed increasing the power increases the useful distance and improves the estimated position. The problem here is that there are laws and regulations that limits transmitted power why this solution must be used with care.
4. Anchor - anchor timestamp prediction. With static anchor positions it should be possible to predict RX time of messages from other anchors based on previous data. This could maybe be exploited to improve the system.

We are working on 2 and 3, let's see where we end up.

I tried to figure out the maximum useful range by moving an anchor around and observing the calculated distance to another anchor. I could get up to somewhere between 8 and 10 meters but with varying results. I think the size of your space probably is on the edge of what can be done in TDoA with the current configuration. Please note that the ranges advertised by Decawave are affected by a multitude of parameters such as TX power, packet length, data rates, preambles and so on - there are probably a lot of things to be done in this area.

I think the main reason that it works better in TWR compared to TDoA is that in TWR mode there are always a few anchors that are "close", in your case around 4 meters. In TDoA mode on the other hand, the anchor-anchor communication is experiencing the "worst case", around 8 meters.

Your packet loss looks reasonable to me and you seem to have fixed the anchor-anchor communication, so I think your system probably is in as good shape as possible with the current implementation. Please share any finding or improvements!
carlos.luis306
Beginner
Posts: 17
Joined: Fri Apr 29, 2016 1:53 pm

Re: Variance of TDOA2 measurements

Post by carlos.luis306 »

Thanks for the very insightful response!

I'll keep you posted if we achieve higher performance using the TDoA algorithm, and will look forward no any updates on your side.

Keep up the astounding work at Bitcraze!
Post Reply