#### Abstract

Considering the problem of dynamic positioning systems for the slowly varying disturbances, a parametrically adaptive observer is presented. The peak frequency of observer is adjusted on-line by autoregressive (AR) spectral estimation; other parameters of observer are optimized using particle swarm optimization (PSO). The peak frequency can be calculated by spectral analysis of the pitch, roll, and heave measurements. In the spectral estimation, Levinson-Durbin algorithm is used to solve the Yule-Walker equations. Finally, the computer simulation is given to demonstrate the effectiveness of the proposed method.

#### 1. Introduction

Dynamic positioning systems keep floating structures in fixed position or predetermined track for marine operation purposes exclusively by means of active thrusters [1].

Filtering and state estimation are important features of a DP system. In most cases, measurements of the vessel velocities are not available. Hence, estimates of the velocities must be computed from noisy position and heading measurements through a state observer. Unfortunately, the position and heading measurements are corrupted with colored noise due to wind, waves, and ocean currents as well as sensor noise. However, only the slowly varying disturbances should be counteracted by the propulsion system, whereas the oscillatory motion due to the waves (first-order wave disturbances) should not enter the feedback loop. This is done by using the so-called wave filtering techniques, which separate the position and heading measurements into a low-frequency and wave frequency position and heading estimate.

The conventional observer filters out the WF motions from the measured position and estimates the LF position and velocity. In the early studies, Balchen et al. [2] and Sørensen et al. [3] used the Kalman filter to filter the WF motion. Later, Fossen and Strand [4] introduced the nonlinear passive observer. It should be noted that the two types of observers are based on a priori knowledge of the sea state to filter the WF motions; this means that peak frequency is assumed to be known. However, over a longer time frame, the sea state may change, and therefore peak frequency in general is not known. So, Strand and Fossen [5] improved the nonlinear passive observer with recursively adaptive WF filtering; however this design has two main drawbacks. Firstly, only the wave model parameters (not the observer gains) are adapted. This means that a priori knowledge of the sea state is required to choose observer gains, such that a notch filtering effect is achieved to remove the first-order wave components. Secondly, the observer tuning can be quite difficult. Guttorm Torsetnes gives a gain scheduled observer. The gain scheduled wave filtering is achieved by measuring the slowly varying wave model parameters on-line and therefore requires no a priori knowledge of the sea state.

In this study, particle swarm optimization (PSO) is implemented in conjuncture with an AR spectrum estimation to adajust the parameters of observer. Some numerical simulation results are given to demonstrate the effectiveness of the proposed method.

#### 2. Ship Model

A useful model describing the dynamics of a surface ship sailing in a horizontal plane having 3 degrees of freedom is given in [1], which is common to separate the model into a kinematic model and dynamic model.

##### 2.1. Kinematic Model

In dynamic positioning, the motions and state variables of the control system are defined and measured with respect to some reference frames or coordinate systems as shown in Figure 1. The Earth-fixed reference frame is denoted by , and the body frame is (see [1]).

The state vector is defined by , is the position of the ship given in an inertial frame, and is the heading angle of the ship relative to geographic North.

If only surge, sway, and yaw (3-DOF) are considered, the kinematics and the state vectors are reduced to where is defined as

##### 2.2. Dynamic Model

In the mathematical modeling of ship dynamics, it is common to separate the model into a low-frequency model and wave-frequency model. The WF motion of the ship is due to first-order wave loads. The nonlinear LF equation of motion is driven by second-order mean and slowly varying wave, current and wind loads, and thrust forces.

###### 2.2.1. Low-Frequency Model

The equations of motion of a large class of surface ships can be described by the following model:

is the control vector consisting of forces and moments produced by the thruster system; is the environmental disturbance; is the system inertia matrix including added mass; is the damping matrix.

###### 2.2.2. Wave-Frequency Model

In the controller design synthetic white-noise-driven processes consisting of uncoupled harmonic oscillators with damping will be used to model the WF motions. The synthetic WF model can be written in state-space form according to is the position and orientation measurement vector and , is a zero-mean Gaussian white noise vector. Consider

The relative damping ratio will typically be in the range [0.05–0.1]; is the parameter vector of the unknown dominating wave frequencies in surge, sway, and yaw.

The bias model may also be modelled as

#### 3. Observer Design

Fossen and Strand have proposed a passive nonlinear observer; see [4]. The observer includes wave filtering properties, bias state estimation, reconstruction of the LF motion components, and noise-free estimates of the nonmeasured vessel velocities. The proposed observer has been proven to be passive and globally exponentially stable (GES). Based on (1), (3), (4), and (6) the observer takes the following form: where , , and are observer gain matrices; is the estimation error. Consider where is the desired damping ratio (typically 1) and is often set equal to the wave peak frequency. is the cutoff frequency of the notch filter. is a tuning parameter to be set between 0.1 and 1.0. and should be sufficient high to ensure proper bias estimation. and are simply chosen so that is fulfilled. We can see that , , and are the unknown parameters in the wave model.

#### 4. Measuring by AR Estimation

The dominating wave frequency is assumed to be the peak frequency of the unbiased Power Density Spectrum (PDS) based on pitch, roll, and heave response of the vessel. At this point, it is worth noting that the pitch, roll, and heave motions are usually not controlled in DP systems for ships, and they will therefore not be affected by the controller in the same degree as the three horizontal motions; see [6]. The power spectrum estimation method used here is the parametric method of Autoregressive (AR) Spectral Estimation, which has several advantages compared to nonparametric methods; see [7]. Parametric methods are recommended since they give better estimates for shorter finite-length data records.

