## 5 Main Grid System
### Power Electronic Interface (PEI)  
The power electronic interface, specifically, a bi-directional converter, is implemented to integrate the microgrid with the existing utility grid to increase the microgrid system's serviceability. This is achieved by coupling the alternating current (AC) and direct current (DC) buses, hence encompassing other components (PV array, battery, and load) of the MG, as depicted in Figure 1. The power electronic interface has several characters; it can be employed as a rectifier or an inverter and classified under DC-DC, DC-AC, AC-AC, and AC-DC converter topology. The magnitude of the converter primarily relies on the maximum load demand (\(P_{L}^{max}\)). The value of the power electronic inverter (\(P_{inv}\)) can be attained by the equation stated below [30]:  
\[P_{inv}=P_{L}^{max}\Big{/}\eta_{inv} \tag{15}\]  
Figure 4 illustrates a three-phase bi-directional AC-DC converter topology that carries power amidst the three-phase AC voltage supply and the DC voltage bus. The bi-directional AC-DC interface entails six IGBT-diode switches (\(S_{a1}-S_{c2}\)), which are linked with a three-phase AC voltage supply alongside a series filter inductance (\(L\)) and resistance (R). A DC capacitor (C) is connected parallel to the DC voltage bus to maintain the voltage (\(e_{L}\)) constant. The bi-directional AC-DC converter functions in rectifier and inverter mode. Rectifier mode functions as a front-end rectifier and permits power conveyed from the three-phase AC voltage to the DC voltage bus. The subsequent mode is the inverter mode; power flows from the DC voltage bus to the three-phase AC voltage, and the interface behaves as a voltage source inverter. \begin{table}
\begin{tabular}{l l l} \hline \hline
**Criterion** & \multicolumn{2}{l}{**Battery Type/Model**} \\ \hline  & **LA Battery** & **Li-Ion Battery** \\ \hline Cell life @ maximum DOD & 800 & 3200 \\ \hline Float life (years) & 4 & 12 \\ \hline Inverse time constant in AH-1 & 0.774 & 0.038 \\ \hline Polarization constant in volt/AH & 0.0002 & 0 \\ \hline Internal resistance in Ohm per positive plate & 0.00266 & 0.0007 \\ \hline Battery capacity in AH per positive plate & 26.5 & 53 \\ \hline Battery discharge current in amp & 26.5 & 53 \\ \hline Constant Current (A) & 50 & 53 \\ \hline Constant Voltage (V) & 2.2 & 4.15 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: _Cont._Illustration of Bi-Directional AC/DC Converters  
The topology of a three-phase voltage source converter is shown in Figure 4. An L filter is used to connect to the grid and converter. The optimal AC grid source is depicted as \(e_{a}\), \(e_{b}\), \(e_{c}\). \(i_{a}\), \(i_{b}\), \(i_{c}\) depict the source current. L (inductance filter) and R (resistance) of series R-L circuit. C (capacitor) on the DC side, where, \(u_{dc}\) and \(i_{dc}\) depict the DC voltage and DC current, respectively. A resistance \(R_{L}\) and \(e_{L}\) in series are equivalent to the DC load. With the KCL and KVL, the system model can be demonstrated as [33]:  
\[\begin{cases}e_{a}=L\frac{d_{da}}{dt}+Ri_{a}+u_{aN}+u_{NO},\\ e_{b}=L\frac{d_{b}}{dt}+Ri_{b}+u_{BN}+u_{NO},\\ e_{c}=L\frac{d_{dc}}{dt}+Ri_{c}+u_{cN}+u_{NO},\\ \quad\quad\quad\  
power (\(P_{Solar}\)), load demand (\(P_{Load}\)), and the SoC of the battery (\(SoC_{bat}\)). If any change in conditions occurs, the excess or deficiency of solar power is determined. After supplying the load demand, if there is excess energy, then it will be stored in the energy storage. However, its SoC is not allowed to surpass 80% for the preferable battery management. If the state of charge is reached, the excess energy is supplied (sold) to the main grid. Conversely, when solar radiation is inadequate, the power generated from PV is insufficient to supply the load demand. Consequently, the remaining energy sources are required to satisfy the load demand. Before considering the grid, the battery energy storage is preferred to supply the required load demand.