## 1. Introduction

Currently, ship development trends are focused on scale up, speed up, and automated and unmanned ships, and a robust autopilot system is essential to implement automation and unmanned ships. An autopilot system generates course errors by continuously comparing the setting course with the current heading when the ship’s direction deviates from the setting course due to disturbances or when the navigation officer changes the setting course. The controller of an autopilot system amplifies such course errors and sends a rudder angle command to the rudder control mechanism to track the setting course accurately. Factors that affect the steering characteristics of a ship are difficult to control because there are factors caused by operating conditions such as ship speed, loading conditions, and trims, and by frequently changing the environmental factors such as wind, wave and current.

Autopilot systems adopt improved control theories and advanced automatic control technologies for ship heading control. Zwierzewicz (2014) proposed a control system that combines *H*_{∞} optimal control and plant parameter adaptive control to handle uncertainty based on the input-output feedback linearization method, and Larrazabala et al. (2016) proposed a control system that integrates a gain scheduling PID optimized by GAs and a fuzzy logic controller. Liu et al. (2017a) considered a linear quadratic regulation control system to maintain the setting course and stabilize the system. He et al. (2017) studied adaptive neural network control using asymmetric barrier lyapunov Function to accurately track the trajectory of ships with output constraints and uncertainties. Pathan et al. (2012) proposed a fuzzy logic controller with triangular membership functions to control the course changing and course keeping of tankers whose parameters vary with the depth of water. Liu (2017b) proposed a controller that provides robust performance for environmental disturbances and rudder dynamics by using an adaptive sliding mode control algorithm with a nonlinear disturbance observer for ship heading control. However, these methods require accurate mathematical models of the plant and information on internal uncertainties and disturbances, and are very difficult to apply in practice. Nevertheless, the goal of designing ship heading control systems is to implement a relatively easy algorithm with higher precision and better disturbance rejection. In particular, controllers need to improve the performance of setting value tracking and disturbance rejection simultaneously. However, there is a limit in improving both the setting value tracking performance and disturbance rejection performance.

This study proposes an RCGA-based Linear Active Disturbance Rejection Controller (LADRC) design method that is robust against disturbances and noise during navigation and model uncertainties in designing the controller for ship heading control. The LADRC (Han, 2009) consists of a transient profile, a linear extended state observer, and a PD controller, and it treats the disturbances and internal uncertainties applied to the system as total disturbances, and estimates and compensates in real-time.

The gains of the controller and the state observer in the LADRC are tuned by RCGAs (Real-Coded Genetic Algorithms) to minimize the Integral of the Time-weighted Absolute Error (ITAE).

RCGAs for parameter optimization are used to handle real-coded chromosomes to improve the search speed by simplifying programming through matching variables (phenotype) and genes (genotype) and eliminating the need for encoding and decoding processes required by binary-coded genetic algorithms (BCGAs).

A simulation was performed applying the proposed method to ship heading control, and the effectiveness was validated by comparison with a conventional linear PD controller based on a performance evaluation index derived from the perspective of propulsive energy loss.

## 2. Dynamic Model and Performance Index

The autopilot system is shown in Fig. 1 where has *ψ _{r}* the setting course,

*δ*the command rudder angle,

_{r}*δ*the actual rudder angle,

*r*the angular velocity of the heading,

*r*the disturbance that affects the angular velocity of the heading, and

_{d}*ψ*the current heading.

### 2.1 Ship motion and steering gear model

As mathematical models become more complex, it can describe physical phenomenons in more detail, but this requires more information about the parameters in the models. In this regard, response models that express a ship’s maneuvering motion as a relationship of a ship’s rotational motion to a given force (change of rudder angle), rather than hydrodynamic forces, are relatively simple and easy to apply because it only uses linear terms. The linear ship steering model for course control can be expressed by the transfer function in Eq. (1) with the SNAME coordinate system (Fossen, 2002).

where *T*_{1} and *T*_{2} are related to tracking and stability, and *T*_{3} is related to traceability. *K* is a coefficient related to the ship’s turning performance. By ignoring the roll angle (*ϕ*) and pitch angle (*θ*) as *ϕ* = *θ* = 0[°], $\dot{\psi}=r$ is defined, and Eq. (1) can be expressed as follows.

