## Abstract

In this chapter, a photovoltaic system integrated into the building is investigated. The studied structure includes also a battery energy storage system. The overall system is connected to a four-wire AC bus, with the possibility to supply single-phase and three-phase loads. Each equipment is interfaced with a dedicated power converter. This chapter examines the technical operation of all structure components and gives a detailed mathematical study of the DC/AC power converter control in case of two modes, namely, grid connected mode and standalone mode. The investigated control is based on resonant controller. The resonant controller parameters tuning, which is based on the generalized stability margin criterion, is detailed in this chapter. To prove the performance of the proposed control algorithm, several simulation tests developed under PSIM software were performed and then validated by experimental results.

### Keywords

- photovoltaic systems
- battery energy storage system
- building microgrid
- DC/AC power converter control
- standalone mode
- grid connected mode

## 1. Introduction

Nowadays, rooftop photovoltaic systems (PV) and building-integrated photovoltaic (BIPV) systems are becoming well known and commonly used. The growth of these installations is due to their environmental advantages in addition to their social and economic benefits. Indeed, since building electricity consumption accounts for a large proportion of a country’s overall consumption, and tends to increase further for the coming years, local generation offers an ideal solution [1, 2, 3, 4].

Regarding the obstruction of PV systems’ fluctuating aspect, it can be derived in various ways. The integration of battery energy storage system (BESS) is considered as efficient and complementation solution, mainly for standalone microgrids [5]. Urban photovoltaic systems are usually connected to the distribution network, but the operation in standalone is also possible [6, 7].

In order to ameliorate the PV system efficiency, an adequate control strategy should be introduced. In the literature, several control techniques are developed: integral proportional regulators, resonant correctors, hysteresis correctors, sliding mode controls, predictive controls, and so on [8, 9, 10, 11].

This chapter investigates the operation of PV system devoted to building application. It gives an overview of the control of all integrated power converters and then explains in details the control of the DC/AC power converter in both operation modes, namely, standalone mode and grid connected mode. For the grid connected mode, the control must ensure that the AC bus voltage remains within the acceptable range, and for standalone mode the DC/AC converter is controlled to inject generated PV power into the AC-link.

This chapter first outlines overall system description, followed by a review of each power converter control. A detailed mathematical study is dedicated to the DC/AC converter control in grid connected and autonomous modes. Simulation results and experimental validation are subsequently presented.

## 2. System description

The building solar system structure is given in Figure 1. It is composed of a PV panels in parallel with a battery energy storage system which are linked to a DC bus, a DC/AC power converter, and an LCL filter interfacing between DC and AC bus. Single- and three-phase linear and nonlinear loads are connected to the AC bus.

The linear building loads are modeled by a resistive load, and the nonlinear ones are modeled by a rectifier connected to a capacitive filter at the DC side. This model is conformed to many building loads, similar to televisions, personal computers, and fluorescent lamp ballast [12]. In case of three-phase balanced loads, the neutral current is zero, but since several building loads are single phase and include electronic converters, their waves include harmonics which induce a nonzero neutral current. Regarding neutral wire, the more common considered structures are presented in Figure 2. The first structure is based on DC-link neutral point where the neutral wire is generated via two identical capacitors (Figure 2a). In the second structure, the neutral wire is generated through a Delta/Star grounded transformer as shown in Figure 2b [13]. As to the third configuration, it is based on four-leg power converter (Figure 2c) [14, 15, 16]. In this chapter the structure with transformer is adopted.

The PV system presents two operating modes according to the grid state:

Grid connected mode: this mode is activated when the grid is available. In this case, the power surplus is injected into the grid, and if the consumption is superior to local generation, the power flow will be directed from the grid to loads and eventually to charge batteries according to their stat of charge (SOC).

Standalone mode: this mode is activated when the grid is absent. In this case, building loads are supplied first by the PV system then if necessary by the BESS. In case of power deficit, the shedding of non-priority loads is carried out.

## 3. Power converter control

An overview of the control of each converter presented in Figure 2b is subsequently presented.

### 3.1 BESS DC/DC converter control

Batteries are frequently integrated to PV systems thanks to their special energy characteristics. Indeed, batteries have a high energy density, which ensure long time of stable operation. The charging time and number of cycles depend on the adopted technology.

The battery power flow is bidirectional. In discharge mode, the power is supplied by battery, and in charging mode, the power is absorbed by battery. For both modes, the state of charge limits should be respected to not affect the battery lifetime.

The BESS incorporates a DC/DC power converter that manages battery operation modes according to the appropriate control. A cascade control is adopted, the inner loop regulates the battery current, and the external one regulates the DC-link voltage.

