## 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 *C*_{1} and *C*_{2} (Figure 3) are controlled individually. In case of battery charging, *C*_{1} is controlled and in case of battery discharging, *C*_{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 *Vdc* 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 *G* and the temperature *T* as shown in Figure 4.

### 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 *I*_{L1} and the voltage (*Vi* − *Vc*) is given by the following equation:

According to Eqs. (2) and (3), the transfer function between the voltage *Vc* and the current (*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 *RC*_{1} used to regulate the voltage across the LCL filter capacitor. This loop generates at its output the reference current *Ic-ref*. This current will be added to the current *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 *G*. In the following, the tuning of the parameters of the voltage external loop and the current inner loop will be presented and detailed.

#### 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 *RC*_{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 *PGSMc* defined by this criterion is expressed as follows:

where *λc*, *rc*, and *ωic* 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:

According to the generalized stability margin criterion, the resonant controller parameters are tuned by identifying the characteristic polynomial of the closed-loop system *Pc*(*s*) with the reference polynomial *PGSM*(*s*) as shown in Eq. (11):

The identification of *PGSM*(*s*) and *Pc*(*s*) allows the deduction of the current inner loop resonant controller parameters as shown in the following equation:

We choose *rc* equal to 200 and *ωic* equal to *ωg*. For *Cf* equal to 30 μF, the resonant controller *RC*_{1} parameters are given by the following equation:

For the obtained resonant controller parameters, Figure 9 shows the pole maps of *FCL-Vc*(*s*). As shown in this figure, the system is stable and the expected stability margin *rc* is obtained. Figure 10 shows the Bode diagram of *FOL-Vc*(*s*). This figure shows that the obtained gain margins *Gm* and *Pm* are equal to infinity and 72.8°, respectively. Figure 11 presents the gain of *FCL-Vc*(*s*) 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.

#### 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 *τi* is greater than the stability margin chosen for the tuning of the voltage external loop (*rc* = 200) as shown in Eq. (16).

We select *G* equal to 10. For this value, Figures 13 and 14 present the pole maps of *FCL-IL*(*s*) and the Bode diagram of *FOL-IL*(*s*), respectively. These figures show that the system is stable and the obtained *Gm* is equal to infinity and the *Pm* is equal to 90.3°. Figure 15 presents the gain of *FCL-IL*(*s*) 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.

#### 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 *Pi*(*s*) is deduced from Eq. (19), and it is expressed as follows:

The identification between the system characteristic polynomial *Pi*(*s*) and the generalized stability margin criterion reference polynomial *PGSMi*(*s*) [Eq. (21)] and the resonant controller *RC*_{2} parameters are deduced as in Eq. (22):

We choose r_{i} equal to 100 and *ωii* equal to *ωg*. For *Li* equal to 2 mH, the resonant controller *RC*_{2} parameters are given by the following equation:

For the obtained resonant controller parameters, Figure 18 shows the pole map of *FCL-i*(*s*). Based on this figure, the stability margin *ri* is equal to the desired one. Figure 19 gives the bode diagram of *FOL-i*(*s*). As mentioned on this figure, the gain margins *Gm* and *Pm* are equal to infinity and 79.5°, respectively. Figure 20 presents the gain of *FCL-i*(*s*) and shows that the bandwidth of the internal current loop is equal to 40.8 Hz.

## 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 *Vc-ref-abc*. 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_{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 *Vc-ref-abc*. As shown in this figure, the obtained voltages are equal to their references.

## 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.