Virtual Pheromone Based Network Flow Control For Modular Robotic Systems

: Guaranteeing data transmission between modules is the key for application development of modular robotic systems. In a multi-channel modular robotic system, intersection modules play an essential role of communication channel selection in controlling data ﬂow toward desired destinations. The gradient-based routing algorithm is an ideal solution to create an one-way communication path from any robotic module to a designated destination. To create bi-directional communication for a communication path of robotic conﬁguration, virtual pheromone-based routing algorithm is a promising mechanism for intersection modules due to its simplicity and distributivity. In this paper, we address a virtual pheromone based network ﬂow control based on the integration of gradient and virtual pheromone-based routing algorithms. We validated this method through an education and entertainment application using our newly developed modular robotic system.


Introduction
Inspired by using natural ant pheromone in path searching and selection [1], the idea of artificial pheromone has been applied for many robotic systems [2]. Pheromone inspired stigmergy has advantages of simplicity and distributivity so this approach provides a suitable solution for robotic modules with limited computing resources. Artificial pheromone was used for robot foraging, group following, and cooperation in applications of modular robotic systems [3][4][5][6][7][8][9][10]. Light intensity Both global and local communication protocols have its own limitation in these existing modular robotic systems. Some types of hybrid communication was exploited but these approaches bring complexity to the hardware infrastructure. As a result, broadcasting becomes the most popular method for data transmission between robotic modules [18]. To illustrate this fact, we provide a comparison of the key properties of communication methods of the existing modular robotic systems including our system as seen in Table 1. We see that application-oriented design is the main research of such systems while communication is only considered as a simple data transmission protocol. Controlling data flow in a given configuration was only studied in a few systems but these routing protocols are relatively simple. We consider these approaches as the top-down design approach, focusing on application rather than system level. Meanwhile, we believe that, in order to enable scalability and flexibility of a modular robotic system for numerous desired applications, we must pay particular attention on a robust communication protocol that is capable of dealing with data flow in a given configuration, which can be also considered as the bottom-up design approach of modular robotic systems.
The idea of virtual pheromone based communication path selection with low computational complexity has been becoming more popular in mobile ad-hoc networks. However, this research direction has been not mature, especially in modular robotics. One typical example can be found with using virtual ants for path construction in a robotic network [19]. The communication path is used for transmitting information between food sources and a nest by mimicking the ant foraging phenomenon. However, virtual ants are sent between the nest and food sources with a fixed rate and a specific packet is required to update the network topology during operation, leading to conflict between virtual ants at the intersection and overused communication resources.
In [20], we have implemented a simplified virtual pheromone technique for information foraging to reducing the excessive virtual ants and updating signal in modular robotics. We developed the virtual pheromone inspired algorithm in which the nest sends out virtual ants, so-called forward ants, and wait for return ants from the food source. All robotic modules along the communication path randomly select communication direction without neighbourhood information. Once virtual ants reach food sources, they return to the nest and accumulate the virtual pheromone concentration on the modules along the path. If a forward ant is lost on the way back, the virtual pheromone concentration is reduced by the effect of danger warning parameter. A communication path can be established with high time-consuming cost. In addition, neighbourhood awareness and link maintenance are neglected in [19,20]. Therefore, although they demonstrated the advantages of the virtual pheromone techniques in robotic networks, it is not realistically practical for modular robotic systems.

