Fully Coupled 6 Degree-of-Freedom Control of an Over-Actuated Autonomous Underwater Vehicle

Unmanned underwater vehicles (UUVs) are increasingly being used by civilian and defence operators for ever more complex and dangerous missions. This is due to the underlying characteristics of safety and cost effectiveness when compared to manned vehicles. UUVs require no human operator be subject to the conditions and dangers inherent in the underwater environment that the vehicle is exposed to, and therefore the risk to human life is greatly minimised or even removed. Cost effectiveness, in both time and financial respects, comes from a much smaller vehicle not containing the various subsystems required to sustain life whilst underwater, as well as smaller, less powerful actuators not placing the same levels of stress and strain on the vehicles as compared to a manned vehicle. This leads to a much smaller team required to undertake the regular maintenance needed to keep a vehicle operational. Taking these two main factors into account, the progression from manned vehicles to unmanned vehicles is a logical step within the oceanographic industry. Within the broad class of UUVs are the remotely operated vehicles (ROVs) and the autonomous underwater vehicles (AUVs). Both of these types of vehicles have been successfully used in industry, and their fundamental differences determine which type of vehicle is suited to a particular mission. The key difference between the two is that an ROV requires a tether of some description back to a base station, whereas an AUV does not. This tether connects the ROV to a human operator who can observe the current state of the vehicle and therefore provide the control for the vehicle while it executes its mission. This tether, depending on the configuration of the vehicle, can also provide the electricity to power the vehicles actuators, sensors and various internal electronic systems. AUVs have an advantage over ROVs of not requiring this tether, which leads to two main benefits. Firstly, an AUV requires little or no human interaction while the vehicle is executing its mission. The vehicle is pre-programmed with the desired mission objectives and, upon launch, attempts to complete these objectives without intervention from personnel located at the base station. This minimises the effect of human error while the vehicle is operational. The second benefit is the increased manoeuvrability that is possible without a cable continuously attached to the AUV. This tether has the potential to become caught on underwater structures, which could limit the possible working environments of an ROV, as well as cause drag on the motion of the vehicle, thus affecting its manoeuvring


Introduction
Unmanned underwater vehicles (UUVs) are increasingly being used by civilian and defence operators for ever more complex and dangerous missions. This is due to the underlying characteristics of safety and cost effectiveness when compared to manned vehicles. UUVs require no human operator be subject to the conditions and dangers inherent in the underwater environment that the vehicle is exposed to, and therefore the risk to human life is greatly minimised or even removed. Cost effectiveness, in both time and financial respects, comes from a much smaller vehicle not containing the various subsystems required to sustain life whilst underwater, as well as smaller, less powerful actuators not placing the same levels of stress and strain on the vehicles as compared to a manned vehicle. This leads to a much smaller team required to undertake the regular maintenance needed to keep a vehicle operational. Taking these two main factors into account, the progression from manned vehicles to unmanned vehicles is a logical step within the oceanographic industry. Within the broad class of UUVs are the remotely operated vehicles (ROVs) and the autonomous underwater vehicles (AUVs). Both of these types of vehicles have been successfully used in industry, and their fundamental differences determine which type of vehicle is suited to a particular mission. The key difference between the two is that an ROV requires a tether of some description back to a base station, whereas an AUV does not. This tether connects the ROV to a human operator who can observe the current state of the vehicle and therefore provide the control for the vehicle while it executes its mission. This tether, depending on the configuration of the vehicle, can also provide the electricity to power the vehicles actuators, sensors and various internal electronic systems. AUVs have an advantage over ROVs of not requiring this tether, which leads to two main benefits. Firstly, an AUV requires little or no human interaction while the vehicle is executing its mission. The vehicle is pre-programmed with the desired mission objectives and, upon launch, attempts to complete these objectives without intervention from personnel located at the base station. This minimises the effect of human error while the vehicle is operational. The second benefit is the increased manoeuvrability that is possible without a cable continuously attached to the AUV. This tether has the potential to become caught on underwater structures, which could limit the possible working environments of an ROV, as well as cause drag on the motion of the vehicle, thus affecting its manoeuvring www.intechopen.com Autonomous Underwater Vehicles 148 performance. The possible range of the vehicle from the base station is also restricted, depending on the length of this tether. These two main benefits of AUVs over ROVs lead, in principle, to autonomous vehicles being selected for survey tasks in complex, dynamic and dangerous underwater environments, and therefore AUVs are the subject of this chapter. Furthermore, combining the desired performance characteristics of AUVs, with the aforementioned complex operation environment, leads to the conclusion that controllers implemented within AUVs must be precise and accurate, as well as robust to disturbances and uncertainties. Hence, the focus of this chapter will primarily be on the precise and robust control of AUVs. Within the autonomy architecture of AUVs are three main systems. These are:-the guidance system, which is responsible for generating the trajectory for the vehicle to follow; the navigation system, which produces an estimate of the current state of the vehicle; and the control system, which calculates and applies the appropriate forces to manoeuvre the vehicle (Fossen, 2002). This chapter will focus on the control system and its two principal subsystems, namely the control law and the control allocation. The chapter will be divided into three main parts with the first part focusing on the design and analysis of the control law, the second looking at control allocation, and the third providing an example of how these two systems combine to form the overall control system. Within the control law design and analysis section, the requirements of how the various systems within an AUV interact will be considered, paying particular attention to how these systems relate to the control system. An overview of the underwater environment will be given, which depicts the complexity of the possible disturbances acting on a vehicle. This will be followed by an analysis of the equations of motion, namely the kinematic and kinetic equations of motion that determine how a rigid body moves through a fluid. A summary of the relevant frames of reference used within the setting of underwater vehicles will be included. A review of the control laws that are typically used within the context of underwater vehicles will be conducted to conclude this section of the chapter. The second section will look at the role of control allocation in distributing the desired control forces across a vehicle's actuators. An analysis of the principal types of actuators currently available to underwater vehicles will be conducted, outlining their useful properties, as well as their limitations. This section will conclude with an overview of various techniques for performing control allocation, with varying degrees of computational complexity. The third and final section of this chapter will present an example of an overall control system for implementation within the architecture of AUVs. This example will demonstrate how the control law and control allocation subsystems interact to obtain the desired trajectory tracking performance while making use of the various actuators on the vehicle.

