## 3 T-S Fuzzy Modelling
### Optimization of the Fuzzy Parameter \(m\)  
To improve the approximation of the T-S fuzzy rule base with the input-output learning data, it is proposed to use the PSO algorithm for the optimal search of the \(m\) parameter of the c-means fuzzy algorithm. In addition, the PSO algorithm is also used for the optimal selection of the poles of the closed-loop system of the fuzzy rules defined in Equation (6), with a state feedback control structure for each of the fuzzy rules. In this search for the best parameters within the learning space with the input-output measurements, the PSO algorithm was used, as shown in [32; 33]. The proposed cost functions for the optimization problem should be defined according to the characteristics of the system one intends to work with. In our experiment, the cost function of Algorithm 1 is proposed in order to minimise the error of the system identification. On the other hand, the corresponding number of clusters in Algorithm 1 was defined based on the open-loop response of the PGS. Since it presented four operational set points, as depicted in Figure 3, we decided to use four clusters in order to capture most of the system behaviour. This behaviour in the PGS is due to the hysteresis phenomena introduced by the servomotor used to control the ICE's accelerator. In Algorithm 2, the cost function was defined based on the desired transient response. In this sense, the system poles of the considered electromechanical system were defined in the positive real axis inside the unite circle, since the desired system response should be similar to the response of a first-order system. For a different system, the location  
Figure 4: Open-loop generated voltage and output of the identified fuzzy model under an inductive load, where, Input, is the pwm signal sent to the servomotor used to moves the throttle of the combustion engine, and, Load, is the pwm signal sent to the brushless motor used as an inductive load. of the desired closed-loop poles and the number of clusters/rules will depend on the characteristics of the system, as well as on the desired system response. ```
function PSO Algorithm \(\triangleright\) Close Loop System for\(p_{i}\) \(\leftarrow\) 0.01 to 0.9 do\(\triangleright\) Poles \(p_{i}\)  Optimize \(p_{i}\) using Equation (12) \(\triangleright\) Objective function endfor return\(p_{i}\)  Calculate \(K_{i}\) for each \(c_{i}\) using pole assignment function PDC Control(\(A_{i},B_{i},\mathbf{c},c,K_{i},m,x_{1}(0),x_{2}(0)\)) for i \(\gets\) 1 to \(N\)do  Calculate Euclidean distances using (2)  Calculate the membership degrees using (3)  Calculate the strategy control using (14)  Perform defuzzification using (7) endfor endfunction
```  
**Algorithm 2** Pole placement optimization and PDC control. The cost function employed in the PSO to optimize the parameter \(m\), shown in Equation (3), in Algorithm 1 is based on the RMSE between the measurement obtained from the PGS and the output of the identified fuzzy model, and is given as follows:  
\[\text{RMSE}=\sqrt{\frac{\sum_{k=1}^{N}(VG(k)-x_{2}(k))^{2}}{N}} \tag{10}\]  
where \(VG(k)\) is the value of the physical system output and \(x_{2}(k)\) is the output (state variable) of the system identified through fuzzy modelling. Table 3 shows the values used in the PSO algorithm, as well as the search values assigned to the \(m\) parameter and the obtained optimal value of \(m\). To obtain the value of the constants \(\varsigma_{1}\) and \(\varsigma_{2}\), parameter \(\xi\) is calculated as:  
\[\xi=\frac{2\kappa}{\left|2-\phi-\sqrt{\phi^{2}-4\phi}\right|} \tag{11}\]  
where \(\phi=\phi_{1}+\phi_{2}\). The constants \(\phi_{1}\) and \(\phi_{2}\) are bounded as \(\phi\geq 4\) and \(\leq\)\(x\)\(\leq\) 1, whose values are defined in [34] for the PSO algorithm. Thus, \(\varsigma_{1}\) and \(\varsigma_{2}\) are obtained as \(\varsigma_{1}=\xi\phi_{1}\) and \(\varsigma_{2}=\zeta\phi_{2}\).