Problem Formulation
Selecting a proper communication path is critical for application development of modular robotic systems. A typical example of multiple communication paths joining at an intersection in a modular robotic system can be seen in Figure 1, where the intersection plays the key role in the network flow control for inter-communication between modules. A complex communication protocol with a memorized routing table or a master-slave mode cannot be applied for modular robotics because physical connections of robotic modules are rapidly reconfigured. A distributed and simplified communication protocol could be an ideal approach to solve this challenge.
In our previous work [17], we designed a distributed communication protocol for modular robotic systems. The protocol was developed in the four-layer hierarchical architecture: physical layer, link access and management layer, transport layer, and application layer (refer to Figure 2 and detailed explanation in [17]). The physical layer deals with neighbourhood communication between modules. This layer was developed on the hardware characteristics of communication mechanism including data transferring medium, transmission rate, and signal frame. The link access and management layer is responsible for discovering, establishing, and maintaining bidirectional communication links between physically connected neighbours. The transport layer is capable of managing data flow through a network of inter-connected directional communication links. The application layer provides a platform for application development. The four-layer protocol governs communication functionalities dealing with user-demanded reconfiguration of modular robotics. However, this protocol does not include a routing protocol capable of handling inter-communication of reconfigurable robotic systems for several potential applications. We implemented a gradient-based routing algorithm as a simple but effective communication path construction method for data delivery between modules [39]. We employed "integer" gradient as temporary identifications (ID) for robotic modules. All the modules have no gradients at the beginning but they can be automatically assigned a gradient value in order when any module is activated with the first gradient. Once a designated module is activated as a root by an user, it is initiated with the lowest integer gradient. Gradient of the other modules is automatically increased when the root spreads out its gradient to immediate neighbours. If a module receives more than one gradient from its neighbours, it only selects and processes the lowest one. Eventually, every module in the network has its own gradient, thus a shortest communication path is automatically formed by all the modules following the gradient descent to the root. An example of a network of robotic modules with the gradient-based ID can be seen in Figure 1. Note that some robots might have the same gradient because they belong to different communication paths.
Using the gradient-based routing as shown in Figure 1, there exist three typical intercommunication models between the root and other modules: (1) one-to-many; (2) many-to-one; (3) one-to-one. In the one-to-many model, the root sends data packets to other modules by a broadcasting communication protocol in which data packets can be relayed and transferred by following the gradient ascent. In the many-to-one model, the root receives data packets following the gradient descent from any other modules. In the one-to-one model, data packets are transmitted to the root by following the gradient descent, similar to the many-to-one model, but cannot be transferred from the root to any other modules by following the gradient ascent because there are more than one communication paths with the same gradient ascent. That is, if the root plays the role as a "sensor or "brain" in the "sense-think-act" model of a robotic system, its commands may not properly reach a "brain" for data processing or an "actuator" for actions. Indeed, an adaptive routing algorithm for a bidirectional communication path in a network of physically connected robotic modules is required to develop practical applications.
In the one-to-one model, the gradient-based routing is only capable of generating an one-way communication path from any module to the root, but not from the root to other modules. The intersection module plays a crucial role in relaying and forwarding data packets received from the root to the right directional neighbour of the desired route. However, this module encounters difficulty if it has more than one neighbours with the same gradient. We see two possible technical solutions for the intersection module to handle this issue: broadcasting data packets to all the directional channels and randomly selecting a directional channel to send data packets. The former is a typical case of the one-to-all model in which data packets are forwarded to all the other modules in the network. However, an encoding method must be used to encrypt data packets and communication resource is overloaded, which is not realistic due to limited computing power and communication bandwidth of modular robotic systems. The later relies on randomness of channel selection so it also requires encryption of data packets thus encountering the limitation of overloading bandwidth and missing data packets.
Indeed, both the broadcasting and random selection methods are not ideal solutions for generating a directional communication path from the root to any module in the one-to-one model. In order to control data flow on a desired bidirectional communication path, we need to develop a communication mechanism that is simple enough to be executed on robotic modules, especially on intersection modules, but capable of directing data packets to desired destination at the highest possibility. Inspired from the natural pheromone of ant colonies and our observation on user's behaviours in modular robotic systems, we propose virtual pheromone-based network flow control for transmitting data packets from the root to any module. We believe that a combination of gradient-based and virtual pheromone-based routing methods is a complete solution for creating a bidirectional data communication path from the root to another module in modular robotics.

