I have an issue regarding calibration of these tags, and I imagine plenty of people have had this issue and got around it, I’m just fairly new to the technology.
I have about 8 DWM3001CDK tags, I’ve written some custom firmware for them, but I’ve not fundamentally messed with any of the FiRa ranging stuff so it’s stock in that regard. It’s my understanding that the RESPF and INITF commands that come with the standard firmware use FiRa standard DSTWR. The mathematical formula for that should look like this (I think):
I’ll save you the full mathematical proof, but the slight differences in clock speed between the devices get cancelled out by DSTWR, very handy.
I decided to do some characterisation testing to make sure of this fact, and I got some unexpected results. I measured out a set distance, put my boards in the same spot every time (antennas in the same direction etc) and recorded the average distance readings it gave me. Suffice it to say, at 25cm, one board gave me an exact 25cm average, another gave me 0cm (it only starts measuring distance at about 30cm) and another gave me 40ish cm. Keep in mind these boards are all running the same firmware, and I’ve changed nothing about the ranging regimes. I have tested changing the XTALTRIM values of these boards, and I’ve found it to be temperamental at best, it often makes the distance values more accurate but less precise (lots of jumping around).
I’m not entirely sure why changing the crystal trim register would have much of an effect here, given that DSTWR should cancel it out (I am definitely using it, I have checked). I’m also not sure what the source of such a large offset would be when using the default crystal trim value (0x2e).
Is anyone able to give me an idea of what’s going on here, or point me in the direction of relevant documentation for it?
Hi @OJackson ,
When you say “one board” do you mean one set of boards, i.e., 2 boards? Otherwise, in TWR, both the initiator and responder should be reporting the same distance. If you are seeing different results when using 2 different sets of boards at the same distance, that would probably be related to antenna delay and can be calibrated if the distance error is relatively constant across a variety of different distances.
We also have application note: APS011: Sources of Error in DW1000-Based Two-Way Ranging (TWR) Schemes if you are interested here: Application Notes - Qorvo
Ah, no. What I mean to say is that I have a test rig set up where the initiator is constant (I never change that one), and I’m switching out the responders to find the difference between the distances they give for characterisation. For example:
Test 1: board 1 is the initiator, board 2 is the responder. Gives 25cm.
Test 2: board 1 is the initiator, board 3 is the responder. Gives 0cm.
Test 3: board 1 is the initiator, board 4 is the responder. Gives 40cm.
Sounds like classic antenna delay calibration issues to me.
Set 3 up in a triangle. Measure all 3 sides. Work out the amount you would need to add/subtract from each unit to make all the results correct. Set the appropriate antenna delay on each unit. Repeat until all units are calibrated.
You should now get the correct values.
Also on the xtal trim settings make sure you’ve let everything warm up and things aren’t sitting in a strong air current before doing this, it can be very temperature sensitive.
Oh that worked rather nicely - I think the temperature thing probably made a large difference there. I was previously cold-starting the units that I was swapping in, I didn’t know that they needed a minute to sort themselves out. Thank you.
Crystals are very temperature sensitive. Electronics always warm up when in use. The change is enough that you can see the frequency drift over time when first powered on. For the same parts they will tend to drift in similar ways with temperature. So if you calibrate them all at about the same temperature then assuming all devices in the system are in the same environment they will tend to have similar clock errors. Not the same but similar.
Also on the antenna delay calibration doing 3 at a time is in theory fine but I’ve found it does give slight errors. If you do this with 3 then swap one and switch everything’s locations you should still calculate a zero error on the two that were previously calibrated. That’s never the case. An alternative approach is to use a lot more than 3 devices at once. Measure all to all (so order n squared measurements, this can take a while if you are using averaged values rather than single results). And then use something like a least squares optimisation to find the antenna delays that best fit all the data. It doesn’t give the perfect answer for anything but it tends to give the least bad solution for general use.