# Stable Rules Definition for Fuzzy TS Speed Controller Implemented for BLDC Motor
## 2 Description of the Speed Control Algorithm
### Fuzzy Rules Definition  
The requirement of good dynamics is the main assumption for designing a speed controller. Nevertheless, it is crucial, at the same time, to ensure the stability of operation. This can be achieved by adapting the transfer function of the controller to the plant when all the elements are properly identified and the parameters are correctly selected. If more complex nonlinear controllers are taken into account, the mathematical model also becomes more problematic. Because of this, such a procedure is unfeasible in real applications and is susceptible to changes in the drive parameters. A common concept in the design process is based on the fact that the stability of the control structure may be verified for the system. Different methods can be used to prove the stability of the control structure, among which the Routh-Hurwitz [53] or Nyquist [54] stability criteria are the most popular in control theory. However, for nonlinear systems, verification according to the Lyapunov stability theorem is the most common approach [55; 56; 57]. In this application of the fuzzy model, as the speed controller of a drive, it was assumed that the key element for the correct operation of the system was the definition of the rule base.  
Figure 4: The structure of the fuzzy controller (NVB—negative very big; N—negative; PVB—positive very big; and P—positive).  
The stable rules selection began with the definition of the speed error as  
\[e=\omega_{m}-\omega_{ref} \tag{6}\]  
where \(\omega_{m}\) is the measured speed, and \(\omega_{ref}\) is the reference speed.  
For the stability considerations, the two-element positive-definite Lyapunov candidate function was chosen (7):  
\[V(q_{1},q_{2})=\frac{q_{1}^{2}+q_{2}^{2}}{2} \tag{7}\]  
where \(q_{1}\) and \(q_{2}\) are the controlled process state variables. For the analyzed controller, the following mathematical expressions were assumed:  
\[q_{1}=e \tag{8}\]  
\[q_{2}=\frac{de}{dt}=e \tag{9}\]  
According to the Lyapunov criterion, in order to confirm the system stability, the condition given by Equation (10) has to be fulfilled [58].  
\[\dot{V}\leq 0 \tag{10}\]  
where \(\dot{V}\) is the derivative of the Lyapunov candidate function:  
\[\dot{V}=q_{1}\cdot\dot{q}_{1}+q_{2}\cdot\dot{q}_{2} \tag{11}\]  
Hence, replacing the universal variables with the process-specific ones ((8) and (9)) and combining them with the Formula (10), the stability condition is defined as follows:  
\[e\cdot\dot{e}+\dot{e}\cdot\ddot{e}\leq 0 \tag{12}\]  
Because the error value depends on the object state variable (6), it can be assumed that the second derivative of the error value is proportional to the control signal:  
\[\ddot{e}\propto u \tag{13}\]  
where \(u\) is the control signal. Thus, the following considerations were included in the expression presented below:  
\[e\cdot\dot{e}+\dot{e}\cdot u\leq 0 \tag{14}\]  
\[\dot{e}\cdot(e+u)\leq 0 \tag{15}\]  
It can be noted that if \(\dot{e}=0\), the condition is fulfilled arbitrarily for any value of the speed error \(e\) and control signal \(u\). In order to define a full knowledge base, where all state variables are determined, the scenario presented below was applied:  
\[\dot{e}\to 0^{-}=0-\delta \tag{16}\]  
\[\dot{e}\to 0^{+}=0+\delta \tag{17}\]  
where \(\delta\) is a very small value. In such a case, the sign of the equation in brackets (15) can always be determined.  
Using the above-described assumptions, a definition of the stable control rules can be provided. The considerations of the first rule are presented below.  
_Let \(\dot{e}<0\); then, the condition in (15) is true if \(e+u\geq 0\). This is always true for \(e\geq 0\) and \(u\geq 0\)._