*3.3.2.1.1 Tuning of the external loop resonant controller* RC*<sup>1</sup>*

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*<sup>1</sup> is given by Eq. (6):

$$F\_{\rm CR1}(s) = \frac{c\omega s^2 + c\iota s + c\iota c}{s^2 + a\_0^2} \tag{6}$$

$$F\_{OL\cdot Vc}(s) = \frac{V\_c}{V\_{c\cdot r\circ f} - V\_c} = \frac{c\_{2s}s^2 + c\_{1c}s + c\_{0c}}{C\_f s^3 + C\_f \alpha\_0^2 s} \tag{7}$$

$$F\_{CL\cdot VC}(s) = \frac{V\_c}{V\_{c\cdot ref}} = \frac{c\_{2\epsilon}s^2 + c\_{1\epsilon}s + c\_{0\epsilon}}{C\_f s^3 + c\_{2\epsilon}s^2 + \left(C\_f \alpha\_0^2 + c\_{1\epsilon}\right)s + c\_{0\epsilon}}\tag{8}$$

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:

$$P\_{\rm GSMc}(\mathfrak{s}) = \lambda\_{\mathfrak{c}} (\mathfrak{s} + r\_{\mathfrak{c}}) (\mathfrak{s} + r\_{\mathfrak{c}} + jao\_{\mathfrak{c}}) (\mathfrak{s} + r\_{\mathfrak{c}} - jao\_{\mathfrak{c}}) \tag{9}$$

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:

$$P\_{\varepsilon}(\mathfrak{s}) = \mathbf{C}\_{f}\mathfrak{s}^{3} + \mathfrak{c}\_{2\varepsilon}\mathfrak{s}^{2} + \left(\mathbf{C}\_{f}\mathfrak{o}\_{\mathbf{0}}^{2} + \mathfrak{c}\_{1\varepsilon}\right)\mathfrak{s} + \mathfrak{c}\_{0\varepsilon} \tag{10}$$

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):

