Design and Motion Simulation of an Underwater Glider in the Vertical Plane

: Net buoyancy, as the main power source for the motion of an underwater glider, is affected by the pump or bladder that the glider adopts to change its buoyancy force in water. In this study, a new underwater glider that can dive to a depth of 400 m at a cruising speed of 2 knots, which is faster than conventional underwater gliders and is less affected by sea currents, is investigated. The UG resisting 400 m pressure on the buoyancy engine and achieving 2 knots’ speed was designed and constructed. For this UG, its steady-state attitude was studied according to the variance of the buoyancy center and the center of gravity with the buoyancy engine inﬂuenced by the displacement of the movable mass block. In motion simulation of the UG, the attitude of the UG under different displacement conditions was simulated in Simulink according to the displacements of the piston and the movable mass block. To validate the simulation performance, a UG was constructed and experiments were conducted. The simulation and experimental results were compared to show the reliability of the simulation results under limited conditions. experiments The simulation results indicated that the AOA changed rapidly with the position change of the movable mass, i.e., the larger the displacement of the movable mass, the smaller the AOA, and the smoother the change in the AOA. In addition, as the displacement of the movable mass increased, the buoyant effect on the AOA diminished gradually. The movable mass signiﬁcantly affected the pitching angle, where a larger mass and displacement resulted in a more signiﬁcant change in the pitching angle. The results showed that the pitch angle varied approximately linearly with the displacement of the piston in the glider dive stage and that the pitch angle changed by approximately 1 ◦ for every 10 mm movement of the piston. However, the displacement of the piston imposed a less signiﬁcant effect on the pitch angle when the glider was surfacing. In the glider diving or surfacing stage, the pitch angle changed linearly with the displacement of the movable mass, and the pitch angle changed by approximately 7 ◦ for every 10 mm movement of the movable mass; however, as the displacement of the movable mass block increased, the change in pitch angle decreased slowly. The effects of the displacements of the piston and movable mass block on the glide angle were consistent with the pitch angle results. From the contents of Figures 10 and 11, it can be obtained that under ﬁve different conditions, the glider showed different magnitude ﬂuctuations in the angle of attack and pitch angle during the attitude switching; keeping the consistency of the piston and movable mass block can make the glider behave more stably in the attitude transformation; and the simulation results can be used as reference data for the attitude control of the UG. For the pitching experiments involving the adjustments of different positions of the movable mass block, the maximum pitching angle error was less than 1 ◦ , which indicates the excellent modeling of the glider.