Virtual Pheromone Based Network Flow Control
This virtual pheromone based network flow control is a combination of gradient-based and virtual pheromone-based routing algorithms. The gradient-based routing forms an one-way directional communication path from any module to the root. Meanwhile, the virtual pheromone-based routing acts in association with the gradient-based routing algorithm in controlling data flow from the root to any module. Note that both gradient and virtual pheromone-based routing algorithms must be executed on the foundation of the physical layer and link access & link management layer in the distributed communication protocol [17]. and their probability of data communication is conditionally constrained with the probability of the neighbourhood discovery & awareness, and link maintenance. We explain how the virtual pheromone based network flow control algorithm is developed as follows:

Neighbourhood Discovery & Awareness and Link Maintenance
We briefly summarize the key characteristics of the neighbourhood discovery & awareness and the link management to show the probability of transmitting data packets. More detailed information of this layer can be found in [17].
Neighbourhood discovery & awareness: All the modules are considered in free state at the beginning; that is, a module may have maximum N physical communication channels available for the neighbourhood discovery & awareness. They periodically send out "hello" signal through its physical channels to search for neighbours. When "echo" and "confirmation" signals have been received, the involved modules change the stage from free to busy. The channels receiving "hello" are marked passive and the other are marked as active. As a result, a vacant channel with the newly identified neighbour is updated to occupied state. The number of physical communication channels available for the neighbourhood discovery process on such a module is reduced to n, n < N. If a module does not receive an "echo" in a directional channel, it continues searching on other channels. Here, the deadline for echo to be received is set equal to three time the duration of closing interval t c .
When two robotic modules are physically connected, their directional channels are aligned for line-of-sight communication. On a robotic module, signals are only sent over a selected channel for a short period of time, hence P s = 1. A successful neighbourhood discovery process on a module occurs when signals are correctly received. The probability for a successful neighbourhood discovery process between two free modules is where the closing time t c is caused by the receiving robot when it performs the discovery process on other channels; the processing time t w1 is the interval between two consecutive discovery processes when the robots are in free state. The time factor F tr represents the serial processing characteristic of robotic modules. When free modules send out "hello" signal, but the connected modules might be busy searching for new neighbours on other channels that have not yet occupied, the probability for a robot in busy state to discover a robot in free state is Note that n = N when the robot is in free state as in Equation (1). Link maintenance: For a robot in busy state, the closing time is added up due to the link maintenance process. The time factor becomes F tr where the time factor F d is used for the discovery process with t w2 as the processing time in busy state, and the time factor F m is used for the maintenance process with t w3 as the processing time of the link maintenance process. As a result, the probability for a robot to recognize a neighbourhood module in busy state is At this state, the robotic module has recognized the direction of its neighbour from the neighbourhood discovery process, thus the probability for a link maintenance signal can be received by its neighbour is calculated as:

