Esp32 + dw1000 or dw3000 uwb

Hello eveybody. I would like to ask about dw1000 or dw3000 TDoA implementation. I have a problem with TDOA in arduino code. I dont find a library TDoA. I found jremington library it use TWR not TDoA. It is very timing sensitive application therefore I use ESP32. Can you help me! Thanks all members.

1 Like

TDoA generally requires a set of networked anchors all using a perfectly synchronised clock. This is normally (but not always) done by distributing a 10 MHz clock to all the anchors using cabled connections.

In terms of infrastructure TDoA is a far more complex system than TWR and usually requires custom hardware. As such you’re unlikely to find much in the way of example code, most TDoA systems will be commercial closed source implementations.

Is there any specific reason you can’t use TWR?

Hello. Thank you for reply. I am thinking of using 4-6 anchors and 4-6 tags. I thought TDoA was suitable because the number of tags is much. Do you think this can be done with TWR instead of TDOA? Because the error should be low in the system. And is there a proper calibration code for TWR? I know the anchor calibration code in the Jremington library. Can we find a calibration code other than that?

It depends on the update rate you need but 4-6 tags is fine for TWR as long as you have a good TDMA system defined to sharing time between them.
Exactly performance you can achieve and how best to do the TDMA depends on how much you are willing to customise things for your specific application.
Low dynamics make life a lot easier, as does a constant group of tags. If things are moving quickly or different tags are constantly switching on and off or moving in and out of range then things get more complicated.

In terms of calibration it depends what you mean by “proper” calibration code. My early calibration system involved placing tags at known points and then measuring ranges between every possible pair of devices including tag to tag and anchor to anchor. My firmware is basically identical between the two, when a tag isn’t actively ranging it acts identically to an anchor, which makes this easy to do.
I then passed the true locations and all the measured ranges into a least squares solver and it calculated the antenna delays for each device. This took about 5 lines in python using numpy.

The final c# code ended up being a lot more complicated. It gave an interactive display and drove the whole process rather than simply parsing a log file. However the basic theory of operation for how the calibration was done remained the same.

In good conditions with a minor change the same code can also be used to calculate 2d anchor locations based on some initial estimated locations. This wasn’t as accurate as a good survey but normally ended up within around 5 cm of truth.

Hello. Yes, my calibration process is similar to you. However, the system increases its error after a certain period of time. I perform the calibration process by taking measurements for each module at a certain distance from each other and saving the resulting value as adelay. Which library did you use for this process? I use jremington library for dw1000 in github.

1 Like

I wrote my own code based on the user manual.

Are you compensating for temperature? That would explain it drifting off after it has been running for a while?

No. I do not regard the temperature. How can you regard it the process? And can you share your code? I would like to glance your code if it is okey for you.

The code is for a commercial product so unfortunately I can’t share it.
We read the temperature from the DW1000 and then apply a linear correction to the range based on temperature. We use a very slightly different distance per degree value to the one in the user manual but it’s not far off.

To come up with this I put a unit in the freezer for a couple of hours, pulled it out and put it in a fixed location. It then measured range constantly to a second unit that had been on and running for hours. I logged the measured range Vs internal temperature like this for a group of units. There was a common liner trend for them all which gave me the constant linear correction I use. After applying that correction each unit was repeatable but unit to unit there was a lot of difference and the results weren’t even remotely linear. However none of them had differences of over 1mm per degree C so as long as the calibration is done fairly close to the normal operating temperature the errors aren’t too bad.

1 Like

Thank you for your reply. I can try to control the temperature.