Understanding and Correctly Implementing Antenna Delay Values in DW3000 TWR Mode

Hello, I’m delving into antenna calibration values and have encountered some confusion. The application paper mentions an aggregate antenna delay of approximately 514ns. However, while using a DW3000 in TWR mode, the code provided by Qorvo shows a value of 16530, which is significantly larger than the 514ns stated in the paper. Additionally, the decaRanging application indicates an antenna delay close to 573ns, and I’ve observed that it yields more accurate results than the provided code. Attempting to input 570 as the value in the code only led to poorer outcomes. Could you clarify what aggregate antenna delay refers to and guide me on how to correctly input this value in the code?

The antenna delay value is in chip units of 15.65ps. If 16530 is set in each device:
16530 x 2 x 15.65ps = 517ns

Ok, now it’s clear! But can I ask where is written? And why you multiply for 2 and 15.65ps?

Thanks for the help!

Because there are 2 devices doing the ranging exchange. Each is responsible for half the aggregate delay (assuming they are identical).

Also please remember that you’ll never get accurate results using a constant value for all units. The value will depend on the PCB layout and antenna type used. There will be a batch to batch variation between the chips. And even for two identical units using chips from the same batch there will still be unit to unit variation.
The only way to get an accurate antenna delay value is to measure it on every unit. The one time programmable memory on the device does have an space reserved for holding this value but it’s optional whether you use it or not.
With only two devices it’s impossible to work out the delay on each unit, you can only work out the combined total delay and assume it’s split evenly between the two. Which works fine if you only ever use those two devices. With more than 2 it’s possible to calculate the delay for each unit. There is a decawave app not on this and a lot of forum posts on ways to do this.