The switches _{1} and _{2} (Figure 3) are controlled individually. In case of battery charging, _{1} is controlled and in case of battery discharging, _{2} is controlled.

### 3.2 PV DC/DC converter control

The structure of the two-stage power conversion is adopted for the PV system; this configuration is commonly privileged in the majority of the PV systems. The difference with the conventional structure is that the * V*regulation is ensured by the BESS. As to the control of the DC/DC converter, it aims to ensure Maximum Power Point Tracking (MPPT) (which corresponds to the peak point of the power versus the voltage curve). In the case of this study, the Perturbation and Observation (P&O) algorithm is applied. The inputs of the P&O algorithm are the solar radiation

_{dc}

*and the temperature*G

*as shown in Figure 4.*T

### 3.3 DC/AC converter control

#### 3.3.1 Modeling of the DC/AC converter

The output of the DC/AC and the LCL filter are modeled in single phase as shown in Figure 5. According to this figure, the obtained results are expressed as follows:

Based on Eq. (3), the transfer function between the current _{L1} and the voltage (* V* −

_{i}

*) is given by the following equation:*V

_{c}

According to Eqs. (2) and (3), the transfer function between the voltage * V*and the current (

_{c}

I

_{L1}−

I

_{L2}) is expressed as follows:

The transfer functions given by Eqs. (4) and (5) allow the deduction of the system block diagram given by Figure 6.

#### 3.3.2 Control of the DC/AC converter

#### 3.3.2.1 Standalone mode

In standalone mode, the DC/AC converter control ensures that the LCL filter capacitor voltages are equal to their references. In that case, the converter control includes two cascade loops as shown in Figure 7. The external loop is based on a resonant controller _{1} used to regulate the voltage across the LCL filter capacitor. This loop generates at its output the reference current * I*. This current will be added to the current

_{c-ref}

I

_{2}to provide the inner loop reference current

I

_{1-ref}. The inner loop is based on a resonant controller, and in this work, it simplified to a simple gain

*. In the following, the tuning of the parameters of the voltage external loop and the current inner loop will be presented and detailed.*G

#### 3.3.2.1.1 Tuning of the external loop resonant controller RC _{1}

For simplification reasons, it is assumed that the internal current loop is faster than the external voltage loop. Thus, it can be approximated equal to the unity by associating it with the PWM function. The following block diagram is then obtained for the determination of the external voltage loop resonant controller parameters as presented in Figure 8.

According to Figure 4, the open and closed-loop system transfer functions are expressed by Eqs. (7) and (8), respectively. Note that the transfer function of the resonant controller _{1} is given by Eq. (6):

The method chosen for the resonant controller parameters tuning is based on the generalized stability margin criterion [17, 18]. The reference polynomial * P*defined by this criterion is expressed as follows:

_{GSMc}

where * λ*,

_{c}

*, and*r

_{c}

*are the factorization coefficient, the abscissa, and the ordinate in the complex plane. On the other hand, the system characteristic polynomial is deduced from Eq. (8), and it is expressed as follows:*ω

_{ic}

According to the generalized stability margin criterion, the resonant controller parameters are tuned by identifying the characteristic polynomial of the closed-loop system * P*(

_{c}

*) with the reference polynomial*s

*(*P

_{GSM}

*) as shown in Eq. (11):*s

The identification of * P*(

_{GSM}

*) and*s

*(*P

_{c}

*) allows the deduction of the current inner loop resonant controller parameters as shown in the following equation:*s

We choose * r*equal to 200 and

_{c}

*equal to*ω

_{ic}

*. For*ω

_{g}

*equal to 30 μF, the resonant controller*C

_{f}

RC

_{1}parameters are given by the following equation:

For the obtained resonant controller parameters, Figure 9 shows the pole maps of * F*(

_{CL-Vc}

*). As shown in this figure, the system is stable and the expected stability margin*s

*is obtained. Figure 10 shows the Bode diagram of*r

_{c}

*(*F

_{OL-Vc}

*). This figure shows that the obtained gain margins*s

*and*G

_{m}

*are equal to infinity and 72.8°, respectively. Figure 11 presents the gain of*P

_{m}

*(*F

_{CL-Vc}

*) and shows that the bandwidth of the external voltage loop is equal to 24 Hz. It should be noted here that the larger is the bandwidth, the faster is the system.*s

#### 3.3.2.1.2 Tuning of the inner loop gain G

According to Figure 6, the block diagram of the current inner loop is given by Figure 12.

According to Figure 12, the open and closed-loop transfer functions are given by Eqs. (14) and (15), respectively:

