# Reducing Detrimental Communication Failure Impacts in Microgrids by Using Deep Learning Techniques
## 6 Proposed EMS and ESS Architecture  
Following the discussions in the previous sections regarding load and PV-generation short-term forecastings, in this section the proposed structure of the EMS and also the ESS power-reference controller is presented. Figure 11 illustrates the aforementioned architecture.  
As it can be observed, the EMS receives load and PV-generation generation values from the smart-house sensors through the MQTT communication system. The ESS-SoC is also transmitted to the EMS by the same link. Depending on the particular time-step, the EMS either calculates the immediate power reference for the ESS or perform load/PV-generation forecastings and prepare an enhanced message that contain ESS power references for multiple future time-steps. In this proposed architecture, assuming that the measurements sampling rate is 1 minute, EMS forecastings are performed every 30 min with 1-hour time horizon so that the ESS has forecasted setpoints for at least 30 min in case a communication failure occurs immediately before a scheduled EMS forecasting.  
Once these power-references are transmitted from the EMS, they will be received by the ESS while it is subscribing to the same topic in the MQTT communication infrastructure. In MG methodology, ESSs (similar to DGs) are controlled by power-electronics based converters. The experimental testbed configuration used for this research that was explained in Section 3.1 is based on grid-feeding inverters operating in grid-connected mode. In such a configuration, the transmitted power references are required to be consumed by the converter's controller power loop to regulate the power exchange with the MG bus. This scheme is illustrated in Figure 12.  
Figure 11: EMS and ESS Pref Controller architecture to transmit and receive enhanced power references with redundant information.  
The EMS power-references are directly utilized to generate pulse width modulation signals that coordinate the charge and discharge operations of the ESS. However, prior to this step, there should be another controller that investigates the operational conditions of the communication link and select what type of data (real time or forecasted) should be provided to the converter's main controller. This is described in the right hand side block (ESS Pref Controller) of Figure 11. As it can be observed, the link health status is first checked by performing a wait loop. If no change is detected in the received Pref (from the EMS) for more than one minute the controller assumes a link-loss has occurred and attempts to use the forecasted values stored in its memory storage. These predicted Prefs were previously stored by recognizing an _\"enhanced EMS message\"_ (according to its larger size) from a normal message. The main characteristics of the proposed EMS-ESS structure are listed bellow:  
* The measurements and also EMS generated Prefs rates are every 1 min.
* The load and PV-generation forecasting's time-horizon is one hour with 5 min resolution.
* Enhanced messages with redundant (predicted) Prefs are created every 30 min.
* Based on the experiments presented in Section 5.2 a normal message contains approximately 20 bytes while enhanced messages can be between 200 and 300 bytes in size. It is important to mention that, the byte # uncertainties are due to the possible different number of digits of Prefs. However, It has been proven earlier that the end-to-end latencies do not significantly change when and increase in payload size of this scale occurs.
* When using saved data, if the Pref controller cannot find a stored Pref for a specific instant, the value of zero is send to the ESS controller as power-reference. This happens when the communication outage duration prolongs and all the saved values are used.