As such, the equation of motion between the heading angle *ψ* and rudder angle *δ* is derived because it is easy to measure the heading angle when configuring the autopilot system. In addition, if the time constant related to course stability is defined as *T* = *T*_{1} +*T*_{2} -*T*_{3} , the equation can be expressed as an approximate equation as shown in Eq. (3).

The steering gear is generally expressed as the following first-order approximation model.

where, *δ _{r}* is the command rudder angle,

*δ*is the actual rudder angle, usually limited to the operating range of ∣

*δ*∣≤ 35[°]. The angular velocity of the rudder angle is also limited to $\left|\dot{\delta}\right|\le 3\sim 6\left[\xb0/sec\right]$.

*T*is the time constant of the rudder, generally 2.5 [sec].

_{E}### 2.2 Ocean wave model

Ocean waves make it difficult to control the heading angle of ships. Ocean waves are very irregular and random, so they are usually treated as random processes. Random wave spectrum is used to describe the internal energy distribution and intrinsic distribution characteristics of a wave in each wave unit. Among various idealized wave spectra, The Pierson-Moskowitz (PM) spectrum of two-parameter wave spectral formulation is widely used in ocean engineering. The linearized approximate response equation of wave disturbance on a ship is as follows (Fossen, 2002).

where, *y _{w}* (

*s*) is the wave motion,

*w*(

*s*) is zero-mean Gaussian white noise,

*K*the gain of the wave spectrum,

_{w}*ω*the peak of the wave period and

_{p}*λ*the damping factor.

By defining state variables ${x}_{w1}={\displaystyle \int {y}_{w}dt}$ and ${x}_{w2}={y}_{w}$, Eq. (5) can be expressed as the following state equation.

where, *x _{w}*

_{1}and

*x*

_{w}_{2}are wave states, and

*u*is zero-mean Gaussian white noise.

### 2.3 Performance evaluation

When ships are course keeping with automatic steering in the ocean, the ships are disturbed by wind and waves and subjected to irregular yaw motion. Irregular yaw motion is a combination of many regular components, so a performance evaluation index of an autopilot system for irregular yaw motion can be obtained by deriving a performance evaluation index based on the assumption that the ship is performing regular yaw motion at random frequency. Based on the coordinate system representing the ship’s maneuvering motion and the motion equation in the x-axis expressed as a motion variable, an approximate forward speed (surge) motion equation for the ship can be obtained by considering the ship’s motion in course keeping according to the steering commands of the autopilot system. The performance evaluation index for irregular yaw motion (Sohn et al., 1995) is as follows.

where, $\overline{{\psi}^{2}},\overline{{{r}^{\prime}}^{2}},\hspace{0.17em}\text{and}\hspace{0.17em}\overline{{\delta}^{2}}$ are the square means of *ψ* , *r*′, and *δ*, respectively. The values of *a*′_{rr}, *a*′_{VV}, and *a*′_{δδ} can be obtained from the ship’s hydrodynamic force coefficient, which may differ depending on the type of ship.

The first term on the right-hand side of Eq. (7) represents the energy loss due to the increased route, and the second term represents the energy loss due to the components in the fore-and-aft direction of centrifugal force by angular velocity. The third term shows the energy loss due to the components in the fore-and-aft direction of the rudder normal force by steering.

## 3. LADRC for Heading Angle Control

A general PID controller is an error-based feedback control system that consists of a linear combination of the error *e*(=*y _{r}* -

*y*) between the setting value (

*y*) and the output of the plant (

_{r}*y*), a derivative term that is proportional to the derivative of the error

*de*/

*dt*, and an integral term that is proportional to the integral of the error ${\int}_{0}^{t}e\hspace{0.17em}dt$.

When the model of the system is given, PID controller gains can be found easily by systematic analysis or trial and error. There are fundamental limitations to general PID controllers with such simplicity and ease of tuning, and this is even more noticeable in cases where the performance of more demanding control systems are required. To be more specific, PID controllers have four fundamental difficulties. 1) The control signal jumps suddenly to obtain an output that follows most of the settings entered in a stepwise ways, which is not suitable for most dynamic systems. 2) PID controllers are often implemented without derivative terms due to the effects of noise. 3) The sum of the weights in Eq. (8) is simple, but may not be the best control based on the current and past errors, and the rate of change of the errors. 4) The integral term is significant for removing steady-state errors, but other difficulties arise, such as saturation and reduced stability margins due to phase delay (Han, 2009).

