Application of Embedded Sensor Systems to Improve Safety for Container Ships in Cargo Loading or Unloading Operations

In recent years, several accidents involving container ships have occurred in which the ships capsized when loading or unloading operations in ports, resulting in casualties of personnel, damage to cargo, and huge financial losses. In all cases, the reasons for the accidents were found to be operational errors causing the ships to tip sideways owing to changes in cargo weight. Since the loading and unloading of containers are subject to random conditions, such as the timing of arrival versus the space conditions in the cargo holds and the on-the-spot decisions of operational staff, it is difficult to plan for the effects of cargo weight changes on the ship stability during loading or unloading. However, the general operating environment in a harbor is under a still water condition, and changes in the ship stability can be monitored by detecting the minute rolling periods of the ship. We explore the practicality of monitoring the rolling periods of container ships using a simulation model comprising an embedded system with a nine-axis attitude module; the module is attached to a ship model to record the rolling angles of the ship in a static pool and transmit the data to a computer for analysis. The experimental results show that the embedded system with a nine-axis attitude module as a sensor can be applied to capture the rolling period of a container ship; moreover, it can be applied to analyze the rolling data and obtain optimized relevant ship-stability parameters for loading and unloading operations.

In recent years, several accidents involving container ships have occurred in which the ships capsized when loading or unloading operations in ports, resulting in casualties of personnel, damage to cargo, and huge financial losses. In all cases, the reasons for the accidents were found to be operational errors causing the ships to tip sideways owing to changes in cargo weight. Since the loading and unloading of containers are subject to random conditions, such as the timing of arrival versus the space conditions in the cargo holds and the on-the-spot decisions of operational staff, it is difficult to plan for the effects of cargo weight changes on the ship stability during loading or unloading. However, the general operating environment in a harbor is under a still water condition, and changes in the ship stability can be monitored by detecting the minute rolling periods of the ship. We explore the practicality of monitoring the rolling periods of container ships using a simulation model comprising an embedded system with a nine-axis attitude module; the module is attached to a ship model to record the rolling angles of the ship in a static pool and transmit the data to a computer for analysis. The experimental results show that the embedded system with a nine-axis attitude module as a sensor can be applied to capture the rolling period of a container ship; moreover, it can be applied to analyze the rolling data and obtain optimized relevant ship-stability parameters for loading and unloading operations.

Introduction
When sailing on the ocean, ships are affected by various natural external forces, such as wind, waves, currents, and flapping effects. These factors cause ships to tilt, roll, and sway. In general, a ship moves in six degrees of freedom (DOFs). Among these ship motions, rolling is the most dangerous and has a huge impact on the ship. When the ship has a large inclination at sea, not only is the crew's comfort affected, but internal equipment is also damaged. The inclination may cause the ship to capsize directly and cause severe personnel and property losses. The container ships MSC Matilde [ Fig. 1(a)] and SL Star [ Fig. 1(b)] experienced heavy tilting and overturning due to stability issues during cargo loading and unloading operations in a port on May 24, 2019 and March 19, 2019, respectively. (1,2) In the process of loading and unloading cargos in the port, several thousands of containers operate independently and simultaneously at each hatch position. In addition to the stability problem, overturning is also caused by external environmental factors, cargo yard transfer operations, worker skills, hatch design, and other cabin-related factors. Complicated conditions such as the configuration of different loading and unloading ports for internal cargoes have led to improper counterweights and insufficient stability, resulting in severe ship overturning disasters.
In the shipping industry, ship rolling is an important issue and a hot research topic. Ship rolling can be controlled and evaluated thoroughly. (3)(4)(5)(6)(7)(8) Suppose that the origin of the coordinates in a ship is the center of gravity and the three perpendicular axes are the horizontal axis X, horizontal axis Y, and vertical axis Z. Then, the six DOFs of the ship motion are rolling, pitching, yawing, heaving, surging, and swaying, as shown in Fig. 2. (9)(10)(11) In this study, a reduced-scale box-shaped ship with multiple water tanks is used as the experimental target, and a nine-axis attitude module on the ship as a sensor is used to detect the ship inclination angle. The water tanks are set up in different locations of the ship to test the ship stability under various conditions such as the free-surface effect (FSE). The FSE is a mechanism that can cause a ship to become unstable and capsize. When a tank in a ship is partially filled, the liquid's center of gravity will change as the ship becomes inclined. The FSE must be considered in ship design, and operators must be aware of its significance and use the tanks in the ways intended.
We adopt the reduced-scale ship to simulate the change in the ship stability loss under different stowage during loading and unloading operations. The experimental environment is in still water. First, the center of gravity and rolling-period coefficient of the empty ship are verified. Then, the water tanks are filled with different proportions of liquid load, so that the loss of metacentric height, which affects the ship stability, is reduced due to the FSE of the liquid. We also analyze the motion signals of the sensor in the reduced-scale ship and obtain the natural frequency of the ship's rolling, which can indicate the stability of the same type of ship and the influence of the FSE on the ship's center of gravity.

