1. Dynamic positioning
The dynamic positioning module is a control module with the following input and output:
Input:

Position measurement

Wind measurement

Anchor line force measurement

Thrust measurement
Output:

Desired resultant forces and moment from the thrusters
A PID controller and a Kalman filterbased controller exist. In addition it is possible to use an external dynamic positioning controller that can be coded by SITEF Ocean as a shared library (DLL), or use the internal SINTEF Ocean DPsystem (MTDP) which is used for model tests in the SINTEF Ocean Basin.
1.1. PID controller
The controller converts position and velocity errors into a demand for thrust forces to correct the errors. A decoupling approach allows PID control parameters to be specified separately for surge, sway and yaw.
PID characteristics
The control law of the PID (Proportional + Integral + Derivative) controller is
where
\(x(t)\)  filtered position 

\(x_0(t)\) 
desired (target) position 
\(\varepsilon (t)\) 
position error 
\(F_{T0}\) 
desired control force from thrusters 
\(K_D\) 
velocity feedback gain 
\(K_P\) 
position feedback gain 
\(K_I\) 
integral feedback gain 
Figure 1 shows an example of the PID controller’s frequency response from the position error \(\mathrm {\varepsilon }\) to control force \(\mathrm {F_{T0}}\) . It is seen that for low frequencies (below \(\mathrm {\omega _{I}}\) ) the controller acts like an integrator. In the medium frequency range it has proportional action, and for high frequencies (above \(\mathrm {\omega _{D}}\) ) the controller behaves like a differentiator. With increasing frequency, the phase angle of the controller goes from \(90\mathrm {deg}\) to \(+90\mathrm {deg}\) . The relations between the frequencies \(\mathrm {\omega _{I}}\) and \(\mathrm {\omega _{V}}\) and the feedback gains are
where \(\mathrm {K_P'}\) is the level of the horizontal asymptote in the figure. Usually \(\mathrm {\omega _I\ll\omega _D}\) , so that \(\mathrm {K_P'\approx K_P}\)
As \(\mathrm {\omega }\) approaches zero the controller gain approaches infinity due to the integral term. As a result, there will be no static (mean) position error  which is the purpose of integral action. Without the integral term (\(\mathrm {K_{I}=0}\) or equivalently, \(\mathrm {\omega _{I}=0}\) ) the static error would be \(x_{\mathrm {stat}}=F_{\mathrm {ext}}/K_{P}\) , where \(F_{\mathrm {ext}}\) is the static component of the external disturbing force.
The purpose of the derivative action (i.e. the velocity feedback) is to provide phase lead. As is seen from Figure 1, the derivative term causes the phase to approach \(+90\,\mathrm {deg}\) . In general, a certain amount of phase lead will be required in order to obtain stability.
Filtering
It appears from Figure 1 that the PID’s gain also approaches infinity for high frequencies. This will make the system very sensitive to high frequency noise in the position and velocity signals as this noise would be amplified and put through to the thrusters. For this reason, high frequency components are removed from the signals by filtering before they are fed to the controller.
There are two filters. One serves the double purpose of 1) lowpass filtering the position measurement to reduce the amount of measurement noise, and 2) differentiating the filtered position. The result is the input \(\mathrm {x}\) and and its derivative. Frequency response of lowpass filter (solid lines) and combined lowpass filter/differentiator (dashed) shows the frequency response of the lowpassfilter/differentiator, which has the cutoff frequency \(\mathrm {\omega _{C}}\) as the only parameter. The cutoff frequency is the frequency at which the attenuation starts. Above this frequency the attenuation is \(20\,\mathrm {dB}\) (10 times) per frequency decade.
In Frequency response of lowpass filter (solid lines) and combined lowpass filter/differentiator (dashed), the frequency axis is scaled as \(\mathrm {\omega /\omega _{c}}\) where \(\mathrm {\omega _{c}}\) is the cutoff frequency.
The other filter is a wave filter. Its task is to remove the wave frequency components of the position measurement signal to prevent them from entering the thrusters. This is because thrusters usually have no chance of counteracting firstorder wave forces. [tmfigfreqwavefilter] shows the frequency response of a wave filter for different values of the strength parameter \(\mathrm {\eta _{WF}}\).
The wave filter is of band stop type. It is characterised by a frequency parameter and a strength parameter. The frequency response of the filter is given in [tmfigfreqwavefilter] for a number of values of the strength parameter \(\mathrm {\eta _{WF}}\) , to be chosen in the range from \(\mathrm {0}\) to \(\mathrm {1}\) . The maximum attenuation of the wave filter is \(16.5\mathrm {dB}\) or about \(\mathrm {7}\) times. It is intended that optimum filter performance should be achieved simply by equating the filter frequency with the peak frequency of the wave spectrum. As a consequence of the typical asymmetry of wave spectra, the frequency parameter is chosen to the left of the filter’s centre frequency.
It is perfectly possible to filter off the wave frequency motion using the lowpass filter only. It is just a question of choosing the cutoff frequency low enough. The wave filter, however, is better suited for this task, since it gives more attenuation for less phase lag than the lowpass filter. The wave filter does not reduce any high frequency measurement noise. If such noise exists and is a problem, the cutoff frequency of the lowpass filter must be chosen low enough to give a sufficient suppression of it. In any circumstance the cutoff frequency should not be chosen any lower than necessary, in order to introduce as little negative phase as possible into control loop. On the other hand, the cutoff frequency should be chosen well below one half of the sampling rate of the measurements.
Mechanical analogy
In a DP system, the position and velocity feedback gains can be interpreted as stiffness and damping coefficients, respectively, and this mechanical analogy can be useful in determining these gains. However, due to the influence of the integral term and the filters, the analogy should not be pulled too far. Both the integral term and the filters may affect the system’s frequency response substantially, and the controlled system’s behaviour should therefore not be judged on the basis of \(\mathrm {K_P}\) and \(\mathrm {K_D}\) alone. A procedure for selecting the control parameters is included below.
Crosscoupling effects
The above description applies to each of the three controllers for surge, sway and yaw. When the vessel’s centre of mass is chosen as the point to be positioned and the mooring system (if any) is fairly symmetric, the effects of crosscoupling between the motions will in general be small. In this case it may be good enough to control the motions independently of each other. If, on the other hand, a point near the vessel’s bow is to be positioned, large coupling effects must be expected. In this case effective control may be difficult to achieve with independent controllers.
There are three kinds of crosscoupling effects: through mass forces, damping forces and mooring forces. SIMO uses the vessel’s mass matrix (dry mass + hydrodynamic mass) to "couple together" the independently calculated force outputs from the three PIDs. This happens automatically without participation from the user. In this manner compensation for the effect of mass coupling, which is well defined, is achieved. It is expected that also the damping crosscoupling is partially compensated for in this manner, so that approximate decoupled control of any point on a nonmoored ship can be obtained. For a moored ship however, the characteristics of the mooring system must be taken into account when the PID parameters are selected.
Procedure for tuning the PID controller
Tuning a control system is no exact science. The following procedure should serve as a guideline.

