3基站对1标签进行测距的流程如下:
1、标签发起测距poll,等待3个基站的回应resp;依次收到3个基站的resp后,发送携带时间戳的final;
2、基站等待poll;收到poll后,发送resp,再继续等待final;收到final后,提取时间戳,计算距离;每个基站都是上述流程
1、发起方发送的轮询POLL消息,用于触发测距交换。同时记录发送时间戳:poll_tx_ts
2、响应方接收到轮询POLL消息后,发送的响应RESP消息,允许发起方继续处理。同时记录接收和发送时间戳:poll_rx_ts、resp_tx_ts
3、发起者接收到RESP帧后,记录接收时间戳resp_rx_ts,再发送的最终FINAL消息,同时记录发送时间戳final_tx_ts,并将所有时间戳(poll_tx_ts、resp_rx_ts、final_tx_ts)打包在FINAL帧中,用于完成交换,并向响应方提供估算飞行时间(ToF)所需的所有时间戳信息。
4、响应方接收到FINAL帧后,记录接收时间戳final_rx_ts,并提取FINAL帧中的三个时间戳,根据自己记录的另外三个时间戳(poll_rx_ts、resp_tx_ts、final_rx_ts),开始计算ToF。
* The first 10 bytes of those frame are common and are composed of the following fields:
* - byte 0/1: frame control (0x8841 to indicate a data frame using 16-bit addressing).
* - byte 2: sequence number, incremented for each new frame.
* - byte 3/4: PAN ID (0xDECA).
* - byte 5/6: destination address, see NOTE 3 below.
* - byte 7/8: source address, see NOTE 3 below.
* - byte 9: function code (specific values to indicate which message it is in the ranging process).
* The remaining bytes are specific to each message as follows:
* Poll message:
* - no more data
* Response message:
* - byte 10: activity code (0x02 to tell the initiator to go on with the ranging exchange).
* - byte 11/12: activity parameter, not used for activity code 0x02.
* Final message:
* - byte 10 -> 13: poll message transmission timestamp.
* - byte 14 -> 17: response message reception timestamp.
* - byte 18 -> 21: final message transmission timestamp.
* All messages end with a 2-byte checksum automatically set by DW1000.
Poll帧格式
字节序号 | 0-1 | 2 | 3-4 | 5-6 | 7-8 | 9 | 10-11 |
字节类型 | 控制码 | 序列号 | PAN ID | 目标地址 | 源地址 | 功能码 | 校验码 |
字节数 | 2 | 1 | 2 | 2 | 2 | 1 | 2 |
内容 | 0x8841 | 0xDECA | 0x21 |
Resp帧格式
字节序号 | 0-1 | 2 | 3-4 | 5-6 | 7-8 | 9 | 10 | 11-12 | 13-14 |
字节类型 | 控制码 | 序列号 | PAN ID | 目标地址 | 源地址 | 功能码 | 状态码 | 状态参数 | 校验码 |
字节数 | 2 | 1 | 2 | 2 | 2 | 1 | 1 | 2 | 2 |
内容 | 0x8841 | 0xDECA | 0x10 | 0x02 |
Final帧格式
字节序号 | 0-1 | 2 | 3-4 | 5-6 | 7-8 | 9 | 10-13 | 14-17 | 18-21 | 22-23 |
字节类型 | 控制码 | 序列号 | PAN ID | 目标地址 | 源地址 | 功能码 | Poll帧发送时间戳 | resp帧接收时间戳 | final帧发送时间戳 | 校验码 |
字节数 | 2 | 1 | 2 | 2 | 2 | 1 | 4 | 4 | 4 | 2 |
内容 | 0x8841 | 0xDECA | 0x23 |