Ship parameters
Some ship parameters are defined in this subsection. One of the important issues for a ship is its stability. When a ship in still water is inclined at a small angle by an external force, the center of gravity G is fixed if the loads on the ship are not transferred, but the center of buoyancy changes. The intersection of the action line of the new buoyancy force and the center of gravity is called the metacenter M. Whether a heeled ship can return to its upright state depends on the relative positions of the center of gravity G and the metacenter M. The center of gravity G should be below the metacenter M.
The righting moment can keep a ship upright. The larger the righting moment, the less likely the ship will capsize. One of the standard metrics for indicating the initial stability of a ship is the metacentric height GM, which represents the relative position of the ship center of gravity G to the metacenter M (12,13) (Fig. 3).
Through an inclination experiment, we can compute the initial metacentric height GM 0 under a light-ship condition: where W t is the weight of the test object, d is the sliding distance of the object, W s is the ship light weight, and θ is the tilting angle (Fig. 4). The metacentric radius (BM for the box-shaped vessel) in Fig. 3 can be expressed as 2 12 where I is the moment of inertia, V is the volume of the ship below the waterline, B is the ship breadth, and Draft is the ship draft. For a box-shaped vessel, the center of buoyancy above the keel (KB) can be expressed as  The height of the metacenter above the keel (KM) can be formulated as The center of gravity above the keel (KG) of the light ship is defined as During ship cargo loading or unloading operations, the ship center of gravity changes with the cargo weight, and consequently, KB, BM, KG, and KM also change; therefore, the metacenter M differs from the original one.
Furthermore, we can apply the GM formula to determine the rolling-period coefficient f under the light-ship condition. When the ship is acted upon by an external force to produce a natural roll period T, the initial metacentric height GM 0 is inversely proportional to the square of the roll period. The relationship is expressed as where f is the rolling-period coefficient under the light-ship condition, B is the ship breadth, and T is the rolling period under the light-ship condition. Since B remains unchanged, the exact rolling coefficient f under various ship loading conditions can be obtained. By detecting the natural rolling period of the ship, we can obtain the metacentric height GM, which affects the ship stability. From Eq. (1), the metacentric height GM 0 of the empty ship can be obtained. (12)(13)(14) Then, using Eq. (6), we can find the rolling coefficient f of the empty ship. Furthermore, regarding the FSE on the metacentric height, the FSE is mainly related to the widths of the ship tanks and compartments, and it is also related to the ship type.
The moment of inertia (or second moment of area) in these rectangular tanks with FSEs can be determined by 3 12 where l and b are the total length and breadth of the slack tanks with FSEs, respectively. The reduced metacentric height GM of the ship can be expressed as (15) where i is given by Eq. (7), d is the liquid density, W is the ship displacement, and n is the number of compartments of longitudinal bulkheads.

