## 3 Theoretical Framework
### MPPT Controller and Motion Detection
In this approach, the proposed method predicts the path of cloud movement and anticipates changes in the MPP of the panels after four time steps. In this manner, the proposed approach can predict the MPP of new panels based on the previous data of other panels before the shadow reaches them. This significantly improves the MPPT INC method speed by updating the \(Vpv_{E}\). To  
Figure 10: Different aspects of the studied solar farm: (**a**) the model of the solar farm with panels represented by white dots, (**b**) a cloud and its shadow on the solar farm, and (**c**) the solar farm model with shading effects. Figure 9: INC MPPT controller. detect, locate, and predict the shadow movement in the solar farm area, the 2D normalized cross-correlation (2D NCC) algorithm and linear regression are used. Since the shaded area causes changes in the panels' output, it is only necessary to track the changes in the MPP to determine the pattern of shadow movement on the solar farm. In the proposed approach, area-based matching algorithms are employed for this purpose. These algorithms assume the area of change to be a rectangular block with variable length and width. To identify the new location of the shadow, the location is first calculated based on changes in the MPPT over several time steps. Then, the future shadow's location is predicted by estimating the new motion vector. The cross-correlation algorithm is one of the most common and efficient area-based matching algorithms. This method identifies the new shadow region in the secondary image by searching the image window by window, considering its initial pattern. Among the cross-correlation algorithms, NCC was used in this study as follows:  
\[2 DNCC=\frac{\sum\limits_{v=0}^{R_{length}}\sum\limits_{u=0}^{R_{width}}R(u,v).S(c+u,l+v)}{\sqrt{\sum\limits_{v=0}^{R_{length}}\sum\limits_{u=0}^{R_{width}}R^ {2}(u,v).}\sum\limits_{v=0}^{R_{length}}\sum\limits_{u=0}^{R_{width}}S^{2}(c+u,l+v)}, \tag{23}\]  
where \(R\) and \(S\) are previously shaded areas and current areas, respectively; the intensity values of these images are selected based on the \(V_{mpp}\) value of MPPT controllers; and \(R_{length}\) and \(R_{width}\) denote the length and width of a previously shaded area. If several shades exist in the solar farm, the NCC (Equation (23)) is calculated for all shades separately to find the best match. Compared to other area-based matching algorithms, correlation-based methods require significantly less computational resources and hardware, making them well-suited for online implementations. Figure 11 shows shade changes in four-time steps on the solar farm area. The proposed method identifies the location of the shadow in Figure 11 and then obtains the cloud motion vector using the NCC function (Equation (23)). Figure 11: Shade change in four-time steps on the solar farm area (cloud movement from (**a**) to (**d**)—the location of the shadow in the solar farm are indicated by yellow squares). In the next step, the \(V_{mpp}\) values are predicted using the predicted cloud motion vector. Figure 12 shows real motion vectors, represented using squares, and predicted motion vectors, represented using circles on solid lines. At a glance, the proposed motion estimator predicts the future position of the shadow. Based on this prediction, the central controller predicts the required \(V_{mpp}\) voltage for panels and transmits this information to MPPT controllers. This approach enhances the convergence speed of total MPPT controllers without additional sensors. Figure 13 shows the final solution of the proposed system consisting of the DFIG, PV system, battery charger, ANFIS, and Z-source converter.