For each of the three motions surge, sway and yaw, determine position and velocity feedback gains \(\mathrm {K_{P}}\) and \(\mathrm {K_{D}}\) that give the wanted stiffness and damping. Set the integral gains \(\mathrm {K_{I}}\) to zero. Turn off the wave frequency filter (\(\mathrm {\eta _{WF}=0}\) ) and set the cutoff frequency of the lowpass filter to \(\mathrm {1/5}\) of the sampling rate.

From an initial position of nonequilibrium and with no dynamic environmental forces acting, simulate the transient motion towards equilibrium (To avoid complications caused by possible crosscoupling effects, it is safest to do this for one motion at a time, simulating pure transients in surge, sway and yaw). The transients should be nonoscillating. If they are not, the damping coefficients must be reduced.

Make a simulation with dynamic environmental excitation. Inspect the thruster outputs to see if the amount of wave frequency components is admissible. If it is, proceed to 5. If not, select the appropriate value for the strength parameter of the wave filter according to [tmfigfreqwavefilter].

With the selected wave filter, simulate transients again. The wave filter introduces negative phase in the control loop, which reduces stability. If any transient is unstable or shows oscillatory behaviour that does not die out rapidly (i.e. during one or two half cycles), stability must be improved. If it is unacceptable to reduce the strength of the wave filter, the remedy is to: 1) make the controller phase more positive at the frequency of oscillation, and/or 2) reduce the controller gain at the same frequency. Remedy (1) is carried out by reducing \(\mathrm {K_{P}}\) while keeping \(\mathrm {K_{D}}\) constant. Try this choice first, for example by halving the value of \(\mathrm {K_{P}}\) . Remedy (2) is effectuated by reducing \(\mathrm {K_{P}}\) and \(\mathrm {K_{D}}\) by the same amount (e.g. halving them). Try this remedy if (1) fails or is insufficient.