Introduction
Unmanned underwater vehicles, such as remotely operated vehicles (ROVs) and autonomous underwater vehicles (AUVs), have been used to investigate the underwater terrain or work under the water. Sometimes, small ROVs are used to identify unidentified targets [1,2]. However, the working range of ROVs is limited such that AUVs have been used for a wide range of areas. Autonomous underwater gliders, one kind of AUV, have been developed and investigated for decades as devices that enable long-range underwater detection and reconnaissance [3]. An underwater glider (UG) is a new type of underwater monitoring platform [4]; it comprises a pair of fixed wings assembled on both sides of the fuselage, as well as a controllable rudder to realize the change in motion direction. A variable-volume buoyancy engine causes changes in its own buoyancy; when the buoyancy force is less than the gravity force, the engine sinks in the water, and when the gravity force is less than the buoyancy force, it floats in the water. During the sinking and surfacing motions, the fixed wing is subjected to hydrodynamic force, which generates a horizontal force to drive the glider forward. The gliding pitch angle of the glider is changed by adjusting the position of the internal adjustable mass block in the body through the internal structure. A heat engine was investigated for use as an energy source of the buoyancy engine of a SLOCUM glider; additionally, the linear movement of the battery pack for controlling the glider's pitching motion underwater was analyzed [5]. The mass configuration of a buoyancy-driven underwater glider was decomposed and defined, and the glider motion was established and investigated using MATLAB [6]. System identification was conducted to investigate the ballast system of a USM underwater glider to understand the pumping rate as the input of the system and the corresponding net buoyancy of the ballast system. The estimation was performed using various models available in the MATLAB System Identification Toolbox, in which the ARMAX model was selected as the best model to represent the system and to obtain the transfer function. In addition, the glider depth and pitching angle were monitored [7]. The hydrodynamic performance of the underwater glider was analyzed using FLUENT software to provide a reference basis for the ideal design of each section of the body, and the motion in the vertical plane of the underwater glider was analyzed. The variation curves of the angle of attack (AOA) and attitude angle were obtained for different net buoyancies, different center of gravity displacements, and different speeds [8]. The motion of the glider in the vertical plane was simulated and analyzed to derive a relationship between the pitch angle of the glider and each of the axial displacements of the slider and the net buoyancy [9].
For the underwater glider, under the premise of satisfying the performance, the structure should be designed as compact as possible in order to reduce the manufacturing cost, and the shape should be streamlined to reduce the resistance in an underwater operation so as to reduce the energy loss during the operation and to extend the mission time.
In this paper, a new UG resisting 400 m pressure on the buoyancy engine and achieving 2 knots' speed was designed and constructed, and the related piston cylinder-type buoyancy engine and an internal mass block were studied. For the design of the UG, the net buoyancy and the movable range of the movable mass block were studied, and after determining the net buoyancy, the mass of the movable mass block could be indirectly determined. Based on the UG design, the parameters of the buoyancy engine and the movable mass were obtained.
In the glider motion simulation, the displacement of the piston and movable mass block were used as input conditions, which allowed a more visual representation of the effect of different displacements on the gliding parameters. Therefore, in this study, the main parameters of glider motion in the vertical plane, such as AOA, pitch angle, and glide angle, were analyzed and compared for different displacement conditions of the piston and the movable mass block; through the comparison of the gliding parameters, it was found that maintaining the consistency of the piston and movable mass block motion could lead to the best control performance of the glider during attitude transition.