### 3.1 Transient Profile

If the setting values are given in a stepwise manner, the control signal suddenly increases (or decreases) due to the difference from the current output and affects the plant. This is not suitable for most dynamic systems because dynamic systems must accommodate these sudden changes and must be physically durable. Consider the Transient Profile (TP) to ensure that the plant’s output tracks the setting values at an appropriate level (speed).

All ships have high inertia, so a TP in the form of a second order filter as shown in Eq. (9) is generally applied to control the heading angle of a ship. This increases the stability of the heading angle control system and changes the setting values smoothly (Chen, 2019).

where, *ζ* and *ω _{n}* are parameters describing the motion of the system, which are set to

*ζ*=1 and

*ω*=0.03 in this study.

_{n}### 3.2 LADRC design

Consider the second-order plant of Eq. (10).

where, *y* is the output, *u* the input, and *w* the disturbance. Parameters *a*_{1} and *a*_{2} are unknown internal parameters. However, *b* can be divided into *b*_{0} which is known to some extent and *∆b* uncertain part, and substituting them into Eq. (10) becomes as follows.

where, $f=-{a}_{1}\dot{y}-{a}_{2}y+w+\Delta bu$ is regarded as generalized disturbance because it represents both the unknown internal dynamics $-{a}_{1}\dot{y}-{a}_{2}y+\Delta bu$ and the disturbance *w* (Han, 2009).

The control goal in Eq. (11) is to make output *y* move as desired using input *u*, the manipulated variable. There is no need to analyze *f* mathematically. In the context of feedback control, *f* is an object that must be overcome by the control signal, and this is considered as the total disturbance of the system. In this case, Eq. (11) is converted from a system identification problem to a disturbance removal problem. Eq. (11) becomes Eq. (12) by obtaining an estimate $\widehat{f}$ of the total disturbance *f* and using the control law *u*.

In terms of the plant of Eq. (11), by setting *x*_{1} = *y* and ${x}_{2}=\dot{y}$, adding state variable *x*_{3} = *f*, and considering $h=\dot{f}$ as an unknown disturbance, the extended state equation can be expressed as follows.

The LESO (Linear Extended State Observer) for Eq. (13) consists of Eq. (14).

where, *L* is the observer gain vector obtained by the pole placement method.

Then, the total disturbance *f* can be estimated using Eq. (14).

If the state observer is designed correctly and the estimation error *z*_{3} is ignored, Eq. (12) can be expressed as Eq. (15) below.

Eq. (15) can be easily controlled by Eq. (16).

where, *y _{r}* is the setting value. -

*k*

_{2}

*z*

_{2}is used instead of ${k}_{2}\left({\dot{y}}_{r}-{z}_{2}\right)$ to avoid the derivative of the setting value and to make the second order transfer function Eq. (17) with no zeros in the closed loop transfer function.

where, *ω _{c}* is the desired closed loop natural frequency and

*ζ*is the desired closed loop damping ratio selected to avoid oscillation.

A LADRC that actively compensates for disturbances can be implemented by combining the controller represented by Eqs. (15) and (16) with the LESO Eq. (14). A LADRC is a special ADRC first proposed by Han (2009).

## 4. Simulation Results and Review

The ship to apply the RCGA-based LADRC was set as an ore carrier (length: 247 [m]) sailing at a speed of 17.0 [knot]. Table 1 shows the characteristic coefficients that make the motion equations for each non-dimensional model for simulation and the coefficients for Eq. (7) to evaluate the performance of the automatic steering system.

Fig. 2 shows a block diagram for tuning LADRC control gains *k*_{1} , *k*_{2}, ${\mathcal{l}}_{1},{\mathcal{l}}_{2},{\mathcal{l}}_{3}$, and *b*_{0} using RCGAs.

Optimal tuning of LADRC-related gains was performed by using RCGAs and minimizing the ITAE index Eq. (18).

where, *ψ _{r}* is the setting course and

*ψ*the current course.

*t*is a time enough for subsequent integrals to be ignored.

_{f}### 4.1 Tuning of LADRC

The control variables of RCGAs used to search for gains are the population size (20) through a random method using a random number generator, reproduction coefficient (1.8) from a gradient-like reproduction, crossover probability (95%) from a modified simple crossover, and mutation probability (20%) by a dynamic mutation. This study also used linear scaling and elitism strategies to enhance the search performance.