$$P\_{\text{GSMc}}(\mathfrak{s}) = P\_{\mathfrak{c}}(\mathfrak{s}) \tag{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:

$$\begin{cases} c\_{2\varepsilon} = 3r\_{\varepsilon}\lambda\_{\varepsilon} \\ c\_{1\varepsilon} = \lambda\_{\varepsilon} \left( 3r\_{\varepsilon}^{2} + o\_{\mathrm{ic}}^{2} \right) - C\_{f} o r\_{0}^{2} \\ c\_{0\varepsilon} = \lambda\_{\varepsilon} \left( r\_{\varepsilon}^{3} + r\_{\varepsilon} o r\_{\mathrm{ic}}^{2} \right) \\ \lambda\_{\varepsilon} = C\_{f} \end{cases} \tag{12}$$

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

$$\begin{cases} c\_{2c} = 0.018\\ c\_{1c} = 3.6\\ c\_{0c} = \textbf{832.17} \end{cases} \tag{13}$$

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:

$$F\_{OL\text{-}IL1}(\mathbf{s}) = \frac{I\_{L1}(\mathbf{s})}{I\_{L1\text{-}ref}(\mathbf{s}) - I\_{L1}(\mathbf{s})} = \frac{G}{L\_1\mathbf{s}}\tag{14}$$

**Figure 10.**

**Figure 11.**

**Figure 12.**

**63**

*Bode diagram of* FCL-Vc(s)*.*

*Block diagram of the inner current loop.*

*Bode diagram of* FOL-Vc(s)*.*

*Control Analysis of Building-Integrated Photovoltaic System*

*DOI: http://dx.doi.org/10.5772/intechopen.91739*

$$F\_{CL\cdot IL1}(s) = \frac{I\_{L1}}{I\_{L1\cdot ref}} = \frac{1}{\frac{\tau}{G}s + 1} = \frac{1}{1 + \tau\_i s} \quad where \quad \tau\_i = \frac{L\_1}{G} \tag{15}$$

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

**Figure 9.** *Pole map of* FCL-Vc(s)*.*

*Control Analysis of Building-Integrated Photovoltaic System DOI: http://dx.doi.org/10.5772/intechopen.91739*

**Figure 10.** *Bode diagram of* FOL-Vc(s)*.*

We choose *rc* equal to 200 and *ωic* equal to *ωg*. For *Cf* equal to 30 μF, the resonant

*c*2*<sup>c</sup>* ¼ 0*:*018 *c*1*<sup>c</sup>* ¼ 3*:*6 *c*0*<sup>c</sup>* ¼ 832*:*17

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

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

According to **Figure 12**, the open and closed-loop transfer functions are given by

*IL*1ð Þ*s IL*<sup>1</sup>‐*ref*ðÞ�*<sup>s</sup> IL*1ð Þ*<sup>s</sup>* <sup>¼</sup> *<sup>G</sup>*

1 þ *τis*

*<sup>G</sup> <sup>s</sup>* <sup>þ</sup> <sup>1</sup> <sup>¼</sup> <sup>1</sup>

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

*L*1*s*

*where <sup>τ</sup><sup>i</sup>* <sup>¼</sup> *<sup>L</sup>*<sup>1</sup>

(13)

(14)

*<sup>G</sup>* (15)

controller *RC*<sup>1</sup> parameters are given by the following equation:

*FOL*‐*IL*1ðÞ¼ *<sup>s</sup>*

*IL*<sup>1</sup> *IL*<sup>1</sup>‐*ref* <sup>¼</sup> <sup>1</sup> *L*

is the bandwidth, the faster is the system.

*Numerical Modeling and Computer Simulation*

*FCL*‐*IL*1ðÞ¼ *<sup>s</sup>*

*3.3.2.1.2 Tuning of the inner loop gain* G

Eqs. (14) and (15), respectively:

**Figure 12**.

**Figure 9.**

**62**

*Pole map of* FCL-Vc(s)*.*

8 ><

>:

**Figure 11.** *Bode diagram of* FCL-Vc(s)*.*

**Figure 12.** *Block diagram of the inner current loop.*

$$\frac{1}{\tau\_i} \gg 100 \quad \Rightarrow \quad \frac{G}{L\_1} \gg 100 \quad \Rightarrow \quad G \gg 0.1 \tag{16}$$

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.

*Control Analysis of Building-Integrated Photovoltaic System*

*DOI: http://dx.doi.org/10.5772/intechopen.91739*

**Figure 15.**

**Figure 16.**

**65**

*Control strategy of DC/AC converter in case of grid connected mode.*

*Bode diagram of* FCL-IL(s)*.*

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

**Figure 13.** *Pole map of* FCL-IL(s)*.*

**Figure 14.** *Bode diagram of* FOL-IL(s)*.*

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.

**Figure 15.** *Bode diagram of* FCL-IL(s)*.*

1 *τi*

*Numerical Modeling and Computer Simulation*

**Figure 13.**

**Figure 14.**

**64**

*Bode diagram of* FOL-IL(s)*.*

*Pole map of* FCL-IL(s)*.*

>>100 )

*G L*1

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

>> 100 ) *G* >>0*:*1 (16)

**Figure 16.** *Control strategy of DC/AC converter in case of grid connected mode.*

*Pi*ðÞ¼ *s L*1*s*

*Control Analysis of Building-Integrated Photovoltaic System*

*DOI: http://dx.doi.org/10.5772/intechopen.91739*

**Figure 19.**

**Figure 20.**

**67**

*Bode diagram of* FCL-i(s)*.*

*Bode diagram of* FOL-i(s)*.*

<sup>3</sup> <sup>þ</sup> *<sup>i</sup>*2*is*

the resonant controller *RC*<sup>2</sup> parameters are deduced as in Eq. (22):

<sup>2</sup> <sup>þ</sup> *<sup>L</sup>*1*ω*<sup>2</sup>

The identification between the system characteristic polynomial *Pi*(*s*) and the generalized stability margin criterion reference polynomial *PGSMi*(*s*) [Eq. (21)] and

<sup>0</sup> þ *i*1*<sup>i</sup>*

*PGSMi*ðÞ¼ *s λi*ð Þ *s* þ *ri* ð Þ *s* þ *ri* þ *jωii* ð Þ *s* þ *ri* � *jωii* (21)

*<sup>s</sup>* <sup>þ</sup> *<sup>i</sup>*0*<sup>i</sup>* (20)
