# Design and Implementation of Composed Position/Force Controllers for Object Manipulation
## 5 Grasping Stage
### Type-I and Type-II Fuzzy Controllers
#### 5.4.2 Type-II Fuzzy Controller for Position and Force Control  
Figure 10 shows the interval type-II fuzzy input sets for the four inputs \(<F_{R}(t)\), \(F_{L}(t)\), \(Pos_{R\omega}(t)\), and \(Pos_{L\omega}(t)\)\(>\); and interval type-II fuzzy output sets for the two outputs \(<M_{R}(t)\) and \(M_{L}(t)\)\(>\). Both types of fuzzy sets are for the right finger. It can be seen that upper \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**IF** & \(\mathbf{F_{L}}\) & **Operator** & \(\mathbf{F_{R}}\) & **Operator** & \(\mathbf{Pos_{L\omega}(t)}\) & **Operator** & \(\mathbf{Pos_{R\omega}(t)}\) & **THEN** & \(M_{L}(t)\), \(M_{R}(t)\) \\ \hline
1 & \(SLTS\) & AND & \(SRO\) & AND & \(OLM\) & AND & \(CRM\) & THEN & \(L4\), \(R2\) \\
2 & \(SLTS\) & AND & \(SRTS\) & AND & \(OLM\) & AND & \(CRM\) & THEN & \(L4\), \(R3\) \\
3 & \(SLTS\) & AND & \(SRTS\) & AND & \(OLM\) & AND & \(CLRM\) & THEN & \(L2\), \(R2\) \\
4 & \(SLTS\) & AND & \(SRTS\) & AND & \(OLM\) & AND & \(ORM\) & THEN & \(L4\), \(R4\) \\  &... & & & & & & &... \\
25 & \(SLTS\) & AND & \(SRO\) & AND & \(OLM\) & AND & \(ORM\) & THEN & \(L4\), \(R2\) \\
26 & \(SLTS\) & AND & \(SRO\) & AND & \(CLM\) & AND & \(CRM\) & THEN & \(L3\), \(R3\) \\
27 & \(SLTS\) & AND & \(SRO\) & AND & \(CLLM\) & AND & \(CLRM\) & THEN & \(L3\), \(R2\) \\
28 & \(SLTS\) & AND & \(SRO\) & AND & \(OLM\) & AND & \(CRM\) & THEN & \(L4\), \(R2\) \\  &... & & & & & &... &... \\
47 & \(SLTH\) & AND & \(SRO\) & AND & CLLM & AND & \(CLRM\) & THEN & \(L4\), \(R4\) \\
48 & \(SLO\) & AND & \(SRTH\) & AND & \(CLM\) & AND & \(CRM\) & THEN & \(L4\), \(R2\) \\
49 & \(SLO\) & AND & \(SRTH\) & AND & \(CLLM\) & AND & \(CLRM\) & THEN & \(L4\), \(R2\) \\
50 & \(SLO\) & AND & \(SRTH\) & AND & \(CLM\) & AND & \(CLRM\) & THEN & \(L4\), \(R2\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Fuzzy rules for the type-I fuzzy controller. Figure 9: Cases for the design of the fuzzy rules. membership functions were added to both types of fuzzy sets (fuzzy input sets and fuzzy output sets) defined in the type-I fuzzy controller. The fuzzy rules for the type-II fuzzy controller are the same as those implemented for the type-I controller. These rules correspond to the Mamdani fuzzifier and employ minimum implications. However, the type-II fuzzy controller uses 50 fuzzy rules for the upper membership functions and 50 rules for the lower membership functions. Table 2 shows a summary of these rules. As mentioned earlier, a key difference between type-I and type-II controllers is that type-II uses a type-reducer to transform type-II fuzzy sets to type-I fuzzy sets. The type-II fuzzy controller employs the Karnik-Mendel (KM) algorithm as the type-reducer. The KM algorithm [41, 42] computes the lower and upper intervals of the type-II fuzzy outputs for the left and right motors. For instance, the command for the left motor \(Y^{i}\) (output) is composed of two intervals \(\{\underline{y}^{i},\bar{y}^{i}\}\), where \(\underline{y}^{i}\) is the lower left command motor, and \(\bar{y^{i}}\) is the upper left command motor. Therefore, the KM algorithm corresponding to the left motor works as follows:  
1. Firstly, the lower left motor (\(y_{l}\)) is computed in the following manner: 1. \(y^{i}_{l}\) is sorted in ascending order, where \(y^{i}_{l}\) is the lower left motor. 2. \(y_{l}\) is computed as \[y_{l}=\frac{\sum_{i=1}^{M}f_{l}^{i}y^{i}_{l}}{\sum_{i=1}^{M}f_{l}^{i}}\] (4)  
Figure 10: Type II (upper and lower) membership functions for the inputs \(F_{R}(t)\) and \(Pos_{R\omega}(t)\), and for the output \(M_{R}(t)\). where \(f_{l}^{i}=\frac{\bar{f}_{l}+\bar{f}^{i}}{2}\) and \(\bar{f}^{i}\), \(\bar{f}_{l}^{i}\) are the firing intervals. Let \(y_{l}^{\prime}=y_{l}\). (c) Find \(S\), such that \(y_{l}^{S}\leq y_{l}^{\prime}\leq y_{l}^{S+1}\). (d) Find \(y_{l}^{\prime}=\frac{\sum_{l=1}^{M}f_{l}|y_{l}^{\prime}|}{\sum_{i=1}^{M}f_{l}^ {i}}\) with \(f_{l}^{i}=\bar{f}^{i}\) for \(i\leq S\) and \(f_{l}^{i}=\bar{f}^{i}\) for \(i>S\). Let \(y_{l}^{\prime\prime}=y_{l}\).