## 3 Controller Design
### The Design of SC-AFNN
#### 3.2.2 SC-AFNN Construction  
Based on the fuzzy rule base, the SC-AFNN is further constructed to realize self-learning and self-adjusting of control rules and control parameters. Therefore, SC-AFNN could adapt variational desired trajectories caused by different technological requirements actively. The SC-AFNN consists of an input layer, fuzzification layer, rule layer, normalization layer, defuzzification layer, and output layer. The first layer is the input layer, in which each neuron transmits the input signal to the next layer. The second layer is the fuzzification layer, in which the neurons receive the input layer signals and use Gaussian function as a membership function to divide the distribution of input signals. The third layer is the rule layer, where each neuron represents a fuzzy rule and the firing strength of each rule can be calculated. The fourth layer is the normalization layer, in which each neuron receives the input of all neurons in the rule layer and calculates the normalized firing strength of the given rule. The firing strength of the normalized layer is the ratio of the firing strength of a given rule to the sum of the firing strength of all rules. The fifth layer is the defuzzification layer, in which each neuron is connected to its own normalized layer neuron and receives the initial input. The sixth layer is the output layer, which calculates the sum of the outputs of all neurons in the defuzzification layer. Figure 4 presents the structure of SC-AFNN. The number of input layer neurons is \(m=30\); the input \(\mathbf{x}_{in}\) comprises \([\mathbf{x},\mathbf{\dot{x}}]\), and \([\mathbf{x}_{d},\mathbf{\dot{x}}_{d},\mathbf{\dot{x}}_{d}]\); and the output \(\mathbf{y}_{out}\) is \(\mathbf{\tau}\). The membership functions are defined by the Gaussian functions as follows:  
\[\mu_{A_{j}^{i}}=\exp\left[-\frac{(x_{j}^{(2)}-c_{ij})^{2}}{2\sigma_{ij}^{2}}\right] \tag{17}\]  
where \(c_{ij}\) and \(\sigma_{ij}\), respectively, denotes the center and width of the membership functions; \(i=1,2,\cdots,n\), \(n\) is the number of fuzzy rules; and \(j=1,2,\cdots,m\), \(m\) is the number of input layer neurons. Then, the output layer of SC-AFNN, that is, the control torque \(\mathbf{\tau}\) of each active joint of the hybrid robot, is  
\[y_{i}^{(6)}=\sum_{i=1}^{n}\bar{\sigma}_{i}[\dot{\theta}_{0}^{i}+\dot{\theta}_{ 1}^{i}x_{1}+\dot{\theta}_{2}^{i}x_{2}+\cdots+\dot{\theta}_{j}^{i}x_{j}] \tag{18}\]  
where \(\bar{\sigma}_{i}=\frac{\bar{\sigma}_{i}}{\sum_{i=1}^{n}\bar{\sigma}_{i}}\); \(\bar{\sigma}_{i}=\prod\limits_{j=1}^{m}\mu_{A_{j}^{i}}\) indicates the firing strength of a rule; \([\dot{\theta}_{0}^{i},\dot{\theta}_{1}^{i},\dot{\theta}_{2}^{i},\cdots,\dot{ \theta}_{j}^{i}]\) represents parameters of the consequent part; and \(x_{j}\) is the initial input of SC-AFNN. Figure 3: Membership functions generated by subtractive clustering. (**a**) Membership functions of \(\mathbf{x}_{d}\); (**b**) Membership functions of \(\mathbf{\dot{x}}_{d}\); (**c**) Membership functions of \(\mathbf{\dot{x}}_{d}\); (**d**) Membership functions of \(\mathbf{x}\); (**e**) Membership functions of \(\mathbf{\dot{x}}\). According to (18), the SC-AFNN model of the hybrid robot is  
\[\hat{\mathbf{x}}(t)=\frac{\sum_{i=1}^{n}\sigma_{i}\theta_{i}\mathbf{x}(t)}{\sum_{i=1}^{n} \sigma_{i}} \tag{19}\]  
in which \(\mathbf{x}(t)= \begin{bmatrix}x_{1}(t)\\ x_{2}(t)\\ \ldots\\ x_{j}(t)\end{bmatrix} ,j=1,2,\cdots,m\), \(\mathbf{\theta}_{i}= \begin{bmatrix}0&1&0&\cdots&0\\ 0&0&1&\cdots&0\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ 0&0&0&\cdots&1\\ \theta_{1}^{i}&\theta_{2}^{i}&\cdots&\theta_{(n-1)}^{i}&\theta_{n}^{i}\end{bmatrix} .\)  
**Lemma 1**. : _For the fuzzy system (19), \(\theta(i=1,2,...,n)\) is a stable and nonsingular matrix. If there is a common positive definite matrix \(P_{2}\), for \(\forall i\), \(\theta_{i}^{\mathrm{T}}P_{2}+P_{2}\theta_{i}<0\), then for \(\forall i,j=1,2,...,n\), \(\hat{\theta}_{i}+\hat{\theta}_{j}\) is the stable matrix (the eigenvalues of the stable matrix are in the left half plane)._  
Proof.