Big jumps in LPS position in one spot

All discussions related to the Loco Positioning system
Post Reply
huizerd
Beginner
Posts: 9
Joined: Mon Aug 02, 2021 7:49 am

Big jumps in LPS position in one spot

Post by huizerd »

Hi all,

Our setup involves a larger drone with a Crazyflie 2.1 strapped on top for position estimation in combination with 8 LPS nodes. When flying a rectangle in XY, the position estimate seems to be correct most of the time, however large jumps in position occur in one of the corners, and sometimes we don't seem to receive position data from the Crazyflie. Both can be seen in the image below.

lps.jpeg

Do you have any idea what could cause this behaviour?

Thanks!

Jessse
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Big jumps in LPS position in one spot

Post by kristoffer »

Hi Jesse!

Which positioning mode are you running the system in?
huizerd
Beginner
Posts: 9
Joined: Mon Aug 02, 2021 7:49 am

Re: Big jumps in LPS position in one spot

Post by huizerd »

TWR mode
huizerd
Beginner
Posts: 9
Joined: Mon Aug 02, 2021 7:49 am

Re: Big jumps in LPS position in one spot

Post by huizerd »

I have more data from another flight, also with these strange jumps and missing data. But now, we also logged the individual TWR distances. Also, we observed that a disconnect happened during the flight, which could explain the missing data? Please find the plots below. Thanks!

bitcraze.png
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Big jumps in LPS position in one spot

Post by kristoffer »

I'm not sure what is going on but let's try to figure out. I have some more questions:

Where are the anchors located, in the corners?

The axis in your graph indicates that your flight space is around 8x16, is this meters?

Is the problem reproducible and do you see the same behavior every time at the same location?
Do you see the same errors from the same anchors or are different anchors involved?

I'm a bit surprised by the part where you miss data from all anchors at the same time. In TWR the Crazyflie is driving the process by transmitting packets to anchor 0, 1, 2 and so on. If one anchor is missing a packet (maybe it is too far away) that anchor will not respond and it will be lost for a while, but it is weird that all anchors are lost at the same time.
huizerd
Beginner
Posts: 9
Joined: Mon Aug 02, 2021 7:49 am

Re: Big jumps in LPS position in one spot

Post by huizerd »

Yes, the anchors are in the corners of the flight space, which is 8x16x3 (xyz) meters. We did two flights where the drone was controlled manually (data shown before), and it seems to be roughly the same spot. The anchor distance logging also shows that in both cases, anchor 2 gives weird measurements. Anchor 2 is located in the lower plane on the top right corner of the flight space (8, 16, 0), which seems furthest away from the spot where the corrupt/missing data is.

We think the missing data from all anchors at the same time can be explained by a disconnect between crazyflie and crazyradio. Because our own loop has blocking reconnect code, it doesn't continue logging, but because we fly manually and the crazyflie is strapped to another drone, the flight continues. As soon as it reconnects, it seems to the logger as if the drone has "teleported". Does this make sense?

Also, am I correct in assuming that TWR doesn't have outlier rejection, hence the large influence of the corrupt measurements on the position estimate? Maybe we would be better off with TDoA3, which does have outlier rejection?
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Big jumps in LPS position in one spot

Post by kristoffer »

Thanks for the clarifications!

As you observe the problem in the same area repeatedly I think we can assume it is mainly related to the geometry of the system. Like you noted it is maybe related to the distance to the anchors. 8x16 meters is a fairly large system, I guess you have increased the transmission power of the UWB radios on both the Crazyflie and the anchors (compile flag in the Crazyflie and configuration in the anchors) to reach this far?

TWR actually has outlier rejection based on the standard deviation, but it is implemented down in the deck driver (https://github.com/bitcraze/crazyflie-f ... #L239-L262) as opposed to the TDoA outlier rejection that is implemented in the EKF.

One thing I'm curious about is the graph with distances to the anchors. The weird values you get seems to be negative which does not make sense from a physical point of view. Are you logging the ranging.distance0 to ranging.distance7 log variables?
A negative value could indicate that there might be some sort of bug in the distance calculation when reception is bad?
It would be easy to filter out any negative values in the outlier rejection which would maybe be an interesting experiment?

I also see that you get negative values for the blue, gray and orange anchors, does this correspond the anchors that are furthest away?

You could try to use TDoA3 but there is a risk that you will run into other problems instead. In TDoA the anchors are essentially doing TWR between each other and the anchors that are furthest away will maybe have a hard time reaching the other side. This would maybe give poor positioning information in the center of the flight space.
We don't have that much experience in systems this big but in TDoA3 there are a few options:
1. You can add a couple of more anchors half way on the 16 meter sides (TDoA3 supports 8+ anchors). This would potentially also improve your Z estimation in the center of the flight space.
2. If you already are at full TX power and the range is not enough, there is a possibility to use a longer preamble in the UWB packets. This functionality is experimental and not fully tested but I played with it a few years ago and got fairly good 2D positioning in a 80x80 meter space. Let me know if you want to try it out, I would have to dig into the code a bit to figure out how to enable it.
huizerd
Beginner
Posts: 9
Joined: Mon Aug 02, 2021 7:49 am

Re: Big jumps in LPS position in one spot

Post by huizerd »

Thanks!

We have indeed set the tx power on both crazyflie and anchors to max. And indeed, we're logging the ranging.distance0-7 variables.

We'll try with adding the rejection of negative values; if it works, I'll let you know and we could maybe put it in master. Also, I saw that there's another "robust" implementation of integrating TWR distances into the Kalman filter, maybe this also helps?
kristoffer
Bitcraze
Posts: 630
Joined: Tue Jun 30, 2015 7:47 am

Re: Big jumps in LPS position in one spot

Post by kristoffer »

It could be interesting to try the robust TWR. Note that you must make sure that the EKF has converged before turning the rubust flavour on
Post Reply