UG Design
To achieve better mechanical properties for resisting seawater pressure and to facilitate fabrication, the shape of the underwater glider was designed by applying MYRING hull profile equations [10]. The MYRING hull profile is illustrated in Figure 1.
Here, d represents the body diameter, a represents the head length, n can be used to determine the shape of the head section, c represents the length of the stern section, and θ represents the tail wrap angle, which determines the shape of the stern. The greater the angle of δ, the smoother is the shape change at the stern. The parameters of the MYRING hull profile equations in this study were as follows: a = 280 mm, b = 1530 mm, c = 400 mm, d = 260 mm, n = 2, and tan δ = 0.8.
Net buoyancy is the main driving force for the motion of an underwater glider, and it determines the performance and reliability of the glider. The underwater glider changes its buoyancy by drawing and discharging water through a built-in pump. When the net buoyancy is positive, the glider floats upward, and when the net buoyancy is negative, the glider moves downward. Furthermore, the glider is subject to hydrodynamic forces from water when moving underwater. The force analysis of the glider during stable gliding is presented in Figure 2. The drag force can be expressed by Here, ρ is the density of the fluid, C D the drag coefficient of the glider, A D the crosssectional area of the glider, and V the gliding speed. During steady gliding in the water, the force will maintain balance on the glider; therefore, the net buoyancy ∆B and hydrodynamic drag force D are correlated as follows: where ζ is the gliding angle. Combining Equations (4) and (5), the net buoyancy is expressed as The net buoyancy of the UG is expressed as Here, V b is the volume of drainage of the buoyancy engine, and Equations (6) and (7) are merged to obtain the equation for the displacement of the buoyancy engine of the UG, which occurs as the gliding angle is 35 • [11].
Based on the design specifications, an underwater glider that can reach a maximum path speed of 2 knots was designed. Ji et al. [11] present a similar underwater glider with a diameter of 0.22 m, whose total drag coefficient is 0.2629. The water volume was obtained using the equations above. Considering the internal space of the waterproof housing and the compactness of the structure, the inner diameter of the cylinder of the buoyancy engine was set to 0.15 m. From the known conditions, the displacement of the piston can be calculated to be approximately 74.3 mm when the glider reaches the maximum speed. Taking into account the error in the theoretical calculation and the difference in the hydrodynamic drag coefficient, the effective stroke of the piston was set to 220 mm.
SolidWorks was used to construct a three-dimensional model of the underwater glider and to calculate the maximum displacement mass and center of gravity of the glider. Subsequently, an assembly model of the glider was constructed based on the center of gravity as the origin of the coordinates. The buoyancy of the glider m B at this moment can be obtained as follows: Here, M B and m b present the maximum buoyancy and ballast water, separately. In this study, the piston assembly was regarded as a movable mass block, and when the piston and movable mass were displaced, the center of gravity of the glider system changed accordingly. The underwater glider was regarded as a rigid body motion system composed of several masses, including the movable mass (m), piston assembly (m p ), and stationary mass (m s ), which include the mass of the hull and the fixed wings. An illustration of the glider mass is shown in Figure 3. The glider mass can be expressed as follows: If the glider is suspended in water, then the position of the movable mass is adjusted such that the glider is in horizontal suspension equilibrium in water. Subsequently, the net buoyancy of the glider is changed via the water absorption or drainage of the piston to drive the glider down or up, and the water absorption mass of the piston can be expressed as Here, r represents the inner radius of the buoyant cylinder and d p1 represents the displacement of the piston (the direction of water absorption is positive). The position of the buoyancy center (r CB ) is calculated as follows: Here, r b is the position of ballast water in the body coordinate. The terms r m , r p , r b , and r s in Figure 3 represent the position vectors of the movable mass, piston assembly, ballast water, and stationary mass to the origin of the body frame, respectively. The center of the glider mass is expressed as follows: Because the movable mass and the piston can only move along the longitudinal axis of the glider, the x-axis dimension changes in the body coordinate system, the z-axis dimension is fixed, and the stationary mass is fixed in the body. Hence, the equation for the center of gravity of the glider can be derived. When the glider is suspended horizontally in water, the mass position of each mass block in the x-axis direction of the body coordinate are recorded as the initial positions of balance of r mi1 , r pi1 , r bi1 ,and r si1 . The details of the parameters are shown in Table 1 below.  The mass center displacement of the movable mass, piston assembly, and ballast water are represented by d m , d p , and d b , respectively (the positive direction of the x-axis is recorded as a positive value).
When the piston moves, the mass of ballast water in the buoyant cylinder after the suspension state changes accordingly, as follows: Subsequently, Equation (13) can be rewritten as The relative position of the center of gravity to the center of buoyancy of the glider in different states can be deduced as follows: Because only the motion of the glider in the vertical plane is analyzed in this study, the recovery moment of the glider is expressed as Here, the r rx and r rz present the position of center of gravity in xand z-axes in the body coordinate, respectively.

