# Research on a Support System for Automatic Ship Navigation in Fairway
## 4 Automatic Navigation System of a ship in a Fairway
### Control System  
#### 4.4.1 Ship Track-Keeping Controller  
For the track-keeping purpose of the ship, the fuzzy logic controller is designed using a Mamdani-type and bisector method. The proposed controller includes four sets of membership functions: Three for input signals and one for the output signal. The three inputs consist of the cross track error, the heading error, and the yaw rate of the ship. The output is the ship rudder angle. The parameters of this controller are shown in Table 3.  
Input set 1: +VB (\(-\)VB) signifies a very big error from the route to the left (right); +B (\(-\)B): is big error; +M (\(-\)M): is medium error; Zero: is small error, see Figure 6a.  
Figure 5: The heading angle from ship to waypoint.  
Figure 6: _Cont_.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Fuzzy Logic Controller** & **Variable Name (Unit)** & \begin{tabular}{c} **Zones of Membership Functions** \\ **and Their Parameters** \\ \end{tabular} \\ \hline Input set 1 & Cross track error (meters) & \begin{tabular}{c} +VB (\(-\)VB): (zmf [100 70]) \\ +B (\(-\)B): (trapmf [100 80 46 35]) \\ +M (\(-\)M): (trapmf [45 35 10 4]) \\ Zero: (trimf [\(-\)6 0 6]) \\ \end{tabular} \\ \hline Input set 2 & Heading error (Degrees) & \begin{tabular}{c} +VB (\(-\)VB): (trapmf [90 90 80 75]) \\ +B (\(-\)B): (trapmf [80 75 15 12]) \\ +M (\(-\)M): (trapmf [16 12 4 2.5]) \\ +S (\(-\)S): (trimf [3 1.5 0]) \\ Zero: (trimf [\(-\)1.2 0 1.2]) \\ \end{tabular} \\ \hline Input set 3 & Yaw rate (Degrees/second) & \
\begin{tabular}{c} +B (\(-\)B): (zmf [3 2]) \\ +S (\(-\)S): (trimf [3 2.5 0.8 0.3]) \\ Zero: (trimf [\(-\)0.7 0.2 0.1]) \\ \end{tabular} \\ \hline Output set & Ship rudder angle (Degrees) &
\begin{tabular}{c} +B (\(-\)B): (trapmf [35 35 25 8]) \\ +M (\(-\)M): (trapmf [10 8 6 4]) \\ +S (\(-\)S): (trapmf [6 4 2 0]) \\ Zero: (trimf [\(-\)1 0 1]) \\ \end{tabular} \\ \hline \hline \end{tabular}
\end{table}
Table 3: The parameters of track-keeping controller.  
Input set 2: +VB (\(-\)VB) signifies as very big heading error to the port (starboard) side; +B (\(-\)B): is big heading error; +M (\(-\)M): is medium heading error; +S (\(-\)S): is small heading error; Zero: is very small heading error, see Figure 6b.  
Input set 3: +B (\(-\)B) signifies a fast yaw rate to the starboard (port); +M (\(-\)M): is slow yaw rate; +S (\(-\)S): is very slow yaw rate; Zero: is small error, see Figure 6c.  
Output set: +B (\(-\)B) signifies a big rudder angle to the starboard (port); +M (\(-\)M): is medium rudder angle; +S(\(-\)S): is small rudder angle; Zero: is rudder angle set to zero, see Figure 6d.  
The inference knowledge of the track-keeping controller is established based on reasoning rules between the inputs and the output. These rules take the form of: IF \(\ldots\) THEN \(\ldots\), for example:  
_IF_ (_Cross track error is +VB) and (Heading error is +VB) and (Yaw-rate is \(-\)B)_  
_THEN_ (_Ship rudder angle is +B_)  
In this example, these rules can be understood as follows: When the ship is on left of the planned route with very big distance, and ship heading error is very large toward port side, and a fast ship yaw rate to port, then the ship's rudder needs to be altered to hard starboard to bring the ship back onto the planned route as fast as possible and stabilize the ship's heading on the route. In this study, 441 rules were constructed to perform the inference of the controller.  
Figure 6: Membership functions of three inputs and one output of track-keeping controller: (**a**) Cross tracking error; (**b**) heading error; (**c**) yaw rate; (**d**) rudder angle.