## 4 Control Design
### Fuzzy Compensator  
Based on the estimates via IDC, the fuzzy compensator is given as  
\[\mathbf{u}_{fuzzy}=\mathbf{\rho}\hat{\delta}+\mathbf{\epsilon} \tag{30}\]  
where \(\mathbf{\rho}=\text{diag}(\rho_{1},\rho_{2}\cdots\rho_{6+n})\) is the parameter of the fuzzy compensator, and \(\mathbf{\epsilon}\) is a constant vector. The fuzzy compensator is a multiple-inputs-single-output fuzzy logic controller (FLC) with the joint-space system errors \(e_{i}\) and \(e_{j}\) as two input variables and \(\rho_{i}\) after defuzzification and denormalization as an output variable. Denote the system error vector \(\mathbf{e}\) (as given in (17)) as \(\mathbf{e}=[\epsilon_{1},\epsilon_{2}\cdots\epsilon_{i}\cdots\epsilon_{6+n}]\). The main advantage of this fuzzy compensator is that the required fuzzy rules take the dynamic coupling between the vehicle and the manipulator [15; 16] into account. It is known that the roll, pitch and yaw motions of the vehicle are coupled with its surge, sway and heave motions. As the roll and pitch angles should be kept small for properly working of the bottom sensors, it is assumed that the surge and sway motions are mostly affected by the yaw angle. Note that the pitch and heave motions are interactive, and the manipulator's joints 2 and 3 are interactive. The position of manipulator's joint 1 is mostly affected by the sway motion. Based on these analysis, the fuzzy rules are given in Table 1. Table 2 shows the relationships between an output and two input variables. The following symbols are used in Table 1: ZE (zeros), PS (positive small), PM (positive medium), PB (positive big). Figure 2(a),b shows the member functions of the normalized input and output variables respectively. After the fuzzification stage, the Mamdani inference method is used for fuzzy implication, and then the centroid method is used for defuzzification. Finally, based on denormalization the actual output variables can be obtained. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline inputs & \(|e_{i}|\) & \(|e_{1}|\) & \(|e_{2}|\) & \(|e_{3}|\) & \(|e_{5}|\) & \(|e_{6}|\) & \(|e_{7}|\) & \(|e_{8}|\) & \(|e_{9}|\) \\ \cline{2-6}  & \(|e_{j}|\) & \(|e_{6}|\) & \(|e_{6}|\) & \(|e_{5}|\) & \(|e_{3}|\) & \(|e_{2}|\) & \(|e_{2}|\) & \(|e_{9}|\) & \(|e_{8}|\) \\ \hline outputs & \(\rho_{i}\) & \(\rho_{1}\) & \(\rho_{2}\) & \(\rho_{3}\) & \(\rho_{5}\) & \(\rho_{6}\) & \(\rho_{7}\) & \(\rho_{8}\) & \(\rho_{9}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Relationships between two input variables and an output variable. Incorporating the fuzzy compensator, the proposed coordinated motion controller is given as  
\[\mathbf{u}_{c}=\mathbf{u}-\mathbf{u}_{fuzzy} \tag{31}\]  
Then we can obtain the vector of thruster forces and actuator torques \(\mathbf{F}_{ld}\), as shown in (32). \[\mathbf{F}_{ld}=\mathbf{B}^{+}\mathbf{u}_{c}= \begin{bmatrix}\mathbf{B}_{v}^{+}&\mathbf{0}_{p_{v}\times n }\\ \mathbf{0}_{n\times 6}&\mathbf{I}_{n}\end{bmatrix} \mathbf{u}_{c} \tag{32}\]  
where \(\mathbf{B}_{v}^{+}\) is the pseudo inverse of \(\mathbf{B}_{v}\) and \(\mathbf{B}^{+}\) is the pseudo inverse of \(\mathbf{B}\). Therefore, the generalized force vector \(\mathbf{\tau}\) can be obtained based on (5). For an under-actuated UVMS, \(\mathbf{\tau}=\mathbf{u}\) except that the elements of \(\tau\) corresponding to the underacted motions are zeros. The proposed control system is schematically represented by a block diagram in Figure 4. The controller block includes five sub blocks to calculate a control vector; i.e., the tracking controller, IDC, fuzzy compensator, \(\mathbf{B}^{+}\) and \(\mathbf{B}\) blocks. In addition to system dynamics, the tracking controller also requires tracking errors of end-effector positions and joint-space states. The end-effector position tracking errors are calculated according to the desired end-effector positions derived from the trajectory planning block and the estimated end-effector positions obtained from the forward kinematics block using the estimated joint-space states.