Page 1 of 1

anchor 2 or 3 hang with TDMA run about 7 hours

Posted: Thu Sep 29, 2016 1:26 am
by justinleeyang
hi, arnuad:

I try run 4 tags distance with 3 anchors, pass 6 hours, but when run 7 hours anchor2 and 3 fail. TX,RX,SFD and RXOK LED no toggle, range fail.
anchor1 still range right, all tags also are normal. then I also try 2 tags with 3 anchors, likely anchor2 or 3 fail.

you have time to test it ? maybe problem ?

Re: anchor 2 or 3 hang with TDMA run about 7 hours

Posted: Thu Sep 29, 2016 3:15 am
by arnaud
Hi Justin,

I have seen such problem and I am investigating it. The anchors seems to stop working if there is a collision between the ranging of 2 tags (ie. if 2 tags transmits at the same time). There are (at least) 2 bugs:
1 - The tags should never stop, they should just fail the ranging of one of the tag. (I created a github issue: https://github.com/bitcraze/lps-node-firmware/issues/6)
2 - The TDMA algorithm should not let 2 tag range at the same time. The most likely reason is that one of the tag loses contact with Anchor 1 for too long. Anchor 1 is used as master clock for TDMA.

I will update this thread when I make progress. If you have a debugger for the nodes I am not against some help to find where the bug is ;-). My assumption is that there is a dw1000 error state I am not handling.

/Arnaud

Re: anchor 2 or 3 hang with TDMA run about 7 hours

Posted: Thu Sep 29, 2016 4:58 am
by justinleeyang
hi,arnaud:

for anchors, we add lock mechanism, in other words. when one tag is ranging with anchor x, we lock anchor x, if other tag range with anchor x at the same time. anchor x ignore it. what do you think ?

In addition, when power up, all tag firstly range with anchor1, for example, tag 1 running, when power up tag 2, how to ensure tag1 and tag2 no range with anchor1 at the same time?

Re: anchor 2 or 3 hang with TDMA run about 7 hours

Posted: Thu Sep 29, 2016 5:37 am
by arnaud
Hi Justin,

Yes the lock mechanism is very nice to have. How are you making sure that anchor x is not staying locked if, for example, the tag disappear? I was more thinking of a mechanism where if a POLL packet is received by an anchor, the anchor resets all internal timestamp and will answer only to the tag that sent the POLL. This way if there is a collision the latest anchor to send the POLL will be the one to get a ranging.

For the startup of the tag, one solution would be to make the tag wait for an anchor 1 report message for about 100ms for example and if none come start to communicate with anchor 1. If we modify anchor 1 to always send at least a packet every 50ms (ie. if no-one is currently ranging anchor 1 sends a packet at regular interval), it would solve completely the startup of the system.

Though, in practice, having the tag that disturbs a couple of ranging on the system at startup is not supposed to be such a problem, unless it hangs the anchors the way it is doing it right now. So I think the first priority is to make sure the anchors are never hanging, then the start sequence becomes much less of a problem.

Re: anchor 2 or 3 hang with TDMA run about 7 hours

Posted: Thu Sep 29, 2016 6:02 am
by justinleeyang
hi, arnaud:

when anchor x receive poll lock, and when report unlock.

I don't understand your method. why reset internal timestamp?

Re: anchor 2 or 3 hang with TDMA run about 7 hours

Posted: Fri Sep 30, 2016 2:31 am
by justinleeyang
hi, arnaud:

still 4 tags with 3 anchors, I feel that range interleave is 8ms, the position rate should be 125HZ, but find only 40HZ rate, so I reasearch the code, find
when no anchor1, the rangingInterval = 8ms, so when complete range with anchor1~3, we take 24ms, so 2D position only 40HZ.

Code: Select all

 if (current_anchor == 0) {
        int slotId = (boardId-9)&((1<<(DWM1000_TDMA_SLOTS_BITS+1))-1);
        uint64_t nextReceiveTime = (poll_rx.full&(~((1ULL<<(TIME_SLOTS+DWM1000_TDMA_SLOTS_BITS+1))-1))) + (slotId*(1ULL<<(TIME_SLOTS+1)));
        nextReceiveTime += 1ULL<<(TIME_SLOTS+DWM1000_TDMA_SLOTS_BITS+1);
        if (!synchronized) {
          // Starts well ahead to not risk starting in the past
          nextReceiveTime += 1ULL<<(TIME_SLOTS+DWM1000_TDMA_SLOTS_BITS+1);
        }
        rangingInterval.full = nextReceiveTime - poll_rx.full;
        synchronized = true;
      } else {
        rangingInterval.full = 1ULL<<(TIME_SLOTS+DWM1000_TDMA_SLOTS_BITS+1);
      }
rangingInterval.full = 1ULL<<(TIME_SLOTS+DWM1000_TDMA_SLOTS_BITS+1);

so when no anchor1 or current_anchor != 0, if I adjust the rangingInterval.full = 0, immediately range with anchor 2 or 3, is it OK ?
I know that you are preparing the Make Faire, Congratulations on your success!

Re: anchor 2 or 3 hang with TDMA run about 7 hours

Posted: Fri Sep 30, 2016 6:58 am
by arnaud
Hi Justin,

Thanks, yes we are currently at the Maker Faire and we have an LPS system setup, let see today how it works :).

For the lock: If you lock at POLL and unlock at REPORT there is a risk the anchor will never be unlocked: if the tag disappears before sending FINAL or if there is a collision on the FINAL packet. What I was thinking of doing is to lock for one anchor at POLL. So for example is tag0 sends poll, the anchor is locked to tag 0. If before the end of tag 0 ranging, tag 1 sends POLL, the anchor is now locked to tag1 and tag0 will be ignored. That way an anchor can never stay completely locked.

For the ranging speed, do you mean that you would like to range with all 3 anchors in one timeslot? This is something I was doing before but it was yielding to worth performance. We found that it was better to range with one anchor at a time so the kalman filter get info more often. If you increase the size of 1 slot and you set the interval for anchor 2 and 3 at 0 that should range with 1 2 3 in one slot. Though I am not sure this is going to give you higher update rate.

With 4 tag, you get a ranging rate of 120Hz (480/4) and so you range with 3 anchors at 40Hz (120/3) that seems correct.

Re: anchor 2 or 3 hang with TDMA run about 7 hours

Posted: Fri Sep 30, 2016 8:02 am
by justinleeyang
hi, arnadu:

for the lock:
yes, maybe always no lock. maybe add timeout mechanism likely rxTimeoutCallback method to exit lock. I will try it this weekend.
so you have tested your method and anchor no hang ?

for rangeing speed:
range with all 3 anchors maybe one timeslot or over one timeslot, in a word, I want to reduce the anchor1 time interleave with anchor2.