# Development of a Power and Communication Bus Using HIL and Computational Intelligence
## 4 Auto Addressing Method
### Auto-Addressing Configuration  
The idea to use the auto-addressing feature was to generate a special signal by the master board, then generating disruption by client(s), and using parasitic parameters of the connection cable, recognizing how far from the master the client is. Information about the distance of each client from the master providing a unique address. This method has the disadvantage of minimal cable length between clients. After the first test, using an oscilloscope, the authors noted that 20 cm of cable is sufficient length to recognize changes in the signal shape. This is enough to meet the project requirement, and to develop an auto-addressing idea. The proposed interface uses only two wires to transmit power, data and allowing auto-addressing, which necessitates a wireless connection to have a second layer of communication between nodes and the MATLAB environment(MathWorks, Natick, Massachusetts, USA). The second layer will be used only for research, to avoid any disturbance from the signal between nodes. It is widely known that many solutions can be incorporated, with optical or radio connection options as are most commonly used. The optical connection can be characterized by the necessity of face-to-face transceivers' orientation. The idea was to use 15 nodes in the research stand. To ensure high stability, each node should have an individual transceiver, which generates problems to find or build management devices for all 15 transceivers. The second approach is to use radio, which eliminates most of the problems related to optical solutions. The authors had to decide which radio communication standard to choose. Due to their broad experience with IoT, the authors conducted research on IoT libraries in the MATLAB environment. An external MQTT library written in Java was adapted to the MATLAB environment. After stability tests, the decision was made to continue the idea of using the external library. The test setup was built with ESP32 and MQTT brokers on Raspberry Pi (Rpi, Raspberry Pi Foundation, Cambridge, England), where Raspberry was also configured as an Access Point (AP) for ESP32 clients. DLN interface works by continually changing the state of work from power delivery to data interface. For the auto-addressing procedure, the signal was divided into a 10 ms period of power delivery, and 12 ms of auto-addressing signals; an example is given in Figure 2(a). Positions of clients are known. Calculated positions are compared with known positions; when they match, parameters like cost, standard deviation between nodes' addresses (more is better), standard deviation between measures (less is better) and minimal difference between addresses(more is better), are calculated. If not successful, all parameters are set to 1. Every test contains 15 repeats (for each node--Figure 2(a)), every repeat contains 25 measure cycles (Figure 2(b)). Each cycle is based on sending an energy pulse to the line (Figure 4). Most of the parameters were initially programmed to allow change in value during operation. All signals that can influence the possibility of auto-addressing were connected with algorithm solvers to optimize their value. Figure 4 shows how a generator for injecting disturbance was constructed. Variable X2(A22) defines time in \(\upmu\)s to charge capacitor C0; a higher time denotes more energy. Variable \(p_{lhs}\) defines which pulse coil will be used to inject the signal. Time to discharge the capacitor C0 through the coil is constant (A23). Switches S1-S8 are close during the whole cycle (Figure 2(b), elements C0-C24). Using a dedicated circuit with an RC filter, an active peak detector and an analogue to digital converter (ADC), the microcontroller can capture the numerical value of the response from the line. Based on [PERSON] tests [29], the authors anticipated that the internal ADC from the ESP32 microcontroller would not be precise enough to measure signals. The PCB was equipped with an external, precise ADC, but the analogue signal was also connected to integrated ADC from ESP32.