I’m trying to modify and run the example code for two-way ranging (ds_twr_initiator_sts.c and ds_twr_responder_sts.c) so they work in PDOA mode 3. But the ranging always fails. It seems that some extra modification is needed for this mode.
Could anyone please suggest what needs to be modified in this case, or which manual I can refer to regarding PDOA mode 3?
Could you please also help to explain a bit about the PDOA offset as well?
In the API guide, dwt_readpdoaoffset returns a uint16_t value, and it says this value is in DWT_TIME_UNITS (15.65 picoseconds ticks). I have no idea how to convert this value into an angle (rad).
In the example of ds_twr_responder_sts.c, I added code for reading diagnosis data (CIR and PDOA basically). The code is running fine in PDOA mode 3 with your help. I compared the PDOA read directly with dwt_readpdoa, and the PDOA I calculated with CIR imaginary and real part. They are almost the same. So I guess I’m getting the correct PDOA.
However, when I calculate AOA from the PDOA (arcsin(PDOA_rad/pi*0.5/0.45), I always get AOA estimations near zero, even if the actual AOA is 4/pi. If I read the measurements from the virtual COM port in UCI at the same distance and same angle, it actually gives good AOA estimations.
I’ve tried varying the actual AOA from -pi/4 to pi/4. The calculated AOA from PDOA is always nearly 0.
Could you please suggest what might be wrong or missing here?
I did some further analysis. It seems that in PDOA mode 3, the CIRs of STS and STS2 are very similar for both the imaginary and real parts. For example, the figure below shows the real part of STS and STS2 CIRs (last 200 samples). I guess that is why the PDOA is small and results in an AOA close to 0.
Do you maybe have any idea why this happens?
Thanks!