Gradient-Based Routing Algorithm
After discovering to obtain neighbourhood information, we explain how the gradient-based routing algorithm is used to generate communication paths for delivery of data packets from any module to the root.
An example of a configuration of physically connected robotic modules with automatically generated gradient-based ID can be seen in Figure 1. The root is activated with the lowest gradient, i.e., zero, and the gradient is dispersed over its neighbour so the other robots receive their corresponding gradient, which is increased from the root. Some modules might have the same gradients because they belong to different paths. A gradient dispersion algorithm can be seen in Algorithm 1. if module ← gradient request then 3: root gradient generation 4: broadcasting gradient to neighbours 5: else if module ← gradient from neighbour then 6: check current state 7: if empty gradient then 8: process gradient 9: propagating gradient to neighbours 10: else if existing gradient is greater then 11: update gradient 12: propagating gradient to neighbours 13: else if existing gradient is smaller then 14: keep current gradient 15: end if 16: end if 17: end procedure Once the gradient has been generated, it is automatically adjusted in a distributed fashion by a path recovery mechanism. If a module is manually removed from the network configuration, e.g., B 2 in Figure 2a, its neighbours are aware of disconnections through the link maintenance process. B 2 has a smaller gradient than B 3 , so B 3 requests a new gradient from its remaining neighbours. Meanwhile, B 1 remains its existing gradient as it has smaller gradient than B 2 . Hence, a new path is formed with the updated gradient of involved robots. On the other hand, if a new module is added to the network configuration, e.g., B 2 , it collects all the gradients from its immediate neighbours and selects the lowest one. To let its neighbour update their gradients, this module will transmit its gradient to all of its immediate neighbours. As a result, a communication path is constructed by involved modules without a centralized control from a master. This path recovery mechanism can be applied for any distributed modular robotic systems.
While local communication between neighbourhood modules is well managed by the physical layer and the link access & management layer [17], a path recovery mechanism with its gradient recovery procedure is used to deal with reconfiguration of communication networks. An algorithm of communication path recovery can be seen in Algorithm 2. if current state ← neighbour then 5: send gradient to new neighbour 6: else if lost neighbour then 7: check current state 8: if lost neighbour has greater gradient then 9: keep current gradient 10: else if lost neighbour has smaller gradient then 11: clear current gradient 12: request gradient from other neighbours 13: end if 14: end if 15: end procedure Without using the gradient-based routing algorithm, the probability for a data packet to be transferred from any module to the root through a communication path of k connected robotic modules by a random physical channel selection on any robotic module is: In contrast, once the gradient generation has been successfully achieved through the network, the probability of delivering a data packet through a communication path of k connected robotic modules only relies on the probability of the neighbourhood discovery & awareness and link maintenance processes as calculated in Section 3.1. Using these processes, the physical channel matching between neighbourhood robotic modules has been successfully achieved prior to one-way directional communication path establishment, thus we can increase the probability of delivering a data packet on such a communication path of k connected robotic modules: On the opposite direction, data packets may not be precisely delivered from the root to any robot because the intersection modules do not know which direction it should forward such data packets through. We apply a virtual pheromone-based routing algorithm for the intersection modules to direct data packets from the root to any module as explained in the next section.

Virtual Pheromone-Based Routing Algorithm
In nature, ants lay their pheromone on the trail. Ants use pheromone as implicit communication to search for the optimal path between food sources and their nest. At the beginning, ants randomly spread their pheromone out during their searching and exploration. Ants instinctively select their paths based on the pheromone concentration-the highest probability is selected. The more ants on a path, the higher the pheromone concentration on that direction, and the higher the pheromone concentration, the higher possibility the number of ants selecting this way. There might exist multiple paths between food sources and the nest but the path with the highest pheromone concentration becomes an optimal path as it is highly selected by ants. The pheromone concentration on an existing path is automatically evaporated over time, thus ants can search for new food sources when less food available on the existing food sources. In general, number of ants travelling on a path is proportional to the pheromone concentration of such a path. Therefore, ant pheromone-based path formation and selection is done in a distributed fashion.
Inspired from ant pheromone-based path formation and selection, we develop a routing algorithm using virtual pheromone for selecting and creating communication paths in modular robotics. On a robotic module, a data packet is considered as a virtual ant when received in or sent out from a physical communication channel, thus virtual pheromone of such a virtual ant is accumulated on such a physical channel of the robotic module. The more virtual ants going through a physical channel, the higher virtual pheromone concentration accumulated on it. To maintain the balance of the overall virtual pheromone on a module, increasing pheromone concentration on one physical channel leads to decreasing pheromone concentration on other channels. Hence, virtual pheromone concentration becomes the key factor for physical channel selection on a robotic module: the higher pheromone concentration on a physical channel, the higher possibility the channel being selected as the communication path. A simple scenario of selecting a physical communication channel is illustrated in Figure 3. The pheromone deposition rate d: A virtual ant passing through a physical communication channel i leaves an amount of virtual pheromone on the channel. Consequently, the pheromone concentration C i of such a channel is adjusted: with N > 2 is the condition for virtual pheromone to operate on each channel. The pheromone concentration of the other channels C j is re-adjusted accordingly: Note that N − 2 is the number of physical communication channels with the pheromone concentration C j =i on the module, except for the receiving channel and the forwarding channel selected based on the pheromone concentration C i The pheromone evaporation rate e: Similar to ant pheromone concentration, the virtual pheromone concentration on a physical communication channel automatically evaporates over time, leading to flexibility of communication path selection. Obviously, the evaporation rate must be smaller than the deposition rate in order to maintain the physical communication channel: e << d.
Evaporation only occurs when the virtual pheromone concentration is different from the initial state. The interval between two consecutive ants passing through a channel t 1 and t 2 can vary but evaporation time is set to a constant value ∆t.
In summary, the virtual pheromone concentration of a physical communication channel i on a robotic module after a communication process is calculated as: and, the pheromone concentration of the other physical channels C j is re-adjusted accordingly: The virtual pheromone concentration represents the amount of information passing through a physical communication channel of a robotic module. The higher pheromone concentration on the channel, the higher possibility the channel being selected for data communication. The probability of a physical communication channel i th of N channels on a robotic module is selected: where d and e can be selected by users in different applications. On a robotic module, the probability P i is the decision factor for which physical communication channel is selected to forward data packets on the directional communication path from the root to any module in a robotic configuration.

