# A New General Type-2 Fuzzy Predictive Scheme for PID Tuning
## 3 Identification by Fuzzy System  
This section illustrates the generalized type-2 fuzzy-logic systems (GT2-FLS) that is used for online modeling. The general scheme of the proposed control system is depicted in Figure 1. As it is seen from Figure 1, the system model is online identified by the suggested GT2-FLS. The structure of GT2-FLS is depicted in Figure 2 and details are illustrated as follows.  
(1) The inputs of GT2-FLS are control signal and system output at previous sample times. (2) The suggested membership function (MF) is shown in Figure 3. For \(\beta\) slice level, we have:  
\[\begin{array}{c}\tilde{\vartheta}_{\dot{y}_{i,\beta}^{h}}\left(x_{i}\right)= \frac{1}{2}\Big{(}\tilde{\vartheta}_{\dot{y}_{i,0}^{h}}\left(x_{i}\right)+ \underline{\hat{\varrho}}_{\dot{y}_{i,0}^{h}}^{h}\left(x_{i}\right)\Big{)}+\\ \frac{1}{2\ln(1/\varepsilon)}\Big{(}\tilde{\vartheta}_{\dot{y}_{i,0}^{h}}^{h} \left(x_{i}\right)-\underline{\hat{\varrho}}_{\dot{y}_{i,0}^{h}}^{h}\left(x_{i }\right)\Big{)}\sqrt{\ln(1/\beta)}\end{array} \tag{1}\]  
\[\begin{array}{c}\underline{\hat{\varrho}}_{\dot{y}_{i,\beta}^{h}}^{h}\left(x _{i}\right)=\frac{1}{2}\Big{(}\tilde{\vartheta}_{\dot{y}_{i,0}^{h}}^{h}\left(x _{i}\right)+\underline{\hat{\varrho}}_{\dot{y}_{i,0}^{h}}^{h}\left(x_{i}\right) \Big{)}-\\ \frac{1}{2\ln(1/\varepsilon)}\Big{(}\tilde{\vartheta}_{\dot{y}_{i,0}^{h}}^{h} \left(x_{i}\right)-\underline{\hat{\varrho}}_{\dot{y}_{i,0}^{h}}^{h}\left(x_{i }\right)\Big{)}\sqrt{\ln(1/\beta)}\end{array} \tag{2}\]where,  
\[\bar{\vartheta}_{\bar{\psi}_{i0}^{k}}(x_{i})=\exp\left(-\frac{\left(x_{i}-\zeta_{ \bar{\psi}_{i0}^{k}}\right)^{2}}{\bar{\psi}_{i0}^{2}}\right) \tag{3}\]  
\[\bar{\vartheta}_{\bar{\psi}_{i0}^{k}}(x_{i})=\exp\left(-\frac{\left(x_{i}-\zeta_ {\bar{\psi}_{i0}^{k}}\right)^{2}}{\frac{\sigma^{2}_{\bar{\psi}_{i0}^{k}}}{ \bar{\psi}_{i0}^{2}}}\right) \tag{4}\]  
where \(\bar{\psi}_{i0}^{k}\) denotes the \(l^{th}\) MF for \(i-th\) input, \(c_{\bar{\psi}_{i0}^{k}}\) represents the center of MF, \(\varepsilon\) is the small constant and \(\sigma_{\bar{\psi}_{i0}^{k}}\) and \(\bar{\sigma}_{\bar{\psi}_{i0}^{k}}\) are the standard divisions.  
Figure 1: Schematic of the proposed control scheme.  
Figure 2: The structure of the proposed GT2-FLS.  
(3) The rule firings are written as:  
\[z_{h,\beta} =\bar{\theta}_{\bar{y}_{1,\beta}^{h}}(x_{i})\times\cdots\bar{\theta} _{\bar{y}_{n,\beta}^{h}}(x_{i}) \tag{5}\] \[\bar{z}_{h,\beta} =\bar{\theta}_{\bar{y}_{1,\beta}^{h}}(x_{i})\times\cdots\bar{ \theta}_{\bar{y}_{n,\beta}^{h}}(x_{i}) \tag{6}\]  
where, \(h=1,...,\mu\) and \(\mu\) are rules number. (4) The output is written as:  
\[\hat{f}=\frac{\sum\limits_{h=1}^{\mu}\beta\Big{(}z_{h,\beta}\bar{\theta}_{h}+ z_{h,\beta}\bar{\theta}_{h}\Big{)}}{\sum\limits_{\beta}\sum\limits_{h=1}^{\mu} \bar{z}_{h,\beta}+z_{h,\beta}} \tag{7}\]  
where, \(\bar{\theta}_{h}\) and \(\bar{\theta}_{h}\) are rule parameters.  
The rule parameters are leaned by the following adaptation law:  
\[\bar{\theta}_{h}(t+1) =\bar{\theta}_{h}(t)+\gamma\sum\limits_{\beta}\frac{\beta z_{h, \beta}}{\sum\limits_{h=1}^{\mu}z_{h,\beta}+\bar{z}_{h,\beta}}e \tag{8}\] \[\bar{\theta}_{h}(t+1) =\bar{\theta}_{h}(t)+\gamma\sum\limits_{\beta}\frac{\beta z_{h, \beta}}{\sum\limits_{h=1}^{\mu}z_{h,\beta}+\bar{z}_{h,\beta}}e \tag{9}\]  
where, \(\gamma\) is a constant and \(e\) represents the tracking error.