arduino-dw1000 icon indicating copy to clipboard operation
arduino-dw1000 copied to clipboard

multiple Tags - best way to achieve it

Open prideofisland opened this issue 7 years ago • 35 comments

Hey, My friend and I are struggling with implementation of multiple Tags in DW1000. Actually, we have already done it once by switching the channel. It goes as follows:

  • 3Anchors always use channel 5
  • Tag No.1 starts on channel 5, Tag No.2 on channel 4. -Tag No.1 does ranging with all 3 Anchors and switches to channel 4
    -Tag No.2 switches to channel 5 and does ranging with Anchors. If it collects measurements from all 3 Anchors, Tag No.2 switches to channel 4.

In general, it works. The main drawback is time resolution which really sucks. System initialization after channel switching lasts about two seconds.

We want to try sth different. We tought about dividing tags to time slots or introducing a variable 'it s your turn'. Do you have some better ideas than that?

Best regards, Piotr

prideofisland avatar Mar 30 '17 00:03 prideofisland

Hello @prideofisland, I'm also interested in implementing more tags.

As you said, best way was dividing tags in time slots in order to have only one Tag speaking in one time. But first you must know how many tags there are in system, and then, assign an order number to each tag to speak to anchors. There are some ways to do... It will be perfect to do a dinamically system, not close, that every tag will be able to know this information by itself...

I have found this protocol I think is very interesting for this system. It's call Token Ring Protocol: http://www-verimag.imag.fr/~tripakis/papers/its01.pdf

xforus avatar Mar 30 '17 07:03 xforus

Hi @xforus

As you said, best way was dividing tags in time slots in order to have only one Tag speaking in one time.

You're right. It would be a good solution but the time resolution will be two times lower when we want to use two tags.

I have found this protocol I think is very interesting for this system. It's call Token Ring Protocol Thanks for the link.

We are going to implement something different. As you now Tag saves all Anchors in networkDevicesNumber variable. We want to add the similar feature to Anchors (they will save messages from few Tags).

//each devices have a different reply delay time.
			_networkDevices[i].setReplyTime((2*i+1)*DEFAULT_REPLY_DELAY_TIME);

To get the system working we have to set other replay delay time for Tags too. 20170403_104325

prideofisland avatar Apr 03 '17 09:04 prideofisland

Hi @prideofisland, I'm happy to know you also want implement more tags. I would more time to dedicate with this but only have some time at some weekends.

Time ago, I also tried to do what you say about doing a list of tags in anchor device, but it don't work for me. There are more thing to keep in mind. Tags finally speaks in a kaos way...

I think that Tags have to sincronize between them. If there is a master Tag, this is easy... But I dont want to have a Master and what I have now is a system that every Tag generates an order number position reading its own short adress and from other tags. In this way every tag knows when start to do blinks or polls.

Tell me if you get something with method you say using reply delay time

xforus avatar Apr 04 '17 07:04 xforus

Hey @xforus . That's nice to hear. Hope, we ll have more luck. After two days of coding it can certainly be said that it's really complex thing to do. Despite this,we managed to establish first connection. multiple_tags_404 Our system is composed of two Tags(B1 and B3) and one Anchor(A2).

  1. Anchor receives two BLINKs from B1 and B2
  2. Anchor sends one Ranging_INIT to both of them (broadcast)
  3. Anchor receives two Poll messages from each of Tags
  4. Anchor sends one PollAck message (broadcast to all Tags)
  5. Anchor receives first Range(from B1 for example) msg and calculates the distance
  6. Anchor receives second Range(from B3 for example) msg and calculates the distance Measurement starts from third point.

There are still a lot of things to improve. I hope that I can share my results with you in the following week.

prideofisland avatar Apr 04 '17 12:04 prideofisland

Hi @prideofisland , this is perfect! Is exactly what I wanted to achieve. Are you using an old MAC version of code? Could you give me more details or make a branch? I would like to try your method and see what I could do.. Thanks!

xforus avatar Apr 10 '17 22:04 xforus

Hi@prideofisland Good to hear your idea. I am building one anchor and multi tag connections, too. The broadcast way is exactly what I reflect these days. I consider that this way: the anchor broadcast to multi tag and match the message to decide which tag to work, in another word, to control which distance to measure. It sounds like that the teacher call a student within lots to answer the question on class. (But I am not sure whether the response time is satisfying. ) :)

ghost avatar Apr 22 '17 09:04 ghost

Hi! I'm trying to add more than one Tag but I can't, I don't know how to control times. I have one Tag speaking with up to 6 Anchors. But when I try to coordinate more Tags, system is going too bad...

@prideofisland , @KeyYD Do you have better results? Could you give me more details how to implement this?

Thank you!!!

xforus avatar Apr 29 '17 13:04 xforus

