## 3 Results  
### Case Study  
In this article, algorithms developed in MATLAB were implemented to conduct real-time testing on a real isolated microgrid. The system includes polycrystalline solar panels with an installed capacity of 15 kWp and a lithium-ion based BESS of 44 kWh. The tests were conducted in the Microgrid Laboratory at the University of Cuenca, Ecuador, where an isolated network was configured. This network consisted of PV panels (\(P_{PV}\)), a diesel thermal generator (\(P_{GD}\)), a programmable three-phase load, and an EVCS, all interconnected via inverters operating at 220 V AC [31]. To ensure controlled energy balance, the programmable three-phase load was set to a constant value of 20 kW, allowing system disturbances to be solely attributed to the intermittent solar generation. Additionally, a BYD T3 electric vehicle, equipped with a 100 kW electric motor and a 50.3 kWh LiNiMnCo battery, was used. Its charging process was recorded to determine the active power profile when connected to the microgrid. The V2G connection was emulated using a lithium battery bank with 642 VDC and 88 kW, connected to a 50 kW bidirectional converter (see Figure 2). This system enables both energy injection and extraction in two modes: Grid-to-Vehicle (G2V) and V2G. It also includes functionalities such as peak demand management and power stabilization. The experimental configuration, featuring real-time control capabilities, provides a robust platform to validate the V2G strategy in isolated microgrids. In this study, a MATLAB-based configuration and communication protocol were developed using Ethernet Modbus TCP/IP to enable efficient data transfer between sensors, programmable logic controllers (PLCs), and inverters. The system control and monitoring were centralized within a SCADA platform integrated with a LabVIEW interface, ensuring real-time data acquisition, reducing latency issues, and minimizing errors in data processing with a sampling interval of 100 ms. The electrical measurements critical for evaluating the power smoothing methods were retrieved through the SCADA system from the commercial three-phase inverter BPCS80, manufactured by GPtech. This inverter provides comprehensive electrical readings, including RMS voltage and current, active and reactive power, frequency, DC-link voltage, and the SoC of the lithium-ion battery storage system, as reported by the Battery Management System. The Modbus communication protocol facilitates seamless data exchange between the inverter and the SCADA platform, ensuring continuous monitoring of system performance. As the effectiveness of the proposed power smoothing method depends on precise measurement of power fluctuations and SoC levels, sensor accuracy becomes vital. According to the manufacturer's specifications, the tolerance range for voltage and current sensors in the BPCS80 inverter is \(\pm\)0.5% to \(\pm\)1% of the measured value. These tolerances introduce minor deviations in the electrical variables, potentially affecting the energy storage system's compensation response when mitigating photovoltaic power fluctuations. However, as these measurement tolerances remain consistent across all experiments and comparative methodologies, their influence is expected to be systematic rather than introducing significant discrepancies in performance evaluation. Figure 3 illustrates the behavior of the power generated by a PV system (\(P_{PV}\)) (green curve) operating within the experimental microgrid. The graph reveals the characteristic variability of solar energy production, which is directly influenced by weather conditions throughout the day. Additionally, an emulated profile (blue curve) complements and validates the experimental results. The green curve shows a typical PV generation profile, \(P_{PV}\), with a gradual increase in power during the early morning hours, peaking around midday, and then declining towards the end of the day. However, abrupt power fluctuations indicate intermittent cloud cover attenuating the solar radiation received by the PV modules.