# A MLP-Hedge-Algebras Admittance Controller for Physical Human-Robot Interaction
## 3 Hedge-Algebras-Based Admittance Controllers
### MLP-HA-Based Admittance Controller
Step 2: At the \(k^{th}\) sample, the output of \(i^{th}\) neuron at the input layer (\(q\) =1) is measured as (\(q\) is the order of layers in the network):  
\[y_{i}^{q}=y_{i}^{1}=x_{i}^{k} \tag{26}\]  
The signal is propagated sequentially following the order input layer-hidden layers-output layer:  
\[y_{i}^{q}=g(^{q}net_{i})=g(\sum_{i}w_{ij}^{q}y_{i}^{q-1}) \tag{27}\]  
Here, \({}^{q}net_{i}\) is the effect of \((q-1)^{th}\) layer on \(i^{th}\) neuron in \(q^{th}\) layer at the \(k^{th}\) sample, and \(j\) is the index of neuron in \((q-1)^{th}\) layer. Step 3: Measuring the error at the output layer:  
\[E_{t}=\frac{1}{2}\sum_{i=1}^{n}{(d_{i}^{k}-y_{i}^{q})}^{2}+E_{t-1} \tag{28}\]  
\[\delta_{i}^{q}=(d_{i}^{k}-y_{i}^{q})g^{\prime}(^{q}net_{i}) \tag{29}\]  
Here, \(d_{i}^{k}\) is the sample output. Step 4: Back-propagating error and calculating the weights:  
\[{}^{t}\Delta w_{ij}^{q}=y_{i}\delta_{i}^{q}y_{i}^{q-1}+\alpha_{q}{}^{t-1} \Delta w_{ij}^{q} \tag{30}\]  
\[{}^{t}w_{ij}^{q}={}^{t-1}w_{ij}^{q}+{}^{t}\Delta w_{ij}^{q} \tag{31}\]  
\[\delta_{i}^{q-1}=g^{\prime}(^{q-1}net_{i})\sum_{i}w_{ij}^{q}\delta_{i}^{q} \tag{32}\]  
where \(q>1\), \(t\) is current weight update  
Step 5: Checking the training iteration:If \(k<p\): \(k=k+1\) and return step 2; Else: go to step 6; Here, \(p\) is the size of the training data Step 6: Checking the loop condition If E \(<\) E\({}_{\text{max}}\): finishing and returning the set of weights; Else: setting E = 0, \(k=1\) and return to 2. The initial weights \(w_{\overline{i}}\) are randomly chosen in the range \([-3/\sqrt{m_{i}},3/\sqrt{m_{i}}]\). Here: \(m_{i}\) is the whole number of links from neuron j to neuron i [51]. The initial value of the learning rate is randomly chosen in the range [0.1, 0.6], as presented in [52; 53]. In this paper, the MLP is used as an interpolation for the semantic relationship in the HA, which is predefined based on the policy of the engineering system. For the admittance controller, the semantic relationship among inputs (semantic values of the external wrench and transmitted power) and output (semantic value of the velocity of the end-effector) are presented in Tables 6 and 7. Therefore, the sample data for the MLP network is tabular, including Tables 6 and 7. Moreover, to speed up the convergence of the backpropagation, the adaptive learning rate and momentum parameters are necessary since the backpropagation converges slowly, even for the medium-sized network. A five-layer network is chosen, and, initial values of momentum parameters of connection groups are 0.01, 0.03, 0.1, and 0.09, respectively, and the initial value of the learning rate is 0.4. These values will be increased or decreased depending on the gradient of the error after a number of iterations (in this paper, this parameter is 99 iterations). The desired error is E\({}_{\text{max}}\) = 0.0002. After the training process and removing redundant neurons (neurons have values of weights approximated zero), the configuration of MLP is chosen in this paper as presented in \[N_{h}=\frac{N_{s}}{\beta(N_{i}+N_{o})} \tag{24}\]0 This MLP consists of 5 layers, including the input layer, three hidden layers and the output layer. The input layer has two neurons, hidden layer 1 has five neurons, hidden layer 2 has three neurons, hidden layer 3 has three neurons, and the output layer has one neuron. The input 1 and input 2 of the MLP network are semantic values of the controller's inputs (semantic values of the external wrench and transmitted power), and the output of the MLP network is the semantic value of the controller's output (semantic value of the end-effector's velocity). by using the MLP interpolation. Hence, wiggled values included in Figures 6 and 7 when semantic values of inputs are close to either 1 or 0. Similarly, only the semantic values of outputs \(\ket{\mathbf{V}}\) and \(\ket{\mathbf{W}}\) are known. To receive their real physical values, their term semantics is mapped from \([0,1]\) to their individual physical domains.