# Stable Rules Definition for Fuzzy TS Speed Controller Implemented for BLDC Motor
## 2 Description of the Speed Control Algorithm
### Bio-Inspired Optimization of the Fuzzy Speed Controller Using the Chameleon Swarm Algorithm  
The control structure contains three tunable parameters--these are the two input signal gains \(K_{e}\) and \(K_{de}\) and the controller output coefficient \(K_{u}\). In order to keep the above stability considerations valid, it is required that the parameters do not equal 0 and are positive. Considering the rules (Table 1), the relationship between the external parameters of the model could be determined. The output coefficient should have a higher value than the error and error derivative gains. Taking into consideration the above observations, the boundaries of the parameter values were defined for the optimization process according to Table 2.  
In control theory, different approaches to controller coefficient calculations have been proposed, including popular ones such as magnitude and symmetric optimum criteria [59; 60], or the pole placement method [61; 62; 63]. The application of these methods requires the precise identification of the object and the transmittance of the elements. This makes them very difficult to implement with neural or fuzzy controllers, where the controller dynamics cannot be easily described with a transfer function. However, the present trend in tuning controllers is the application of intelligent algorithms [55; 64; 65; 66]. These can solve the problem by an adaptation of the controller coefficients based on object response. This is especially convenient for insufficiently identified machines or compound structures whose mathematical description is very complex. Different groups of optimization algorithms may be considered, depending on the operation principles and inspiration. Bio-inspired metaheuristic optimization algorithms are the most popular [67]. A variety of successful applications have already been presented in papers from different scientific disciplines. The most common problems deal with economic sciences [68; 69], power distribution [70; 71], and mechanics [72]. The tuning process can also be automatized with the application of these algorithms. In this study, the Chameleon Swarm Algorithm (CSA), developed by [PERSON] in 2021 [73], was applied to tune the controller coefficients. The tool is a nature-inspired metaheuristic optimization algorithm that mimics chameleon hunting behavior. The algorithm was initially evaluated successfully with 67 benchmark functions, and since then a variety of implementations have been proposed. The CSA has been implemented for telecommunication \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter** & **Lower Boundary** & **Upper Boundary** \\ \hline \(K_{e}\) & 0.001 & 10 \\ \(K_{de}\) & 0.001 & 10 \\ \(K_{u}\) & 0.001 & 1000 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Limits for the controller parameters. and electronic device design [74; 75] and developed as a computer system supervisor [76] and dataset manager [77]. It was successfully proven that the CSA can also be used as an intelligent tool for robot suspension synthesis [78]. The premise of the CSA is that the best solution is synonymous with prey, while the optimization agent is a hunting chameleon. Similarly to other nature-inspired algorithms, the optimization is calculated iteratively for an evolving group of specimens called the population. Every iteration of the algorithm consists of three steps that are inspired by consecutive chameleon hunting behaviors (reflected in the flowchart of the CSA presented in Figure 7):  
* Search for prey;
* Eye rotation to locate prey;
* Prey capture. The two first steps are based on the unique sight of chameleons, which enables a viewing area of 360\({}^{\circ}\) and helps to reveal prey position. This provides the possibility to explore the search space and define the direction towards the best solution. The last step determines the new position of the chameleon as it approaches its victim with its tongue. Figure 7: Flowchart of the CSA. The algorithm considers multiple chameleons that explore the optimization space.