## 3 MG-Based BTS Operation
### Communication System  
The communication system is the basis of the smart sensing operation. It is divided into the local communication architecture, which is aimed at creating communication channels between the different SBC processes, the SBC driver and the weather station, and the global communication strategy, which allows the SBC and a global controller to communicate via the IEC61850 standard. A specific extension of this standard is the IEC61850-7-420, which defines the communication and control interfaces of Distributed  
Figure 8: (a) Wireless weather station: PT100 fixed to the PV module, (b) anemometer and (c) the acquisition electronics.  
Energy Resources (DERs) and proposes logic nodes (LN) to completely describe DERs and control systems associated to them. This extension can be used to model communications in MGs [51].  
The local communication architecture is based on \"The Robot Operating System\" (ROS). ROS is an open-source operational system mainly meant to develop robotic systems [52]. In the local communication architecture, the SBC driver sends the measurements via I2C and Modbus to the processes in the SBC. The SBC collects and publishes the measurements as ROS topics to be shared by all the processes. On the other hand, the weather station sends the environmental information via Wi-Fi through MQTT protocol to the SBC. The choice of the MQTT protocol is due to its stability. Finally, the environmental parameters are transformed into ROS topics at the SBC. The block diagram in Figure 10 shows the communication protocols of the smart sensing system.  
As for the global communication strategy, the EMS and the IEC61850 Server read the ROS topics related to the measurements and update the IEC61850 plant model parameters of the MG-based BTS. As a result, the IEC61850 clients can directly access the MG-based BTS parameters through a standard communication channel via a TCP/IP protocol. Furthermore, this global communication strategy can receive control instructions from global controllers to change the behavior of the local controller or to directly control the MG-based BTS. The IEC61850 communication standard provides high scalability and interoperability allowing the MG-based BTS to be easily extended with any system or equipment which comply with the standard. From a VPP perspective (based on BTSs), this standard brings an economic benefit, since after the initial investment in the development of an MG-based BTS, the time and capital cost of adding a new MG-based BTS is dramatically reduced.  
Figure 9: Interface of Thingspeak to visualize stored variables: panel and environment temperature, humidity, irradiance, wind speed and wind direction.  
Figure 11 depicts the plant model of the MG-based BTS, which consists of different logical devices (LD), each one representing one component or device with its own entity. For instance, the logical device labeled as LD RGL represents the MPPT solar charger. This LD contains the ZRGL class, which has been fully specified in this work and cannot be found in the standard. It can be considered that the ZRGL class (Appendix A) expands the IEC61850 (specifically IEC61850-7-420), as the standard does not include any class to describe a DC/DC voltage regulator.  
Figure 11: Plant model of the MG-based BTS.  
Figure 10: Communication protocols of the smart sensing system.