## 4 Fuzzy-PI Controller Design  
In order to design a fuzzy logic controller (FLC) for the current control loop, the block diagram of LC filter in the d-q rotating reference frame shown in Figure 6 is considered as a plant system. The plant system can be modelled by using the d-axis component only as shown in Figure 11, where the cross coupling and the grid voltage are neglected. Figure 12 shows a block diagram of the current control loop for GSC. The control system is composed of a Fuzzy-PI controller, a processing delay, and a plant system, using the converter side voltage (\(V_{id}\)) as input and the converter side current (\(I_{id}\)) as output. The FLC is used to adjust the PI parameters according to the input signal error (\(er\)). To determine a control signal for proportional signal control (\(P_{er}\)) and integral signal control (\(I_{er}\)), an inference engine with rule base having if-then rules in form of \"If \(er\), then \(P_{er}\) and \(I_{er}\)\" is used. The general structure of the fuzzy logic control is shown in Figure 13. The FLC is composed of fuzzification, membership function, rule base, fuzzy inference and defuzzification. Figure 11: The LC filter in d-axis component only. Figure 10: Pitch controller. The fuzzification comprises the process of transforming crisp values into grades of membership for linguistic terms of fuzzy sets. The membership function is used to associate a grade to each linguistic term. For fuzzification, the three variables of the FLC--the error (\(er\)) and the outputs of \(P_{er}\) and \(I_{er}\)--have five triangle membership functions. The variables fuzzy subsets for input are Negative Big (NB), Negative Small (NS), Zero (Z), Positive Small (PS), and Positive Big (PB). Figure 14 shows the membership function for input \(er\). The interval input of the membership function is set at [\(-\)1 to 1] due to the variation of the d-axis or q-axis current between \(-\)1 to 1 pu. Figures 15 and 16 show the membership functions of output for \(P_{er}\) and \(I_{er}\), respectively. The membership functions are designed based on frequency response of the bode diagram of the current control loop. In this paper the initial gain \(K_{p}\) is obtained by using optimum modulus criterion. The integral time constant (\(T_{i}\)) usually set equal to the plant system time constant (\(L_{tot}/R_{tot}\)) [6], where  
Figure 14: The membership function for input \(er\). Figure 12: Current control loop of the grid side converter (GSC). Figure 13: Block diagram of fuzzy logic controller. Figure 17 shows frequency response of the bode diagram of the current loop control of GSC for four different values of \(K_{p}\) and \(K_{i}\). It is seen that maximum gain with gain margin (Gm) larger than 10 dB and phase margin (Pm) larger than 45\({}^{\circ}\) is obtained with \(K_{p}\) = 0.35 and \(K_{i}\) =7.07. Therefore, the interval of membership function for output \(P_{er}\) and \(I_{er}\) can be set at [\(-\)0.35 to 0.35] and [\(-\)7.04 to 7.04] as shown in Figures 15 and 16, respectively. The rules are set based upon the knowledge and working of the system. The values of \(P_{er}\) and \(I_{er}\) for Fuzzy-PI controller of the current regulator are calculated for the changes in the input of the FLC according to the rule base. The number of rules can be set as desired. A rule in the rule base can be expressed in the form: \begin{tabular}{l l l} If (_er_ is NB), & then (\(P_{er}\) is NB) & and (\(I_{er}\) is NB) \\ If (_er_ is NS), & then (\(P_{er}\) is NS) & and (\(I_{er}\) is NS) \\ If (_er_ is ZE), & then (\(P_{er}\) is ZE) & and (\(I_{er}\) is ZE) \\ If (_er_ is PS), & then (\(P_{er}\) is PS) & and (\(I_{er}\) is PS) \\ If (_er_ is PB), & then (\(P_{er}\) is PB) & and (\(I_{er}\) is PB) \\ \end{tabular}   
The rule base includes five rules, which are based upon the five membership functions of the input variables to achieve the desired \(P_{er}\) and \(I_{er}\). In this work, [PERSON]'s max-min method is used for inference mechanism.