Dynamic positioning of an oceanographic research vessel using fuzzy logic controller in different sea states

A dynamic positioning (DP) system is a computer-controlled system which maintains the positioning and heading of ship by means of active thrust. A DP system consist of sensors, observer, controller and thrust allocation algorithm. The purpose of this paper is to investigate the performance of proportional derivative type fuzzy controller with Mamdani interface scheme for dynamic positioning of an oceanographic research vessel (ORV) by numerical simulation. Nonlinear passive observer is used to filter the noise from the position and orientation. A nonlinear mathematical model of the ORV is subjected to the wave disturbance ranging from calm to phenomenal sea. Robustness and efficiency of the fuzzy logic controller is analysed in comparison with the multivariable proportional integral derivative (PID) and the linear quadratic regulator (LQR) controller. A simplified constrained linear quadratic algorithm is used for thrust allocation. The frequency response of the closed loop system with different controllers is analysed using the bode plot. The stability of controller is established using the Lyapunov criteria.


Introduction
The foundation of Dynamic Positioning (DP) can be traced to 1930's where decoupled control for surge, sway and yaw were used. An initial instance of analogue computer simulated dynamic positioning of a ship having four azimuth thruster can be found in [16]. In that paper a proportionalintegral-derivative (PID) controller was used for control while a simple linear sequential thrust allocation algorithm was used for furnishing the thruster rpm and the azimuth angle. A hybrid computer simulation of DP in different sea state was done by [31]. A study for the optimum heading in different environmental conditions was also done in the same report. Harbonn [17] used a Terebel controller for dynamic positioning. The Terebel controller consist of three parallel PID with derivative filter realised using an operational amplifiers. A cost comparison was made between the traditional mooring and DP, with former found to be cheaper when drilling operations for a year is considered.
The results were based on the sea trials for three different ships conducted over a period of five years. Pinkster in 1978 [29] created an experimental set-up to impart generalised thrust forces to the ship model in a wave basin. This set-up was used to demonstrate the effectiveness of employing a feed forward wave compensator in addition to a simple PD controller. Experiments were carried out on 200,000t DWT shuttle tanker ship model in the irregular waves. Usually, tankers are not fitted with the DP systems. Shuttle tankers are used for transporting the oil from the offshore oil fields. The operation of offloading oil onto the tanker requires use of the DP to avoid collision. Theory behind use of the modern control for the DP assisted position mooring is advocated in [24]. Sea trial data for Seaway Eagle (2000t DWT, diving vessel) is used to justify the claim. Advantage of Kalman filter in sensing the ship position, orientation and accelerations is described in the paper. The relation between the Kalman filter and the notch filter is described in [13]. Mathematical models used for simulating the modern control theory application for the DP of ship in the waves is described in [44]. An insight in the physical meaning of various mathematical models used is provided in the paper. A combination of a self tuning adaptive filter and a Kalman filter for estimation of the states in the linear quadratic Gaussian (LQG) controller is simulated in [12]. The adaptive filter has superior performance in varying wind loads. An unconventional approach to the DP is presented in [28] where, heading control is independent of the DP system. A favourable heading is sought to minimise the thruster loading. A successful experimental proof of the concept is presented for above mentioned tanker ship for different loading conditions [28].
Sorensen [33] tested linear quadratic regulator (LQR) with a Kalman filter for a multi-purpose supply vessel. The controller was tested for full scale sea trials. A quadratic optimization algorithm was used for the thrust allocation. A Feed forward compensator was used for wave and wind disturbance rejection. Cao [4] proposed a neural network based control and allocation scheme for a drill ship. A fuzzy control for the same ship is presented in [20,21]. A time varying feedback control algorithm based on the basic engineering involving integral gain for computing the propeller rpm is presented by Pettersen [27].
Application of the acceleration feedback based PID controller can be found in [10,22]. This was first instance of use of Cybership II, a scaled model of an offshore supply vessel to study dynamic positioning. This model is then used to investigate performance of various other control schemes. Sveen [36] used a Lyapunov based robust control scheme for the control and simplified allocation algorithm. Fannemel [7] explored a nonlinear model predictive control. The control strategy failed due to poor solution for the online optimisation problem. A genetic programming based controller is investigated experimentally by [1] . It is found to be less effective when compared with the H ∞ controller but better than the pole placement method. Wondergem [45] proposed a Lyapunov-Christoffel based controller-observer scheme. A robust hybrid controller constituting an state feed back, an inverse filter and an observer is presented in [5]. A review of dynamic positioning control in maritime microgrid systems is done in [26]. This paper is thorough analysis of the concept presented in [38,41]. In this paper, dynamic positioning of an offshore research vessel is simulated in different sea conditions (calm to phenomenal). A nonlinear mathematical model of vessel is considered for simulation. The wave force are generated using mathematical model that considers the direction of the waves, the amplitude of the waves, the frequency of the waves and the geometry of the vessel. A control scheme based on three separate fuzzy logic controller with an non linear passive observer and a feed-forward decoupling compensation for the yaw and the sway is designed, discussed and validated in comparison with the PID and the LQR. A Lyapunov stability analysis of the controller is presented. The frequency response of the fuzzy controller is compared with the PID and the LQR using the bode plot.

