# Induction Machine-Based EV Vector Control Model Using Mamdani Fuzzy Logic Controller
## 2 Materials and Methods
### Design of P-I Speed Control Model  
The P-I speed control model simulated in Matlab (Simulink) for the speed control of EV is presented in \"Figure 4\". P-I controller is used for controlling speed parameters. The reference speed is compared with the measured speed via a comparator block. The output of the comparator is simultaneously applied to proportional and integral controller. The gains of both controllers are adjusted as per the given error signal and the required reference  
Figure 4: Simulink model of P–I control–based speed controller.  
Figure 5: Simulink model of fuzzy logic controller–based vector control.  
speed is finally achieved by the controller after a continuous closed-loop operation. The P-I controller generates the reference torque input and the estimated rotor flux is generated by taking a direct axis current from ABC to the dq current conversion block, whilst Equation (3) is used in the calculation of a reference quadrature axis-generated current \(i_{qs}^{*}\) required for dq to ABC current conversion; this current is compared with measured current in the current regulator block responsible for six pulses desired for optimum dc supply required for stable speed operation.  
\[i_{qs}^{*}=\frac{2}{3}\cdot\frac{2}{\mathrm{P}}\cdot\frac{L_{r}}{L_{m}}\cdot \left(\frac{T_{e}^{*}}{|\Psi_{r}|_{est}}\right) \tag{3}\]  
Here:  
\(|\Psi_{r}|_{est}\): Estimated rotor flux;  
\(T_{e}^{*}\): reference torque input generated by speed controller;  
\(L_{r}\): rotor inductance;  
\(L_{m}\): motor inductance;  
\(L_{lr}\): rotor leakage inductance;  
\(P\): number of poles;  
\(l_{d}\): direct axis current;  
\(i_{ds}^{*}\): direct axis current generated;  
\(l_{q}\): quadrature axis current;  
\(R_{r}\): rotor resistance;  
\(T_{r}\): rotor time constant;  
\(|\Psi_{r}|^{*}\): input flux; (\(phir^{*}\))  
\(\omega_{r}\): rotor speed;  
\(\omega_{m}\): measured speed;  
\(\theta_{e}\): theta generated;  
\(l_{a}\): phase \(a\) current;  
\(l_{b}\): phase \(b\) current;  
\(l_{c}\): phase \(c\) current.  
Equations (4)-(9) present various parameters required for vector control action:  
\[|\Psi_{r}|_{est}=\frac{L_{m}\cdot i_{d}}{1+T_{r}\cdot s} \tag{4}\]  
\[T_{r}=\frac{L_{r}}{R_{r}} \tag{5}\]  
\[L_{r}=L_{lr}+L_{m} \tag{6}\]  
\[i_{ds}^{*}=\frac{|\Psi_{r}|^{*}}{L_{m}} \tag{7}\]  
\[\omega_{r}=\frac{L_{m}\cdot i_{q}}{T_{r}.|\Psi_{r}|^{*}} \tag{8}\]  
\[\theta_{e}=\int\left(\omega_{r}+\omega_{m}\right) \tag{9}\]  
The conversion of ABC current to dq current is presented in Equations (10) and (11) as below  
\[I_{d}=\frac{2}{3}\left(I_{a}cos\theta+I_{b}cos\left(\theta-\frac{2}{3}\pi \right)+I_{c}cos\left(\theta+\frac{2}{3}\pi\right)\right) \tag{10}\]  
\[I_{q}=-\frac{2}{3}\left(I_{a}sin\theta+I_{b}sin\left(\theta-\frac{2}{3}\pi \right)+I_{c}sin\left(\theta+\frac{2}{3}\pi\right)\right) \tag{11}\]  
The dq current to ABC current conversion is presented in Equations (12)-(14) as  
\[I_{a}=I_{d}cos\theta-I_{b}sin\theta \tag{12}\]\[I_{b} = I_{d}cos\left(\theta-\frac{2}{3}\pi\right)-I_{q}sin\left(\theta-\frac{2}{3 }\pi\right) \tag{13}\] \[I_{c} = I_{d}cos\left(\theta+\frac{2}{3}\pi\right)-I_{q}sin\left(\theta+ \frac{2}{3}\pi\right) \tag{14}\]  
The reference three-phase current \(I_{abc}^{*}\) is obtained by dq to the three-phase conversion process. Here, inputs are \(i_{ds}^{*}\),\(i_{qs}^{*}\) and \(\theta_{e}\) and the output is \(I_{abc}^{*}\). The hysteresis band current regulator takes the measured current \(I_{abc}\) and current generated by dq to the three-phase converter \(I_{abc}^{*}\). The output of the hysteresis band current regulator block is six gate pulses. These gate pulses are used to provide a firing angle to the IGBT switches in the inverter powered by a DC Li-ion battery. The IM was powered by an IGBT inverter. \"Table 1\" shows IM electrical and impedance parameters, respectively.