Virtual Pheromone-Based Network Flow Control
The gradient-based routing algorithm [39] is capable of generating one-way directional communication path from any module to a root in a network of physically connected robotic modules. The probability of transmitting data packets from any module to the root by following the gradient decent is guaranteed at the probability of the neighbourhood discovery & awareness and link maintenance process, which is mostly based on the user's behaviours. However, data packets cannot be precisely delivered from the root to any module in the network by following the gradient ascent because the intersection modules may not identify the proper physical communication channel for such packets. The virtual pheromone mechanism can be used as a probabilistic switching for the directional channel selection, especially for the intersection modules responsible for relaying data packets to proper communication channels in the direction from the root to other modules.
The probability of forwarding data packets in the direction from the root to any module is equal on all the physical directional channels at the initial stage: (13) where N − 1 channels are available because one channel is used to receive data packets from the root.
The virtual pheromone adjustment mechanism on the intersection modules starts differentiating the level of virtual pheromone concentration, so the concentration level on a channel i receiving data packets is adjusted by Equation (10) and the probabilistic switching of the channel i calculated by Equation (12). The virtual pheromone concentration plays a key role as the decision making factor whether this channel is selected for forwarding data packets from the root to any module.
In summary, the gradient-based routing algorithm is used to create any-to-root communication paths while the virtual pheromone-based routing algorithm is applied to form root-to-any communication paths. A combination of the gradient and virtual pheromone-based routing algorithms is a complete solution of generating bi-directional communication paths for the network flow control in modular robotics. Hence, we define this method as the virtual pheromone based network flow control.

Hardware Platform
Our robotic modules, named moreBot, are designed for research and edutainment purposes. The module is 7 cm cubic shape, fabricated by a 3D printer using ABS plastic material. On each face, four pairs of magnet cylinders are used to secure the physical connection between modules. A moreBot module, so called building block, is equipped with several sensors and actuators, e.g., an accelerometer, light detectors, microphones, RGB LEDs, a buzzer and differential wheels. On the face's center, a pair of infra-red transceiver is employed for line-of-sight communication and distance ranging measurement. Each moreBot is governed by a XMEGA128A3U micro-controller running at the frequency of 32 MHz. Thanks to the Universal Synchronous Asynchronous Receiver Transmitters (USART) built-in function, each pair of infra-red transceiver is directly managed by an USART port for independent directional communication. The interface with a computer is done via USB or RF device. The building blocks can be programmed through the standard PDI or the boot-loader via the USB port. One moreBot block is powered by four AA batteries. A set of moreBot can be seen in Figure 4.

