# Hysteresis Compensation and Trajectory Tracking Control Model for Pneumatic Artificial Muscles
## 2 Hysteresis Model and Inverse Model of PAM
### The FN-QUPI Model
\(p_{0}\) and \(p_{m}\) represent the minimum and maximum values of the pressure data, respectively; \(y_{0}\) and \(y_{m}\) represent the minimum  
Figure 1: QUPI operator. Figure 2: QUPI model. and maximum values of the displacement data, respectively; \(r_{1}\) and \(r_{2}\) represent the lengths of the edges of the line segments. \(d_{ij}\) denotes the weight of the operator. In this study, \(N_{a}\) and \(N_{b}\) are set to 10. Based on the maximum and minimum lengths, as well as the minimum and maximum pressures from the collected hysteresis data, the parameters \(y_{0}\), \(y_{m}\), \(p_{0}\), and \(p_{m}\) in the QUPI model are determined, thereby reducing the number of parameters required for model identification. The only parameters that require identification in the entire QUPI model are the weight terms of the QUPI operators, which reduces the computational load of the model. Since the QUPI model can only describe the static hysteresis behavior of the PAM under specific conditions, an additional nonlinear model is needed to capture the dynamic characteristics of the PAM. The NARMAX model, a nonlinear form of the autoregressive moving average model, is a commonly used black-box model for describing nonlinear systems. It effectively addresses system nonlinearity and dynamic issues without relying on the internal structure or parameters of the system. For the PAM actuator, its output displacement is mainly influenced by two factors: the input voltage at previous time steps and the current driving voltage. The NARMAX model can accurately describe the memory effect and rate-dependent characteristics of the PAM's hysteresis behavior. Considering the impact of load on the PAM's dynamic characteristics, load variations are introduced into the input part of the NARMAX model. Its specific expression is as follows:  
\[\left\{ \begin{array}{l}\hat{y}(t)=g[\hat{y}(t-1),\ldots,\hat{y}(t-n_{a}),f(t ),\ldots,f(t-n_{b}),m(t),\ldots,m(t-n_{c})]\\ f(t)=y_{\text{QUPI}}[u](t)\end{array} \right. \tag{5}\]  
In the equation, \(\hat{y}(t)\) represents the output of the NARMAX model, \(f(t)\) and \(y_{\text{QUPI}}[u](t)\) represent the output of the QUPI model at time \(t\), and \(m(t)\) represents the PAM load. \(n_{a}\), \(n_{b}\), and \(n_{c}\) are the maximum delay times of \(\hat{y}(t),f(t)\) and \(m(t)\), respectively. Accordingly, the input vector of the dynamic submodel contains the present and historical values of the output and load of the hysteresis submodel, as well as the historical output displacement values, which can capture the dynamic information of the driving frequency and load. In this study, the nonlinear function of the NARMAX model is established through a feedforward neural network (FNN), which ensures that the model can meet the requirements of dynamic system changes. The FNN has been widely applied in complex nonlinear systems, which is directly related to its excellent learning capability. Aside from these characteristics, the FNN performs well in simulating dynamic systems and is, therefore, widely used in nonlinear system analysis. Given that hysteresis properties exhibit multi-valued mapping, to improve the accuracy of the hysteresis model, the FN-QUPI model, i.e., the FNN-NARMAX model, is designed in this study. Its structure is shown in Figure 3, where \(u(t)\) and \(y(t)\) represent the system's input and output, respectively, and \(y(t)\) is the output of the NARMAX model. \(Z^{-1}\) denotes a unit delay. Its magnitude represents the output result from the previous iteration, corresponding to the parameter \(\hat{y}(t-1)\). The expression for the FNN is as follows:  
\[O(k)=\sum_{j=1}^{n}w_{j}\varphi\big{(}s_{j}(k)\big{)} \tag{6}\]  
\[s_{j}(k)=\sum_{i=1}^{m}w_{ij}I_{i} \tag{7}\]  
In the equation, \(w_{ij}\) and \(w_{j}\) are the weights between the input and hidden layers, along with between the hidden and output layers, separately; \(I\) and \(O\) are the inputs and outputs of the FNN, respectively; \(S_{j}(k)\) is the input of the \(j\)th neuron within the hidden layer.