Distance calculation using time of flight in DWM1001

Hello Varun

You can find the units by looking at the definition of DWT_TIME_UNITS (seconds/dw time unit) and SPEED_OF_LIGHT (meters/second). This would mean the result of tof will be in seconds and thus distance in meters. Both these values are floating point, meaning they are more precise.

The main thing to calibrate is the antenna delay, since this is the only thing that should really change (unless you want to use the system in space / under water / a non-typical earth atmosphere, in which case you will also need to adjust the value of SPEED_OF_LIGHT). See APS014 - DW1000 Antenna Delay Calibration for more information.

An other thing that can be calibrated is the XTAL trim value, which allows to tune the crystal frequency and reduce the crystal offset ratio. This is depended on temperature and requires special equipment (A spectrum analyzer or frequency counter capable at measuring the center frequencies), making the solution in the example a bit more achievable. AFAIK the DWM1001 modules are factory calibrated for room temperature operation.