Ranging Variation too Large

Hi all,

I’ve had my two way ranging working for a while with custom boards and software using the DWM module, but I can’t seem to reduce the variation in the range estimates I’m obtaining. I have been using the symmetric double sided TWR as described in the manuals, but I just recently switched to the asymmetric variant described on page 213 of DW1000 user manual v2.05. Both give the same results for me thus far, and I’m trying to hunt down the source of my range variation.

My overall results look good if I average my range estimates over about a 1 second window (I’m ranging at 10 Hz), and I’m disregarding any range bias at the moment. Because of this, I don’t care about any antenna calibration delay. I’m assuming the XTAL trim loaded onto the DWM module is good enough for decent ranging, as well. My RF settings are as follow:

// channel configuration (taken from mode 3 of EVK1000)
dwt_config_t ch_config = {
.chan = 2,
.rxCode = 9,
.txCode = 9,
.prf = DWT_PRF_64M,
.dataRate = DWT_BR_6M8,
.txPreambLength = DWT_PLEN_128,
.rxPAC = DWT_PAC8,
.nsSFD = 0,
.phrMode = DWT_PHRMODE_STD,
.sfdTO = (256+64-32),
.smartPowerEn = 0
};

// calibrated tx values
dwt_txconfig_t tx_calib = {
.PGdly = 0xC2, // ch2
//.power = 0x07274767
.power = 0x00000000
};

And my reply time is 1ms right now for both tag and anchor.

I measured the variance as the 2*sigma width (95% confident interval) for Tround1, Tround2, Treply1, and Treply2 (DW1000 manual v2.05 page 213) as well as the final distance estimate (in cm). My reply times (1 and 2) vary by between 1.8-2.5 ns (due to discrepancies between rx time (full 40 bit) and scheduled tx time (only 32 bit as per DW1000 manual). The round trip times are 4ns variation for Tround1 and as much as 8ns for Tround2. These sound way too high. I’d expect some variation in addition to the reply time variations, but they’re more than double the reply time variation.

Is there a calibration I may have overlooked that will correct the ranging variation rather than the absolute range (bias)? I’ve instructed the dwt_initialise function to load the ucode for leading edge detection as well.

// One-time-programmable (OTP) memory loading
int otp_options = DWT_LOADUCODE | DWT_LOADLDO | DWT_LOADXTALTRIM;

// load from OTP and initialize DW1000
result = dwt_initialise(otp_options);
if( result != DWT_SUCCESS ) return DWR_RETURN_ERR;

// configure the channel
dwt_configure(&ch_config, otp_options);
dwt_configuretxrf(&tx_calib);

My final distance estimates have a 95% confidence interval of around 80 cm, while I’d expect on the order of 5-10 cm (from what I’ve heard from you all and from DW1000 data sheet v2.04 page 15).

Any help would be greatly appreciated!

Thanks,
-Paul

And I’ve fixed it! It was, unsurprisingly, a software bug of mine but I thought I’d share in case anyone else made the same oversight. I knew that the delayed TX only took as an argument the top
32 bits from the DW’s 40 bit timer. I had overlooked, however, that the least significant of these bits was ignored, leaving only 31 significant bits. This last bit was a random source of noise for me.
My range estimates are now free of noise (by any practical standards).

Happy coding!

1 Like