Hi @xforus and @KeyYD , Yes, we managed to achieve the 2 Tags ranging with 3 Anchors. System works like as illustrated above. We set a fixed delay time for each Tag (7ms for Tag1 and 21ms). You have to do it in order to prevent signal collisions (microprocessor needs some time to process the signal. First thing you have to do is analayse MAC frames and find there timestemps.

2 Tags+3 Anchors --> 6 measurements in one cycle. Our data rate is about 20 measurements pro s. So about 3,3 cycles/s. It's not much faster than 'token' strategy but much more complicated to implement. It seems to me that it was not a perfect decision. We're going to upload a short video with our sensors. I'll post a link here.

prideofisland avatar May 02 '17 17:05 prideofisland

Here is the video: youtube

prideofisland avatar May 03 '17 12:05 prideofisland

Happy to hear @prideofisland . @prideofisland @xforus My system contains two tag and one anchor. And it can work, too! I didn't use POLL_ACK message but broadcasting way with time line controlled. Some of the point should be cared: Software:

  1. it will be better that the addresses of tag or anchor are decided by you, and not randomly.
  2. some part of library code should be adjusted to run the multi tag/anchor.
  3. the time line should be controlled.

Hardware:

  1. the current while working in the receiving mode is about 0.12A (You can see this in the picture) Here is my test version of anchor. (the DC regulated power supply shows that the current is about 120mA) anchor Still hacking : )

ghost avatar May 04 '17 01:05 ghost

we also implemted multi-tag. this will be available on the website in the next days. https://youtu.be/vubk64ok1TA

kuek avatar Jun 11 '17 18:06 kuek

Could you give me more details or make a branch? I would like to try your method and see what I could do..

Hey, Some people ask me to upload my code. I'm ready to do it. Should I make a branch? or a new repository? There are pretty much changes in code, new unit etc. I have also some MATLAB code for user interface and reducing errors. I've finished my adventure with DW1000 chip and will probably never again work with it. Anyway, I want to share my knowledge (and code) to help you develop this amazing project.

prideofisland avatar Sep 23 '17 13:09 prideofisland

@prideofisland Sounds good, the best way would be to split your new stuff into different topics and according branches.

For example I suggest following topics:

  • the driver for the dw are the files DW1000.h/cpp and DW1000Time.h/cpp
  • the package to build correct frames/packages DW1000Mac.h
  • the build in ranging of the class DW1000Ranging.h and DW1000Device.h
  • alternative ranging as example DW1000Ranging_**
  • examples for the library

Rotzbua avatar Sep 24 '17 09:09 Rotzbua

To use multiple tags localization on the same band I made a "Synchronizer". One tag that triggers the other tags in a synchronous way.

AlexisTM avatar Nov 17 '17 13:11 AlexisTM

@AlexisTM , I am also exploring on similar ideas now but hasn't found a solution. If possible, could you share some references you have used, please? Thanks.

kerr4huo avatar Nov 18 '17 03:11 kerr4huo

I am using Pozyx devices (DWM1000 + IMU).

I am not sure it is part of the default Firmware; but the Pozyx allows to call functions remotely.

Therefore I have one more device I am just using to synchronise. I send to the devices: Take your position measurement. The the foreign robot, I have a Python script polling for the interruption bit. When there is an interruption, I read the position.

Yet, the GPS like solution is the one which is scalable. Instead of ranging, you can send position and timestamps. Then, you have 2 solutions:

  • All devices are well synchronised in time: you have a direct measurement of time with the timestamps received and with 3 anchors position/timestamp you have your position.

  • Only your anchors are synchronised in time: you need to solve the time ambiguity thus need at least 4 anchors (just like we need 4 satellites to get a position)

AlexisTM avatar Nov 18 '17 08:11 AlexisTM

Hello ~@prideofisland
I see that you did some amazing projects I want to do something like you recently
,but when i download your project (multiple_Tags) I cannot use it the two tags can not work at the same time !! Can you please teach me how to use it ???

Note: i add the missing DW1000.cpp by myself because i see you deleted it and use the example DW1000Ranging_TAG

robintzeng avatar Jan 16 '18 11:01 robintzeng

@robintzeng The way I'm doing it for N tags is having N+1 tags.

N tags are waiting and the "+1" is triggering them one by one at a certain frequency. Therefore, only one tag at the same time is using the channel.

AlexisTM avatar Jan 16 '18 11:01 AlexisTM

hello !! @AlexisTM thanks for your reply I tried to change the channel to prevent the signal from being interrupted but when I used 2 Anchors on channel 5, 1 tag on channel 5, 1 tag on channel 3 they couldn't communicate well. And when I turned off the channel 3 tag the tags and Anchors on channel 5 can work well . Do you have any idea to deal with it ?? and can you tell me what channel you set the N+1 tag and your tags and Anchors on ??
Thanks !!  

robintzeng avatar Jan 18 '18 04:01 robintzeng

I.never said anything about channels, keep the same channel for all!

