Ruling the colony of Phyllos

Yesterday we mostly worked out the detail of how we’ll be detecting neighbouring Phyllos.

Without further ado, here it is :

Step 1 : Discovery and identifier attribution

The first step for the Phyllos is to establish collectively which other Phyllos are present. Each Phyllo must therefore broadcast its presence and be given an identifier. 

This step must be repeated regularly in case Phyllos are switched on/off. 

As described in this post, we plan to base the protocol on wifi broadcast: a Phyllo regularly broadcasts its IP over wifi to signal that it is still on. The others register this IP address in a local running Phyllos table. After a while (let’s say a minute), if one Phyllo has not heard the broadcast of another, it will remove it from its active Phyllos table.

Step 2 : IR detection of the neighbours

When this stage is reached, all the Phyllos have a unique identifier and a list of the identifiers of all the other Phyllos present.

The detection protocol is inspired from this paper as follows:

  • The Phyllo with the lowest ID annonces its ID over Wifi. The ID is derived from the unique UUID register in the STM32.
  • At the same time, this Phyllo emits a 360 ° IR signal with an unmodulated carrier frequency f=56kHz generated by PWM on an IR LED.
  • Meanwhile, all the other Phyllos seek to detect the signal with a 56KHz rotary receiver.
  • They recognize the moment when the emitting Phyllo enters their field of vision because the receiver begins to receive, and the moment when it leaves the field of vision because the receiver cease receiving. Given the speed of rotation, this gives each Phyllo two angular values. The correct angle is computed as the average of the two. Given the frequency of 56KHz and the durations of the periodic gaps in the transmission, the precision is around 0.1 °.
  • They each update an internal list of their neighbours.
  • The next Phyllo starts over the same process (in the order of their IDs).

After that, every Phyllo knows who their neighbours are. 

You’ll note that collectively, this is enough information to determine the whole graph of neighbouring Phyllos.

Step 3 : Common time reference

We need a common time reference to be able to synchronize neighbouring Phyllos during the animations, for instance so that they can start previously uploaded animations at the same time.

To achieve this we use a breadth-first search algorithm to propagate a time reference from the root to the others over modulated IR:

  1. The Phyllo with the smallest ID this time emits an IR signal modulated on the carrier frequency, containing the information of the correct time reference.
  2. All neighboring Phyllos receive it and synchronize their time reference.
  3. Then, step 1) repeats itself for each neighbour in turn, one at a turn, and the time reference gets updated according to the elapsed time since step 1). 

To decide which neighbours go first, we could for instance have the phyllos send the list of neighbours to their neighbours, sorting them by their ID.

If the graph is not connected because the Phyllos are clumped in groups too far apart to detect IR but close enough to speak over Wifi, the algorithm will have to be performed for each connected component, starting from the smallest ID Phyllo of each component.

And now ?

We ordered receivers (TSOP4456) and transmitters (AA4040SF4S-P22) to test as soon as possible. 

The transmitter will be located inside the shell, on the rotating PCB. We will “fiddle” to increase its diffusion angle from 120 ° to 180 °. Also, we’ll try to make the IR range short enough that Phyllos too far apart would not be considered neighbours.

We will keep you posted 🙂

One Reply to “Ruling the colony of Phyllos”

  1. Is there a specific reason for the choice of the AA4040SF4S-P22 ? The TSOP48xx are most sensitive in the 950nm wavelength. The VSMS3700 emitter seems more suitable.

Leave a Reply

Your email address will not be published. Required fields are marked *