The search range for unknown gains was set to 0≤*k*_{1}≤ 10, 0≤*k*_{2}≤50, 0≤${\mathcal{l}}_{1}$≤10, 0≤${\mathcal{l}}_{2}$≤50, 0≤${\mathcal{l}}_{3}$≤1, and 0≤*b*_{0}≤1. The initial yaw angle of the ship starts at 0[°], and the gains are tuned to minimize the objective function Eq. (18), while changing the target course angle 0[°]→60[°]→0[°]→ -60(300)[°]→-100(260)[°]→0[°]→60[°]. The LADRC control gains, tuned by RCGAs, are *k*_{1}=1.5030, *k*_{2}=47.3350, ${\mathcal{l}}_{1}$ =2.0300, ${\mathcal{l}}_{2}$=36.3760, ${\mathcal{l}}_{3}$=0.0090, and *b*_{0}=0.0760.

The control gains of the PD controller to be compared with LADRC were also tuned by RCGAs under the same conditions as when searching for the LADRC gains, and [*k _{p}*,

*k*] are [392, 12616].

_{d}### 4.2 Ship heading control simulation

The controller gains were tuned using Eq. (3), an approximate model, and the model of Eq. (2) was used in the simulation. The proposed LADRC control system in this study for ship heading control is shown in Fig. 3.

Fig. 4 shows the process of changing the heading angle from 0[°] to 60[°] to examine the transient response characteristics of the LADRC and PD controller to change the setting course. Table 2 summarizes the transient response characteristics and the propulsive energy loss calculated by the performance evaluation index Eq. (7) of the ship’s autopilot system. The LADRC follows the setting course that changes in a curved form by the TP, and the rudder operation is relatively smoother and it operates fewer times than the PD controller. As a result, much less propulsive energy loss than the PD controller is shown significantly by the LADRC.

Fig. 5 shows the transient response characteristics of the modeling errors and the internal uncertainties of the plant. The modeling errors of the plant to be controlled were *T*_{1}*(+10%), *T*_{2}*(-10%), *T*_{3}*(+10%), *K**(-10%), and *T _{E}**(-10%), and the ship speed was changed to 13.6 [knot], -20% of 17 [knot]. Table 3 summarizes the transient response characteristics and propulsive energy loss.

Although not shown in the paper, the response depending on the effect of unexpected each modeling errors among the internal uncertainties tracked the setting course with similar trends to the results in Fig. 4. In addition, the PD controller gains need to be adjusted again because the propulsive energy loss changes rapidly as change of the specific ship speed. Fig. 6 shows the simulation results for course changing 0[°] →60[°] and course keeping 60[°] when the environmental disturbance affects the angular velocity under the assumption that there are no modeling errors.

Environmental disturbance includes wind 11.8 [m/s] and wave height 3 [m], and Gaussian noise N(0, 0.005) is entered in *u* of Eq. (6). The LADRC tracks the setting course, but the PD controller does not, and the rudder continues to operate near the maximum rudder angle of 35[°]. The propulsive energy loss is 398.9 for the LADRC and 1611.0 for the PD controller, showing a significant difference.

Fig. 7 shows the response when there is Gaussian noise N(0, 0.001) in the yaw angle measurement sensor under the assumption that there are no modeling errors. The LADRC tracks the setting course even when there is measurement noise, but the PD controller has a relatively larger course error than the LADRC.

## 5. Conclusion

In controller design, focusing too much on setting value tracking performance results in poor disturbance reject performance, and vice versa, so there is a need for some compromise between each other. Ships are constantly subjected to various disturbances and uncertainties on the service voyage, so this study proposed a LADRC design method that focuses on improving disturbance elimination performance for ship heading control. The gains of the controller in the LADRC with linear extended state observer were adjusted by RCGAs to minimize the ITAE which is the objective functions. As a result of applying the proposed method to ship heading control, performing simulation, and evaluating it based on the performance evaluation index derived from the perspective of propulsive energy loss, the proposed method showed significantly improved results compared to the PD controller. In particular, when there are environmental disturbances (such as wind and wave) and sensor noise, the PD controller does not track the setting course well, but the proposed method tracks the setting course in a satisfying manner. Although not shown in the paper, the proposed controller also deviates from the setting course when there is more than a certain amount of noise and disturbance, and further studies should be performed in the future to minimize the effect of such noise and disturbance.