## 4 Robot Modeling
### Dynamic Model Identification  
The theoretical models of IPMCs found in the literature stand out for their complexity and the huge variability of their chemical parameters due to the lack of technical standards in manufacturing methods. More precisely, the existing models can be categorized as: (1) black-box models, based on empirical responses [43]; (2) gray-box models, which combine the knowledge about materials with experimental data, i.e., they are formulated based on physical principles while empirical results are used to define more complex physical processes [42]; and (3) white-box models, whose components explain the physics and actuation responses by partial differential equations [51; 52]. Taking into account that the last method is not practical for real-time control purposes due to the high computational efforts required, the second approach will be used in this work as described below. From the measured frequency responses, it can be seen that the system has two resonance frequencies in the frequency range under study, regardless of the considered link. Moreover, the farther a link is from the first link, the lower the resonance peak. On the other hand, it should be remarked that the magnitude curves are not flat at low frequencies: they fall with a slope of \(-10\) dB/dec being the phase approximately \(45^{\circ}\). This behavior matches perfectly with a fractional integrator of order 0.5, i.e. :  
\[H(s)\approx s^{-0.5} \tag{4}\]  
It is worth mentioning that these low-frequency dynamics was also proved for other prototypes in [43; 53; 54], in our previous work [55], and in [42; 51], whose theoretical models present root square of the Laplacian variable to define the electrical dynamics of IPMC. Theoretical studies on IPMCs usually model mechanical behavior and hydrodynamic interactions when the actuator is submerged by coupling a resonant system for the first vibration mode in order to obtain a more reliable model. This consideration can be accepted in this work since, as it can be seen from the experimental frequency responses, the first resonance mode predominates for frequencies below 50 rad/s, which are high enough for the frequency range of interest for this application. Therefore, that dynamics may be given by a spring-mass-damper second order system of the form:  
\[G_{1}(s)=\frac{a_{0}}{b_{2}s^{2}+b_{1}s+1} \tag{5}\]  
Figure 6: Frequency responses of the AEF swimimng robot for the excitation of first segment and the deflection in each IPMC link. or by a fractional order system as  
\[G_{2}(s)=\frac{a_{0}}{b_{1}s^{\alpha}+1} \tag{6}\]  
with \(\alpha\in\mathbb{R}^{+}\) (\(\alpha\in(1,2)\)), and being \(a_{0}\), \(b_{1}\), and \(b_{2}\) constants. Notice that both models have the same number of parameters (i.e., three). Hence, the global dynamics of the system will be obtained as the fractional order integrator cascaded with the mechanical model, i.e., \(P_{i}(s)=H(s)G_{i}(s)\), with \(i=\{1,2\}\), for the frequency range of interest of \([0.2,50]\) rad/s. For simplicity, the dynamics corresponding to the integrator was removed from the measured frequency responses. Consequently, the identification procedure was reduced to identify models of the form of (5) and (6) in the mentioned frequency range. In particular, the average frequency response of the 10 measurements was used for identification. Concerning the identification process, the [PERSON]'s method is implemented in MATLAB(r) (with function levy, [56]) for both the integer and the fractional order models. The adjustment was performed by minimizing \(J=(G(j\omega)D(j\omega)-N(j\omega))^{2}\), i.e., the quadratic error per sampling frequency (\(N(j\omega)\) and \(D(j\omega)\) are the numerator and denominator of the transfer function of the model to be identified, respectively). Fractional models were found sweeping \(\alpha\) in the interval \((1,2)\), with a step of 0.01, and choosing the best result from among the stable models obtained.