# RBF Neural Network Based Backstepping Control for an Electrohydraulic Elastic Manipulator
## 3 Control Design
### Adaptive Backstepping Control Based RBFNN
#### 3.2.1 Adaptive Approximation via RBFNN  
As shown in Figure 5, the RBFNN with four layers, which are the input layer, selection layer, hidden layer, and output layer, is employed to implement the approximations. The inputs and the output of the RBFNN are the tracking errors and the control input, respectively. The functions of each layer are presented as follows:  
The input layer rescaled the input variables, \(e_{i}(i=1,\ldots,p)\) to the next layers.  
The selection layer chooses the input for each approximation, \(v_{ij}\in R^{p\times 1}(i=1,2\,;j=1\ldots m)\).  
\[\gamma_{ij}=v_{ij}^{T}E,(i=1,2;j=1,\ldots,m) \tag{31}\]  
with \(\sum\limits_{k=1}^{p}v_{ijk}=1,\|v_{ij}\|_{2}=1\), and \(E=\left[e_{1},\ldots,e_{p}\right]^{T}\in R^{p\times 1}\).  
The hidden layer derives the input values with the radius basis function, Gaussian function, as follows:  
\[\mu_{ij}=\exp\left(\frac{-\left(G_{i}-m_{eij}\right)^{T}\left(G_{i}-m_{eij} \right)}{\sigma_{ij}^{2}}\right),\left(i=1,2;j=1,\ldots,n\right) \tag{32}\]  
where \(G_{i}=\left[\begin{array}{cccc}\gamma_{11}&\cdots&\gamma_{im}\\ \end{array}\right]^{T}\in R^{m\times 1}\) is the input vector, and \(m_{eij}\in R^{m\times 1}\) and \(\sigma_{ij}(i=1,2;j=1,\ldots,n)\), respectively, are the mean vector and the standard derivation of the Gaussian functions of the node \(ij\) in the hidden layer.  
The output layer presents the compensation signals for the mechanical dynamics and the hydraulic dynamics. Each node \(\delta_{i}(i=1,2)\), which is calculated as follows:  
\[\delta_{i}=\sum_{j=1}^{m}w_{ij}\mu_{ij}(G_{i}) \tag{33}\]  
These equations can be represented in the vector form as follows:  
\[D=\left[\begin{array}{cccc}\delta_{1}&\delta_{2}\\ \end{array}\right]^{T}=\textit{trace}\left(W^{T}\mu\right) \tag{34}\]  
where \(W=\left[\begin{array}{cccc}W_{1}\\ W_{2}\\ \end{array}\right]=\left[\begin{array}{cccc}w_{11}&\ldots&w_{1i}&\ldots&w_{1m }\\ w_{21}&\ldots&w_{2i}&\ldots&w_{2m}\\ \end{array}\right]^{T}\), \(\mu=\left[\begin{array}{cccc}\mu_{11},\cdots,\mu_{1m}\\ \mu_{21},\cdots,\mu_{2m}\\ \end{array}\right]^{T}\).  
Each adaptive approximation includes an RBFNN and its adaptive laws, and the online-tuning RBFNN is deployed to eliminate the uncertainties in the mechanical dynamics or the hydraulic dynamics. These approximations reduce the chattering effects and improve the precisions. The adaptive laws are derived from the Lyapunov approach [29] and the projection algorithm [31]. The approximation will compensate for the mechanical uncertainties and the hydraulic uncertainties such that  
\[D=D^{*}+\varepsilon=\textit{trace}\left(W^{T}\mu\right)+\varepsilon \tag{35}\]  
where \(\varepsilon=\left[\begin{array}{cc}\varepsilon_{1}&\varepsilon_{2}\\ \end{array}\right]^{T}\) is the reconstructed vector, and \(W^{*}\) is an optimal parameter of \(W\), in the RBFNN.  
The approximated vector is expressed as the following form:  
\[\hat{D}=\textit{trace}\left(\hat{W}^{T}\mu\right) \tag{36}\]  
where \(\hat{W}\) are the estimated parameters of the RBFNN. An approximation error vector \(\overline{D}\) is defined as follows:  
\[\begin{array}{ll}\overline{D}&=D-\hat{D}=D^{*}+\varepsilon-\hat{D}\\ &=\textit{trace}\left(W^{T}\mu\right)-\textit{trace}\left(\widetilde{W}^{T} \mu\right)+\varepsilon=\textit{trace}\left(\widetilde{W}\mu\right)+\varepsilon \end{array} \tag{37}\]  
where \(\widetilde{W}=W^{*}-\hat{W}\).  
Figure 5: Structure of the radial basis function neural network (RBFNN).