Design Development of Detection System and Ro-Ro Ship Notification based on Fuzzy Inference System

- Ship stability is very important for the safety of ship motion. There are many factors that affect the stability of a ship. One of the causes of accidents on ships is the problem of ship stability, including the ship cannot be controlled, and loses balance due to improper placement of cargo loads. This study combines gyroscopes, accelerometers, compasses, and GPS sensors, so that more accurate ship tilt information is obtained through an Android smartphone application. This study uses the fuzzy inference system (FIS) method with a trapezoidal membership function where there are 2 inputs and 1 output. Ship tilt input uses 3 linguistic variables very tilted, tilted, and stable. The slope duration input uses 5 very fast, fast, fairly fast, slow, and very slow linguistic variables. Ship status output is divided into 3 linguistic variables safe, alert, and dangerous. Testing and implementation with an input slope of 4.8 and a slope duration of 10 seconds using the Sugeno fuzzy method, the ship's crips value of 0.65 with an alert status was obtained. Calculation of the accuracy of the gyroscope sensor error using the MAPE method, the result is an error percentage of 6.55% (very good). The system accuracy error of 39 trials (36 correct and 3 incorrect) is 92.30% (very good). This research is expected to make it easier for the captain to monitor the stability of the ship and can provide notification of the status of the ship to the captain of the ship if there is a condition of the ship that needs to be watched out for. In addition, the notification will also be received by Port officers on land.


Introduction
Ships are water vehicles of any shape and type, which are propelled by mechanical power, wind power, or towed, including vehicles with dynamic support, underwater vehicles, as well as floating devices and floating structures that do not move [1]. Ship stability is very important for the safety of the ship's motion itself so that there are many factors that affect the stability of a ship [2]. The geometrical characteristics related to stability are the ratio between the width and draft of the ship, the ratio between the freeboard and the width of the ship and the coefficient of the shape of the ship. The greater the ratio of the width and height of the ship, the better the stability of the ship [3]. One of the causes of accidents on ships is the problem of the stability of the tilt of the ship, including the ship cannot be controlled, and loss of balance caused by the placement of the load that is not quite right. At a certain tilt angle the ship cannot be returned to its original position so it can capsize and eventually sink.
Currently, there are 35 ships at the Lembar -Padang Bai Ferry Port, many of which still use a manual tilt stability detection system, where the measurement of the ship's tilt is carried out using a tool called a Clinometer [4]. Based on accident data from the National Transportation Safety Committee (NTSC), between 2010 and 2016 there were 54 ship accidents. Among them sank 13 times, caught fire/exploded 19 times, crashed 17 times, ran aground 3 times, and others 2 times [5]. Emergency information on ships still uses a radio system for communication between ship captains and port officers, so there are still frequent delays in information for officers at the port and there are still frequent errors of information received, both related to the condition of the ship and the location of the ship.
Another research related to fuzzy logic that was carried out by [6] designed an automatic early warning system application to avoid collisions based on AIS (automatic identification system) data which was simulated using a GPS receiver and using fuzzy logic. In this study, two types of simulation were carried out, namely the head-on situation and the crossing situation, using a ship prototype. The calculation is done by determining the distance and angle of the ship to the object, then it is processed using the zero-order Sugeno fuzzy method, so that it can be compared with the rules issued by the IMO (International Maritime Organization). The response generated by this warning system is information in the form of speed and course direction Jurnal Ilmu Komputer dan Informatika that must be taken so that a collision does not occur in accordance with the rules set by IMO.
Research [7] designed a wind condition notification system using fuzzy Sugeno for shipping safety. The hardware used in the system is Arduino uno and as a microcontroller. The input used is a rotary encoder module and a dual-axis module. The rotary encoder module is used to determine wind speed while the dualaxis module is used as a wind direction indicator. In the wind direction input, this input has 3 sets, namely front, side and rear. While the input wind speed has 4 sets, namely not windy, slow, medium and strong. The output of this fuzzy system is a safe, alert or dangerous warning.
To minimize accidents due to delays in information about the condition of the ship, this research built an automated system for detecting ship tilt and sending ship status notifications to captains and port officers if needed, using Raspberry Pi and Sugeno's fuzzy inference system (FIS) method. The input to Sugeno's FIS method is obtained from the readings of the gyroscope sensor which are categorized into three sets of slopes (stable, tilted and very tilted) and the duration of the slope is categorized into five sets of slope durations (very fast, fairly fast, fast, slow and very slow). The three ship statuses produced based on Sugeno's FIS in this study are: safe, alert and dangerous. Notification to the port officer is sent if the ship's status is dangerous. In addition to the ship's status, other information sent to port officials is the ship's coordinates obtained from the NEO 6M GPS embedded in the built hardware module.
Sugeno's FIS method was chosen because it has advantages in terms of computation time which is more efficient, especially in terms of nonlinear dynamic systems and is more adaptive in terms of optimization [8]. As an example of using the nonlinear Sugeno FIS method, namely the movement of the pendulum which is influenced by the force of gravity, it is known that the ship's tilt clinometer also uses a pendulum to determine the ship's tilt. When the ship tilts, the pendulum will swing with a certain angle, relative to the ship's stable state (not tilted). Thus, the Sugeno FIS method is very suitable for use in the development of a nonlinear system for detecting ship tilt and notification of the status of this ship's tilt.
The benefits of this research are expected to make it easier for ship captains to monitor the condition of the ship's slope, without having to go to the location where the clinometer is installed as in a manual system. For port officers, information on the position of the ship that is sent together with the status of the ship will make it easier if needed for further action. Thus, officers can act more quickly in helping ships that are in dangerous condition. Furthermore, data on the ship's inclination, duration, and event coordinates that are stored during the voyage period, can be used for further research regarding the conditions of the waters that the ship passes through.

