# Induction Machine-Based EV Vector Control Model Using Mamdani Fuzzy Logic Controller
## 2 Materials and Methods
### Design of MFLC Speed Control Model
Moreover, the remaining interval of both input and output is filled with several triangular-shaped MFs. Input and output intervals are subdivided into seven MFs represented as (EH = extremely high; VH = very high; H = high; N = neutral; L = low; VL = very low; EL = extremely low). The seven MFs used in the model are trapezoidal (R-function, L-function) and triangular functions, respectively. After modeling appropriate MFs (5-Triangular and 2-Trapezoidal), some rule needs to be established to individually relate input MFs with output MFs. All rules are placed on the rule base of FLC. The relationship of the input function dataset with the output function dataset is inversely proportional. This fact guides the development of rules between the respective MFs of input and output accordingly. The rule editor in Simulink provides an environment to design rules built on logical grounds. The rules are modified, added, or deleted in the rule editor. Moreover, the rule viewer provides a platform to check the distribution of MFs as per the rules established in the rule editor. The mapping curve of the input range with the output range is available in the surface viewer. Hence, the user can easily observe output value for selected input values which ultimately helps in the design of the precise and logical distribution of ranges. The list of rules in the rule base is shown below:  
1. If (Speed_difference == EL) => then(torque = EH);
2. If (Speed_difference == VL) => then (torque = VH);
3. If (Speed_difference == L) => then (torque = H);
4. If (Speed_difference == N) => then (torque = N);
5. If (Speed_difference == H) => then (torque = L);
6. If (Speed_difference == VH) => then (torque = VL);
7. If (Speed_difference == EH) => then (torque = EL). Geometric-centroid (GC) defuzzification by [PERSON] and [PERSON] offers a better estimation of the type-reduced centroid. Mathematically, the center of the area \(\big{(}COA\big{)}\) is represented in Equation (16) as:  
\[COA\big{(}B\big{)}\equiv\frac{\sum_{i=1}^{n}y_{i}\mu_{B}\big{(}y_{i}\big{)}}{ \sum_{i=1}^{n}\mu_{B}\big{(}y_{i}\big{)}} \tag{16}\]  
Here:  
\(n\): number of discrete elements;  
\(y_{i}\): current value for ith discrete element;  
\(\mu_{B}\big{(}y_{i}\big{)}\): relevant MF value at point \(y_{i}\). The \(COA\) provides input to the application to be controlled by FLC. In the case of a given input, the Mamdani control block fuzzifies the input and then applies the rule base to generate the output value. A rule base of seven rules is used by FLC to form the output signal. The model was tested multiple times for the correct estimation of the output from the given input signal. After adjustments in MFs and rule base, the final shape of the required response is obtained. Triangular MF in \"Figure 8\" is represented by lower boundary \(c\), upper boundary \(d\), and a peak value m anywhere between the upper and lower boundary where the vertical value is highest. The variable \"\(m\)\" must satisfy the following condition \(c<m<d\). The triangular MF is presented in Equation (17) as:  
\[\mu_{a}^{x}= \begin{cases}0,&x\leq c\\ \frac{x-c}{m-c},&c<x\leq m\\ \frac{d-x}{d-m},&m<x<d\\ 0,&x\geq d\end{cases}  \tag{17}\]  
Trapezoidal MF distinct functions (R-function and L-function) are used to represent a lower and upper range of variables defined in FLC. R-functions are suitable to represent the lower limit, as shown in \"Figure 9\", whereas the L-function fills the upper limit area of the variable range defined in FLC. In the case of the R-function lower limit \"\(c\)\" and lower support limit \"\(d\)\" are at \"\(-\infty\)\". Moreover, an upper support limit \"\(e\)\" and upper limit \"\(f\)\" should meet the following criteria \(e<\)_f_. The trapezoidal MF \(\left(\text{R}\right)\) function is presented in Equation (18) as:  
\[\mu_{a}^{x}= \begin{cases}0,&x>e\\ \frac{f-x}{f-c},&e\leq x\leq f\\ 1,&x<e\end{cases}  \tag{18}\]  
Figure 8: Triangular Member–Function. Figure 9: R–Trapezoidal Member–Function.