## 4 Study Cases
### Robot Mobile Controller
\!\!\  
\(C\big{(}q,\dot{q}\big{)}\dot{g}\) is the vector of centripetal and Coriolis forces;  
\(D\ \in R^{2\times 2}\) is a diagonal positive-definite damping matrix. The kinematic system is determined by Equation (16):  
\[\dot{q}=\left[ \begin{array}{cc}\cos\theta&0\\ \sin\theta&0\\ 0&1\end{array} \right]\left[ \begin{array}{c}v\\ \omega\end{array} \right] \tag{16}\]  
where  
(x,y) is the position in the \(X-Y\) (world) reference frame;  
\(\theta\) is the angle between the heading direction and the \(x\)-axis;  
\(v\)_and_\(\omega\) are the linear and angular velocities, respectively. Equation (17) represents the non-holonomic constraint, which this system has, which corresponds to a non-slip wheel condition preventing the robot from moving sideways. \[\dot{y}\ \cos\theta-\dot{x}\sin\theta=0 \tag{17}\]  
One of the membership functions used in the controller is the trapezoidal one, which has four scalar parameters--\(a\), \(b\), \(c\), and \(d\) as given by the Equation (18), where \(a\) and \(d\) represents the lower corners of the trapezoid and the \(b\) and \(c\) locate the shoulders. To represent the graphical form of the trapezoidal membership function, we illustrate it in Figure 7.  
\[f(x;a,\ b,c,d)= max\left(\min\left(\frac{x-a}{b-a},1,\frac{d-x}{d-c}\right),0\right) \tag{18}\]  
The structure of the fuzzy system of the Sugeno-type controller is composed of two inputs: the first one is the linear velocity error, and the second is the angular velocity error, which are granulated into three membership functions (negative, zero, positive). Both are composed of trapezoidal functions on the extremes and a triangular one in the center, as can be appreciated in Figure 8.  
Figure 7: Points of trapezoidal membership function. Tables 5 and 6 show the mathematical knowledge of each membership function for each of the inputs. The controller used is of the Takagi-Sugeno type and is formed by nine fuzzy rules that govern the trajectory of the robot based on the controller. Table 7 contains more detail of these fuzzy rules. The Sugeno coefficients of this controller are presented in Table 8. \begin{table}
\begin{tabular}{c c c} \hline \hline  & **Linear Velocity Error (ev)** \\ \hline Negative (N) & \(\mu\)N\((x)=\max\)\(\left(\min\left(\frac{x+50}{-50+50},1,\frac{-1-x}{-1+5}\right),0\right)\) \\ Zero (Z) & \(\mu\)Z\((x)=\max\)\(\left(\min\left(\frac{x+50}{0+4},\frac{6-x}{-50}\right),0\right)\) \\ Positive (P) & \(\mu\)P\((x)=\max\)\(\left(\min\left(\frac{x-1}{5-1},1,\frac{50-x}{50-50}\right),0\right)\) \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Mathematical representation of the input 2 membership function. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**ev (Input1)** & **ew (Input2)** & \(\tau_{1}\) **(Output1)** & \(\tau_{2}\) **(Output2)** \\ \hline N & N & N & N \\ N & Z & N & Z \\ N & P & N & P \\ Z & N & Z & N \\ Z & Z & Z & Z \\ P & N & P & N \\ P & Z & P & Z \\ P & P & P & P \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Rules for the fuzzy logic controller. Figure 8: Points membership functions of Input 1 and Input 2. \begin{table}
\begin{tabular}{c c c} \hline \hline  & **Angular Velocity Error (ev)** \\ \hline Negative (N) & \(\mu\)N\((x)=\max\)\(\left(\min\left(\frac{x+50}{-50+50},1,\frac{-1-x}{-1+5}\right),0\right)\) \\ Zero (Z) & \(\mu\)Z\((x)=\max\)\(\left(\min\left(\frac{x+50}{0+4},\frac{6-x}{-50}\right),0\right)\) \\ Positive (P) & \(\mu\)P\((x)=\max\)\(\left(\min\left(\frac{x-1}{5-1},1,\frac{50-x}{50-50}\right),0\right)\) \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Mathematical representation of the input 1 membership function. The purpose of the controller is shown in detail in Figure 9.  
The proposed OFDE and OFHS methods are used to optimize the parameter values of the membership functions of the mobile robot controller in order to minimize the root mean square error (RMSE) described in Equation (19). Figure 10 represents the vector with the points of the membership functions of both controller inputs.