Ro-Ro Ship (Roll on-Roll Over)
In general, this ship is a passenger ship and transports vehicles such as motorbikes, bicycles, cars and trucks. Where this type of ship functions as a link between islands in Indonesia, as shown in Figure 1. This ship has a door called the ramdoor for the entry and exit of vehicles from ship to port or from port to ship [8].

Research Place
This research was carried out at the IPB campus pond to test the detection and notification system for the tilt status of a ro-ro ship based on a fuzzy inference system to help the performance of ship captains and port officers in monitoring ship status.

Research Stages
The research carried out included several stages of research, namely problem identification, data collection, inference system design, system architecture design, prototype development, implementation and lab tests, field tests and results analysis. The flowchart of the research stages is shown in Figure 2.

Identification of Problems
The stages of problem identification are carried out by direct observation of the ship's location at Lembar Harbor -Padang Bae and conducting direct interviews with both the crew and the ship's captain, so that the results of this problem identification can be used as a reference in the development of a tilt status detection and notification system new ship.

Data Collection
Ship tilt data was collected on the KMP Munic I ship by means of observation. This activity was an activity of recording a symptom with the help of instruments and recording it for scientific purposes or other purposes. It is further said that observation is a collection of impressions about the world around it based on all the capabilities of the human senses (Hasyim 2017). The observation process was carried out using a gyroscope sensor and Arduino Uno as a microcontroller to collect ship tilt data. Information on the KMP Munic I ship can be seen in Table  1.

Inference System Design
Fuzzy logic is a problem-solving control system methodology, which is suitable for implementation on systems ranging from simple systems, small systems, embedded systems, PC networks, multi-channel or data acquisition-based workstations, and control systems. This methodology can be applied to hardware, software, or a combination of both. In classical logic it is stated that everything is binary, which means it only has two possibilities, Yes or No, True or False, Good or Bad [9]. The reasons for using fuzzy logic are as follows: 1 The concept of fuzzy logic is easy to understand. The mathematical concepts underlying fuzzy reasoning are very simple and easy to understand.
2 Fuzzy logic is very flexible.
3 Fuzzy logic has tolerance for imprecise data.
4 Fuzzy logic is capable of modeling very complex nonlinear functions.
5 Fuzzy logics can build and apply the experiences of experts directly without having to go through the training process.
6 Fuzzy logics can work with conventional control techniques.
7 Fuzzy logic is based on natural language.
A fuzzy logic control system, also known as a Fuzzy Inference System (FIS) or a fuzzy inference engine, is a system that can reason with similar principles as humans' reason with their instincts [10]. In building a fuzzy system, there are three methods of reasoning, namely Tsukamoto, Mamdani, Sugeno. The Mamdani model is usually used for intuitive problems while Sugeno is used to deal with control or control [11].
The membership function is a curve that shows the mapping of data input points into their membership values which have interval values [12]. The range of curves used in determining the inclination of a ship is determined by the static stability curve where the static curve determines the size of the stability arm on a ship at a tilt angle of 0-90 degrees under certain loading conditions [13]. Meanwhile, Fyson [14] explained that the calculation of the value of the return arm/coupling is a very important part in terms of ship stability. The range of the curve is shown in Figure 3. In a fuzzy system, the membership function has a very important role in representing the problem. The membership function is a curve that shows the mapping of data input points into their membership values, often referred to as membership degrees, which have an interval between 0 and 1. One way that can be used to obtain membership values is through the trapezoidal membership function approach.

a. Trapezoid Membership Function
The trapezoidal membership function represents the magnitude of the membership degree of each input variable that is in the interval between 0 and 1. The degree of membership of a variable x is denoted by the symbol μ(x). The rules (Rules) use the membership value as a weighting factor to determine its effect when making inferences in drawing conclusions. The membership function can be represented as equation 1 [15].

