# Online Learning-Based ANN Controller for a Grid-Interactive Solar PV System
## 4 Proposed ANN Model to Control Grid-Interactive VSC  
Valuation of the active component and reactive component of the load currents and reference source currents were determined using the backpropagation algorithm. The block diagram of the weight estimation is shown in Figure 6. The sensed source currents and reference source currents were processed, errors were amplified through a PI controller, and their outputs were fed to a PWM controller to generate IGBT switching pulses.  
URp, UYp, and UBp are the unit template voltages of the three-phase source grid. ILr, ILy, and IIB are the sensed load currents of the three phases. Assuming the initial weights, the estimated weights were calculated and activated using a sigmoidal function. The weights were updated until the error becames zero. The ANN model of the proposed controller is shown in Figure 7.  
Figure 5: Bode plot of the super-lift Luo converter.  
Figure 6: Block diagram of the ANN controller.  
Batch/offline training is typically a time-consuming matter as it may include many repetitions throughout the training data. In most cases, this may demand much time; furthermore, the learning parameters (i.e., learning rate, number of learning epochs, stopping criteria, and other predefined parameters) must be appropriately selected to ensure convergence. Whenever new sets of data are used by the batch model, it includes the past set of data together with the new data, and performs a retraining, thus taking a large amount of time.  
Online learning performs parameter updates one by one (no training with the entire dataset)  
No redundancy as there is only one update at a time;  
It learns online, so it is faster than offline learning;  
Backpropagation is the appropriate method for both offline and online learning.  
A gradient descent-based backpropagation (BP) algorithm offers improved simplification performance at an enormously fast learning rate and the training of many models can be finished much faster. This algorithm is used to estimate the reference source current components to obtain the pulses for the DSTATCOM.  
One input layer, one output layer, and two hidden layers were used in the model, as shown in Figure 8. There were three neurons in each layer for the active component estimation of reference source currents, and three for the reactive component.  
The weights were updated continuously using an online-learning based gradient descent backpropagation algorithm. The detailed algorithm is shown using the flowchart in Figure 9. The same ANN model can also be used for unbalanced loads.  
Figure 8: Structural view of the ANN model.  
Figure 7: Configuration of backpropagation-based ANN model.  
The updated weight of the active component of phase R was assessed using Wp(k) as a feedback signal represented as an Equation (10).  
\[\mathrm{W_{Rp}(k)}=\mathrm{W_{p}(k)}+\eta\{\mathrm{W_{p}(k)}-\mathrm{W_{Rp1}(k)} \}\mathrm{f}\left(\mathrm{i_{Rp1}}\right)Z_{Rp}(k) \tag{10}\]  
Revision of the weights using backpropagation algorithm is shown in Figure 9. Wp(k) is the average weight of three phases; WRp1(k) is the fundamental component of the R phase; iRp1 is the current of phase R, i.e., output of the hidden layer; ZRp(k) is the sigmoidal function output; and \(\eta\) is the learning rate, which was tuned and updated as per the adaptive learning based-gradient descent online learning.