Experimental methods
According to Newton's second law of motion, an object subjected to an external force will accelerate, and the magnitude of the acceleration is proportional to the force and inversely proportional to the mass, where F is the external force (N), m is the mass (kg), and a is the acceleration (m/s 2 ). In our experiment, we used a micro-electromechanical system (MEMS) to sense the ship movement. As the movement changes, the MEMS sensor is subjected to pressure changes in all directions of inertia and produces voltage changes. An MPU 9150 MEMS chip is used to detect the ship roll angle, and the gyroscope in the MPU 9150 chip is used to detect the angular velocity. A meter is used to measure the angle change, and it measures the rotation state of the object. Similar to an accelerometer, it senses the X, Y, and Z directions.
In still water, the box-shaped ship returns from the initial angle to generate natural periodic shaking due to inclination. The embedded system adopts a 9-DOF module to sense the roll angle and then transmits the signal to a personal computer via a Bluetooth module for signal processing, analysis, and result storage. A block diagram of the vessel rolling detection system proposed in this research is displayed in Fig. 5. Figure 6 shows the box-shaped ship, which is built with a metal frame and has a length, width, and height of 3, 2, and 0.75 m, respectively. The ship model contains 18 water tanks (nine on the bottom layer as ballast tanks, six on the middle layer, and three on the top layer), and the 9-DOF module and the microcontroller are inside the ship body. The experimental environment is the above-ground pool shown in Fig. 7.
The water tanks in the experimental ship model are filled with water to simulate the fullload state without the FSE, and different proportions of free-liquid loads are configured in some tanks to simulate the FSE. (12)(13)(14)16) Because the FSE will reduce the metacentric height and affect the ship stability, we calculate the rolling coefficient under various conditions. In this study, the inclination test is used to obtain the center of gravity above the keel (KG) (10,12,15) and the rolling coefficient of the empty ship. Figure 8 is the automation interface used for the calculation of the ship stability. By simply inputting the ship weight, draft, and rolling cycle, we obtain the rolling coefficient of the empty ship. Similarly, by computing the rolling coefficient under the conditions of a full-load state and partial-load state, we can analyze the stability of the box-shaped ship and determine the effect of the FSE on the ship's center of gravity and the rolling coefficient.
To  The reduced GM is given by Then, the new GM is From Eqs. (6) and (12), the new rolling coefficients f′ under the ship conditions with various cargo load and free liquid can be obtained as

Results
In this study, the inclination test is used to obtain the center-of-gravity height and the rolling coefficient f of the empty ship. The water tanks in the experimental ship model are filled with various free-liquid proportions (5, 10, 15, 20, 25, 30, and 35%), and the related rolling coefficients f′ are calculated. In addition, by verifying the obtained rolling coefficients, we can obtain the stability of the same type of box-shaped ship and evaluate the FSE, that is, the effect of the free-liquid proportion on the ship center of gravity and the rolling parameters. The metacentric height (GM) in the full-load state can be computed as a reference for loading and unloading operations in the port. Figure 9 shows the time response of the natural rolling test for the light ship and full-load ship. Figure 10 shows the time responses of the natural rolling for different free-liquid proportions. The rolling data are recorded from a nine-axis attitude module with a sampling time of 50 ms. The heeling angle is obtained by shifting the weights and causing the ship model to roll. The free-liquid proportion is varied to simulate the effect of changing the cargo weight of a container ship going through a loading and unloading operation in a port. The relationship between the free-liquid proportion and the corresponding rolling period is illustrated in Fig.  10(h).

Conclusions
The proposed method could effectively detect the continuous rolling signal of the ship. In this research, the rolling cycle was detected under conditions of no load, a full load, and 5 to 35% free-liquid loads. The results show that an embedded system with a nine-axis attitude module as a sensor could be applied to capture the rolling angles of a container ship, analyze the rolling data, and obtain optimized relevant ship-stability parameters in loading or unloading operations. Acquiring the rolling data simplifies the process of determining the ship stability, which usually needs complex mathematical computation with the weights of cargo and liquid tanks. The experimental results, which are based on the detected rolling angle and period of the ship, prove the feasibility of the proposed method. We have thus proposed a stability detection tool for a ship under restricted conditions (loading and unloading operations in still water or in a port), and the tool can be further developed into a general monitoring system for ship stability.
of Maritime Information and Technology, National Kaohsiung Marine