. Fuzzy If-Then rules
The inference membership function is a process of drawing a conclusion based on certain data and rules [16]. FIS has 3 important components, namely knowledge base (fuzzy rules), database (membership function), and inference mechanism.

System Architecture Design
In the process of designing the system architecture, what is being done is designing the system architecture with the sensors needed in the detection system and notification of the ship's tilt status.

Prototype Development
The development of a prototype system for detection and notification of ship tilt status was carried out by combining the Sugeno fuzzy inference system model with a combination of GPS, compass and raspberry pi as the processor.

Lab Testing and Implementation
Laboratory tests and implementation are carried out to determine the performance of the system being built, the accuracy of the resulting output and implementing the system architecture for detecting and notifying the ship's tilt status on the prototype.

Results Analysis
In this process an analysis of research results will be carried out based on the results of the research conducted, both in lab tests and field tests.

Sugeno Method
The Sugeno fuzzy method has several advantages, namely: The Sugeno method is computationally efficient and works optimally, is suitable for mathematical analysis, is very suitable for linear simulation problems, works well for system optimization and adaptive techniques [17]. The main difference between Sugeno's method and other methods lies in the consequences of fuzzy rules. The Mamdani fuzzy system uses fuzzy sets as a consequence of the rules while the Sugeno fuzzy system uses a linear function of the input variables as a consequence of the rules [18].
There are four stages to obtain the output value in the Sugeno type fuzzy inference system. The first is to do fuzzification. First, the fuzzification process is a change in a crips value into a fuzzy variable in the form of a linguistic variable which will later be grouped into a fuzzy set.
The second process performs the implication function where the input variable applies the t-norm. T-norm is a slice operation on a fuzzy set. The rule system used is min with the conjunction "AND". The results of operations with the "AND" operator is expressed as α-predicates. Each rule can use the form of equation 2 [19].
If is AND … AND is THEN is B The third process of aggregation combines fuzzy rules to get the area of the composition of the rules used. If the system consists of several rules, inference is obtained from the collection and correlation between rules, namely calculating the result of where R is the number of rules, is the of the , and is the output at the accent of the rule [8].
The last process is defuzzification, where this process will calculate the average weight and antecedent calculation values (Center Average Defuzzifier) using Equation 3 [20].
(3) Information: = is the predicate in rule = is the output of rule

Haversine Formula
Harvesine formula is a method of calculating the distance between two points on earth based on the length of a straight line between two points without neglecting the curvature of the earth [21]. The following is the calculation formula for the Harvesine formula shown in equation 4.

Mean Absolute Percentage Error (MAPE)
MAPE is an evaluation calculation, MAPE is used to measure how precise or accurate a prediction is that is often used [22]. By using MAPE, you can assess the difference between the clinometer value and the gyroscope sensor value so that you can determine the percentage of error from the system output results with the rules determined by the expert. The following MAPE calculation formula is shown in equation 5. = the amount of data tested The MAPE value has criteria which explain that the smaller the MAPE value, the better the accuracy value. The MAPE value criteria are shown in Table 2 [22].

Identification of Problems
The process of developing a fuzzy inference system begins with identifying the problems studied based on the specific conditions of the existing ships at the Lembar Port -Padang Bai that will be addressed. In this study, the problem being studied is that the ship's tilt system, which is still in a conventional form, will be converted to an automated one, so that it can assist port officers and also the ship's captain in monitoring or maintaining the maximum stability of the ship and can monitor the condition of the ship without the need to be on the bridge.

Inference System
In the inference system process, a trapezoidal membership function is created. This process can be formed by comparing the input variables and the membership function to obtain the membership value of the ship's tilt variable and the duration of the tilt. The membership function of the duration of the ship's tilt can be seen in Figure 5. The value of the duration of the ship's tilt has 5 linguistic variables very fast, fast, quite fast, slow, very slow. Where the overall value range is from 0 to 60 seconds. Value ranges for very fast [ 0, 1, 9, 10 ], fast [9,10 , 19, 20], normal [ 19,20,29  The membership function for ship status output is represented in singleton form, which can be seen in Figure 6.  Table 3. Example of testing the fuzzification process after obtaining a ship tilt value of 4.8 , and a ship tilt duration of 10 seconds.
After obtaining the inclination value and the duration of the inclination of the ship, the membership function is calculated using equation (1), the membership value is obtained as follows: Ship Tilt: Tilt duration: The implication function used is MIN, which means the membership level obtained from this process is the minimum value of the variables formed. Therefore, we get a fuzzy area on the decision variable for each rule. In the Sugeno method, not all possible rules are used, but only those that may be used in determining the status of the ship. Thus, there are 2 rules that are triggered with the premises as follows: Then do the defuzzification where this stage is the last stage of Sugeno's fuzzy using the centroid method to obtain the crips value. The centroid method consists of determining the moment, determining the area, and determining the center point. The fuzzy set obtained from the composition of the rules is used as input, while the resulting output is a number in the domain of the fuzzy set. In calculating the crips value of the trapezium centroid method is carried out using equation (3).
Based on the results of calculations using the Sugeno fuzzy method, the ship's crips status value is 0.65 which is included in the alert condition. And then it is processed with a ship status detection and notification system so that officers and ship captains can monitor the condition of the ship's status through the internet and local networks.

