prathje / uwb-swarm-ranging

This project contains the PoC for Ultra-Wideband ranging using a single, broadcast message for simultaneous rangings to all other devices.
5 stars 2 forks source link

Ranging resolution bound to 0.3m #1

Open laran002 opened 2 years ago

laran002 commented 2 years ago

I have noticed 0.3m steps in ranging results when using the included ieee802154_dw1000 driver. I am thinking this may be related to the nanosecond resolution in net_ptp_time structure.

Is this something can confirm? if so: 1) Can you suggest a workaround? 2) Are you planning to extend the structure to improve the resolution?

prathje commented 2 years ago

Hi @laran002, the original Zephyr driver does indeed only support a nanosecond resolution which is not enough for UWB based measurements. So yes, I can confirm this.

My workaround was to extend a specific dw1000 api. You will find this API extension in the override folder (https://github.com/prathje/uwb-swarm-ranging/tree/main/override). I was planning to integrate that into Zephyr at a later point - if you need the functionality I am happy to provide it faster.

For now, you can copy those files into the Zephyr directory. Then you should be able to use the extended dw1000 api to receive the internal dw1000 timestamps. Please read the README in this repo as well since I needed to revert a specific commit.

prathje commented 2 years ago

FYI: You can now also use the feature branch: https://github.com/prathje/zephyr/tree/feature/dwm_1001_ranging_api

laran002 commented 2 years ago

Thanks @prathje,

I have patched my zephyr installation with your code, it worked out great. It turns out one have to be careful when writing to uart, since that can have impact on the timing. I have not looked deeper into why it at this point.

However, after cleaning up the code I get 16x higher resolution (LSB ~18mm).