If integral action is desired, determine the upper frequency limit \(\mathrm {\omega _{I}}\) for this action, i.e. the frequency above which the integral action becomes insignificant (cf. [tmfigfreqwavefilter]) Then set \(\mathrm {K_{I}=w_{I}\cdot K_{P}}\) and simulate transients. The integral action also deteriorates stability. If stability is unsatisfactory, \(\mathrm {K_{I}}\) must be reduced.

If it is known that the amount of measurement noise (the present version of SIMO does not simulate such noise) necessitates harder lowpass filtering of the position measurements, the cutoff frequency of the filter must be reduced from the value set according to paragraph 1 above. This may then lead to an adjustment of the controller gains as outlined in paragraph 4, until a satisfactory transient motion is obtained for all three motion variables.
The above procedure reflects the standard knowledge from control theory that for a feedback system to be stable, the openloop gain must be less than \(1(0\,\mathrm {dB})\) at the crossover frequency (i.e. the frequency at which the openloop phase is \(180\,\mathrm {deg}\) .)
1.2. Kalman filter
The Kalman filter module was originally developed at SINTEF, division of Automatic Control during the period 197577, and has later been maintained and slightly modified by MARINTEK.
The system is based on an optimal state estimator which is running in parallel with the physical process (the SIMO vessel). With feedback from estimated positions and velocities, the estimator acts as an adaptive controller.
The mathematical model of the vessel is divided in three main sections:

Model of waveinduced motions, high frequency (HF) model.

Vessel motions in calm water, low frequency (LF) model.

Model for slowly varying forces from waves and current.
Slowly varying forces due to current and second order wave forces can be modelled by two methods:

Estimation of global current velocity components

Estimation of local bias forces
In both cases, other unknown forces will also be estimated. The bias esimation represents the integrator effect of the controller.
Input data to the Kalman filter routines are:
\(x_\mathrm{ref}^G\) 
global xreference 
\(y_\mathrm{ref}^G\) 
global y reference 
\(\psi_\mathrm{ref}\) 
heading reference 
\(x_\mathrm{loc}^L\) 
xcoordinate of point on vessel to be positioned 
\(y_\mathrm{loc}^L\) 
ycoordinate of point on vessel to be positioned 
\(d_x\) 
longitudinal quadratic drag coefficient 
\(d_y\) 
transverse quadratic drag coefficient 
\(d_\psi\) 
rotational quadratic drag coefficient 
\(v_\mathrm{typ}\) 
typical velocity 
\(m_x\) 
body mass and added mass in surge 
\(m_y\) 
body mass and added mass in sway 
\(m_\psi\) 
body inertia and added inertia in yaw 
\(R(3, \, 4)\) 
Kalman filter gain matrix 
\(G(3, \, 2)\) 
linear controller matrix 
Each time step, the following measurements are input to the Kalman filter:
\(F_{Mx}^L\)  measured longitudinal forces 

\(F_{My}^L\) 
measured transverse forces 
\(F_{M\psi}\) 
measured moment 
\(x_M^G\) 
measured global xposition of body origin 
\(y_M^G\) 
measured global yposition of body origin 
\(\psi_M\) 
measured heading 
The output from the routines are:
\(F_{Tx}^L\)  longitudinal thrust demand 

\(F_{My}^L\) 
transverse thrust demand 
\(F_{T\psi}\) 
thrust moment demand 
The Kalman filter has the following state variables:
\(x_{LF}^G\)  global LF xposition 