Neighbourhood discovery & awareness:
In this section, we demonstrate the neighbourhood discovery & awareness and link maintenance processes between the building blocks.
In general, robotic modules gather information of its immediate neighbours to establish the neighbourhood communication between them. We used color from the RGB LEDs to indicate the number of physical connections or communication channels of the building blocks. Blinking Red indicates unconnected blocks while steady Blue, Green, Cyan, Yellow, Magenta or White indicate number of neighbourhood connections from 1 to 6, respectively.
To illustrate the effectiveness of the neighbourhood discovery & awareness, a random morphology is constructed in Figure 5. At the initial stage as shown in Figure 5a, five blocks were in free state while they were blinking in Red. The robotic blocks recognized its neighbours only when they were physically connected. As soon as the block discovered a neighbour, its color changes accordingly to indicate the current state. As depicted in Figure 5b, those blocks were in steady Blue because they had one immediate neighbour while the middle one displayed Green as it recognized the second neighbour. At the third stage, we joined two isolated chains of building blocks together to make an united network with three terminals as seen in Figure 5c. One block turned to Cyan because it had found three neighbours. Finally, when we disconnected one block as shown in Figure 5d, the isolated block turned to blinking Red because it lost all neighbours while its former neighbour turned from Cyan to Green as it only had two neighbours. In the physical layer, the standard data frame 8N1 consisting of 8-bit data, non-parity, and 1 stop bit is used. We temporarily excluded the error checking function in this experiment. Table 2 shows parameter setting of the communication process. In the second layer, we set t w1 to 300 ms for robotic modules in free state. The t w1 is the average time between two consecutive discovery signals, which is also a processing time for a channel. A discovery signal is completely transmitted within 1.8 ms, which is the closing time t c . We configured the modules to send only one signal, equivalent to 0.6% of t w1 for reducing energy consumption. The probability for modules in free state to discovery its neighbours with a single discovery signal is When a robotic module transmits a signal, its receiving channels must be closed to avoid infra-red reflection and interference. Thus the time it needs to complete sending a signal is also its closing time t c . Beside, all the robots are identical so t c is similar to all the modules.
The neighbourhood discovery process continues with the unoccupied channels of the building blocks at greater time interval t w2 to maximize the time slot for data communication and minimize the power consumption. On the established channels, the link maintenance process is activated with the processing time t w3 . We have the probability for the robots in free state to discover a topology of connected modules as: The closing time is short as compared to the processing time, thus its effect on the overall result is unnoticeable. Reducing the processing time leads to increasing the chance to discover neighbours but also increasing the energy consumption. In opposition, increasing processing time might affect the time response of the robotic system to end users.
In the link maintenance process, the probability for a maintenance signal successfully received by its connected neighbour is calculated: We applied the common hand shake technique for local neighbour-to-neighbour communication process. If the receiver B does not involve in other communication process, the probability for receiving a data packet from the sender A is Even both the neighbourhood discovery and link maintenance active during the communication process, neighbour-to-neighbour data transmission still remains at the high possibility.

Gradient-based routing for any-to-root communication path:
We designed an edutainment application to illustrate the path formation based on the gradient-based routing algorithm. The Phonic Game is developed to help children studying language through tangible programming by replacing passive wood blocks by the moreBot, which provides an innovative teaching and learning method.
moreBot are converted into the alphabet character building blocks. We embedded five different characters to five faces of each block. Using the accelerometer to identify the top face, the character on the top face is selected to represent the building block in the Phonic Game. We also designed one special block with a loud speaker to play the recorded soundtracks. The Phonic Game is used to examine the path formation process by the following demonstrations.
Transferring data from any module to the root: We proved that the gradient-based routing provides a reliable method for transferring data packets from any module to the root. The first mode of the Phonic Game is about the word generation. We started the word generation game by plugging the speaker module at one end of the robotic configuration. The block was activated by the user to become the root, so it broadcasted the gradient to its neighbours sequentially. The gradient recovery mechanism helped all the building blocks adjust their gradients whenever the network morphology was reconfigured. We utilized the infra-red ranging function on the top face only for user-block interaction, preventing interference of infra-red signals on the other faces.
In general, the further the building blocks counted from the root, the higher the gradient-based ID, as shown in Figure 6. When the user interacted with a building block, the representing character i.e. 'a' or 'b' was embedded into the data packet sent to the neighbours towards the root by following the gradient descent. Along the communication path, the representing characters of the other building blocks were also inserted into the data packets. Hence the final packet reaching the root contained a string of characters of all the building blocks in the communication path in order of the gradient descent counted from the block activated by the user. The speaker module verified this string whether it was a correct word or not in reference to the embedded dictionary. If a meaningful word was found, the speaker played the corresponding recorded soundtrack, e.g., 'strong' or 'study'. Note that the position of every character was unique in a correct word, thus the speaker module only recognized the word and spoken it out if and only if the gradient-based routing algorithm guaranteed the precision of data collection and packaging on the route from the block initialized by the user to the root by using the any-to-root directional communication path. Transferring data from root to any module: The second mode of Phonic Game is about spelling. When a correct word was checked, the speaker module should spell each character of the word in order along with lighting up the corresponding module of such character. Therefore, the building blocks involved in the word must be able to relay and deliver the commands from the root to other blocks correctly and timely. A root-to-any directional communication path is expected to build up for this assignment. However, the gradient mechanism could create the same gradient-based ID to different modules. Therefore, data packets smoothly flew back to the root from different communication paths but did not correctly flow from the root to expected modules because the intersection module, character t in this example, did not know which the directional communication channel should be selected. Therefore, we demonstrate how the virtual pheromone-based routing algorithm is capable of solving this issue in the next section.

