## 3 Theoretical Framework
### ANFIS Controller  
In the current study, the wind turbine, one of the main parts of the studied system, is connected to DFIG and Z-source converter, which are controlled using ANFIS through switching systems (Figure 1). Switching by converters produces voltage and current harmonics, thus increasing power losses in electrical machines. Increasing the switching frequency reduces torque and power ripple. On the other hand, the limited switching frequency for power electronic equipment is necessary to increase the frequency to the desired level. Therefore, other methods must be used to reduce losses and fluctuations in the electric drive system [65]. Several methods have been proposed for controlling DFIGs, particularly the vector and direct control methods [66; 67; 68]. The vector control method controls the flux vector, and direct torque and power control methods directly detect the error in DFIG parameters, such as torque, flux, real power, and reactive power, and then set the rotor voltage using pre-defined criteria. An ANFIS controller combines an artificial neural network (ANN) and a fuzzy system. ANNs are mathematical models for fast and accurate processing of information. The ability of ANNs to learn different patterns has led to their widespread use. ANNs transfer data throughout their network structures based on learning processes during data handling. Neural networks can be viewed as electronic models of the human brain, with the foundation of these models being the simulation of neuron activity. A fuzzy system is based on knowledge and rules. The meaning of knowledge concerns the knowledge of human experts, and the purpose of regulations involves the establishment of rules. Human experience is essential to a fuzzy system, often derived from fuzzy if-then rules. There are two main steps in a fuzzy system, namely, (1) extraction of the rules and (2) combining these rules into a single system known as a fuzzy system. The precise design of a fuzzy controller depends on the high level of experience of the system under study, mainly due to the selection and adjustment of membership functions and their rules. Combining ANN and fuzzy systems can result in a controller with less training data. In this study, aiming to determine the power reference, the DFIG direct power control method was used from an ANFIS controller to reduce the ripple in the speed and torque responses. Additionally, a proportional-integral controller was used to adjust the parameters of the fuzzy elliptic membership functions of the proposed controller. The general plan of the proposed controller was taken from [69], where a type 2 fuzzy neural network was used. The ANFIS controller proposed for the studied wind turbine is shown in Figure 1. In the proposed scheme, the ANFIS controls both converters. A comprehensive analysis under different scenarios, such as variations in wind speed and super- and sub-synchronous modes, was conducted in the study presented in [53], which validated the performance of the used solution compared to conventional proportional-integral (PI), PI-supervised ANFIS, and model predictive control controllers. On the other hand, the ANFIS controller used for the studied PV system is a modified version of the one suggested in [33]. The block diagram of the proposed PV system, ANFIS controller, and Z-source converter is depicted in Figure 6. The proposed approach, similar to [33], uses the change in power with respect to voltage (\(\frac{dP}{dP}\)) and the rate of change of power for voltage (\(\frac{\Delta dP}{dP}\)) as additional input variables. The difference between the proposed approach and that suggested in [33] is the addition of a Z-source converter to convert DC output to AC form. This proposed approach results in a sharper response than usual controllers, leading to robust performance and reduced convergence time for the MPPT controller, which is desirable [33];  
The ANFIS controller, Z-source converter, and the main DC-AC converter (Figure 5) regulate the generated voltage before supplying it to the load.