## 4 Control Cases
### Mobile Robot Controller  
The main goal of this controller is to follow a reference trajectory, based on the model of a unicycle mobile robot [31], which is composed of two drive wheels located on the same axis and a front free wheel that is used only for stability. The graphical representation of this model can be found in Figure 10. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Rule Number**} & \multicolumn{2}{c}{**Inputs**} & \multicolumn{2}{c}{**Output**} \\ \cline{2-6}  & **Temp** & **Operator** & **Flow** & **Cold** & **Hot** \\ \hline
1 & cold & and & soft & open slow & open fast \\
2 & cold & and & good & close slow & open slow \\
3 & cold & and & hard & close fast & close slow \\
4 & good & and & soft & open slow & open slow \\
5 & good & and & good & steady & steady \\
6 & good & and & hard & close slow & close slow \\
7 & hot & and & soft & open fast & open slow \\
8 & hot & and & good & open slow & close slow \\
9 & hot & and & hard & close slow & close fast \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Fuzzy rules for the temperature controller. Figure 10: Diagram of the robot mobile controller. Figure 9: Structure of the water tank fuzzy system for control. The operation of the robot model is determined by Equations (7) and (8):  
\[M(q)\dot{v}+C\big{(}q,\dot{q}\big{)}v+Dv=\ \tau+P(t), \tag{7}\]  
where  
\(q=(x,y,\theta)^{\text{T}}\) is the vector of the configuration coordinates;  
\(v=(v,w)^{\text{T}}\) is the vector of velocities;  
\(\tau=(\tau_{1},\tau_{2})\) is the vector of torques applied to the wheels of the robot where \(\tau_{1}\) and \(\tau_{2}\) denote the torques of the right and left wheel, respectively;  
\(P\in\ R^{2}\) is the uniformly bounded disturbance vector;  
\(M(q)\in\ R^{2X2}\) is the positive-definite inertia matrix;  
\(C\big{(}q,\dot{q}\big{)}\theta\) is the vector of centripetal and Coriolis forces;  
\(D\in R^{2X2}\) is a diagonal positive-definite damping matrix. The kinematic system is determined by Equation (8):  
\[\dot{q}=\left[ \begin{array}{cc}\cos\theta&0\\ \sin\theta&0\\ 0&1\end{array} \right]\Big{[}\frac{v}{w}\Big{]}, \tag{8}\]  
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 \(w\) are the linear and angular velocities, respectively  
Equation (9) represents the non-holonomic constraint 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{9}\]  
This controller is composed of two inputs and two outputs; the first input is the ev (error in the linear velocity), which has two trapezoidal and one triangular membership functions with linguistic variables called N, Z, and P. The second input is the ev (error in the angular velocity), which has two trapezoidal and one triangular membership functions with linguistic variables of N, Z, and P. The first output is T1 (torque 1), which has three triangular membership functions with linguistic variables of N, Z, and P. The second output is T2 (torque 2), which has three triangular membership functions with linguistic variables of N, Z, and P. This controller is of the Mamdani type and uses nine fuzzy rules, which are presented in detail in Table 4. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Rule Number**} & \multicolumn{3}{c}{**Inputs**} & \multicolumn{3}{c}{**Output**} \\ \cline{2-6}  & **Ev** & **Operator** & **Ew** & **T1** & **T2** \\ \hline
1 & N & and & N & N & N \\
2 & N & and & Z & N & Z \\
3 & N & and & P & N & P \\
4 & Z & and & N & Z & N \\
5 & Z & and & Z & Z & Z \\
6 & Z & and & P & Z & P \\
7 & P & and & N & P & N \\
8 & P & and & Z & P & Z \\
9 & P & and & P & P & P \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Fuzzy rules for the robot mobile controller. Table 4 presents in detail each of the rules that compose the robot mobile controller to achieve the main objective of this controller.