Mathematical modelling
The three degrees of freedom (3DOF), horizontal planar motions of a low-speed marine vessel are described by the motion components in surge, sway and yaw. The ship velocity vector is represented by, where u is the surge velocity, v is the sway velocity and r is the yaw velocity. The position and orientation vector is represented by, where x is the displacement in the surge direction, y is the displacement in the sway direction and is the heading angle. The dynamics associated with the vertical motion are neglected.
The relation between and with one principal rotation about z-axis is given by the 3DOF Euler matrix ( R( )), where The equation of motions for a vessel, by linearly superimposing the hydrodynamic forces and moments on the rigid body dynamics in 3DOF and neglecting the quadratic velocity terms of Coriolis-centripetal forces can be stated as, where M is the system inertial matrix with assumption that xy-plane is symmetric and a homogeneous mass distribution exists and is given by, where m is the mass of ship and x g is the distance between the centre of gravity and the origin of coordinate system. Ẋu , Ẏv , Ẏr , Ṅv and Ṅr are acceleration related hydrodynamic derivatives also called as added mass. D is the damping matrix and is given by, N v and N r are the velocity related linear hydrodynamic derivatives. X |u|u , Y |v|v , Y |r|r , N |v|v , N |r|r are the nonlinear hydrodynamic derivatives. The Coriolis matrix is given as, thr and env are the force and moment matrix for the thrust generated by propeller and the force exerted by environmental forces on the ship. X , Y and N represents thruster forces in surge, sway and moment about z-axis respectively. env X , env Y and env N are components of environmental forces acting in surge, sway and moment about z-axis. For low speed application it is safe to assume N v = Y r and fore/aft structural similarity (symmetry) dictate that Ẏr ≈ Ṅv [9]. The model is implemented in SIMULINK using the hydrodynamic derivative values for ORV obtained by planar motion mechanism (particular in Table 1), which are given in Table 2 [40].

Thruster model
The thruster model for the ORV (Fig. 1) as derived experimentally in [37] is, where F jp and F jn are the nominal thrust coefficient at zero speed for the j th thruster; j = 1, 2, 3 represent PT (main propeller on port side), SB (main propeller on starboard side) and BT (bow thruster).

Environmental disturbances
The sea surface is composed of random waves of various lengths and periods. It can be described using a spectrum. The sea spectrum gives distribution of the wave energy among different frequencies of wavelength on the sea surface. Pierson and Moskowitz (1963) developed a spectrum formulation from analysis of the North Atlantic Ocean wave spectrum [9].
where (11)  where H s is the significant wave height and g is the acceleration due to gravity. In this paper, we are using the second order wave transfer function approximation of Pierson-Moskowitz (PM) spectrum which includes a zero mean oscillatory wave frequency motion (first order) induced forces and a non-zero slow varying wave drift forces (second-order wave induced forces). The wave slope transfer function is given as, where -H i (s) is the wave slope transfer function. Index i represents force in x-direction or y-direction and moment about z-axis as 1,2 and 3, respectively.
is calculated using, The wave force are calculated as [43], where w is the density of water, g is the acceleration due to gravity, B m is the breadth of the model, L m is the model length, T m is the model draft and is the angle between the wave and the ship heading in radian.
Based on the sea state given in Table 3 [8] and equation 14, the parameter to simulate the wave forces and moments are found and tabulated in Table 4.

