## 5 Proposed Fuzzy Logic Controller  
The baseline PI acts on the tracking error of the reference for the generator speed, and it presents a gain-scheduling law that depends on the actual value of the collective pitch. The addition of an Anti Wind-Up method (Figure 4) improved this PI performance according to the aforementioned indexes [52]. The original PI is described in detail in [19; 45], and the improved PI and its implementation for simulation is presented in [46]. The main contribution of this work is the description and evaluation of a fuzzy logic controller that adjusts the reference calculated by the improved PI controller. The fuzzy rules were designed according to expert knowledge of the desired behavior of the system. Since the desired behavior could be better described using linguistic variables, a Mamdani-type fuzzy inference was selected. The scheme of the topology of the proposed fuzzy logic controller can be seen in Figure 5.  
As can be seen, the improved PI calculates a pitch reference, which is sent to the fuzzy logic controller. Using it and the generator speed as normalized inputs, this fuzzy logic controller produces a new and adjusted pitch reference for the blades. A common practice is to make the output values fall within the range [0, 1] and to de-normalize it afterward, which, in the scheme, is completed before sending the fuzzy pitch reference to the wind turbine, i.e., the OC4 Deepwind semi-submersible FAST simulation model. Explicitly, the Mamdani-type fuzzy logic controller is composed of:  
* Two normalized inputs (generator speed and the pitch reference calculated by the improved PI, Figures 6-9) and one normalized output (pitch reference calculated by the fuzzy logic controller, Figures 10 and 11). The membership functions of each of them are shown in Tables 2-4. Figure 4: Simplified diagram for the improved PI scheme. Figure 5: Simplified diagram for the proposed fuzzy logic controller topology scheme. Figure 11: Membership functions of the pitch reference input. Zoom-in on the \([0,0.20]\) range of the horizontal axis. Figure 10: Membership functions of the pitch reference output. Figure 9: Membership functions of the pitch reference input calculated by the improved PL Zoom-in on the range \([0,0.20]\) of the horizontal axis. Figure 12: A surface that summarizes the interactions between the rules, inputs, and membership functions to produce the output. The general form representation is due to using a big mesh with low precision. \begin{table}
\begin{tabular}{c c c} \hline
**MF Name** & **MF Type** & **Defining Points** \\ \hline Null & Trapmf & [\(-0.225\)\(-0.025\)\(-0.001\)\(-0.002\)] \\ L1 & Trimf & [\(0.002\)\(-0.02\)\(-0.04\)] \\ L2 & Trimf & [\(0.02\)\(-0.04\)\(-0.06\)] \\ L3 & Trimf & [\(0.04\)\(-0.06\)\(-0.08\)] \\ L4 & Trimf & [\(0.06\)\(-0.08\)\(-0.10\)] \\ Max & Trapmf & [\(0.08\)\(-0.20\)\(-1.0\)\(-1.50\)] \\ \hline \end{tabular}
\end{table} 
Table 3: Input 2 (improved PI pitch reference) membership functions (MF). Figure 13: A surface that summarizes the interactions between the rules and membership functions using the output value for each pair of input values. Representation with a small mesh so the details of transitions can be appreciated. The membership functions for the generator speed input were defined with respect to several relevant speed values above the nominal value, as shown in Figure 6. A normalization with regard to the nominal generator speed is applied. This is reflected in the name of the sets, were A5.0 means a membership function centered on a speed of 5.0% higher than nominal speed, as shown in Figure 7 and summarized in Table 2.  
For the improved PI pitch reference input, the behavior of that PI was studied under different operating scenarios, resulting in the division of possible pitch values into some ranges (Figure 8).