Mathematical Model
To facilitate the study and analysis of the six degrees-of-freedom motion of the marine vessel, two different reference coordinate systems [12] were established: the Earth-fixed reference coordinate system (E-XYZ) and the body reference coordinate system (O-xyz). The Earth-fixed reference coordinate system uses any point at sea level and sets the floating center position of the underwater glider as the origin of the body reference coordinate system. The motion reference coordinates are shown in Figure 4. The transformation matrix from the body-fixed frame O-xyz to the Earth-fixed frame E-XYZ is as follows: The position of the glider b = (x, y, z) T is the vector from the origin of the earth reference frame to the origin of the body-fixed frame. The linear motion velocities and angular velocities of the glider are expressed as v = (v 1 , v 2 , v 3 ) T and = (ω 1 , ω 2 , ω 3 ) T , respectively. For a vector x = (x 1 , x 2 , x 3 ) T , the skew-symmetric matrix is expressed as follows [13] For any vector y = (y 1 , y 2 , y 3 ) T , the vector product of x and y is expressed aŝ Subsequently, the kinematics of a glider can be written as Let P E and π E represent the total linear momentum and angular momentum of the UG in the Earth-fixed reference coordinate, respectively; P m,E and P P,E represent the total momentum of the movable mass and piston in the Earth-fixed coordinate, respectively [13]. .
Here, k is a unit vector point in the direction of gravity, f ext,i the external force exerting on the glider system, and τ ext,j the external torque applied to the system. Vector x i applies the point of application of the external force with respect to Earth's reference frame. The force f int,m exerts on the movable mass from the glider body, and f int,m p is the force applied from the glider body onto the piston.
Let P represent the total linear momentum of the glider-fluid system expressed in the body-fixed reference frame. Let Π be the total angular momentum of the origin of the body coordinate. Let P m represent the momentum of the moving mass and P p the momentum of the pistons in the body frame.
Combining Equations (25) and (26), the derivatives on both sides of the equations above can be calculated as follows: The following dynamics equations are obtained in the body frame: . .
Here, R T K ∑ k=1 f int,m is the internal force exerted on the movable mass in the body-fixed frame. Let The total glider-fluid kinetic energy is calculated, and the kinetic energy of the movable mass, piston, ballast mass, and static mass are expressed as follows: The kinetic energy of a rigid body immersed in an ideal fluid can be expressed as follows: Here, M f is the added mass matrix, J f is the added inertia matrix, and D f is the added cross term. These matrices are determined by the body shape and the fluid density.
The total glider-fluid kinetic energy is expressed as The rotational kinetic energy of a rigid body around the axis of rotation is expressed as Here, the inertia of the total system is expressed as Subsequently, P, Π, P m , and P p can be calculated as follows: The design of this glider can be regarded as symmetric about three planes for calculation convenience, where M f and J f are diagonal matrices and The linear and angular momentum can be expressed as Here, the inertia matrix I is expressed as From Equation (58), we obtain The inverse of the inertia matrix is expressed as From Equations (14) and (15), we obtain .
Combining the equations above, the equations of motion governing a UG propagating in a three-dimensional space are expressed as follows: The total moment and force are expressed as follows: Here, τ ext and F ext are the hydrodynamic moment, lift, and drag forces exerting on the glider, respectively.
According to parallel axis theorem and the Pythagorean theorem, the moment of inertia of the stationary mass can be expressed as Here, J ms2 is the moment of inertia at the center of the stationary mass about the y-axis.
Considering the complexity of the actual underwater environment, the effects of currents and waves on the underwater glider were disregarded [14]. Owing to the symmetry of the underwater glider configuration, only its dive and uplift in the vertical direction were considered in this study. The underwater forces on the glider and the distribution of each mass point can be explained as follows: When the glider dives or floats underwater, it is subjected to hydrodynamic forces from the water, in addition to its own gravity and buoyancy. When the gravity force is greater than the buoyancy force, the glider sinks for diving movement; when the buoyancy force is greater than the gravity force, the glider floats to the surface. The force diagram of the glider is shown in Figure 5. The motion model was designed to move in the xz-plane of the Earth reference coordinate system and the body coordinate system. The vector and matrix representations of the motion parameters are as follows: The movable mass and piston move only along the x-axis; hence, r m3 and r p3 are constant, . r m3 = 0, and . r p3 = 0. The dynamics equations are obtained using the Newton-Euler motion and dynamics equations shown below [7,13,15]: . . . .
Here, x and z represent the horizontal and vertical displacements of the UG in the Earth reference coordinate frame, respectively; α is the AOA; θ is the angle of pitch; ξ is the gliding angle; v 1 and v 3 present the velocity components of the glider along the xand z-axes in the body-fixed frame, respectively; ω 2 represents the pitch angular velocity of the UG rotating about the y-axis of the body-fixed frame; L is the hydrodynamic lift; D is the hydrodynamic drag; M DL represents the pitching moment yielded by the hydrodynamic; m 1 and m 3 represent the added mass along the xand z-axes, respectively; J 2 represents the moment of inertia rotating about the y-axis; and P m1 , P m3 , and P P1 , P P3 represent the momenta of the movable masses and piston along the xand z-axes, respectively. Furthermore L, D, and M DL can be expressed as follows [16]: Ks are a hydrodynamic parameter obtained by using FLUENT and fitting the data by MATLAB, and its values are shown in Table 2.