Controller design
From the equation of motion for the vessel (equation 5) along with the symmetric nature of the system inertia matrix M (equation 6) and the damping matrix D (equation 7), it can be inferred that the surge motion is decoupled from the sway motion and the yaw motion. At the same time sway and yaw motions are coupled to each other. A decentralised Takagi-Sugeno(TS) PD-type fuzzy logic controller is proposed. The intention behind application of the fuzzy logic is the use of an advance control strategy which can be easily implemented in real time unlike the strategies discussed in [1,3,6,15,32,34]. The overall closed feedback loop used for the dynamic position is represented in Fig. 2. Error in (position and orientation vector), calculated as difference between the desired and the actual values ( e = d − ) is fed to the controller to produce a thrust and moment command. Mathematical model of the ORV (refer equation from 1 to 7), is subjected to the resultant command thrust and moment along with the force and moment generated by wave disturbance block. The block diagram of the controller is presented in Fig. 3. The output of the surge FLC is directly used as thrust command while those of sway and yaw are subjected to coupling compensation before being directed to the ship model (Fig 4).

Fuzzy logic controller (FLC)
Fuzzy controllers are heuristic controllers which try to emulate the human sense of reasoning. The controller is basically divided into three parts : fuzzification, inference and defuzzification [30]. A block diagram of the fuzzy controller is given in Fig. 5. Fuzzification of the two inputs, error (Fig. 6) and rate of change of error (Fig. 7) is achieved using five fuzzy subset, each assigned with a linguistic label, over the universe of discourse (-1,1). Triangular membership functions are assigned to the fuzzy subsets such as SN (small negative), Z (zero) and SP (small positive), and open ended trapezoid membership functions are assigned to the fuzzy subsets such as MN (medium negative) and MP (medium positive), present at the extreme end of the universe of discourse. The normalised universe of discourse is manipulated using the input gains ( K e and K̇e ). Output (Fig. 8) is divided into seven fuzzy subsets, five of these subsets, which have linguistic label assigned similar to the input variables are     The aim of rules is to guide the error to zero. A typical [19] setpoint response is shown in Fig. 9. The response can be divided into five major segments as highlighted in the figure. In the first segment, the error is positive but the rate of change of error is negative. The objective of control system in this phase is to guide the error to zero while gradually decreasing the rate of change of error. The part of rules assigned to achieve this is highlighted in purple colour ( Table 5). In similar ways, when the error and the rate of change of error are negative, that is the response is moving away from the set point, rules from set II (highlighted by orange colour) pull back the response towards the desired value. Rules from set III (green) are activated when the error is negative, the rate of change of error is positive and the response is moving towards the set point. Set IV takes care of the situation where both the error and the rate of change of error are positive. The rules can be checked for consistency, redundancy and completeness, thereby giving benefit for ease of design. A Lyapunov proof for stability of the controller is given in next subsection. The output is achieved by defuzzification using the centroid method [30].

Stability proof
Let y (e y ,̇e y ) be the candidate Lyapunov function defined as [25,39], where e y = y d − y and ̇e y =̇y d −̇y where =ÿ d −ÿ is used for sake of convenience.
According to the Lyapunov criteria, for stability, ̇y(e y ,̇e y ) < 0 . The restriction on for different values of e y and ̇e y such that the system is stable is given in Table 6. The rules used in this paper ( Table 5) are extension of the condition mentioned in Table 6.

Decoupling
In order to avoid effect of the sway FLC on the yaw and viceversa, a feed-forward compensation decoupling technique is employed [2,35]. The input-output relations of the sway and the yaw with respect to thrust in y-direction and moment about z-axis can be written as, where the transfer functions G Yy (s) , G Ny (s) , G Y (s) , and G N (s) can be computed by substituting value from Tables 1 and 2 in equation from 1 to 9 as, The two subsystems can be decoupled by compensating for the coupling by introducing the element, given in equation 25 and 26 as shown in Fig. 3.

