# Fuzzy Sliding Mode Control of Vehicle Magnetorheological Semi-Active Air Suspension
## 2 Damping Performance Test and Mechanical Modeling of MR Damper
### ANFIS Inverse Model of MR Damper  
The ANFIS is a multilayer feedforward network that uses neural network learning algorithms and fuzzy reasoning to map an input space to an output space [29]. The ANFIS algorithm has a strong adaptive ability and self-learning ability, and it has a strong approximation ability to the nonlinear system. Therefore, ANFIS is suitable for the modeling of complex systems, such as MR dampers. Figure 7 shows the structure of ANFIS. There are five layers in total, and the function types of the nodes in each layer are the same. Layer 1 is used to fuzzify the input signal, and its node output is defined as follows:  
\[\left\{ \begin{array}{l}o_{1,i}=\mu_{A_{i}}(x),i=1,2\;or\\ o_{1,i}=\mu_{B_{i-2}}(x),i=3,4\end{array} \right. \tag{6}\]  
where \(o_{1,i}\) is the output of the \(i\)th node of layer 1, and \(x\) represents the input of the node, respectively. \(A_{i}\) (or \(B_{i-2}\)) represents fuzzy sets (negative big, negative small, positive big, positive small, etc.). The membership function of the fuzzy set is as follows:  
\[\mu_{A_{i}}(x)=\frac{1}{1+\left(\frac{x-c_{i}}{a_{i}}\right)^{2b_{i}}},\mu_{B_ {i-2}}(x)=\frac{1}{1+\left(\frac{y-c_{i}}{a_{i}}\right)^{2b_{i}}} \tag{7}\]  
The above equation is bell-shaped functions (the maximum is 1, the minimum is 0), where \(\{a_{i},b_{i},c_{i}\}\) is the premise parameter used to adjust the shape of the function. Layer 2 is represented by \(\pi\), whose function is to calculate the applicability of each rule \(w_{i}\). The specific operation is to take the product of the membership degree of each input signal as the applicability of this rule, as shown in the equation below. \[o_{2,i}=w_{i}=\mu_{A_{i}}(x)\times\mu_{B_{i}}(y),i=1,2 \tag{8}\]  
Layer 3 is represented by circle N as shown in the Figure 7. Layer 3 is used to normalize the applicability of each rule, as shown in Equation (9). \[o_{3,i}=\overline{w}_{i}=\frac{w_{i}}{w_{1}+w_{2}},i=1,2 \tag{9}\]  
The function of Layer 4 is to calculate the output of each rule. The node function is expressed as follows:  
\[o_{4,i}=\overline{w}_{i}f_{i}=\overline{w}_{i}(p_{i}x+q_{i}y+r_{i}),\;i=1,2 \tag{10}\]  
where parameters \(\{p_{i},q_{i},r_{i}\}\) represent an adjustable parameter set. Figure 7: Structure diagram of ANFIS with two inputs. Layer 5 sums up all the inputs of the node and outputs the results to calculate the total output of the system. \[o_{5,i}=\sum\limits_{i=1}^{2}\overline{w}_{i}f_{i}=\frac{\sum\limits_{i=1}^{2}w_ {i}f_{i}}{\sum\limits_{i=1}^{2}w_{i}} \tag{11}\]  
ANFIS can obtain the required fuzzy rules and membership function after repeated training based on a large amount of data. Usually, the BP algorithm or hybrid algorithm is used to train the data. The adaptive neuro fuzzy inference system (ANFIS) was used to establish the inverse model of the MR damper in this paper [30]. The training schematic diagram of the ANFIS inverse model of the MR damper is shown in Figure 8. In order to establish the inverse model of ANFIS, the velocity, displacement and expected damping force at the current moment as well as the velocity and desired damping force provided by the forward model at the previous moment were selected as the input, while the control current at the current moment was taken as the output. Two sets of data were needed to model a MR damper, using an adaptive neuro-fuzzy reasoning system. One set was used to train the inverse model of ANFIS, and the other set was used to test the accuracy of the model. A sinusoidal function with an amplitude of 20 mm was used for the displacement signal, and a sinusoidal function with an amplitude of 0\(\sim\)2 A was used for the control current signals. There were 1500 data points of which 1000 points were used for training and 500 points were used for validation. Figures 9 and 10 show the comparison between the experimental and predicted values as well as the error of the ANFIS inverse dynamics model of the MR damper, respectively.