AlexisTM avatar Jan 18 '18 06:01 AlexisTM

ques

@AlexisTM
Is the system I drawn same as the system you talk about ???

robintzeng avatar Jan 18 '18 07:01 robintzeng

Yes; with 4+ anchors for 3D and 3+ anchors for 2D

AlexisTM avatar Jan 18 '18 11:01 AlexisTM

Like it. I will also try this also with my additional Localinos I have soon. The channel thingy makes sense for sure ;-)

pipsitel avatar Jan 18 '18 18:01 pipsitel

image

Right now I am testing the library for multiTags with all the anchors and tags on same channel. My understanding of the UWB is that

  1. On one channel only one tag can polI all the anchors at the same time, then the anchor pollAck
  2. Then tag add the anchor's Id into the network, and recognize anchors. And anchors also add tag into the network.
  3. Then tag transmit poll to all the anchors again.
  4. Anchor transmit Range message to the specify tag ID .
  5. Tag calculate the TOF and print the range value. So I just modified the code like the picture, trying to use Serial input to control the poll from tag. In my test, once I Serial input '0' to stop communication, then both the anchor and tag delete Device Id, Then I want to restore the poll, I Serial input '1', but can't restore. How can I control the poll from tag? By the way, I use Channel_5. I think once I can control the poll from tag then I can design a Synchronizer with Timer to control multiTags. All suggestions are welcome! Thanks!

And I still confuse about different channel's communication. Is channel's bandwidth overlapping, then can communicate with each other? or the central frequency? or preamble codes? Really needs help!

27016483_1102414213227634_1622179924_o

Aaron101010 avatar Jan 20 '18 12:01 Aaron101010

@robintzeng Reverse TDOA implementation: The anchors are messaging and the tags are passive (only listen). This means you can have as many tags as you want.

This is done by the Loco positioning system by Bitcraze for CrazyFlies, using the DWM1000.

Anchor software:

  • anchor.c: https://github.com/bitcraze/lps-node-firmware/blob/master/src/uwb_tdoa_anchor2.c

Tag software:

  • tag.c: https://github.com/bitcraze/crazyflie-firmware/blob/a4dc79f53af771788c8fc67275b07b29ccc7a3a1/src/deck/drivers/src/lpsTdoaTag.c
  • tag.h: https://github.com/bitcraze/crazyflie-firmware/blob/a4dc79f53af771788c8fc67275b07b29ccc7a3a1/src/deck/drivers/interface/lpsTdoaTag.h
  • config: https://github.com/bitcraze/crazyflie-firmware/blob/a4dc79f53af771788c8fc67275b07b29ccc7a3a1/src/deck/drivers/src/locodeck.c

AlexisTM avatar Mar 26 '18 14:03 AlexisTM

I put three Anchors around the 2m*3m competition venue。 (0,0) (2,0) (1,3) with height of 0.35m And the tag is on the robot with height 0.35m。The picture below is one of the 3 Anchors p_20180428_041735

The test video is with only 3 anchors and 1 tag in channel_7. https://drive.google.com/open?id=1TxSGrx_w0xiMKlBBKkp-kTj5YrbTJhDZ It works great.

Then I am trying to implement 6 Anchors 2 tags system. 3 Anchors and 1 tag are all in channel_7 and the other set of 3 Anchors and 1 tag are all in channel_4. Both tags works well with around 3 minutes. Then one set of the tag starts not to receive one of the 3 Anchors in same channel. Below picture is the two Anchors. I put 2 Anchors in same point. (0,0) (0,0) (2,0) (2,0) (1,3) (1,3) with height of 0.35m and 0.3m p_20180428_041745

I think maybe the problem is I put two anchors too close? And the electromagnetic wave is too strong, so it interrupt?

AaronZhu2018 avatar Apr 27 '18 20:04 AaronZhu2018

Hellow @prideofisland @kuek @AlexisTM. Above is the problem I encounter. Any advice is welcome. Really thanks!!!!

AaronZhu2018 avatar Apr 27 '18 20:04 AaronZhu2018

I've no clue on perturbation. Yet, the antennas are not omnidirectional. For best results, use the antennas straight. (Up to 5dBm difference)

Also, you can just do as I said before: start the localisation from a master device.

AlexisTM avatar Apr 28 '18 08:04 AlexisTM

@AlexisTM Thanks for your advice. I know what you suggest. But I think that your device is all on the same channel with the view to minimize the number of DWM module used. What about the update rate with your multi tags? And even I try one tag and one anchor on channel_7 and another tag and Anchor on channel_4 they still seems to interrupt after about ten minutes later. Have you ever meet this kind of problem? Thanks for your advice.

AaronZhu2018 avatar Apr 28 '18 09:04 AaronZhu2018

The rate is divided by N tags.

The other solution is using the Bitcraze firmware and have as many tags as you want.

AlexisTM avatar Apr 28 '18 11:04 AlexisTM