-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
twr_nranges_tdma example does not work when changing the preamble or/and data rate #16
Comments
When changing the preamble length and datarate you effectively change the length of the packet.
|
I've been working with what you mentioned and I can't seem to find a correct combination of parameters. They seem to communicate but when doing rangings, it seems like a missconfiguration is causing issues. PAN and CCP seem correctly configured but when doing rangings, the TAG device does not print any rangings. When looking at the Wireshark, this is what I'm sniffing: When the TAG sends the broadcast, sometimes the master_node responds correctly (but tag does not print any range) and afterwards, within the CCP_PERIOD, it does not answer anymore. These are the parameters I'm working with:
When I show the logs from the NODE, i see that all NRNG requests are being received and the first answered (I can see it as I registered a custom callback of the TX_COMPLETE):
I registered TX_COMPLETE and TX_ERROR callbacks and I can't register any errors on the TX. I can see the TX_COMPLETE as in Wireshark. I can't seem to understand what's is going on. I also registered a RX_TIMEOUT_CB and it's not triggering within the CCP_PERIOD thus the RX_TIMEOUT value seems correctly configured. The source of the issue seems the semaphore which is not being released previously for some reason. Thus, when it starts receiving after the first TX within the CCP_PERIOD, all the receptions are discarded. It is clear that after changing default RX_TIMEOUT and TX_HOLDOFF the master is able to respond once but it's not fully working... I'm surely missing something. Do you remember if there are any more parameters that could solve this issue? Or is it that I'm missconfiguring the timeouts in someway? Thank you very much for your time and help. |
The _HOLDOFF parameter is in us, essentially it should be the length of the packet plus the turnaround time for the board to go from receiving the request to sending the reply. For a 128bit (and us) preamble this is in the order of 600us, so when increasing the preamble length to 1024 you should increase the holdoff to something of the same order, i.e. 2000us is reasonable. 0x5000 is not reasonable as that's 20ms, i.e. you'll struggle to fit more than a single reply into the max possible rx-timeout. You may need to think about the maths a bit more. With 10 slots you have about 100ms per slot to play with. If the request takes about 1.5ms at 1024bit preamble (roughly) and you have 2ms holdoff... etc. Your RX_SFD_TO looks wrong to me, it should generally be longer than the preamble as otherwise it will timeout before the entire preamble is finished. Try something like 1032, or 1050. |
I've been testing and playing around with what you mentioned. Below ~2000s as the TX_HOLDOFF the NODE seems that it is not able to respond. Anyway, it seems that this value does not make things work properly. I've been testing around with the RX_TIMEOUT values too but they seem to have no effect on the behaviour. I've tested these RX_SFD_TO values too but same behaviour occurs. In case it helps, these are some stats I retrieved from the NODE and the TAG: TAGMAC ->
TWR_SS_NRNG:
NODEMAC ->
TWR_SS_NRNG ->
It seems like the RX_TIMEOUT and RX_UNSOLICITED is occuring but how? The MY_NEWT RX_TIMEOUT variables from what I can see in the code is for TOF allowance thus it shouldn't make sense changing them, right? Just for curiosity, if I head to the RX_CB at the TWR_SS_NRNG and make the semaphore release if previously it hasn't been released, things seem to work in Wireshark but in the TAG COMPLETE_EV_CB is not triggered thus it does not compute any rangings. For illustrating this: And then, If I execute it, I see on Wireshark all working good: Am I missing any other timeout / holdoff values? I'm currently working with this parameters:
NOTE: The calculation of the SFD timeout I initially did it was taken from the source code of the dw1000_hal.c : Anyway, I tested your values and what the dw1000_hal.c says and they do not work :( |
@ncasaril any hint? I'm kind of stuck on this. Thank you :) |
The best hint I have is to start from the working example and change one parameter at a time until it breaks. For instance, go back to the default set and only try preamble length 256. If that works, then up it to 512 etc. |
Board used: DW1001
After working for a while in a real environment, I wanted to higher the preamble and lower the data rate for longer distances and be able to extend the NLOS situation (as stated in the application notes from DecaWave).
After doing so, I found out that when I set the preamble/data rate to a different value results in "Receive Wait Timeout" obtained from the sys_status at the dw1000_mac.c.
I'm changing the datarate and preamble by establishing at the nrng_tag and nrng_master_node as follows:
UWBCFG_DEF_DATARATE: ""850k""
UWBCFG_DEF_TX_PREAM_LEN: ""1024""
I've tried to change TWR_SS_NRNG_RX/TX_TIMEOUT, NRNG_RX/TX_TIMEOUT, TWR_SS_TX/RX_TIMEOUT, TDMA_SANITY_INTERVAL, OS_LATENCY, UWB_CFG_DEF_SFD_TO.
I've also tried changing the PHR to Standard and SFD_TYPE to 0.
It's weird because I'm testing the same parameters in another evaluation board that contains the DW1000 and they communicate. It seems as it was an application level problem resulting in a rx_timeout event that I'm not correctly understanding. Also, I've seen that in certain configurations I see the tag trying to TWR_SS in the Wireshark but the anchor does not respond.
Have you got working the TWR_NRANGES_TDMA example with other data rates / preamble lengths? If so, could you share the syscfg.yml of the nrng_tag and nrng_master_node just in case I'm missing something?
Thanks!
@ncasaril some help into this would be amazing :) sorry for tagging as I know it may be annoying
The text was updated successfully, but these errors were encountered: