*2.5. NN\_P and NN\_V Training and Implementation for Array Control*

First, the MPPs were regressed as a function of irradiance (*G*) and temperature (*T*) with NN\_P. Three methods of regression were compared for this: (a) curve fit [21], (b) feedforward neural network (FFNN) [22], and (c) cascade-forward neural network (CFNN) [23]. As can be seen in Table 1, using the curve fit tool resulted in high MSE, while CFNN resulted in the lowest MSE with 15 neurons; hence, the CFNN was adopted for implementation. This produced NN\_P (*G, T*), as described in Equation (10).

**NN\_P FFNN MSE CFNN MSE Curve-Fit MSE** 3 neurons 9.19 <sup>×</sup> <sup>10</sup>−<sup>4</sup> 2.1 <sup>×</sup> <sup>10</sup>−<sup>4</sup> 9 neurons 7.32 <sup>×</sup> <sup>10</sup> 0.0185 <sup>−</sup><sup>5</sup> 7.76 <sup>×</sup> <sup>10</sup>−<sup>5</sup> 15 neurons 1.01 <sup>×</sup> <sup>10</sup>−<sup>4</sup> 6.5 <sup>×</sup> <sup>10</sup>−<sup>5</sup>

**Table 1.** Mean square error (MSE) for FFNN, CFNN, and curve fit tool for NN\_P for MPP regression.

Second, the terminal voltage of the module was regressed for any given power output *P\**, irradiance (*G*) and temperature (*T*) with NN\_V. Figure 7 highlights the P–V characteristics of a single module, where the right-hand side (RHS) of the MPP was regressed. With different number of hidden neurons, the FFNN and CFNN were examined in terms of their regression accuracy, and results of the comparison are shown in Table 2.

**Figure 7.** Normalized P–V characteristics of the PV panel showing operating point for T = 25 ◦C.



Learning the right-hand side (instead of left-hand side) of the MPP was done for three reasons: (a) to increase regression accuracy of the NN\_V (learning both sides of the P–V characteristics gives two voltages for the same power level that reduces regression accuracy), (b) maneuvering the operating voltage in the second half of the MPP requires reduced controller effort and, hence, increased performance, and (c) the DC/DC converter implemented before the inverter is generally a boost converter and, having a higher input voltage, provides headroom for the boost converter. The output of NN\_V (*G, T, P\**) is the voltage for the desired power output or the voltage setpoint, *Vdc'*.

Here, two separate networks were used to generate *P\** and *Vdc'* to maintain a high level of accuracy. Both networks were trained with the Levenberg–Marquardt algorithm [24,25].

