This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf52840 packet transmitting time measurement for TOA or TDOA

nrf52840 packet transmitting time measurement for TOA or TDOA

Hi I’m currently working with the given nordic project “nrf52-ble-long-range-demo

What I’m trying to do is measuring the sending time of packet from peripheral BLE device and arriving time of packet to central BLE device. Then with those time data I want to measure time of arrival (TOA) or time difference of arrival (TDOA) for checking distance between peri and central BLE devices in real time.

 

I got some questions while going through this project.

Q1) I sniffed some packets using wireshark when peripheral and central device are connected. What I could check is they are transmitting only empty PDUs between each other. Is there any way to store/load sending time onto this empty PDU? 

Q2) What I tried to do is putting RTC1 into manufacturing data in advertising packet to measure the sending time of packet. But the problem is that advertising packet is transmitted only before the connection is built between peripheral and central devices. So After they are connected, there is no way to transmit data. Is it possible to inject data in emptyPDU?

Q3) How can I change the type of packet from emptyPDU to other types like Data PDU or Control PDU? Control PDUs don’t normally carry data, so a preferable choice for me would be converting into Data PDU tho.

 

Q4) In terms of measuring sending time, it is the right way to check RTC1 to measure the time when the packet is transmitted? If it is not, should I use TIMER library?

 

I really hope to get explanation in detail. I’ve already gone through the code many times, so you can just mention the name of any methods or functions in code if you need. Thank you.

Parents
  • Hi,

    sorry, no answers on your questions, just my thoughts..

    - a radio wave passes 300m in one microsecond, max timer frequency is 16 MHz, so the best resolution you can achieve is 300/16=18.75m, maybe a bit better with averaging from multiple packets. Is this ok for you? Anyway, RTC crystal is not suitable for this, only HFCLK.
    - to implement ToA, you have to synchronize time on your devices with 1/16us accuracy, I can't imagine how it can be done.
    - for TDoA, you need at least three base stations and one anchor, seems this is not your case.
    - for ToF method (the one you actually going to implement), you don't need to insert any timestamp in your packets. You have to send a packet back to central with constant delay and measure time difference between two ADDRESS events (for sent and received packets).
    Anyway, it can be implemented only with direct radio programming, PPI and capture/compare feature, not on top of BLE stack.

    Maybe this post will be interesting for you, though it solves a different task.

Reply
  • Hi,

    sorry, no answers on your questions, just my thoughts..

    - a radio wave passes 300m in one microsecond, max timer frequency is 16 MHz, so the best resolution you can achieve is 300/16=18.75m, maybe a bit better with averaging from multiple packets. Is this ok for you? Anyway, RTC crystal is not suitable for this, only HFCLK.
    - to implement ToA, you have to synchronize time on your devices with 1/16us accuracy, I can't imagine how it can be done.
    - for TDoA, you need at least three base stations and one anchor, seems this is not your case.
    - for ToF method (the one you actually going to implement), you don't need to insert any timestamp in your packets. You have to send a packet back to central with constant delay and measure time difference between two ADDRESS events (for sent and received packets).
    Anyway, it can be implemented only with direct radio programming, PPI and capture/compare feature, not on top of BLE stack.

    Maybe this post will be interesting for you, though it solves a different task.

Children
No Data
Related