Yesterday we mostly worked out the detail of how we’ll be detecting neighbouring Phyllos.
Without further ado, here it is :
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.
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.
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:
- 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.
- All neighboring Phyllos receive it and synchronize their time reference.
- 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.
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 🙂
- 3D printing : behind the scenes
- Final LED tests
- A solid foundation
- IRoning out the Phyllo detection
- New Year, new skin
- Ruling the colony of Phyllos
- Update on Phyllos detection
- LED's do some tests
- Taking full control on our 3D model
- The magnet strikes back
- The PCB puzzle
- A false sense of symmetry
- Communicating between Phyllos : Who’s Who ?
- Working anatomy of a Phyllo
- About LEDs
- Generating 3D Models