Virtual Pheromone-Based Routing Algorithm
To validate the virtual pheromone-based routing algorithm on root-to-any directional communication path, we set up a scenario as shown in Figure 7. A network of building blocks was formed by three paths representing three words: s-t-r-o-n-g, s-t-u-d-y, and s-t-a-r. Using the gradient generation mechanism, three any-to-root communication paths were established and the module t acted as the intersection module. This module played the key role in transmitting data packets from the root to any module using the virtual pheromone concentration mechanism. In the spelling mode, characters on the modules must be correctly lighted up in order, corresponding to spelling sound. For instance, once the word study was selected by the user, the lighting commands should reach the character s, t, u, d and y synchronously to sound it on the speaker module. Because the blocks s and t were on the unique path from the root, they received spelling commands without concerning the other directions. The intersection block t had to select the correct direction to relay the lighting commands from the root to the blocks u, d and y, consequently. However, the same gradient were assigned to the blocks u, r, a, so broadcasting spelling commands for the word study could cause unexpected blocks r and a to light up with the probability of random directional channel selection: To solve this issue, we applied the virtual pheromone based path selection for the intersection block. Initially, the virtual pheromone concentration on all the communication channels were equal, thus we took the probability of channel selection P = 1/3 as the baseline for the probabilistic switching of the intersection block. In this case, the module t equally sent data packets to all the directions at the initial stage. When a user interacted with a building block i.e., y, g, or r of a word i.e., study, strong or star while playing the spelling game, data packets transmitted from the building block to the root through a physical communication channel on the module t. The virtual pheromone concentration on such a channel was increased with an amount of pheromone deposition while the virtual pheromone concentration on the other channels were decreased accordingly so that the total amount of the virtual pheromone on module t was unchanged (100%). The more the user interacted with a building block, the more data packets transmitted to the root on the channel due to its pheromone probability. As a result, when the root sent spelling commands through the communication path of the selected word, e.g. study, the building block t chose the directional physical channel towards the building block u based on the probability of the virtual pheromone concentration accumulated on this channel. Note that the virtual pheromone concentration on such a channel was automatically decreased toward the baseline by the evaporation parameter over time if the user stopped interacting with the building block. The virtual pheromone parameters are shown in Table 3. Note that parameters of the virtual pheromone concentration can be changed according to system requirements. High deposition rate could quickly raise the virtual pheromone concentration up to the saturation level leading to fast establishment of root-to-any communication path. High deposition rate could also increase switchability of communication paths according to users' behaviour but might create fluctuation due to the short time reaction. In contrast, low deposition rate requires more time to form root-to-any communication paths. However, a communication path established with the low deposition rate should be expected if we wish to receive a large number of data packets from the chosen direction. Similarly, high evaporation rate enables to switch communication paths according to users's behaviours but creates fluctuation because of the conflict between deposition and evaporation. In contrast, low evaporation rate could reduce flexibility of communication paths since the virtual pheromone concentration is still maintained even when the selected communication path is not used for a while. Selection of deposition and evaporation rates is an important issue for a specific application.
To illustrate the real time analysis of the virtual pheromone concentration, we collected data from the module t and displayed through the Matlab graphical user interface (GUI). Using the basic parameters in Table 3, the virtual pheromone concentration levels on three physical communication channels was presented as in Figure 8. A video demonstration of this experiment can be found in the link (https://youtu.be/ph2a8jShHDk). One research question would be posed: What happens if the deposition rate is not constant? To answer this, we implemented three deposition functions in terms of pseudo-linear, pseudo-quadrature, pseudo-logarithm functions. Figure 9 shows the virtual pheromone concentration of these deposition functions measured on the same system for comparative analysis. First, we applied the pseudo-step function for the modular robotic system. Pseudo-linear function can be seen as one-step response function enabling the virtual pheromone concentration to reach the threshold with only one step. Second, the pseudo-quadrature function slowly increased the virtual pheromone concentration by a little amount for the first few steps, then quickly got up to the maximum value. In a dynamic network where a dominant path is not clear, using the pseudo-quadrature function ensures that a desired communication path is achievable. Meanwhile, the pseudo-logarithm function showed fast reaction to the network reconfiguration. The virtual pheromone concentration quickly raised to the high level, and then slowed down to keep the channel stable when it reached the threshold. This pseudo-logarithm function is helpful for switchability of communication paths but might introduce turbulence when the distinction between paths are not clear. Hence, system performance can be adjusted according to the selected deposition rate. Figure 9. Different functions of deposition rate measured at the intersection block on different physical channels using Equations (7) and (8): Range 1, 2: Pseudo-linear deposition rate creates linear growth of the virtual pheromone concentration on the selected channels. When no data packets were transmitted over this channel, the pheromone concentration was slowly decreased to the initial values by the evaporation. Range 3: Pseudo-quadrature deposition functions with slow increasing rate at the beginning. Range 4: Pseudo-logarithm deposition function has opposite rate to pseudo-quadrature function with high increasing rate at the beginning. Range 5: Pseudo-step function abruptly changed the virtual pheromone concentration, which was unlikely with natural pheromone but useful in some applications.
In particular, we found that this step function is suitable for our Phonic game because any request from any branches can be immediately activated due to the fast switching between communication paths at the threshold of 95%. In addition, if we set the upper threshold to 100% and the lower threshold to 0%, probability of choosing communication paths by randomness did not exist according to user's point of view. The flexibility of system was secured by the evaporation rate because the virtual pheromone concentration automatically went back to the balance level after a while if communication path was no longer used.
We do not consider a fixed rate in this research because our protocol is adaptable to users' interaction. Moreover, we simplified the protocol with only two fundamental parameters: pheromone deposition and evaporation. We have taken real-world issues of the characteristics of modular robotic systems and human behaviours into account to design the virtual pheromone based protocol and successfully demonstrated it through an edutainment game. When we carried out experiments, we found that the duration between two consecutive configuration changes is a critical factor of the developed routing and communication protocol. Since it requires a certain interval for a robotic module to accumulate or evaporate its virtual pheromone, the robotic configuration must be unchanged during such a duration. With the Phonic game, we examined that it usually took 2-3 s for the virtual pheromone on the intersection to converge to a stable rate without any local minimum or maximum. The duration is quite reasonable and acceptable for development of phonic games in the real world.

Conclusions
We presented the novel virtual pheromone based network data flow control for modular robotic systems. We proved the effectiveness of gradient and virtual pheromone-based routing algorithms in dealing with communication path selection of reconfigurable robotic systems through an edutainment game. We believe that this virtual pheromone based routing protocol is sufficient enough for building-up and maintaining bidirectional communication paths in many modular robotic systems. In the future, on the one hand, we will examine the developed algorithm with more complex configuration of our modular robotic system to find out its possible limitations. In addition, we will extend our investigation of this algorithm with an auto-adjustable parameter selection mechanism. On the other hand, we have planned to focus more on developing new education and entertainment games to bring our technological advantages to the society.