The inner current loop must ensure a response time much smaller than the external voltage loop. To this purpose, the gain * G*is selected so that the real part of the inverse of the closed-loop time constant

*is greater than the stability margin chosen for the tuning of the voltage external loop (*τ

_{i}

*= 200) as shown in Eq. (16).*r

_{c}

We select * G*equal to 10. For this value, Figures 13 and 14 present the pole maps of

*(*F

_{CL-IL}

*) and the Bode diagram of*s

*(*F

_{OL-IL}

*), respectively. These figures show that the system is stable and the obtained*s

*is equal to infinity and the*G

_{m}

*is equal to 90.3°. Figure 15 presents the gain of*P

_{m}

*(*F

_{CL-IL}

*) and shows that the bandwidth of the inner current loop is equal to 785 Hz. This value is much higher than the bandwidth of the voltage external loop and shows that the current inner loop is much faster than the voltage external loop.*s

#### 3.3.2.2 Grid connected mode

In grid connection operation mode, the DC/AC converter controls power exchange with grid. In this mode, only the current loop is controlled. This loop is based on a resonant controller as shown in Figure 16.

The simplified block diagram of the current loop is given by Figure 17.

Based on Figure 17, the open and closed-loop transfer functions are given by Eqs. (18) and (19), respectively. The transfer function of the resonant controller RC_{2} is given by Eq. (17):

For the tuning of the internal loop resonant controller, the generalized stability margin criterion is considered. The system characteristic polynomial * P*(

_{i}

*) is deduced from Eq. (19), and it is expressed as follows:*s

The identification between the system characteristic polynomial * P*(

_{i}

*) and the generalized stability margin criterion reference polynomial*s

*(*P

_{GSMi}

*) [Eq. (21)] and the resonant controller*s

RC

_{2}parameters are deduced as in Eq. (22):

We choose r_{i} equal to 100 and * ω*equal to

_{ii}

*. For*ω

_{g}

*equal to 2 mH, the resonant controller*L

_{i}

RC

_{2}parameters are given by the following equation:

For the obtained resonant controller parameters, Figure 18 shows the pole map of * F*(

_{CL-i}

*). Based on this figure, the stability margin*s

*is equal to the desired one. Figure 19 gives the bode diagram of*r

_{i}

*(*F

_{OL-i}

*). As mentioned on this figure, the gain margins*s

*and*G

_{m}

*are equal to infinity and 79.5°, respectively. Figure 20 presents the gain of*P

_{m}

*(*F

_{CL-i}

*) and shows that the bandwidth of the internal current loop is equal to 40.8 Hz.*s

## 4. Simulation results

Several simulation tests developed under PSIM software were done. Figure 21 presents the LCL filter capacitor voltage in islanded mode for different values of voltage reference * V*. As shown in this figure, the obtained voltages are equal to their references. Figure 22 presents the power injected into the AC bus during 24 hours; this power corresponds to the PV generation. In this case all the batteries are considered to be charged to their SOC

_{c-ref-abc}

_{max}. The deduced reference current is presented in Figure 23.

## 5. Experimental results

Figure 24 shows the experimental test bench. The used AC/DC converter is from SEMIKRON. Currents and voltages are censored via LEM LV25 and LEM 55LP, respectively, as given in Figure 24. The control algorithm is implemented on the STM32F4 Discovery. The acquisition time is set to 100 μs. Figure 25 presents the LCL filter capacitor voltage in islanded mode for different values of voltage reference * V*. As shown in this figure, the obtained voltages are equal to their references.

_{c-ref-abc}

## 6. Conclusion

In this chapter, the control of power converters integrated in building solar system is investigated. The studied system is composed of a PV panel in parallel with a battery energy storage system which are linked to a DC bus, a DC/AC power converter, and an LCL filter interfacing between DC and AC bus. Single- and three-phase linear and nonlinear loads are connected to a four-wire AC bus. The neutral wire is generated through a Delta/Star grounded transformer. An overview of the control of each power converter is presented. This chapter focuses on the control of the DC/AC power converter. The resonant controller is adopted. A set of simulation and experimental tests were done to show the efficiency of the studied control algorithm.

## Acknowledgments

This work was supported by the Tunisian Ministry of Higher Education and Scientific Research under Grant LSE-ENIT-LR11ES15.

## References