System Architecture Design
The design of a ship tilt status detection and notification system has 3 types of sensors namely GPS, compass, gyroscope. The data obtained from the gyroscope sensor will be used as input data for the ship's tilt. So that the captain and port officers can monitor the condition of the status of the ship through the internet network and local network. like Figure 7.

Lab Testing and Implementation
Laboratory testing is carried out by testing the sensors used in building a ship's tilt detection system. Following are the test results of the sensors and systems used in the construction of the ship's tilt detection system.

a. Testing LCD Qapass 16x2
LCD testing aims to check whether the LCD can run properly, without any problems, and displays text given the command lcd.print as shown in Figure 8. After testing it is known that the LCD can run well. The first line and the second line can work well in displaying text and print commands that are entered into the system.

b. GPS NEO 6M testing
The purpose of the test is to find out that the GPS sensor can send the correct coordinates according to the GPS location and also to test whether the sensor can work properly or not. This test is carried out by comparing the latitude and longitude coordinates of the NEO 6M GPS and smartphone GPS. The test results can be seen in Table 4. Calculation of the difference in the value of the distance between the Google Maps GPS coordinates and the Neo 6M GPS uses equation (4). So that the results of the difference in distance are shown in Table 3.
Calculation of the average difference by adding up the total difference and then dividing it by the number of trials 20 times so that the results show that the average difference in distance between the Google Maps GPS and the NEO 6M GPS is 12.5 meters. c.

Gyroscope Sensor Tilt Testing
The purpose of this test is to find out whether the algorithm entered into the system can run properly and have results that are in accordance with the existing rules. The test method is to carry out a slope test by inputting a slope variable with a multiple of 2 up to a slope input variable equal to 20 degrees and an input duration of 5 seconds. The test results can be seen in Table 5. The test was carried out five times as can be seen in Table  4, the results of tests 1 to 5 have the same crips value so it can be concluded that the test was successful because there was no discrepancy in the results of tests 1 to 5.

d. Gyroscope Sensor Accuracy Testing with MAPE
Accuracy testing was carried out using 20 data obtained from measuring the tilt of the ship with a clinometer and gyroscope sensor. The overall data is shown in Table 6. Testing the accuracy of the system by comparing the system output results with the output rules of 16 rules. The overall test data is shown in Table 7.

f. Notification Test
The purpose of this test is to find out whether the system can send danger notifications when the ship's status is in a dangerous condition and also see that sending notifications is running properly and correctly without errors or problems. The test results are shown in Figure 9.  From the tests carried out, it was found that the notification of the status of the ship can run well in sending the coordinates of the location of the device and the current condition of the ship's status. Hence, it can be concluded that the test was successful.

Results Analysis
Based on the results of lab testing and the implementation of the detection and notification system for the tilt status of the roro ship based on the fuzzy inference system, each sensor works according to its respective function and testing the detection and notification system for the tilt status of the ro-ro ship based on the fuzzy inference system by inputting a slope of 4.8° and the duration of the tilt of 10 seconds is then calculated using the Sugeno fuzzy inference method, the output of the ship's status is 0.65 where with the crips value it is known that the ship's status is alert. So that with the results of the testing and implementation of the detection system and notification of the tilt status of the ro-ro ship based on the fuzzy inference system it can be said to be successful.

Conclusion
The detection and notification system for ro-ro ship tilt status based on a fuzzy inference system can provide data on ship status and location of the ship, based on tilt data, duration of ship tilt and real ship location. Implementation of a system for detecting and notifying the tilt status of ro-ro ships can facilitate the work of ship captains and port officers in monitoring the condition of ships when the ship is in a dangerous condition. This system can provide information on the condition of the ship quickly to Port officials and also the ship's captain so that if the ship is in a dangerous condition, it can be handled more quickly for ships that are in a dangerous condition. So that the results of testing the detection system and notification of the tilt status of the ro-ro ship based on the fuzzy inference system can be used as a substitute for the conventionally working ship tilt gauge clinometer.
This research can be developed by adding several other supporting variables such as wind speed, sea waves, and weather. So that it can provide more accurate information for the detection system and notification of ship tilt status.