Thrust allocation algorithm
Output of the controller is a generalised thrust command . C X is the correction thrust required in the surge, C Y is the correction thrust required in the sway, and C N is the correction torque required in the yaw. The purpose of a the thrust allocation algorithm is to map these generalised thrust commands specified by the controller into specific commands for various propulsion unit. In this paper, a linear quadratic constrained control allocation is used. The generalised thrust commands are first converted to percentage of maximum allowable thrust. G Yy (s) = 0.011s + 0.00107 0.0299s + 0.005417 P X is the permissible thrust required in the surge, C Y is the permissible thrust required in the sway, and C N is the permissible moment required in the yaw. Relation between these permissible generalised thrust and the thrust produced by the is given as, Where T PT , T SB and T BT are thrust produced by the port thruster, the starboard thruster and the bow thruster respectively (Fig. 1).
is the thruster configuration matrix. 2 2 ) and R L = l 1 + l 2 2 are coefficient relating permissible thrust to propeller thrust. d 1 and d 2 are the hyrodynamic performance parameter relating to drag in the rudder model. l 1 and l 2 are hyrodynamic performance parameter relating to the lift in rudder model. These parameter are specific to rudder and are found experimentally [22]. Since the focus of this paper is on development of the controller, the allocation algorithm was further simplified by keeping the rudder fixed at zero degrees ( = 0 ) for tracking as well as station keeping purpose. In such case, R D = 1 and R L = 0 . This reduces the over-actuated system to a fully-actuated system. A weight matrix W is used to add additional constrains. The thrust that the thruster needs to produce can be found as,

Nonlinear passive observer
Generally, only noisy measurement of the position and orientation are available through sensors. The measurements needs to be made noise free to avoid unnecessary control commands. Further, the wave disturbance consist of oscillatory loads and slow varying loads. If these oscillatory disturbances enter the control loop through position and orientation feedback they may cause excessive thruster commands resulting in unacceptable mechanical wear and tear of the to thruster, excessive fuel consumption and unacceptable operational condition. To attenuate this undesirable, zero mean sinusoidal noise and filter the noise from position and heading signal, a nonlinear passive observer is utilised. The observer also helps to reduce the instability of the DP system. The observer is realised as follows [11]: where y e = y −ŷ is the estimation error, K A ( 0 ) , K B , K C and K D are observer gain matrices. b is the bias term which takes care of unmodelled nonlinear dynamics. T is the matrix of positive bias time constants. w is the wave state matrix. A w = 2 w 0 is the wave system matrix. C w is the unity wave output matrix. The block diagram of the observer is shown in Fig. 10.

