## 3 MPPT Control Algorithms
### Fuzzy Logic for MPPT  
As it was previously mentioned, fuzzy logic has been recently introduced for the MPPT of a PV system, being used to increase the performance of traditional MPPT methods (such as the P&O, Incremental Conductance or the PID) or together with other AI based methods such as Artificial Neural Networks or Genetic algorithms. The improved traditional MPPT algorithms are more robust and have the advantage of not requiring exact model information for their design procedure [37]. The main steps of the FLC can be classified in three stages, fuzzification, inference rules and defuzzification. These steps and the general architecture of the controller are presented in Figure 12.  
Figure 11: MPPT tracking, by changing the duty cycle. Figure 10: Flowchart of the P&O algorithm, implemented in the controller model [36]. The first step, named fuzzification, involves taking Crisp Inputs and combining them with stored membership functions, assigned to each input, to produce fuzzy inputs. After this step, the controller must take real time inputs and compare them with stored membership function information, in order to generate its input values. For the proposed FLC, the inputs are the error (\(E\)) and change of error (\(CE\)), at a moment \(n\), which are obtained by Equations (5) and (6). \[E(n)=\frac{P(n)-P(n-1)}{V(n)-V(n-1)} \tag{5}\]  
\[CE=E(n)-E(n-1) \tag{6}\]  
To obtain \(E\), the change of the output voltage and output power of the \(PV\) panel should be calculated through Equations (7) and (8), respectively. \[\Delta V=V(n)-V(n-1) \tag{7}\]  
\[\Delta P=P(n)-P(n-1) \tag{8}\]  
where \(\mathrm{Vpv}(n)\) and \(\mathrm{Ppv}(n)\), are the measured output voltage and the power of the \(PV\) panel at the sample time \(n\). At the first step simulation, both the output voltage and the power have an arbitrary value to initialize the system. As it was explained in the Section 3.1, the change of the output voltage and output power are used to determine if the duty cycle should be either increased, decreased or remain the same. In order to solve this limitation, the FLC will allow a variable value for the step size, that will be determined by the membership functions and the inference rules, which leads to a system performance increases, both in steady state conditions and in the response to the changing environmental conditions. The values of the membership function are assigned to the linguistic variables, using five fuzzy subsets: NB (Negative Big), NS (Negative Small), ZE (Zero), PS (Positive Small), PB (Positive Big). The shape of the membership function and the partition of the fuzzy subsets, which can be adapted to appropriate the system, are shown in Figure 13.  
Figure 12: Typical architecture of a Fuzzy Logic Controller (FLC). The second step is the inference rules, which can be divided in two components, the rule base and the inference engine. In this stage the fuzzy processor uses linguistic rules to determine which control action should occur, based on a set of input values. The rule base is a collection of if-then rules, that contain all the information for the controlled parameters, that are set according to both the operation system control and professional experience. The fuzzy logic algorithm that will be implemented, contains 25 rules that are listed in Table 4.  
The inference engine aims to reach a logical decision, based on the fuzzy rule setting and transforms the rule base into a fuzzy linguistic output. The fuzzy inference method used in this paper, will be [PERSON]'s fuzzy inference method [38]. The result of this step, is a fuzzy output value adjusted for each type of needed action. \begin{table}
\begin{tabular}{l c c c c c} \hline
**ECE** & **NB** & **NS** & **ZE** & **PS** & **PB** \\ \hline NB & ZE & ZE & PB & PB & PB \\ NS & ZE & ZE & PS & PS & PS \\ ZE & PS & ZE & ZE & 2E & NS \\ PS & NS & NS & NS & ZE & ZE \\ PB & NB & NB & NB & ZE & ZE \\ \hline \end{tabular}
\end{table} 
Table 4: FLC rule base.