## 3 Fault Diagnosis Method for BIW-Welding Robot Based on Multi-Layered BRB
### Reasoning and Optimization Based on Multi-Layered BRB Fault Diagnosis Model
#### 3.3.2 Parameter Optimization of the Model  
The initial parameters of the BRB model are given according to expert experience and expert knowledge. However, the limitations of the expert's knowledge on the expertise can make the given parameters inaccurate. In this paper, the Projection Covariance Matrix Adaption Evolution Strategy (P-CMA-ES) algorithm with projection operation was used to optimize the parameters of the fault diagnosis model for updating. The constraints on the BRB model parameter vector \(V=\left[\theta^{1},\cdots,\theta^{k},\cdots,\delta^{1},\cdots,\delta^{m}, \beta_{1}^{k},\cdots,\beta_{n}^{k}\right]^{T}\) were:  
\[\minMSE(y(\theta^{k},\delta^{m},\beta_{n}^{k})) \tag{6}\]  
\[ \begin{array}{l}s.t.\;\;\;0\leq\theta_{k}\leq 1\\ \;\;\;0\leq\beta_{n,k}\leq 1,n=1,2,\cdots,N\\ \;\;\;\;\sum\limits_{n=1}^{N}\beta_{n,k}\leq 1,k=1,2,\cdots,L\\ \;\;\;0\leq\delta_{i}\leq 1,i=1,2,\cdots,M\end{array}  \tag{7}\]  
The objective function was:  
\[MSE=\frac{1}{T}\sum\limits_{i=1}^{T}(y_{i}-y_{ir})^{2} \tag{8}\]  
where \(MSE(y(\theta^{k},\delta^{m},\beta_{n}^{k}))\) is the mean squared error (MSE), T is the amount of data and \(y_{ir}\) is the true semantic value. The specific steps of the P-CMA-ES algorithm are as follows:  
Figure 6: Experimental data. (**a**) Drive power failure; (**b**) The supply voltage is too low; (**c**) Motor encoder fault; (**d**) Bearing wear failure; (**e**) Demagnetization of rotor permanent magnet; (**f**) Weld detection sensor failure; (**g**) Welding gun suspension height sensor fault; (**h**) Control computer failure; (**i**) Setting error; (**j**) Incorrect setting of welding gun attitude and suspension height. In building the fault diagnosis model for welding robots, the FTA was used to build a fault in the welding robot. The above conversion process was first used to transform it into a multi-layer BRB, and then the implementation process for the multi-layer BRB fault diagnosis model. This conversion process is shown in Figure 7.  
By observing the transformed BRB model, we can see that it has many attributes and a complex structure. In order to prevent problems such as combination explosion in BRB, a multi-layer BRB model was established, and the fault tree was divided into six sub-fault trees and transformed into a multi-layer BRB. In this section, the servo motor driver failure, the wrong torch attitude, and suspension height were used as examples for specific analysis. They correspond to the first sub-rule base and the sixth sub-rule base in the multi-layer BRB, namely BRB1, and BRB6. In BRB1, the two attributes of the drive power failure and supply voltage are too low and are represented by \(X_{1}\) and \(X_{2}\), respectively. The belief rules of the BRB1-based fault diagnosis sub-model for the BIW-welding robot can be described as:  
\[ \begin{array}{l}R_{k}:\text{If }(X_{1}\text{ is }A_{1}^{k})\vee(X_{2}\text{ is }A_{2}^{k}),\text{ then }\big{\{}(D_{1},\beta_{1,k}),\ldots,(D_{n},\beta_{n,k}) \big{\}},\\ \text{with }a\text{ rule weight }\theta_{k}\ (k=1,2,\ldots,L)\text{ and attribute weight }\delta_{k1},\delta_{k2}\end{array}  \tag{13}\]  
In BIW-welding robotic systems, the performance of the system and its components gradually decrease with time until failure occurs. The collected data usually have a certain distribution pattern. In the BRB model, the premise attribute reference value directly determines the distribution of the input data and also determines the number of belief rules in the model and the accuracy of model reasoning. As a result, this study set the reference value of the premise attribute based on data fluctuation and a level of uniform distribution. Then, the reference values and initial parameters of the BRB were determined according to the analysis results, and the input reference values of the BRB were selected using the method as described above. \(X_{1}\) and \(X_{2}\) set four reference levels, respectively, including small (S), medium (M), large (L), and very large (VL). The reference values of BRB1 are shown in Tables 2 and 3.