Simulation and results
A square manoeuvre is adopted to examine the performance of the controller. The idea behind this is to test every aspect of the motion as vessel returns to its initial position making a square trajectory (Fig. 11). The different stages in this manoeuvre are, The vessel experiences a port side sway motion from B to C(5,5).
. A position change of -5m in the x-direction and a 10 • anticlockwise heading change is commanded. The vessel moves backward from C to D(0,5) and turns 10 • to port. 5. A position change of -5m in the y-direction and a clockwise yaw of 10 • is commanded. The vessel experiences a starboard side sway motion from D to A(0,0) and returns to zero heading (Table 7).
World Meteorological Organisation (WMO) defines different sea states using code 0-9, ranging from calm (rippled) water to phenomenal sea. In the present study four different sea conditions (Table 3) have been considered to test the regulatory response of the control scheme. The wave forces are generated by passing a pseudo-random binary number (to simulate band limited white noise) through wave transfer function (given in equation 13) using the parameter mentioned in Tables 4 and 8 [18].
The proposed controller is compared with the multi-variable PID (mvPID) [9,23] and the [14] for the square wave manoeuvre in different sea states. The set point response in the calm sea is given in Fig. 14 From the set-point tracking response in x and y (Fig. 14a, b) we can conclude that the fuzzy logic controller and the LQR controllers are efficient in comparison to the multivariable PID (mvPID). For set-point tracking of (Fig. 14c), we can observe the influence of coupling between Y and at the point B. The fuzzy logic controller is successfully able to overcome this coupling and maintain a constant heading. Failure of the LQR to bring the heading back to zero between point B and C can be attributed to lack of integral term. Among all the controllers, mvPID gives maximum error in position and orientation tracking. Thruster speed for the main propellers ( Fig. 12a and b) and the bow thruster (Fig. 12c) are well within the operation limit for all the three controllers. Overshoots of the mvPID in surge and sway can also be observed in x-y trajectory plot (Fig. 13) around the corners. Performance of the FLC and the LQR can be deemed acceptable. We should note that the LQR gains are determined based on the mathematical model of vessel. The  accuracy of these gains is dependant upon the correctness of mathematical model. In case of fuzzy logic such correct mathematical model is not necessary. The nonlinear nature of fuzzy controller takes care of discrepancies between the mathematical model and actual ship. Same square manoeuvre is performed for three other sea state. Setpoint response in the extreme sea is given in Fig. 19. Though LQR is better at regulatory response in comparison to the FLC ( Fig. 19a and b) we can observe that the control energy required for the LQR is much higher (Fig. 20). The regulatory response in sea state 4 and sea state 7 is similar to that of sea state 9 (Fig. 19) but with less deviation due to the waves. From the xy trajectory during a square manoeuvre in the sea state 9, we can observe that the FLC is robust in presence of disturbance. A graph of absolute error in different sea state during square wave manoeuvre is give in Fig. 22 and corresponding normalised Integral Absolute Error (IAE) is presented in Table 9. Normalised IAE is defined as, From IAE it can be clearly concluded that the fuzzy controller is superior in all aspects when compared with mvPID. For tracking of , the FLC excels the LQR and the mvPID by a fair margin.
For better understanding the controller capabilities a bode plot of various linearised subsystems is plotted in Fig. 23. A bode plot is a graph of the magnitude and the phase of a transfer function versus the frequency plotted on a semi log paper. Bode plot provides insight on how controller influences frequency response of the system. G Xx , G Yy and G N are the subsystems corresponding to appropriate input-output pairing, while G Y and G Ny corresponding to undesirable input output pairing. For plotting of the bode plot the system is linearised at = [0 0 0] . Linearised equivalent of the FLC is obtained by reducing it to single input fuzzy logic controller [42]. The zero dB (decibel) magnitude response for the closed loop fuzzy, the LQR and the mvPID controller (Figs. 23a, b and 23e) at the lower frequencies implies correct tracking of set-point. In the same plot we can observe heavy attenuation at the higher frequencies implying ability of all the controllers, particularly of the FLC to reject the high frequency disturbance. In phase plot we can find that the FLC and mvPID are far from -180 • . For G Y (Fig. 23c) and G Ny (Fig. 23d), magnitude plots show attenuation of input for all the frequencies in case of the LQR and the FLC.

Conclusion
The paper is an attempt to understand the capabilities of three segregated fuzzy logic controller, along with the decoupling mechanism, in tracking and controlling of a ship model position in the horizontal plane. A Lyapunov stability proof for the controller is presented. A nonlinear passive observer and a simplified linear quadratic constrained algorithm is used. A square manoeuvre was employed to assess the tracking ability of controller in different sea states. Frequency response of the fuzzy logic controller is presented in comparison with the PID and the LQR. The results show that the FLC is able to smoothly follow the desired position and heading. The FLC is also successful in computing counter thrust that needs to be produced to minimise the effect of the wave disturbances so that vessel maintains its position and heading. The controller increases the overall stability of the system when compared with traditional controllers like mvPID. It should also be noted that tuning LQR requires an exact mathematical model of the system, where as in case of fuzzy controller an imprecise system model is sufficient for the controller design. It can be concluded that the FLC provides immunity from the wave disturbances in different sea conditions (from calm to phenomenal), and hence it can be called robust. The response of the FLC in extreme seas to maintain the position of vessel within one meter of desired setpoint is good and hence can be deemed acceptable.