Simulation
The force and motion of the underwater glider in the xz vertical plane during steady gliding are presented in the previous section. MATLAB and Simulink were used to simulate the motion of the glider, where the neutral buoyancy state was the initial state of the glider movement. In this simulation, the input parameters of the simulation were the displacements of the movable mass and piston, and the output parameters were the gliding angle, AOA, pitch angle, and gliding speed of the glider. Based on the equations above, the simulation structure is as shown in Figure 6.
The piston was operated by the transmission motor; it propagated inward or outward from the initial equilibrium state, and the buoyancy engine began to absorb or drain water. The glider was subject to the net buoyancy and hydrodynamic forces, and it dove or floated in the water. Based on the simulation results, the trends of the pitch angle, AOA, and gliding angle of the glider were obtained. The UG adjusted the underwater navigation attitude via the buoyancy engine and movable mass, and the gliding attitude angle changed with the variations in the buoyancy engine and movable mass.    Based on the above model, the effect of the interrelationship between the movable mass block and the displacement variation of the piston assembly on the angle of attack and the pitch angle was further investigated. The following five displacement change relationships were simulated here, namely case 1, where the movable mass block moves and stops simultaneously with the piston assembly; case 2, where the piston assembly moves first and the movable mass block starts moving after the piston assembly stops; case 3, where the piston and movable mass block move in the opposite relationship to case 2; case 4, where the piston assembly moves first and the movable mass block starts moving before the piston assembly stops; and case 5, where the piston moves in relation to the movable mass block in the opposite way to case 4. From the changes of angle of attack and pitch angle during attitude transformation in Figures 9 and 10, it can be seen that the fluctuation of angle occurs during attitude adjustment, while in case 1, the glide angle parameters change smoothly, and it can be considered that such state has the best attitude control effect. Figures 9 and 10 show the variation of angles.  The relationship among the attitude angle, buoyancy engine, and movable mass was obtained from the motion simulation (see Figure 11). The AOA changed with the buoyancy and movable mass when the UG glided downward and upward. The horizontal coordinate in the figure indicates the displacement of the piston, i.e., the positive and negative regions represent the piston drawing inward and draining outward, respectively. The legend of the figure shows the displacement of the movable mass. The left-half plane indicates that the glider glides upward and the movable mass moves backward, whereas the right-half plane indicates that the glider dives downward and the movable mass moves forward.     The path speed of the glider indicated the maximum value when the gliding angle was 35 • . Based on the trend of the gliding angle shown in Figure 13, the displacement of the movable mass and piston corresponding to the instant the glider reached the maximum gliding speed can be derived. In this study, the glider motion was simulated in two cycles, i.e., diving followed by surfacing. Figure 14 shows the variation in the gliding speed during the simulation.

