Modeling of an Autonomous Underwater Robot with Rotating Thrusters

These days, underwater vehicles have wide range of applications in different marine industries. Controllability and maneuverability of these vehicles which are strongly affected by various forces including hydrodynamic forces applied on them. At the design stage, knowing and calculating these forces are of very high importance which a mistake in calculations and analysis of forces can have a lot of damage to be followed including time, the cost of re-design and total change in the body and following to that some changes in internal and external, mechanical and electronic components of that. Therefore, simulating a robot in a real system and implementation and real monitoring of a robot performance can significantly help the designer in observing the robot performance in different condition. But it needs a good understanding of the robot environment modeling body coordinate and accurate calculation of the external forces applied on the body. In this project, we implement a virtual simulation of the robot in real conditions after the accurate analysis of the applied forces on the designed robot body and coding achieved equations in MATLAB and the environment of LabVIEW which is able to give us the whole performance of the robot for the moment which this display control in the actual operation of the robot in the water is a very accurate indicator of the robot performance in tests that enables us to manually apply necessary orders to robot through a wireless transceiver of the robot by changing the parameters of this display.


Introduction
These days, underwater vehicles have wide range of applications in different marine industries. Controllability and maneuverability of these vehicles which are strongly affected by various forces including hydrodynamic forces applied on them. At the design stage, knowing and calculating these forces are of very high importance which a mistake in calculations and analysis of forces can have a lot of damage to be followed including time, the cost of re-design and total change in the body and following to that some changes in internal and external, mechanical and electronic components of that. Therefore, simulating a robot in a real system and implementation and real monitoring of a robot performance can significantly help the designer in observing the robot performance in different condition. But it needs a good understanding of the robot environment modeling body coordinate and accurate calculation of the external forces applied on the body. In this project, we implement a virtual simulation of the robot in real conditions after the accurate analysis of the applied forces on the designed robot body and coding achieved equations in MATLAB and the environment of LabVIEW which is able to give us the whole performance of the robot for the moment which this display control in the actual operation of the robot in the water is a very accurate indicator of the robot performance in tests that enables us to manually apply necessary orders to robot through a wireless transceiver of the robot by changing the parameters of this display.

Design the Body
To successfully design the body, one should establish a primary plan of the body structure with the location of each sub-part, knowing that the device will be made of one piece with a camera on the top and engines attached on the sides. In this work ( Figure 1); in this case, all thrusters should be put "on" at the same time to create a simultaneous verticalhorizontal movement; it will then lead to high power consumption. Our first contribution was to use a pair of mobile thrusters instead of fixed vertical/horizontal ones, thus saving energy. In practice, the two thrusters shown in Figure 2 could be oriented within a specific angle based on the vertical and horizontal forces needed to move the device in a predefined direction. Any change of angle should be made possible by the instant movement of a servo motor which consumes much less energy than the constant movement of a thruster.

Mass Shifter
As shown in Figure 3, a mass shifter was included, first because of the thruster's movement and second, to make the maneuver possible in the direction of the pitch. The whole set can have two movement modes. In the first mode, the body will have, by the help of the mass shifter, a constant horizontal movement and its movement towards vertical and horizontal directions should be performed through a change in the thruster's angle. In the second mode, the thrusters should be kept fixed in a horizontal direction and the vertical movement should be made possible through a change in the body angle in the pitch direction. The first mode is used to maneuver or pass obstacles while the second mode is used to preserve and store energy as well as to change direction in relatively large depths.

Physical Device
According to Figure 4, the center of the physical device is matched with the reference point of the vehicle. Its axis comes out from the front end of the vehicle and its y axis extends to the right; the z axis completes the right hand rule. Let this system be called B and its axes b 1 , b 2 and b 3 .

Gravity Model
Assuming the Earth as a perfect sphere, the gravity in terms of height is determined by the following equation: where μ is the earth constant (3.986005 × 10 14 m 3 /s 2 ). R, the distance between the two masses, depends on the earth's radius R [1,2].