Control law design and analysis
Before delving into the laws governing how a particular control system produces a correcting signal, it is necessary to look at the requirements of the various systems within an AUV. This will provide an understanding of how the control system fits in with respect to the overall autonomy architecture of an AUV. The different types of disturbances must be acknowledged such that the effect of these disturbances is minimised, and the equations related to the dynamic motion of the vehicle must be analysed. Only after reviewing these factors can the control law be designed and analysed.

Requirements
As previously stated, the various components that make up the autonomy architecture of AUVs are the guidance system, navigation system, and control system. All three of these systems have their own individual tasks to complete, yet must also work cooperatively in order to reliably allow a vehicle to complete its objectives. Figure 1 shows a block diagram of how these various systems interact. Fig. 1. Guidance, Navigation and Control Block Diagram.

Guidance
The guidance system is responsible for producing the desired trajectory for the vehicle to follow. This task is completed by taking the desired waypoints defined pre-mission and, with the possible inclusion of external environmental disturbances, generates a path for the vehicle to follow in order to reach each successive waypoint (Fossen, 1994(Fossen, , 2002. Information regarding the current condition of the vehicle, such as actuator configuration and possible failures, can also be utilised to provide a realistic trajectory for the vehicle to follow. This trajectory then forms the desired state of the vehicle, as it contains the desired position, orientation, velocity, and acceleration information.

Navigation
The navigation system addresses the task of determining the current state of the vehicle. For surface, land and airborne vehicles, global positioning system (GPS) is readily available and is often used to provide continuous accurate positioning information to the navigation system. However, due to the extremely limited propagation of these signals through water, GPS is largely unavailable for underwater vehicles. The task of the navigation system is then to compute a best estimate of the current state of the vehicle based on multiple measurements from other proprioceptive and exteroceptive sensors, and to use GPS only when it is available. This is completed by using some form of sensor fusion technique, such as Kalman filtering or Particle filtering (Lammas et al., 2010(Lammas et al., , 2008, to obtain a best estimate of the current operating condition, and allow for inclusion of a correction mechanism when GPS is available, such as when the vehicle is surfaced. Overall, the task of the navigation system is to provide a best estimate of the current state of the vehicle, regardless of what sensor information is available.

Control
The control system is responsible for providing the corrective signals to enable the vehicle to follow a desired path. This is achieved by receiving the desired state of the vehicle from the guidance system, and the current state of the vehicle from the navigation system. The control system then calculates and applies a correcting force, through use of the various actuators on the vehicle, to minimise the difference between desired and current states (Fossen, 1994(Fossen, , 2002. This allows the vehicle to track a desired trajectory even in the presence of unknown disturbances. Even though each of the aforementioned systems is responsible for their own task, they must also work collaboratively to fully achieve autonomy within an underwater vehicle setting.

Environment
Underwater environments can be extremely complex and highly dynamic, making the control of an AUV a highly challenging task. Such disturbances as currents and waves are ever present and must be acknowledged in order for an AUV to traverse such an environment.

Currents
Ocean currents, the large scale movement of water, are caused by many sources. One component of the current present in the upper layer of the ocean is due to atmospheric wind conditions at the sea surface. Differing water densities, caused by combining the effect of variation of salinity levels with the exchange of heat that occurs at the ocean surface, cause additional currents known as thermohaline currents, to exist within the ocean. Coriolis forces, forces due to the rotation of the Earth about its axis, also induce ocean currents, while gravitational forces due to other planetary objects, such as the moon and the sun, produce yet another effect on ocean currents (Fossen, 1994(Fossen, , 2002. Combining all of these sources of water current, with the unique geographic topography that are present within isolated coastal regions, leads to highly dynamic and complex currents existing within the world's oceans.

Wind generated waves
There are many factors that lead to the formation of wind generated waves in the ocean. Wind speed, area over which the wind is blowing, duration of wind influencing the ocean surface, and water depth, are just some of the elements that lead to the formation of waves. Due to the oscillatory motion of these waves on the surface, any vehicle on the surface will experience this same oscillatory disturbance. Moreover, an underwater vehicle will experience both translational forces and rotational moments while at or near the surface due to this wave motion.

Dynamics
All matter that exists in our universe must adhere to certain differential equations determining its motion. By analysing the physical properties of an AUV, a set of equations can be derived that determine the motion of this vehicle through a fluid, such as water. To assist in reducing the complexities of these equations, certain frames of reference are utilised depending on the properties that each frame of reference possesses. In order to make use of these different reference frames for different purposes, the process of transforming information from one frame to another must be conducted.

Frames of reference
Within the context of control systems, the two main reference frames used are the n-frame and the b-frame. Both contain three translational components and three rotational components, yet the origin of each frame differs. This difference in origin can lead to useful properties which contain certain advantages when designing a control system.

N-Frame
The n-frame is a co-ordinate space usually defined as a plane oriented at a tangent to the Earth's surface. The most common of these frames for underwater vehicle control design is the North-East-Down (NED) frame. As its name suggests, the three axes of the translational components of this frame have the x-axis pointing towards true North, the y-axis pointing towards East, and the z-axis in the downward direction perpendicular to the Earth's surface. In general, waypoints are defined with reference to a fixed point on the earth, and therefore it is convenient to conduct guidance and navigation in this frame.

B-Frame
The b-frame, also known as the body frame, is a moving reference frame that has its origin fixed to the body of a vehicle. Due to various properties that exist at different points within the body of the vehicle, it is convenient to place the origin of this frame at one of these points to take advantage of, for example, body symmetries, centre of gravity, or centre of buoyancy. As a general rule, the x-axis of this frame points from aft to fore along the longitudinal axis of the body, the y-axis points from port to starboard, and the z-axis points from top to bottom. Due to the orientation of this frame, it is appropriate to express the velocities of the vehicle in this frame.

Kinematic equation
As mentioned in 2.3.1, both the NED and body frames have properties that are useful for underwater vehicle control design. Because both are used for different purposes, a means of converting information from one frame to the other is required. The kinematic equation, (1), achieves this task (Fossen, 1994(Fossen, , 2002. Here, the 6 degree-of-freedom (DoF) position and orientation vector in (1), decomposed in the NED frame, is denoted by (2).
Within (2), the three position components are given in (3), and the three orientation components, also known as Euler angles, are given in (4).

www.intechopen.com
Autonomous Underwater Vehicles The 6 DoF translational and rotational velocity vector in (1), decomposed in the body frame, is denoted by (5).
Here, the three translational velocity components are given in (6), and the three rotational velocity components are given in (7).
In order to rotate from one frame to the other, a transformation matrix is used in (1). This transformation matrix is given in (8).
Here, the transformation of the translational velocities from the body frame to the NED frame are achieved by rotating the translational velocities in the body frame, (6), using the Euler angles (4). Three principal rotation matrices are used in this operation, as shown in (9).
The order of rotation is not arbitrary, due to the compounding effect of the rotation order. Within guidance and control, it is common to use the zyx-convention where rotation is achieved using (10).
() cos cos sin cos cos sin sin sin sin cos sin cos sin cos cos cos sin sin sin cos sin sin sin cos sin cos sin cos cos The transformation of rotational velocities from the body frame to the NED frame is achieved by again applying the principal rotation matrices of (9). For ease of understanding, firstly consider the rotation from the NED frame to the body frame in which ψ is rotated by , y R θ , added to θ , and this sum then rotated by , x R φ and finally added to φ . This process is given in (12).

www.intechopen.com
Fully Coupled 6 Degree-of-Freedom Control of an Over-Actuated Autonomous Underwater Vehicle 153 ,, 00 00 00 By expanding (12), the matrix for transforming the rotational velocities from the NED frame to the body frame is defined as (13) and therefore the matrix for transforming the rotational velocities from the body frame to the NED frame is given in (14).

()
1s i nt a n c o s t a n 0c o s s i n 0 sin cos cos cos Overall, (1) achieves rotation from the body frame to the NED frame, and by taking the inverse of (8), rotation from the NED frame to the body frame can be achieved, as shown in (15).

Kinetic equation
The 6 DoF nonlinear dynamic equations of motion of an underwater vehicle can be conveniently expressed as (16) (Fossen, 1994(Fossen, , 2002. Here, M denotes the 6 6 × system inertia matrix containing both rigid body and added mass, as given by (17).
Linear and nonlinear hydrodynamic damping are contained within the 6 6 × matrix D(ν), and given by (19).
Here, D contains the linear damping terms, and D n (ν) contains the nonlinear damping terms.
The 6 1 × vector of gravitational and buoyancy forces and moments are represented in (16) by g(η), and determined using (20).
Here, W is the weight of the vehicle, determined using W=mg where m is the dry mass of the vehicle and g is the acceleration due to gravity. B is the buoyancy of the vehicle which is due to how much fluid the vehicle displaces while underwater. This will be determined by the size and shape of the vehicle. Vectors determining the locations of the centre of gravity and the centre of buoyancy, relative to the origin of the body frame, are given by (21) and (22) respectively.
The 6 1 × vector of control input forces is denoted by τ, and is given by (23).
Here, the translational forces affecting surge, sway and heave are X, Y, and Z respectively, and the rotational moments affecting roll, pitch and yaw are K, M and N respectively. The 6 1 × vector of external disturbances is denoted by ω.
Overall, (16) provides a compact representation for the nonlinear dynamic equations of motion of an underwater vehicle, formulated in the body frame. By applying the rotations contained within (8), (16) can be formulated in the NED frame as given in (24).
Within (24), the equations in (25) contain the rotations of the various matrices from the body frame to the NED frame. The presence of nonlinearities contained within D n (ν), combined with the coupling effect of any non-zero off-diagonal elements within all matrices, can lead to a highly complex model containing a large number of coefficients.

Control laws
Various control strategies, and therefore control laws, have been implemented for AUV systems. The benchmark for control systems would be the classical proportional-integral-derivative (PID) control that has been used successfully to control many different plants, including autonomous vehicles. PID schemes are, however, not very effective in handling the nonlinear AUV dynamics with uncertain models operating in unknown environments with strong wave and current disturbances. PID schemes are therefore only generally used for very simple AUVs working in environments without any external disturbances. An alternative control scheme known as sliding mode control (SMC), which is a form of variable structure control, has proven far more effective and robust at handling nonlinear dynamics with modelling uncertainties and nonlinear disturbances. SMC is a nonlinear control strategy which uses a nonlinear switching term to obtain a fast transient response while still maintaining a good steady-state response. Consequently, SMC has been successfully applied by many researchers in the AUV community. One of the earliest applications of using SMC to control underwater vehicles was conducted by Yoerger and Slotine wherein the authors demonstrated through simulations studies on an ROV model, the SMC controller's robustness properties to parametric uncertainties (Yoerger & Slotine, 1985). A multivariable sliding mode controller based on state feedback with decoupled design for independently controlling velocity, steering and diving of an AUV is presented in Healey and Lienard (1993). The controller design was successfully implemented on NPS ARIES AUV as reported in Marco and Healey (2001).

PID control
The fundamentals of PID control is that an error signal is generated that relates the desired state of the plant to the actual state (26), Where e(t) is the error signal, x d (t) is the desired state of the plant, and x(t) is the current state of the plant, and this error signal is manipulated to introduce a corrective action, denoted τ(t), to the plant.
PID control is named due to the fact that the three elements that make up the corrective control signal are: proportional to the error signal by a factor of K P , a scaled factor, K I , of the integral of the error signal, and a scaled factor, K D , of the derivative of the error signal, respectively (27).
PID control is best suited to linear plants, yet has also been adopted for use on nonlinear plants even though it lacks the same level of performance that other control systems possess.
However, due to the wide use and acceptance of PID control for use in controlling a wide variety of both linear and nonlinear plants, it is very much employed as the "gold standard" that control systems are measured against. An example of a PID-based control strategy applied to underwater vehicles is given in Jalving (1994).

Sliding mode control
As mentioned previously, sliding mode control is a scheme that makes use of a discontinuous switching term to counteract the effect of dynamics that were not taken into account at the design phase of the controller.
To examine how to apply sliding mode control to AUVs, firstly (24) is compacted to the form of (28), where ( ) ,, f t ηη contains the nonlinear dynamics, including Coriolis and centripetal forces, linear and nonlinear damping forces, gravitational and buoyancy forces and moments, and external disturbances. If a sliding surface is defined as (29), where c is positive, it can be seen that by setting s to zero and solving for η results in η converging to zero according to ( regardless of initial conditions. Therefore, the control problem simplifies to finding a control law such that (31) holds.

( )
This can be achieved by applying a control law in the form of (32), with ( ) , T η η being sufficiently large. Thus, it can be seen that the application of (32) will result in η converging to zero. If η is now replaced by the difference between the current and desired states of the vehicle, it can be observed that application of a control law of this form will now allow for a reference trajectory to be tracked. Two such variants of SMC are the uncoupled SMC and the coupled SMC.

Uncoupled SMC
Within the kinetic equation of an AUV, (16), simplifications can be applied that will reduce the number of coefficients contained within the various matrices. These simplifications can be applied due to, for example, symmetries present in the body of the vehicle, placement of centres of gravity and buoyancy, and assumptions based on the level of effect a particular coefficient will have on the overall dynamics of the vehicle. Thus, the assumption of body symmetries allows reduced level of coupling between the various DoFs. An uncoupled SMC therefore assumes that no coupling exists between the various DoFs, and that simple manoeuvring is employed such that it does not excite these coupling dynamics (Fossen, 1994). The effect this has on (16) is to remove all off-diagonal elements within the various matrices which significantly simplifies the structure of the mathematical model of the vehicle (Fossen, 1994), and therefore makes implementation of a controller substantially easier.

Coupled SMC
Although the removal of the off-diagonal elements reduces the computational complexity of the uncoupled SMC, it also causes some limitation to the control performance of AUVs, particularly those operating in highly dynamic environments and required to execute complex manoeuvres. Taking these two factors into account, these off-diagonal coupling terms will have an influence on the overall dynamics of the vehicle, and therefore cannot be ignored at the design phase of the control law. Coupled SMC is a new, novel control law that retains more of the coupling coefficients present in (16) compared to the uncoupled SMC (Kokegei et al., 2008(Kokegei et al., , 2009). Furthermore, even though it is unconventional to design a controller in this way, the body frame is selected as the reference frame for this controller. This selection avoids the transformations employed in (24) and (25) used to rotate the vehicle model from the body frame to the NED frame although it does require that guidance and navigation data be transformed from the NED frame to the body frame. By defining the position and orientation error in the NED frame according to (33), where η represents an estimate of the current position and orientation provided by the navigation system, and η d represents the desired position and orientation provided by the guidance system, a single rotation is required to transform this error from the NED frame to the body frame. In general, desired and current velocity and acceleration data are already represented in the body frame, and as such, no further rotations are required here for the purposes of implementing a controller in the body frame. By comparing the number of rotations required to transform the vehicle model into the NED frame, as seen in (25), for the uncoupled control scheme with the single rotation required by the coupled control scheme to transform the guidance and navigation data into the body frame, it can be seen that the latter has less rotations involved, and is therefore less computationally demanding.

Control allocation
The role of the control law is to generate a generalised force to apply to the vehicle such that a desired state is approached. This force, τ, for underwater vehicles consists of six components, one for each DoF, as seen in (23). The control allocation system is responsible for distributing this desired force amongst all available actuators onboard the vehicle such that this generalised 6 DoF force is realised. This means that the control allocation module must have apriori knowledge of the types, specifications, and locations, of all actuators on the vehicle.

Role
The role of the control allocation module is to generate the appropriate signals to the actuators in order for the generalised force from the control law to be applied to the vehicle. Since the vehicle under consideration is over-actuated, which means multiple actuators can apply forces to a particular DoF, the control allocation is responsible for utilising all available actuators in the most efficient way to apply the desired force to the vehicle. Power consumption is of particular importance for all autonomous vehicles, as it is a key factor in determining the total mission duration. The control allocation is therefore responsible for applying the desired forces to the vehicle, while minimising the power consumed.

Actuators
The force applied to a vehicle due to the various actuators of a vehicle can be formulated as (34), where, for an AUV operating with 6 DoF with n actuators, T is the actuator configuration matrix of size 6 n × , K is the diagonal force coefficient matrix of size nn × , and u is the control input of size 1 n × . Actuators are the physical components that apply the desired force to the vehicle, and the particular configuration of these actuators will determine the size and structure of T, K and u, with each column of T, denoted t i , in conjunction with the corresponding element on the main diagonal of K, representing a different actuator. A vast array of actuators are available to underwater vehicle designers, the more typical of which include propellers, control fins and tunnel thrusters, and each has their own properties that make them desirable for implementation within AUVs. For all the following actuator descriptions l x defines the offset from the origin of the actuator along the x-axis, l y defines the offset along the y-axis, and l z defines the offset along the z-axis.

Propellers
Propellers are the most common actuators implemented to provide the main translational force that drives underwater vehicles. These are typically located at the stern of the vehicle and apply a force along the longitudinal axis of the vehicle. The structure of t i for a propeller is given in (35).
As can be seen from (35), if the propeller is positioned such that there is no y-axis or z-axis offset, the force produced will be directed entirely along the x-axis of the vehicle, with no rotational moments produced.

Control surfaces
Control surfaces, or control fins, are actuators that utilise Newton's Third Law of motion to apply rotational moments to the vehicle. These surfaces apply a force to the water which causes a deflection in the water's motion. Hence, the water must also apply a force to the control surface. Due to this force being applied at a distance from the centre of gravity of the vehicle, a rotational moment is produced that acts on the vehicle. The typical configuration for control surfaces on an AUV is to have four independently controlled fins arranged in two pairs orientated horizontally and vertically at the stern of the vehicle. The structure of t i for the horizontal fins is given in (36), and for vertical fins given in (37).
[ ] These structures of t i show that horizontal surfaces produce a heave force as well as roll and pitch moments, while vertical surfaces produce a sway force as well as roll and yaw moments. What must be considered here is that the force being produced by control surfaces relies on the vehicle moving relative to the water around it. If the vehicle is stationary compared to the surrounding water, control surfaces are ineffective. However, if the vehicle is moving relative to the surrounding water, these actuators are capable of applying forces and moments to the vehicle while consuming very little power.

Tunnel thrusters
The previously mentioned limitation of control surfaces can be overcome by the use of tunnel thrusters. These thrusters are usually implemented by being placed in tunnels transverse to the longitudinal axis of the vehicle. Similar to control surfaces, the typical arrangement is to position two horizontal tunnel thrusters equidistant fore and aft of the centre of gravity, and two vertical tunnel thrusters also equidistant fore and aft of the centre of gravity. The structure of t i for horizontal thrusters is given in (38), while the structure for vertical thrusters is given in (39).
What can be observed here is that horizontal thrusters provide a sway force as well as a roll and yaw moment, while vertical thrusters provide a heave force as well as roll and pitch moment. In general, horizontal tunnel thrusters are located such that l z is zero, and vertical thrusters are located such that l y is zero. The result of this choice is that no roll moment is produced by these actuators. The advantage of tunnel thrusters is that forces and moments can be produced even if the vehicle is stationary with respect to the surrounding water. This greatly increases the manoeuvrability of the vehicle, as control of the vehicle when moving at low speeds is possible. However, there are limitations associated with the use of these actuators. Firstly, these actuators consume more power when activated compared to control surfaces. This is due to force being produced by the thrusters only when the thruster itself is activated. In contrast, control surfaces consume power when the deflection angle is altered, but require very little power to hold the surface in place once the desired angle has been achieved.
Secondly, thruster efficiency is reduced when the vehicle is moving. Under certain conditions, an area of low pressure is produced at the exit of the tunnel, which has the effect of applying a force to the vehicle in the opposite direction to which the water jet from the tunnel thruster is attempting to provide. The result is less total force being applied to the vehicle, and therefore reduced performance when moving at non-zero forward speeds (Palmer et al., 2009).

Allocation methods
As previously mentioned when reviewing the various actuators for underwater vehicles, if the vehicle is stationary, control surfaces are ineffective while tunnel thrusters are very useful. Conversely, if the vehicle is moving, control surfaces are very efficient in providing force relative to power consumption compared to tunnel thrusters. The role of the control allocation is therefore to find a compromise between all actuators that both applies the desired generalised forces and moments to the vehicle while minimising power consumption. This balancing act allows the vehicle to maintain the manoeuvrability provided by all actuators, while at the same time allowing for as long a mission duration as possible.

Non-optimal scheme
One of the most straightforward methods for control allocation is application of the inverse of (34), i.e., (40) (Fossen, 2002).
This method is very simple to implement as it consists of a single matrix multiplication. Therefore it is easy and efficient to implement within the computational processing constraints of an AUV. However, due to its simplicity, no attempt is made to minimise power consumption. If the vehicle contains both control surfaces and tunnel thrusters, both of these types of actuators will be utilised equally, even when the vehicle is moving at maximum velocity with respect to the surrounding fluid. However, since it is much more efficient to utilise control surfaces rather than tunnel thrusters while the vehicle is moving with respect to the water, a more intelligent approach is desired for implementing control allocation to minimise power consumption.

Quadratic programming
The limitations of the aforementioned non-optimal scheme can be overcome by formulating a quadratic programming optimisation problem to solve for actuator inputs (Fossen, 2002, Fossen et al., 2009). By introducing a weighting matrix into the problem statement, actuator usage can be biased towards utilising control surfaces over tunnel thrusters. Therefore, the generalised force desired from the control law can be realised by the actuators while minimising power consumption. There are however, limitations associated with this scheme. Firstly, although it is possible to calculate an explicit solution to this problem, in the event of actuator reconfiguration, such as an actuator failure, this explicit solution would need to be recalculated, which can be computationally intensive. Iterative approaches, such as sequential quadratic programming, can be implemented that allow for actuator failures, but this method has the potential to require several iterations of the programming problem be solved at each control sample interval. Again, this can be a computationally intensive task.

2-Stage scheme
A third scheme that is proposed here for the implementation of the control allocation is to break the control allocation problem into two smaller sub-problems, as seen in Figure 2, where the first sub-problem addresses control allocation to the main propeller and control surfaces, and the second addresses control allocation to the tunnel thrusters. Using this type of scheme, the control surfaces can firstly be used to their full extent in order to realise the generalised force as closely as possible. Only after full utilisation of the control surfaces occurs will the tunnel thrusters be introduced to provide forces and moments that the surfaces alone cannot produce. Using this methodology, the low power consumption control surfaces will be used as much as possible, while the higher power consumption tunnel thrusters will be called upon only when required to provide the extra manoeuvring capabilities that they possess. Furthermore, in a situation where accurate manoeuvring is not required, such as traversing from one waypoint to the next with no concern for what trajectory the vehicle follows, the second stage can be disabled such that no tunnel thruster is used, and control is performed entirely by the main propeller and control surfaces. However, if trajectory tracking is desired, the thruster allocation module can still be enabled. This will allow for the situation when the control surfaces provide inadequate force to the vehicle, and therefore the thrusters can assist in providing the extra force required to maintain the vehicle tracking the desired trajectory. Implementation of this scheme would look somewhat like a 2-stage non-optimal scheme, as seen in Figure 2. The first stage would require the matrix operation (TK) -1 τ for the main propeller and control surfaces in order to obtain as much force required from these actuators. An estimate of the force produced for this particular set of control values would then be calculated such that this force estimate can be subtracted from the total force required. Any residual force requirement would then become the input to the second stage of the control allocation, which would perform the matrix operation ( ) 1 TK τ − for the tunnel thrusters in order for these actuators to provide any extra force that the control surfaces cannot deliver alone. Therefore, the computational requirement for this scheme is quite minimal compared to the quadratic programming scheme, yet still heavily biases the use of control surfaces over tunnel thrusters.

Overall control system
Overall, the control system of any autonomous underwater vehicle consists of a control law module and a control allocation module. The former is responsible for generating the generalised force in 6 DoF based on current and desired states, while the latter is responsible for distributing this generalised force amongst the actuators of the vehicle. Due to the modularity of such a control system, each of these subsystems can be designed and implemented independently, yet both must work cooperatively in order to accurately control the vehicle. As discussed, the inputs to the control system are the desired state from the guidance system, and the current state from the navigation system. These are also the inputs to the control law. The outputs from the control system are the control signals that are sent to the individual actuators on the vehicle, which are the outputs generated by the control allocation. The intermediate signals connecting the control law to the control allocation are the 6 DoF generalised forces which are the outputs from the control law and therefore the inputs to the control allocation. Figure 3 shows the overall control system. As can be seen, the modularity of the system allows for control laws and control allocation schemes to be easily replaced, provided the inputs and outputs are of the same dimensions. For comparison purposes, both the uncoupled SMC law and the coupled SMC law are simulated here. Both simulations consist of identical control allocation modules that contain the previously described 2-stage scheme. The vehicle model used for these simulations is based on that which was proposed by Prestero (2001aPrestero ( , 2001b. This is a mathematical model for the REMUS (Remote Environmental Monitoring Unit) underwater vehicle developed by the Woods Hole Oceanographic Institute's Oceanographic Systems Laboratory. Alterations have been made to this model, based on current technology, which enable the vehicle to become fully actuated. These changes include the placement of four tunnel thrusters, two fore and two aft, such that sway, heave, pitch, and yaw motions are possible without any water flow over the control surfaces. Furthermore, the position of the vertical thrusters along the y-axis of the body, and the position of the horizontal thrusters along the z-axis of

Control Law
Control Allocation d x x τ u www.intechopen.com Fully Coupled 6 Degree-of-Freedom Control of an Over-Actuated Autonomous Underwater Vehicle 163 the body are set to 0m. Hence, there is no roll moment applied to the vehicle when these thrusters are activated. The thrusters introduced to the model are based on the 70mm IntegratedThruster TM produced by TSL Technology Ltd. This particular device can provide a maximum thrust of 42N, and due to its compact size, is well suited to this particular application. Also, the propulsion unit has been altered within the model. The simulation model used contains a propulsion unit based on the Tecnadyne Model 540 thruster. This device is able to provide approximately 93.2N of thrust and, with a propeller diameter of 15.2cm, is therefore well suited for this application. The trajectory that the vehicle is asked to follow here consists of a series of unit step inputs applied to each DoF. The translational DoFs experience a step input of 1 metre whereas the rotational DoFs experience a step input of 1 radian, or approximately 60°. All inputs are applied for a period of 20 seconds, such that both transient and steady state behaviour can be observed. These unit step inputs excite the vehicle in all combinations of DoFs, from a single DoF, through to all DoFs being excited at once. This simulation assumes no water current, and therefore no water flow over the vehicle when it is stationary. Hence, roll cannot be compensated for when stationary and for this reason this simulation does not excite the roll component of the model. All other DoFs are excited, however. Due to the way the aforementioned trajectory is supplied to the vehicle model, no guidance system is present. The step inputs will be applied at set times regardless of the state of the vehicle, and therefore observation of the control performance can be observed without influence from unnecessary systems. Therefore total execution time is constant for all simulations. Performance metrics used here in evaluating each control system is the accumulated absolute error between the desired translation/rotation and actual translation/rotation for each DoF. By looking at the following plots, observations can be made regarding such time-domain properties as rise time, settling time and percentage overshoot. Figures 4-13 show the desired and actual trajectories for each individual DoF when this complex set of manoeuvres is applied to both the uncoupled SMC and the coupled SMC. Figures 4, 6, 8, 10 and 12 show the complete trajectory for each DoF,while Figures 5,7,9,11 and 13 show these same trajectories with the focus being on the last 300 seconds of the mission. This latter section of the mission is when multiple DoFs, particularly the rotational DoFs, are excited simultaneously. Figure 4 shows the surge motion of the vehicle for the two different control systems. As can be seen, both systems exhibit desired properties for the first 180 seconds. During this period, all manoeuvring is exciting only the translational DoFs which the main propeller and tunnel thrusters can handle independently. After 180 seconds, the other DoFs are also excited, and the effect of this combined motion produces significant overshoots, especially for the uncoupled system, within the surge motion of the vehicle. This is more easily seen in Figure  5 where the larger overshoots can be seen for the uncoupled system compared to the coupled system. The sway motion of the AUV is shown in Figure 6. Minor overshooting is observed for both systems, especially when rotational DoFs are excited in combination with the translational DoFs. This can be observed in Figure 7. However, when the sway motion is excited, convergence to the desired set point is observed.  Heave motion is shown in Figure 8. Here, the initial position of the vehicle is chosen to be 10 metres below the surface of the water, such that the vehicle is completely submerged for the entire trajectory. When observing the heave motion in Figure 9, it is clear that when heave is excited, convergence to the desired set point is achieved. However, it is also evident that significant coupling exists between this DoF and other DoFs as divergence from the desired set point occurs when the heave motion is not excited.  Pitch motion is observed in Figure 10. The first observation that can be made from this plot is the relatively large spikes in the motion for both the coupled and uncoupled systems between 800 seconds and 1000 seconds. The second observation is that a steady state error is observed when the uncoupled system attempts a pitch of 1 radian. This is more clearly observed in Figure 11. Due to the vertical offset of the vehicle's centre of buoyancy from its centre of gravity, a restorative moment will always be applied to the vehicle for non-zero pitch angles. This plot indicates that it is difficult for the uncoupled system to compensate for this effect. However, the coupled system is able to not only eliminate this steady state error, it also has significantly smaller overshoot in general, as can be seen in Figure 10.   Figure 12 shows the desired yaw motion of the vehicle. Here we can see significant overshooting from both systems, especially during the time period before the yaw motion is excited. By observing Figure 13, it can be seen that the coupled system achieves faster dynamics in terms of rise time, but the cost of this is overshoot. The uncoupled system has significantly less overshoot, and this is due to it taking slightly longer to react to trajectory changes.  Overall, the simulation trajectory used here is extremely complex as it excites all possible combinations of DoFs without any water current present. This level of complexity allows for the coupling that exists between DoFs within an AUV model to be highlighted. For example, looking at the period of 0 to 660 seconds in Figure 12, the yaw motion is not being excited, yet motion in this DoF is observed. This coupling between multiple DoFs is the reason why controlling AUVs is a complex and challenging task.  Furthermore, if the absolute error between actual and desired position is accumulated over the entire mission for each DoF, a measure of the accuracy of the control system can be obtained. A comparison can be made using Table 1. Here, we can see that by summing together the values obtained from the three translational DoFs, the coupled system improves upon the uncoupled system by 9.75%, while by summing together the values obtained from the three rotational DoFs, the coupled improves upon the uncoupled system by 23.87%. This indicates that the coupled system is superior to the uncoupled system for both translational and rotational motion, when looking at the accumulated absolute error.

Conclusions
Due to the increased adoption of AUVs for civilian and defence operations, accuracy and reliability are two key factors that enable an AUV to successfully complete its mission. The control system is just one of the various components within the autonomy architecture of an AUV that helps in achieving this goal. Within the control system, the control law should be robust to both external disturbances and model parameter uncertainties, while the control allocation should utilise the various actuators of the vehicle to apply the desired forces to the vehicle while minimising the power expended. PID control has been successfully implemented on a variety of systems to effectively provide compensation. However, since PID control is better suited to linear models, the level of performance provided by PID control is not to the same standard as other, particularly nonlinear, control schemes when applied to complex nonlinear systems. Sliding mode control has proven to be a control law that is robust to parameter uncertainties, and therefore is a prime candidate for implementation within this context due to the highly complex coupled nonlinear underwater vehicle model. Active utilisation of the coupled structure of this model is what coupled SMC attempts to achieve, such that induced motion in one DoF due to motion in another DoF is adequately compensated for. This is where coupled SMC has a distinct advantage over uncoupled SMC for trajectory tracking applications when multiple DoFs are excited at once. Various schemes exist for control allocation with the ultimate goal being to apply the desired generalised forces while minimising power consumption, both due to the actuator usage and computational demands. Non-optimal schemes exist where a generalised inverse of the force produced by all actuators is used as the allocation scheme, with the limitation being that there is no functionality to bias actuators under certain operating conditions, such as utilising control surfaces over thrusters during relatively high speed manoeuvring. Quadratic programming incorporates a weighting matrix that can bias control surface usage over tunnel thrusters, and has been implemented both online and offline, with each having advantages and disadvantages. Online optimisation allows for changes to the actuator configuration, such as failures or varied saturation limits, but is computationally demanding. Offline optimisation is less computationally demanding during mission execution, but cannot allow for altered actuator dynamics. A compromise between these schemes is the proposed 2-stage scheme where control surfaces are utilised to their full extent, and the tunnel thrusters used only when needed. Overall, the goal of the control system is to provide adequate compensation to the vehicle, even in the presence of unknown and unmodelled uncertainties while also minimising power consumption and therefore extending mission duration. Choosing wisely both the control law and the control allocation scheme within the overall control system is fundamental to achieving both of these goals.