Experiment
To verify the feasibility of the glider structure design, a simple experiment was conducted to investigate the variation in the glider pitch angle with the movable mass block owing to the limitations of the experimental conditions. Due to the communication needs, the antenna part must be exposed above the water surface, which means that the glider cannot be completely submerged in water, which is why the ballast water mass obtained from the experiment is not the same as the ballast water mass in the aforementioned Table 1. This experiment only tests the change of the pitch angle of the glider after the movable mass block is moved when the glider floats on the water surface. The experiment was conducted in the university swimming pool, and the deepest depth of the pool was 3 m, which does not satisfy the gliding experiment requirements. Figure 15 shows photographs of the experimental site. The middle section (yellow sector) shown in the photographs above contained communication cables. The total length of the cables was 2800 mm, their diameter was 10 mm, and the buoyancy of the cables was modeled as an equivalent circle (red model), as shown in Figure 15. The glider was not completely submerged in water, which implies that the antenna housing appeared partially above the water. The buoyancy of the glider is illustrated in Figure 16. The green part represents the ballast water in the buoyancy cylinder whose mass was 1.98 kg. First, the glider was suspended horizontally in water by the buoyancy adjustment mechanism and the movable mass block; at the end of the experiment, the distance from the surface of the piston to the end face of the buoyancy cylinder in the buoyancy engine was measured so that the mass of ballast water in the buoyancy engine for this experiment could be calculated; subsequently, the buoyancy mechanism was maintained, and the experimental values of the pitch angle under different attitudes were obtained by adjusting the different positions of the movable mass block, in which the movable mass block moved 10 mm each time. During the motion of the movable mass, the pitch angle was recorded at each moment using the built-in sensor on board, and after the experiment, the data were exported and fitted to produce a relationship between the pitch angle and the displacement of the movable mass. Next, the experimental results were compared with the simulation results. Owing to the limitations of the experiment, only the comparative results of the forward motion of the movable mass block are shown herein. The comparison results showed that the simulation and experimental results agreed well, with a maximum error of less than 1 • . By comparing the model with the physical glider, the analysis concluded that this error should be caused by the distribution of the cables inside the fuselage. We can only measure the mass and the approximate location distribution of the cables, but we cannot easily reproduce the distribution of the cables inside the fuselage with the modeling software. More detailed results will be described in a future paper. The comparative results of the experimental and simulation results are shown below Figure 17.

Conclusions
In this study, a UG that can dive to a depth of 400 m at a cruising speed of 2 knots was investigated. The motion of the UG with respect to the position variation of the internal movable mass and piston cylinder pump was analyzed. The hull profile of the glider was designed using the MYRING equations. The hydrodynamic parameters of the glider were obtained based on computer simulation using SolidWorks. By analyzing the mass distribution of each component in the glider, two reference coordinate systems were established for the underwater glider, different from the motion models of other references, the displacements of the movable mass block (d m1 ), and the piston assembly (d p1 ) in the x-axis of body coordinate as inputs for the simulation, and the equations of motion of the glider in the vertical plane were derived and simulated using MATLAB and Simulink. An underwater glider was constructed to validate the simulation analysis, and experiments were conducted.
The simulation results indicated that the AOA changed rapidly with the position change of the movable mass, i.e., the larger the displacement of the movable mass, the smaller the AOA, and the smoother the change in the AOA. In addition, as the displacement of the movable mass increased, the buoyant effect on the AOA diminished gradually. The movable mass significantly affected the pitching angle, where a larger mass and displacement resulted in a more significant change in the pitching angle. The results showed that the pitch angle varied approximately linearly with the displacement of the piston in the glider dive stage and that the pitch angle changed by approximately 1 • for every 10 mm movement of the piston. However, the displacement of the piston imposed a less significant effect on the pitch angle when the glider was surfacing. In the glider diving or surfacing stage, the pitch angle changed linearly with the displacement of the movable mass, and the pitch angle changed by approximately 7 • for every 10 mm movement of the movable mass; however, as the displacement of the movable mass block increased, the change in pitch angle decreased slowly. The effects of the displacements of the piston and movable mass block on the glide angle were consistent with the pitch angle results. From the contents of Figures 10 and 11, it can be obtained that under five different conditions, the glider showed different magnitude fluctuations in the angle of attack and pitch angle during the attitude switching; keeping the consistency of the piston and movable mass block can make the glider behave more stably in the attitude transformation; and the simulation results can be used as reference data for the attitude control of the UG. For the pitching experiments involving the adjustments of different positions of the movable mass block, the maximum pitching angle error was less than 1 • , which indicates the excellent modeling of the glider.