- 1.
Holland I, Doorsamy W, Nixon K. Analysis of lightning surge effects on small-scale rooftop photovoltaic systems. In: 2018 Power Systems Computation Conference (PSCC), Dublin; 2018. pp. 1-6. DOI: 10.23919/PSCC.2018.8443046 - 2.
Fina B, Fleischhacker A, Auer H, Lettner G. Economic assessment and business models of rooftop photovoltaic systems in multiapartment buildings: Case studies for Austria and Germany. Journal of Renewable Energy. 2018; 2018 :1-16. DOI: 10.1155/2018/9759680 - 3.
Saker N, Al-Qattan A, Al-Otaibi A, Al-Mulla A. Cost–benefit analysis of rooftop photovoltaic systems based on climate conditions of gulf cooperation council countries. IET Renewable Power Generation. 2018; 12 (9):1074-1081. DOI: 10.1049/iet-rpg.2017.0309 - 4.
Dehwah AHA, Asif M. Assessment of net energy contribution to buildings by rooftop photovoltaic Systems in hot-humid climates. Renewable Energy. 2018; 131 :1288-1299. DOI: 10.1016/j.renene.2018.08.031 - 5.
Ahmadi M, Lotfy ME, Shigenobu R, Howlader AM, Senjyu T. Optimal sizing of multiple renewable energy resources and PV inverter reactive power control encompassing environmental, technical, and economic issues. IEEE Systems Journal. 2019; 13 (3):3026-3037. DOI: 10.1109/JSYST.2019.2918185 - 6.
O’Shaughnessy E, Cutler D, Ardani K, Margolis R. Solar plus: A review of the end-user economics of solar PV integration with storage and load control in residential buildings. Applied Energy. 2018; 228 :2165-2175. DOI: 10.1016/j.apenergy.2018.07.048 - 7.
Lu Y, Wang S, Shan K. Design optimization and optimal control of grid-connected and standalone nearly/net zero energy buildings. Applied Energy. 2015; 155 :463-477. DOI: 10.1016/j.apenergy.2015.06.007 - 8.
Jamroen C, Pannawan A, Sirisukprasert S. Battery energy storage system control for voltage regulation in microgrid with high penetration of PV generation. In: 2018 53rd International Universities Power Engineering Conference (UPEC), Glasgow; 2018. pp. 1-6. DOI: 10.1109/UPEC.2018.8541888 - 9.
Bag A, Subudhi B, Ray P. An adaptive variable leaky least mean square control scheme for grid integration of a PV system. IEEE Transactions on Sustainable Energy. 2019. DOI: 10.1109/TSTE.2019.2929551 - 10.
Al-Dhaifallah M, Nassef AM, Rezk H, Nisar KS. Optimal parameter design of fractional order control based INC-MPPT for PV system. Solar Energy. 2018; 159 :650-664. DOI: 10.1016/j.solener.2017.11.040 - 11.
Hamrouni N, Jraidi M, Ghobber A, et al. Control approach of a connected PV system under grid faults. Electrical Engineering. 2018; 100 :1205. DOI: 10.1007/s00202-017-0560-0 - 12.
Antunes AF, Baptista JR, Moura AM, Pomilio JA. Study of harmonic distortion in a residential and commercial LV power system. In: 11th International Conference on Electrical Power Quality and Utilisation; 2011. DOI: 10.1109/epqu.2011.6128873 - 13.
Mohammadi J, Badrkhani Ajaei F, Stevens G. Grounding the AC microgrid. IEEE Transactions on Industry Applications. 2018; 55 :1-1. DOI: 10.1109/tia.2018.2864106 - 14.
Naderipour A, Abdul-Malek Z, Ramachandaramurthy VK, Kalam A, Miveh MR. Hierarchical control strategy for a three-phase 4-wire microgrid under unbalanced and nonlinear load conditions. ISA Transactions. 2019; 94 :352-369. DOI: 10.1016/j.isatra.2019.04.025 - 15.
Kim G-H, Hwang C, Jeon J-H, Ahn J-B, Kim E-S. A novel three-phase four-leg inverter based load unbalance compensator for stand-alone microgrid. International Journal of Electrical Power & Energy Systems. 2015; 65 :70-75. DOI: 10.1016/j.ijepes.2014.09.035 - 16.
Sadeghkhani I, Hamedani Golshan ME, Mehrizi-Sani A, Guerrero JM. Low-voltage ride-through of a droop-based three-phase four-wire grid-connected microgrid. IET Generation Transmission and Distribution. 2018; 12 (8):1906-1914. DOI: 10.1049/iet-gtd.2017.1306 - 17.
Kuperman A. Proportional-resonant current controllers design based on desired transient performance. IEEE Transactions on Power Electronics. 2015; 30 (10):5341-5345. DOI: 10.1109/TPEL.2015.2408053 - 18.
Pereira LFA, Bazanella AS. Tuning rules for proportional resonant controllers. IEEE Transactions on Control Systems Technology. 2015; 23 (5):2010-2017. DOI: 10.1109/TCST.2015.2389655