To train NN-V (*G, T, P\**), 112,477 samples (*G, T,* and desired power *P\** as inputs and Vdc' as the output) were extracted from the P–V characteristics. The model was simulated under different operating conditions of *G, T,* and *P\** to collect *Vdc'*. These samples were randomly divided such that 70% were used for training, 20% were used for validation, and 10% were used for testing. To train NN\_P (G, T), 1911 samples of MPP were used and were divided as above. The samples consisted of *G* and *T* as inputs and maximum power as the output, and they were collected by simulating the model under different conditions of *G* and *T*. The error frequency distribution results of the NNs from testing are displayed in Appendix D.

## *2.6. Inverter Control*

The array control can accommodate the primary and secondary control but will perturb the DC voltage. To maintain the DC voltage and the AC bus voltage, the inverter control described below is used. The PV system is interfaced to the grid with a DC/DC boost converter and an inverter with an inductive filter. The inductive filter and its inherent DC resistance can modeled as

$$
\begin{bmatrix} i\_d \\ i\_q \end{bmatrix} = \begin{bmatrix} -\text{^R/}\text{l}\_f & \omega\_s \\ -\omega\_\mathfrak{s} & -\text{^R/}\text{l}\_f \end{bmatrix} \begin{bmatrix} i\_d \\ i\_q \end{bmatrix} + \begin{bmatrix} 1/\text{l}\_f & 0 \\ 0 & 1/\text{l}\_f \end{bmatrix} \begin{bmatrix} \upsilon\_{d\mathfrak{g}} - V\_{d\text{conv}} \\ \upsilon\_{q\mathfrak{g}} - V\_{q\text{conv}} \end{bmatrix}. \tag{12}
$$

*Rf* and *Lf* are filter resistance and inductance, respectively. The parameter values can be found in Table A5. The DC voltage reference, *Vdc*<sup>∗</sup>, and positive sequence bus voltage magnitude reference, |*V*+| ∗ , can be tracked if we choose the control *Vdconv*, and *Vqconv*, as follows:

$$V\_{dconv} = V\_{dcomp} + PI\_1(PI\_2(V\_{dc}" - V\_{dc}) - i\_d)\_\prime \tag{13}$$

$$V\_{q\text{conv}} = V\_{q\text{comp}} + PI\_1 \left( PI\_2 (\left| V\_+ \right|\_\ast - \left| V\_+ \right|) - i\_q \right),\tag{14}$$

where *PI*<sup>1</sup> is a proportional and integral controller that forms the inner loop and tracks the *dq*-axis current, whose reference is generated by the *PI*2, where *PI*<sup>2</sup> is a proportional and integral controller that forms the external loop and tracks the DC voltage or the positive sequence bus voltage magnitude.

$$V\_{dcomp} = \upsilon\_{d\mathcal{K}} + i\_{\mathcal{q}} \omega\_{\mathcal{S}} L\_f \tag{15}$$

$$V\_{qcomp} = v\_{q\text{g}} - i\_d \omega\_s L\_f \tag{16}$$

By choosing *Vdcomp* and *Vqcomp*, we can cancel out the cross-coupling of states, *iq* and *id*, in Equation (12). The *PI* controllers can be tuned using transfer function approximations of the compensated filters and pole placement techniques. Here, *v* and *V* indicate measured and controlled voltage. Subscripts *d, q, comp, conv*, and *g* stand for *d*-axis, *q*-axis, compensation, converter-side values, and grid-side values; *ω<sup>s</sup>* is the synchronous frequency in rads/s.

## *2.7. TPSH Plant Model and Control*

A 100 MW TPSH dynamic model was constructed in Simulink with parameters listed in Table A3. The TPSH turbine and governor model was constructed as described in previous works and studies [7,26] with a few changes to accommodate the logic flags for automatic mode change. This model is available in Figure A1. The automatic mode change control allowed the TPSH to change its modes simply on the basis of the desired power reference. To further detail the automatic mode change control, the pseudocode for the mode change is provided in Appendix B. According to this pseudocode, the controller generates logic flags *ρp*, and *ρ<sup>t</sup>* , with which it changes the mode of operation of the TPSH. The logic flags indicate on or off commands to the pump and turbine, respectively. The synchronous machine used for the TPSH is a sixth-order machine model [27], with a standard IEEE Type1 excitation system [28], without any stabilizer. All these components are readily available in Simulink libraries. The parameters used for all these components are provided in Tables A1–A3. The model was implemented in [7,26], which demonstrated that it can describe the reference tracking performance, the fast frequency response performance of the TPSH in both turbine and pump mode, and its mode change capability.

## **3. Results**

#### *3.1. Implementation*

The important model modifications and techniques used while implementing the model shown in Figure 3 were as follows:


#### *3.2. PV Plant Set Point Tracking*

To show the accuracy and efficiency of the PV plant and array control, the PV plant with four 25 MW arrays was integrated to an infinite bus and tested for its set-point tracking capability. The main aim of performing set-point tracking is to validate the control scheme described in Figure 5. The solar irradiation levels for the four PV arrays were set to 850, 950, 900, and 400 W/m2 with temperature set to 25 ◦C. Step increments of power reference were made at intervals of 5 s to replicate automatic generation control (AGC) signals. If all arrays were curtailed by 10% with insolation levels being 850, 950, 900, and 400 W/m2, array 4 would have the least amount of reserves. When the AGC step change was equally divided, array 4 was not be able to supply its share accurately as array 4 would saturate at its own MPP faster than the others and, hence, would cause inaccurate tracking of the set-point, as we can see at *t* = 7, 11, and 24 s in Figure 8a. However, when the set-point change was divided in proportion to the reserve of each array, accuracy of set-point tracking increased, as shown in Figure 8b. In other words, the controls were able to coordinate unshaded and shaded arrays to meet a particular set-point.

It was also noticed that the set-point tracking with neural networks was highly accurate. From Figure 8, the output was tracked accurately when the desired output was below the MPP. However, if the desired output was greater than the MPP of the plant, the output saturated at the MPP, as observed from *t* = 11 to 24 s. Figure 8c reflects the accurate and smooth performance of the inverter controls.
