# Self-Evolving Fuzzy Controller Composed of Univariate Fuzzy Control Rules
## 3 Proposed Self-Evolving FLC Design Method
### Online Stage
#### 3.3.3. New Fuzzy Control Rule  
When the criteria, defined later in Section 3.3.4, to add fuzzy control rules are met, a fuzzy control rule will be added to the current knowledge base (i.e., fuzzy control rules defined by (2)). In this way, for the candidate input variable \(x_{j^{*}}\) will be added a new fuzzy control rule \(R_{j^{*}}^{new}\), defined by the membership function \(A_{j^{*}}^{new}\) and the consequent \(\theta_{j^{*}}^{new}\).  
To design the new fuzzy control rule \(R_{j^{*}}^{new}\), the first step is to create the new membership function \(A_{j^{*}}^{new}\). The membership functions being characterized by complementary triangular MFs (Figure 1), it is necessary to define the center of \(A_{j^{*}}^{new}\). In order to reduce the sensitivity to noise/outliers, the center of the new membership function will be obtained based on (as a function of) the distribution of the control estimation error \(e_{c}\). For that purpose, first, a variable \(m_{c}\) representative of such distribution is defined as follows:  
\[m_{c} = \frac{\sum_{m=1}^{T_{M}}m(u(m)-\hat{u}(m))^{2}}{\sum_{m=1}^{T_{M} }(u(m)-\hat{u}(m))^{2}}, \tag{16}\]where, similarly to (13), \(u(m)\) represents the real controller, which is stored in the sliding window \(\mathbf{M}\) (10) at the window's sample time \(m\), and \(\hat{u}(m)\) is the control signal (13) given by the current FLC designed at time instant \(k\) (\(u(\bar{\mathbf{x}}(m))\)) using the vector \(\bar{\mathbf{x}}(m)\). The center of the new membership function \(A_{j^{*}}^{new}\) is given by \(\bar{x}_{j^{*}}(\left\lceil m_{c}\right\rfloor)\), where \(\bar{x}_{j^{*}}\) is the \(j^{*}\)-th variable (15) (component) of \(\bar{\mathbf{x}}\), \(\left\lceil m_{c}\right\rfloor\) is the integer nearest to \(m_{c}\) (16), and \(\bar{\mathbf{x}}(\left\lceil m_{c}\right\rfloor)\) is the value of \(\bar{\mathbf{x}}\) on the \(\left\lceil m_{c}\right\rfloor\)-th sample time of the sliding window \(\mathbf{M}\) (10).  
The new membership function \(A_{j^{*}}^{new}\) and the nearest left (\(A_{j^{*}}^{left}\)) and right (\(A_{j^{*}}^{right}\)) membership functions (which should be updated due to the introduction of a new MF on the respective variable) are given by:  
* \(A_{j^{*}}^{left}\): \(c_{j^{*}left\lceil j,left\rceil=b_{j^{*},new};\right.\)
* \(A_{j^{*}}^{new}\): \(a_{j^{*},new}=b_{j^{*},left};b_{j^{*},new}=\bar{x}_{j^{*}}(\left\lceil m_{c} \right\rfloor)\); and \(c_{j^{*},new}=b_{j^{*},right}\);
* \(A_{j^{*}}^{right}\): \(a_{j^{*},right}=b_{j^{*},new}\).  
Since the antecedent membership functions are defined as complementary triangular membership functions (Figure 1), then in \(A_{j^{*}}^{left}\) and \(A_{j^{*}}^{right}\), only one of their parameters is updated due to the introduction of the membership function \(A_{j^{*}}^{new}\).  
The consequent parameter of \(R_{j^{*}}^{new}\) is obtained as follows:  
\[\theta_{j^{*}}^{new}(k)=\frac{\sum_{i_{j}=left_{t}}^{right}u_{A_{j^{*}}^{i_{j} }}(x_{j^{*}}(k))\,\theta_{j}^{i_{j}}}{\sum_{i_{j}=left_{t}}^{right}\mu_{A_{j^ {*}}^{i_{j}}}(x_{j^{*}}(k))}, \tag{17}\]  
where \(left=i_{j}^{*}-1\) and \(right=i_{j}^{*}+1\) are respectively the nearest left \(A_{j^{*}}^{left}\) and right \(A_{j^{*}}^{right}\) membership functions (MFs). With (17), the impact of the introduction of a new control rule, while the process is under control, is reduced.