An autoregressive (AR) model is a possible method of modeling a stationary stochastic process. Given the signal , , , the autoregressive model can be written as where is an independent identically distributed stochastic sequence with zero mean and variance. The coefficients are called the autoregressive parameters of the model, and is the model order. Once such a model of the process is available, its spectrum can be easily computed:

The values of the parameters and are unknown. The problem is to estimate the unknown parameters. and can be calculated by solving the following:

Since , we have

Equation (14) is called the Yule-Walker equations and describes the unknown AR coefficients in terms of the estimated autocorrelation coefficients. Solving the Yule-Walker equations for is termed the autocorrelation method of AR parameter estimation and can be accomplished using a recursive technique such as the Levinson-Durbin algorithm. The Levinson-Durbin algorithm is given by

The coefficients are generated recursively from their -order values. is the minimum backward prediction errors of -order model, and is the reflection coefficient.

#### 5. Optimizing K_{3} and K_{4}

The tuning of the parameters is a necessary part of design observer, and the appropriate observer can guarantee the system obtaining fast dynamic response and robust. In this section, the matrics and of observer are optimised by PSO.

##### 5.1. Overview of the PSO

The particle swarm optimization (PSO) is an evolutionary computation technique developed by Kennedy and Eberhart in 1995; see [8–11]. Similar to the genetic algorithm (GA), the PSO algorithm is an optimization tool based on population, and the system is initialized with a population of random solutions and can search for optima by the updating of generations. It can be described as follows. At each iteration, each particle can adjust its velocity vector, based on its momentum and the influence of its best position as well as the best position of its neighbors, and then compute a new position where the “particle” is to fly to. Supposing that the dimension for a searching space is , the total number of particles is , the position of the th particle can be expressed as vector ; the best position of the th particle being searching until now is denoted by , and the best position of the total particle swarm being searching until now is denoted by vector ; the velocity of the th particle is represented by vector . So, the velocity and position of the th particle can be updated as follows: where and are random numbers between 0 and 1; and are the acceleration constants with positive values; is the weight function. The following weighting function is usually used in (16): where is the initial weight, is the final weight, is the maximum iteration number, and is the current iteration number.

##### 5.2. Fitness Function

Adopting the absolute error (ITAE) as the minimum, we can gain fitness function as with being positive constant.

##### 5.3. Optimization Procedure

The PSO algorithm comprises the following steps.

*Step 1. *Set ( is the iterative number). Initialization of particle swarm is generated randomly as follows: ; the swarm has 6-dimension particles which can guarantee and to be positive matrices. and are used in the observer mentioned in Section 3. The particle velocities are generated randomly in the range 0~1 and as follows: .

*Step 2. *Define objective function values of the particles that are evaluated given by (18). To each particle in the particles’ swarm, set its best position (the fitness function is the least). Finding the least fitness function values in the initializing particles’ swarm, the best position is .

*Step 3. *The position and the velocity of each particle are updated using (16). The fitness function values are calculated for the updated positions of the particles.

If , then ; else .

Setting the least fitness function values in the current particles’ swarm is the th particle.

If then else .

*Step 4. *If we attain the maximum iteration, exit, and otherwise go to iterate.

#### 6. Simulation Research

In this section, the performance of the observer tuning by PSO and AR spectrum estimation is verified. A supply ship named as S-175 is used as a case study, and the vessel main particulars are shown in Table 1.

For the purpose of comparison, all the simulations deploy the same parameter settings as follows. The ship controlled by PID controller [1] is maintained in the desired position and heading . The population size of PSO is 50, the maximum velocity is set as 1, the iteration is 200, and the weights are and .

##### 6.1. Example 1. Verify the PSO

In order to demonstrate the efficiency of the proposed PSO, optimization observer by PSO is compared with an observer using genetic algorithmic (GA) [12]. The vessel was exposed to the JONSWAP distributed waves with significant wave height 2.0 m and peak frequency rad/s, . The parameters are shown in Table 2, and the simulation curve is shown in Figure 2.

**(a) Simulation curve of observer using GA**

**(b) Simulation curve of observer using PSO**

**(c) The measured position of ship of observer using GA and PSO**

From Figure 2, we can see that the proposed PSO optimization observer can give better results, with a small position and heading bias.

##### 6.2. Example 2. Verify the Parametrically Adaptive Observer

To demonstrate the performance of parametrically adaptive observer in this paper, the proposed parametrically adaptive observer is compared with the observer (7). The aforementioned two observer gains are optimized using PSO. The JONSWAP wave spectrum with significant wave height to be set at 1.2~3.6 m and peak frequency to be set at 0.8~0.65 rad/s is used to imitate sea conditions. The simulation curve is shown in Figure 3.

**(a) Simulation curve of observer without AR estimation**

**(b) Simulation curve of observer using AR estimation**

**(c) The measured position of ship of observer without and with AR estimation**

**(d) The estimated peak frequency**

From Figures 3(a) and 3(b), the observer with AR spectral estimation can avoid the transients caused by the instability of verying sea states. From Figure 3(c), we can clearly see that the ship using observer with AR estimation has better position and heading. It can be seen from Figure 3(d) that the estimated by AR method is very close to predefined peak frequency.

#### 7. Conclusions

This paper proposed a parametrically adaptive observer of ship for the slowly varying seas. The peak frequency of observer can be calculated by AR spectral estimation of the pitch, roll, and heave measurements, some parameters of observer are tuned on-line based on peak frequency, and other parameters of observer are optimized off-line using PSO. The simulation results show that the parametrically adaptive observer can avoid the transients caused by the instability of varying sea states and can improve the accuracy of dynamic positioning systems.

#### Acknowledgment

The paper was supported by the National Nature Science Foundation of China, no. 60775060.