## 5 Robot Propulsion
### Control Design  
The methodology applied to design the controller is based on the reference model strategy proposed in [57], which adjusts the step response of the controlled system to an ideal closed-loop system. The frequency domain specifications for the ideal closed-loop are:  
1. Gain crossover frequency: \(\omega_{cg}=5\) rad/s. 2. Phase margin: \(\phi_{m}=75^{\circ}\). Based on the above specifications, the ideal Bode transfer function of a non-integer integrator is taken as the ideal reference model, whose open- and closed-loop forms are, respectively:  
\[L_{ol}(s)=\left(\frac{\omega_{c}}{s}\right)^{\gamma} \tag{8}\]  
\[L_{cl}(s)=\frac{1}{\left(s/\omega_{c}\right)^{\gamma}+1} \tag{9}\]  
where \(\omega_{c}\) denotes the crossover frequency, and \(\gamma\in(0,2]\) is the non-integer order of the reference system. The gain and phase of the ideal reference model (8) are given by [57; 58]:  
\[|L_{ol}(j\omega)|=-20\gamma\log_{10}\left(\frac{\omega}{\omega_{c}}\right)\quad \text{dB}/\text{dec}\]  
\[\arg\left[L_{ol}(j\omega)\right]=-\gamma\pi/2\quad\text{rad}\]  
The reference model has a constant phase at any frequency to ensure that the controlled system is robust to gain variations and exhibits an iso-damping property at a step response. Then, based on the above relationships, the system must have a crossover frequency of \(\omega_{c}=\omega_{cg}=5\) rad/s and a non-integer order of \(\gamma=1.16\) to meet the desired specifications. In order to achieve this dynamics with the IPMC link model identified (Equation (7)), a PID controller is considered in parallel form as:  
\[C_{\text{PID}}(s)=K_{p}+\frac{K_{i}}{s}+K_{d}s \tag{10}\]  
where \(K_{p}\), \(K_{i}\), and \(K_{d}\) are the proportional, integral, and derivative gains, respectively. The controller parameters were determined by an optimization process based on the structure presented in [57], minimizing the following cost function:  
\[J(K_{p},K_{i},K_{d})=\int_{0}^{\infty}\left(\frac{1}{2}+\frac{t}{2}\right)|e(t )|dt=\int_{0}^{\infty}\left(\frac{1}{2}+\frac{t}{2}\right)|y_{r}(t)-y(t)|dt \tag{11}\]  
where \(y_{r}(t)\) is the desired output, obtained from the reference model, and \(y(t)\) is the output of the controlled swimming robot link with the proposed controller. Note that cost function (11) is a combination of the integral time absolute error (ITAE), to evaluate the performance of the system over time (it penalizes the errors that are persistent and neglects the initial errors) [59], and the integral of absolute error (IAE), to quantify the performance to be sensitive at low errors [59]. The optimization process is divided into two steps and is carried out by combining both MATLAB(r) and Simulink(r). The first step is to implement the system (the dynamics of the third link, i.e., model (7)) controlled by a PID, whose gains are variable, in closed-loop,together with the scheme corresponding to the reference model. The second step is a MATLAB script that implements an iterative process based on the Nelder-Mead simplex search method, through the function fminsearch, that runs the mentioned Simulink model calculating the cost function \(J\) given by (11). In particular, this script varies the parameters of the PID controller until the values that minimize \(J\) are found, i.e., the controller optimal values. In order to be able to find a globally optimal solution, the iterative process was applied for a wide number of initial conditions, which were randomly changed for each optimization. The resulting optimal controller is the following:  
\[C_{\text{PID}}(s)=8.12+\frac{53.36}{s}+0.61s \tag{12}\]  
It is worth mentioning that other performance indices were tried, but results with small variations were obtained with respect to the ones presented. Upon analyzing the design method for the IPMC link model, which also contains non-integer order dynamics, the conclusion is drawn that the PID controller attempts to approximate the dynamics of a non-integer order integrator with the purpose of approaching the system to the desired dynamics.