Welcome to the wiki of the uuv project!

Here you can find up-to-date information on the uuv repository.

First of all, the repository contains software that is used to simulate and control a single unmanned underwater vehicle (UUV) in the Matlab/Simulink environment.

Current status

The code is not fully functional yet. At the moment, the following items have been implemented:

To-do list

Before the software can be considered as fully functional, the following items are required:

Code structure

The code follows a standard Matlab/Simulink project convention. The main files and directories are as follows:

Additionally, the following files and directories may also be of use:

Quick user guide

IMPORTANT: please, do NOT make changes to the master branch without approval. Pull down a personal branch and make changes and saves there instead.

Compilation of the C files

The first step to complete before running the simulations is to compile the C-coded S-functions in Simulink (rov_thrust.c and uuv_dynamics.c) located in the .\models\ directory.

This can be done with the commands mex rov_thrust.c , mex uuv_dynamics.c . As a result, you should see .mex or .mexw64 in the directory .\models\.

Note that before you take this step, it is fundamental to have a C/C++ compiler installed (supported by/compatible with Matlab).

Running simulations

After the C files are compiled, it is possible to run the desired simulations.

From the main project directory, first run

startup

on the Matlab shell.

Then, you can run any simulations. As an example, run

uuvSimRun .

When finished, run

cleanup

to clean up the temporary files and the Matlab path.

Supported UUVs

ROV Minerva

The Minerva ROV is in use at NTNU and well documented in the literature (especially in M.Sc. and Ph.D. theses from NTNU).

More information on the ROV can be found here https://www.ntnu.edu/oceans/minerva.

The dynamics coefficients and fits are taken from Mo (2015).

References

S. M. Mo (2015). Development of a Simulation Platform for ROV Systems. Norwegian University of Science and Technology (NTNU), M.Sc. thesis.

Theory

UUV dynamics

The notation and equations introduced in Fossen (2011) have been used to program the UUV dynamics. However, the downward right-hand rule convention (north,west,down) is employed at the moment.

Let us define the motions in 6 degrees of freedom (DOF) in the inertial reference frame as

and the 6DOF velocity vector in the body-fixed reference frame as

Additionally, it is possible to include the effects of an external current represented by the velocity vector , whose 4th to 6th entries are zero for an irrotational current. The relative velocity vector in body-fixed coordinates is represented by

Then, the dynamics of an UUV can be expressed by the following system of ordinary differential equations:

where is the transformation matrix for the generalized coordinates, the inertia matrix of the rigid body, the added mass inertia matrix, the hydrostating restoring force vector, the damping force vector, the Coriolis force vector, the environmental force vector (which includes the tether effects if one is present, e.g. on a ROV) and the thrust force vector.

The restoring force vector is given by

where is the weight force, the buoyancy force, and .

The damping force vector is represented by a linear and a quadratic term:

where and are the linear and quadratic damping matrices, respectively.

The Coriolis and centripetal force vector is computed as follows:

where the first term represents a fictitious force that causes a movement of the UUV relative to the rotating reference frame due to the Earth’s rotation and the second term describes the effects related to the added mass. Note that at the moment, this term is commented out.

ROVs

The thrust force vector is obtained as

where is the thrust allocation matrix and is the thrust force vector that has an entry for every thruster. Hence, the thrust allocation matrix expresses the contribution of each motor in each degree of freedom in the body-fixed coordinate system. Therefore, the thrust allocation matrix is constant if the motors do not rotate.

The thrust force vector is calculated as

where all vectors have the length equal to the number of propulsors and indicates element-wise multiplication. is the vector of diameters, is the thrust loss coefficient vector, is the propulsors’ rotational velocity, which is output by the controller, and is the thrust coefficient vector, which is a function of the advance ratio vector

where is the vector of the velocity of the propellers through the water.

LOS guidance

At the moment, only a basic line-of-sight (LOS) guidance system is implemented. A number of waypoints through which the UUV should pass is specified as well as a fixed, non-zero forward speed, . Motions in the horizontal and vertical planes are treated as decoupled. The desired heading is then computed in the horizontal plane with a simple line of sight scheme, while in the vertical plane the depth of the points is set as reference.

Horizontal plane guidance

The desired heading angle is computed as

where is the side slip angle, which compensates for side currents and motions in bends, and is the desired course angle. The latter is computed as

where , with indicating the last waypoint that has been encountered and the next one, and where the cross-track error is given by

Vertical plane guidance

At the moment, the desired depth is simply set based on the depth of the waypoints as

However, not that this is valid mainly for ROVs, with AUVs requiring a setting for the pitch angle as well.

PID controller

At the moment, very simple PID controllers have been implemented for the control of the surge velocity, , the UUV depth, , and the heading, .

The thrust force vector is computed from the inverse of the thrust allocation matrix as follows:

where is the vector of control parameters. For the simple PID controller implemented here, the vector of control parameters is given by

Using simple PID controllers, it is possible to obtain the control parameters for speed, depth and heading as

where , , , , , , , and are the proportional, integral and derivative gains for the speed, depth and heading, respectively. Additionally, , and are the desired speed, depth and heading. At the moment, a very simple scheme is used that relies on a fixed forward speed setting, $U$. In order to prevent a big overshoot in tight corners, the desired speed is set as

The desired heading and depth are set by the guidance system (at the moment, a simple decoupled line of sight guidance system).

Path tracking

Path generation and tracking routines are still missing, although a simple minimum-snap trajectory generation and following scheme is implemented for ROVs.

References

F. Dukan (2014). ROV Motion Control Systems. Norwegian University of Science and Technology (NTNU), Ph.D. thesis.

T. I. Fossen (2011). Handbook of Marine Craft Hydrodynamics and Motion Control. John Wiley & Sons, first edition.

A. M. Lekkas (2014). Guidance and Path-Planning Systems for Autonomous Vehicles. Norwegian University of Science and Technology (NTNU), Ph.D. thesis.

S. M. Mo (2015). Development of a Simulation Platform for ROV Systems. Norwegian University of Science and Technology (NTNU), M.Sc. thesis.

To-do list