\(y_{LF}^G\) 
global LF yposition 
\(\psi_{LF}\) 
LF heading 
\(\dot x_{LF}^G\) 
global LF xvelocity 
\(\dot y_{LF}^G\) 
global LF yvelocity 
\(\dot \psi_{LF}\) 
LF heading rate 
\(v_{cx}^G\) 
North current velocity if current is estimated 
\(v_{cy}^G\) 
West current velocity if current is estimated 
\(F_{Bx}^L\) 
local bias xforce if bias is estimated 
\(F_{By}^L\) 
local bias yforce if bias is estimated 
\(F_{B\psi}\) 
bias moment 
\(x_{HF}^L\) 
local HF xposition (surge) 
\(y_{HF}^L\) 
local HF yposition (sway) 
\(\psi_{HF}\) 
HF heading (yaw) 
\(\dot x_{HF}^L\) 
local HF xvelocity 
\(\dot y_{HF}^L\) 
local HF yvelocity 
\(\dot \psi_{HF}\) 
HF heading rate 
\(\omega_x\) 
surge oscillation frequency 
\(\omega_y\) 
sway oscillation frequency 
\(\omega_\psi\) 
yaw oscillation frequency 
In addition, the following important help variables are used:
\(\delta x^L\)  position error surge 

\(\delta y^L\) 
position error sway 
\(\delta \psi\) 
heading error 
\(\varepsilon_x^L\) 
innovation in surge 
\(\varepsilon_y^L\) 
innovation in sway 
\(\varepsilon_\psi\) 
innovation in yaw 
The differences between the position measurements from the vessel and estimated measurements in the Kalman filter are called innovation processes. State variables in the estimator are updated by multiplications of innovations with Kalman filter gains.
The first step is calculation of the innovations.
Updating LF state variables:
Updating HF state variables:
Updating bias estimates. If current is estimated:
If bias force is estimated:
In both cases:
Then the frequencies of high frequency motion are updated according to (Balchen et al., 1980)
Thrust demand is computed as feedback from the LF state variables and feedforward from measured forces (wind) and estimated forces (wave drift and current).
Feedback from LF state variables:
If current is estimated:
If bias force is estimated:
The calculated thrust demands are compensated for estimated and measured bias:
The LF model consists of three discrete differential equations defined by the vessel’s mass and damping coefficients. If current is estimated:
If bias force is estimated:
In both cases:
The accelerations are expressed by:
The HF model for each degree of freedom is an adaptive harmonic oscillator. The outputs from the oscillators are estimates of waveinduced motion in the vessel coordinate system.
The accelerations are integrated to get a priori estimates of global LFstates and local HFstates.
Initial tuning of the Kalman filterbased controller may be performed as described below.
The controller gains:
where \(\mathrm {T_x}\), \(\mathrm {T_y}\) and \(\mathrm {T_\psi}\) are the chosen/wanted natural periods for surge, sway and yaw, respectively. The damping factors are given as \(\mathrm {\xi _x}\) , \(\mathrm {\xi _y}\) and \(\mathrm {\xi _\psi}\), and they are typically set to a value of 0.7 which indicates a damping level of 70% of the critical damping.
Depending on the natural periods of the motions (low frequency) and on the wave frequency motions, cutoff frequencies \(\mathrm {\omega _c}\) for filtering the wave frequency motions are normally chosen. Typically, the cutoff periods for surge, sway and yaw of \(\mathrm {T_c=2\pi /\omega _c}\) are given values between \(25\mathrm {s}\) and \(50\mathrm {s}\) .
Then Kalman filter coefficients (for initial tuning) may be chosen as:
1.3. Velocity PI controller
When the simulator is run in manual mode, the user may use an input device, such as a joystick, to give a reference in velocity. The controller is similar to the controllers with position reference, but the velocity controller uses errors in velocity instead of errors in position.
The controller converts velocity errors into a demand for thruster forces to correct the errors. A decoupling approach allows the PI control parameters to be specified separately for surge, sway and yaw, since these are dominant when the reference point is not given in the centre of gravity.
PI characteristics
The control law of the PI (Proportional + Integral) controller is
where
\(\dot x(t)\)  filtered velocity 

\(\dot x_0(t)\) 
desired (target) velocity 
\(\varepsilon(t)\) 
velocity error 
\(F_{T0}\) 
wanted control force from thrusters 
\(K_P\) 
velocity feedback gain 
\(K_I\) 
integral feedback gain 
The PI controller may be tuned similarly to the tuning of the PID controller in Section PID controller. The damping term \(\mathrm {K_D}\) is omitted because feedback in acceleration is very sensitive to measurement noice. The wave filter is the same as the one described in Section PID controller.