Modeling the Forces
In this work, it has been assumed that the fluid in which the vehicle is moving has a steadily and fixed density ρ = 1000 kg/m 3 . The external forces applied on the vehicle can be then evaluated [3].

Buoyancy force
According to Archimedes' principle, the buoyancy force, applied vertically to the body and in the upward direction, equals the weight of the displaced fluid by the body: where ρ is the density of the fluid and V it's volume.

Weight force
The weight force is calculated as where m B is the vehicle mass.

Thrust force
As shown in Figure 5, two engines on either side of the vehicle are used to provide the thrust force. The forces produced by the left and right engines are noted F r and F L , respectively.

Added mass force
As the device moves within the fluid, a certain amount of liquid will move with it [4]. As inertial and Coriolis matrices relate the accelerations and angular/linear velocities of the body to the forces applied to the device, the added mass matrices and added Coriolis relate the accelerations and angular/linear velocities to the hydrodynamic force arising from the liquid displacement and applied to the device.
When a vehicle moves inside the fluid, a dynamic pressure distribution is created around it. Bernoulli's law states that the pressure applied on a differential surface dS depends on the fluid particle velocity on the differential surface and also to the water column height above it and this pressure applies a differential force dF and differential moment dM on the differential surface dS. The force and differential moment are called the force and added mass moment.
When a force is applied to the fluid particles, its adjacent particles are accelerated due to a viscosity. That is why when a device moves in the fluid, the fluid particles which are located exactly on the device move at the same rate of the vehicle and the particles that are far from the vehicle move with different velocities. In fact, there is a velocity distribution on the differential surface dS and the farthest particles   have a zero velocity [5]. According to Regan et al., [1] the force due to the added mass is ( ) where F A is the added mass, M A the added mass matrix, v the velocity and C A the added Coriolis matrix.

Hydrodynamic force
As stated refs. the main hydrodynamic forces that are applied on a subsurface vessel include Quadratic drag forces and lineal skin friction forces. Although the equations of a vehicle with six degrees of freedom are highly non-linear, a series of simplifications are usually used.
The most common simplification is to assume that the linear and quadratic forces in the direction i depend on the velocity vector components in that direction. Thus, the hydrodynamic forces are calculated as follows : where • u, v and w are the components of the velocity vector in the respective directions x, y and z.
• p, q and r are physical components of the angular velocity vector on the respective directions x, y and z.).
• X u and X u|u| are the linear viscosity and quadratic coefficients along the x direction.
• Y v and Y v|v| are linear viscosity and quadratic coefficients along the y direction.
• Z w and Z w|w| are linear viscosity and quadratic coefficients along the z direction.
• K p and K p|p| are linear viscosity and quadratic coefficients along the p direction.
• M q|q| and M q|q| are linear viscosity and quadratic coefficients along the q direction.
• N r and N r|r| are linear viscosity and quadratic coefficients along the r direction.

Kinematics
To derive a vector V vs. time in any coordinates system (Table 1), the following operator D=d/dt is used: Then, the transfer matrix form a point B to a given vehicle W can be stated as in ref: To calculate the angular speeds, the following equation are used [2]: Physical speeds p, q and r are calculated from the following equation [6]: To model the rotation in three dimensions, the concept in classical mechanics is to use rotational kinematics. One of the ways to describe rotation is the quaternion method. The four elements of the quaternion, q 0 , q 1 , q 2 and q 3 , are related to the physical speed components p , q and r through the following relation:

Dynamics Analyze
The Linear momentum of a m B mass relative to an arbitrary vehicle, denoted I, is given by B m , The system under discussion contains two objects namely, the floating vehicle, considered as m 1 and the weights, considered as m 2 that move relatively to m 1 . According to the Newton's second law, the resultant forces acting on a system m B are equal with the linear momentum changes over time in the inertia system ( Figure 6).
Assuming that both objects have constant mass, we get: Rotation along Z ϕ r N Since m 2 is moving compared to the reference system B connected to the mass m 1 , some of the terms removed in equation (18) cannot not be removed in this last equation, thus leading to: Using the relation m B =m 1 +m 2 , and reorganizing the equations, gives Then, According to the definition of the center of mass: with ω BI =ω BE +ω EI (26) and So f B can be expressed as: According to White [3], the angular momentum of m B around its center of mass is given by, and around the point P, we have     Making the main equation as:

Simulation Platform
The equations obtained in the previous section and describing the movement of the vehicle were coded in MATLAB. The Runge-Kutta method was used to solve them with a time step size of 20 ms. This value was tuned to simultaneously assure relatively fast convergence and acceptable accuracy. After completing the coding in MATLAB, the Lab View software was used to design a Graphical User Interface (GUI) as well as a virtual reality (VR) to virtually observe the maneuvers of the vehicle.

Initial conditions
As shown in Figure 7, this part should be set before running the simulation. Here the user can set the initial conditions of the vehicle including the following cases:

Simulation monitoring
As displayed in Figure 8, it is possible to perform some of the settings related to the platforms including setting the frequency of the loops or choosing the processor.

Setting the simulation parameters
As seen in Figure 9, this part includes four main components: Setting the environmental parameters ( Figure 10). In this part, the simulation parameters include: • Determining the Greenwich longitude and the radius of the earth.
• Determining the rotational velocity of the earth.
• Determining the earth chamfer: If this value is zero, the Earth is assumed a perfect sphere.
• Determining the fluid density in which the vehicle moves.
Setting the volume mass parameters of the vehicle: this part, as seen in Figure 11, consists in the vehicle.  • Determining the total volume and the moment of inertia of the entire vehicle regardless of the moving mass.
• Determining the mass and the moment of inertia of the moving mass.

Setting the hydrodynamic parameters
In this part, the hydrodynamic parameters of the device are set by the user. This part includes three main components: • Determining linear drag coefficients (Figure 12a) • Determining quadratic drag coefficients (Figure 12b) Setting the added mass elements (Figure 13).

Locating the critical points versus the reference point
In this part the user should determine the location contains the critical points of the vehicle versus the B. These important points include • The location of the center of the moving mass.
• The buoyancy location, • The pressure location.
• The left and right engine force location.

Control and displays
This part is composed of three sets that include (Figure 15): • The physical angular velocity. • The physical angle versus the North East Down (NED) coordinate system.
• The vertical velocity that resents the rate of reduced or increased height.
• The height.   Two controllers have been implemented to control the VR environment, including the perspective and setting the distance between the two cameras located on the back of the device (eye) versus the body.

Vehicle control tools
Using these tools, the user can control the device in the GUI environment, i.e., determining: • The right engine speed.     • The right engine speed relative to the body.
• The left engine speed.
• The left engine speed relative to the body.
• The moving mass location.

Data
In this part, the diagrams of the movement data are visible to the operator. These data include: • The velocity.
• The rotational velocity. • The body angle to the magnetic north and horizon. • The acceleration.

VR environment
In this part, a three-dimensional model of the body is created in 1-scale. This graphic model is directly connected to the equation solution subsystem and displays the movement changes of the vehicle including the translational and rotational movements (Figure 16). Figure 17 shows the status of displayers in a position where the robot depth's is 5 m, with a constant speed of 0.2 m/s and with a direction angle of 30° towards the north and with an horizontal movement. Figure 18 shows the displayers in a status where the robot is at rest, at a depth of 2 m, and with a 180° direction.

Conclusion
This work deals with the modeling of the operation of an underwater robot with two rotating thrusters. To efficiently control the device movement at different depths with the help of a mass shifter, an accurate monitoring system was implemented. This virtual environment gives the user the ability to observe and adjust, in real time, the required parameters for controlling the robot in different situations. It also plays an effective role in enhancing the performance of the underwater by using the obtained results to plan/prepare the robot for future tasks. Figure 19 shows the displayers in a position where the device is moving at a depth of 4 m, a speed of 0.35 m/s, and at the same time spinning to the right side to adjust the direction angle to 160°. The image shows the moment where the current direction angle of the device is 99.1°.