## 4 Case Study
### ANFIS Application--Case of Bearing Seat 2  
The data shown in Figure 7 (only \(\text{HPD}_{\text{CNC2}}\)) and Figure 9 were used to teach and evaluate the ANFIS learning process. A set of training data containing 72 data groups and a set of testing data containing 25 data groups used to check the quality of the training process were prepared. The test set was prepared so that every fourth result was selected from all the results and assigned to the test group and the remaining results were assigned to the training group. Figure 9: Error \(\text{E}_{\text{A}-2}\) for individual covers. A diagram of ANFIS and a mathematical description of data processing and the training process can be found in numerous references, e.g., [27; 28]. That is why this paper is limited to important features and parameters of ANFIS that were adopted after numerous tests. A general ANFIS structure is presented in Figure 10.  
Membership functions of fuzzy sets were assumed in the form of Gaussian curves--three sets per input variable. For an output variable, the so-called singletons, i.e., fixed values, were assumed in the quantity of 9. Sharpening was carried out on a weighted average basis. The desired output values from ANFIS were deviations specified on the basis of the results of measurements carried out on the CMM (HPDCM2 presented in Figure 7). The following rule base was created:  
\[ \begin{array}{l}\text{IF (HPDCNC2 is in}_{1}\text{m}_{1}\text{m}_{1})\text{ AND (E}_{\text{A}-2}\text{ is in}_{2}\text{m}_{1})\text{ THEN (HPDCMM2 is out}_{1}\text{m}_{1})\\ \text{IF (HPDCNC2 is in}_{1}\text{m}_{1})\text{ AND (E}_{\text{A}-2}\text{is in}_{2}\text{m}_{2}) \text{ THEN (HPDCMM2 is out}_{1}\text{m}_{2})\\ \text{IF (HPDCNC2 is in}_{1}\text{m}_{1})\text{ AND (E}_{\text{A}-2}\text{is in}_{2}\text{m}_{1}) \text{ THEN (HPDCMM2 is out}_{1}\text{m}_{4})\\ \text{IF (HPDCNC2 is in}_{1}\text{m}_{2})\text{ AND (E}_{\text{A}-2}\text{is in}_{2}\text{m}_{2}) \text{ THEN (HPDCMM2 is out}_{1}\text{m}_{5})\\ \text{IF (HPDCNC2 is in}_{1}\text{m}_{2})\text{ AND (E}_{\text{A}-2}\text{is in}_{2}\text{m}_{3}) \text{ THEN (HPDCMM2 is out}_{1}\text{m}_{6})\\ \text{IF (HPDCNC2 is in}_{1}\text{m}_{3})\text{ AND (E}_{\text{A}-2}\text{is in}_{2}\text{m}_{1}) \text{ THEN (HPDCMM2 is out}_{1}\text{m}_{7})\\ \text{IF (HPDCNC2 is in}_{1}\text{m}_{3})\text{ AND (E}_{\text{A}-2}\text{is in}_{2}\text{m}_{2}) \text{ THEN (HPDCMM2 is out}_{1}\text{m}_{8})\\ \text{IF (HPDCNC2 is in}_{1}\text{m}_{3})\text{ AND (E}_{\text{A}-2}\text{is in}_{2}\text{m}_{3}) \text{ THEN (HPDCMM2 is out}_{1}\text{m}_{9})\\ \end{array}  \tag{3}\]  
in which parameters of premises (widths and positions of fuzzy set centers) and conclusions (singleton values) were trained. A network structure and flow chart are presented in Figure 11.  
Membership functions of fuzzy sets for input variables before and after the training process are presented in Figure 12, whereas the values of output singletons are given in Table 2. Figure 13 shows the surface of the neuro-fuzzy model after the learning process. Figure 11: A network structure and flow chart of Equation (3). Figure 10: A diagram of a neuro-fuzzy system. Figure 12: Membership functions before and after the training process: (**a**) for the first input variable HPDCNC2; (**b**) for the second input variable E\({}_{\text{A}-2}\). Dashed lines refer to the shape of the sets before the training phase; solid lines refer to the shape of the sets after the training phase. Fuzzy set no. 1—red curve; fuzzy set no. 2—green curve; fuzzy set no. 3—blue curve. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**Singleton Number** & **1** & **2** & **3** & **4** & **5** & **6** & **7** & **8** & **9** \\ \hline Value before training & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ Value after training & \(-0.521\) & 0.484 & 0.189 & 0.971 & \(-0.842\) & \(-0.159\) & \(-2.909\) & 2.620 & 0.588 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Singleton values. Figure 13: Surface of ANFIS model after the training process.