Two-way-ranging wrong distances

Hello, I’m using the DW1000 with an arduino and the DW1000-ng library. When using the RTLS exemple code to measure the distance between a tag and an anchor, the graph from the distances measured is not what is expected.
It’s a graph of the distances measured by the DW1000 against the real distances.
The expected distances are in blue and the measured ones are the black crosses.
We can see that around 1m the measurement is good but the closer the 2 DW1000 are the smaller the distance measured is and inversely.
When adjusting the antenna delay it only changes at which distance the measurement is good.
Additionnaly, around 30cm and closer the distance measured goes negative and so is showed as 0.
I don’t know what could be causing this issue and how to resolve it as I’m pretty inexperienced.
Thanks you

Are you compensating for received signal strength? The results you are getting look like you’re missing that.

The system is looking for when the received signal crosses a threshold. Since the signal ramps up over time rather than jumping instantly to the peak a strong signal will cross this detection threshold a small amount earlier than a weak one. This means that at short distances you measure too short a distance and at long distances you measure too far. As you indicated, the point where this correction is zero depends on how you have done the antenna delay calibration.

The correction for this isn’t nice, signal power is related to the square of the distance and the power to time correction isn’t particularly linear either. The application notes on error sources give example corrections or you can measure your own errors and apply corrections based on what you see.

One issue is that the DW1000 ability to measure the received signal power isn’t great. If you expect line of sight, or only care about accurate numbers in that situation, and know the transmitting antennas power level then you can cheat a bit. In that situation the received signal power is at first approximation purely a function of distance. You are already measuring distance.

Hello, another thing to explain this issue could be your setup.

Precision and Accuracy highly depends on the setup. For instance, if you are working on your desk, your laptop or screen may reduce the performances. I would advise to put your setup a minimum 1m from your screen (or any big metallic piece), and on poles (like camera tripod).