1. Introduction
Maritime transport safety has become an important factor restricting the rapid development of the shipping industry [
1]. In addition to the burning process of the ship’s main engine and auxiliary engine, a large number of pollutants will be produced, affecting the safety of maritime transportation [
2]. Ship course control is also the main content of maritime transportation security, and the intelligent development of control systems is the main trend of navigation technology development. For ocean-going ships, course control is essential to enhance maritime traffic safety, especially in the era of autonomous ships [
3].
The traditional controller is considered an effective way to realize ship course keeping. The common method is proportional–integral–differential (PID) control. Mochammad S et al. [
4] proposed a ship control system using a PID controller, realized the parameter identification algorithm of the control system based on gradient approximation, and achieved good ship maneuverability. Sutulo S et al. [
5] proposed a conventional PID controller for course keeping. In the range of water depth, lateral distance, and speed, the hydrodynamic interaction and maneuvering speed response of two ships during overtaking are simulated. When the ratio of water depth to the ship’s draft depth is less than 2.0, the PID controller is still effective for overtaking boats. Bayezit L et al. [
6] proposed a strategically coupled system based on a sensor model and PID controller for course angle control to understand the motion dynamics of ocean vessels and demonstrated the practical feasibility of the system through the “vehicle in the loop” test, demonstrating its potential to improve the efficiency of recreational ocean navigation.
Conventional PID controllers are not robust to external interference, in contrast to fraction-order controllers, sigmoid PID controllers, BELBIC PID controllers, and multi-node hormone neuroendocrine PID controller, which have received attention. Liu L et al. [
7] proposed an FOPID controller based on the three-dimensional stable region analysis method, which improved the robustness of the title control of unmanned ships. Although the robustness of the controller has been improved to some extent, the complexity of determining the parameters of the FOPID controller results in a long control response time, which is obviously insufficient in the face of transient title control situations. Suid MH et al. [
8] proposed the parameters of the SPID controller obtained using an enhanced self-tuning heuristic optimization method called the nonlinear sine-cosine algorithm (NSCA) to achieve a better dynamic response. TAO S et al. [
9] used (BELBIC PID) to control the heading of autonomous ground vehicles. Then, in order to achieve better path tracking performance and drive stability, the PSO algorithm was used to optimize the parameters, and the results were good. To sum up, the PID controller has the characteristics of a simple structure in the control field, but it needs manual adjustment of parameters and has poor adaptability.
In order to improve the shortcomings of PID control, robust controllers are introduced into this topic. Muzammal M et al. [
10] proposed nonlinear control algorithms based on variable structure, namely integral sliding mode, double integral sliding mode, terminal sliding mode, and super spiral sliding mode controller. The controller switches between different control laws depending on the system state, ensuring robust performance in different sea conditions. Hosseinabadi P et al. [
11] designed a new finite-time robust controller for ship heading (heading) control systems with unknown mismatched external disturbances and uncertainties. A fuzzy adaptive finite time sliding mode control (FAFSMC) scheme is proposed. By combining the concept of fuzzy controller, adaptive time stability, and sliding mode control (SMC) scheme, the advantages of these two schemes are utilized and the shortcomings of single applications are compensated. Rezaei A et al. [
12] designed an adaptive fractional-order sliding mode controller (AFOSMC) to reduce the adverse effects of ship roll motion. Through this adaptive control method, the designed controller is robust to the ship’s lateral motion mechanics and the uncertain parameters in the fin actuator. Xu Y et al. [
13] designed a global fast terminal synovial controller to track and compensate ship heave motion data. The results show that the tracking compensation effect of the improved sliding mode controller is better than that of the traditional PID control, and the tracking error is smaller than that of the traditional PID control when the improved sliding mode controller is introduced. Global fast terminal sliding mode control has good robustness and can be used in a ship heave compensation system. To sum up, the course control accuracy and stability of the robust controller are stronger, but it lacks intelligence.
In the current field of course control, in order to assist ship driving more safely, effectively reduce the danger to the crew, and improve the efficiency of maritime traffic [
14], intelligent controllers are widely concerned. Both artificial neural network control and fuzzy control belong to intelligent control. NIM N et al. [
15] developed a nonlinear autoregressive model based on a neural network by combining an artificial neural network with fuzzy logic control. The results show that the two-wheeled wheelchair system combining fuzzy logic control and a neural network can improve the stability and performance. Aghaseyedabdollah M et al. [
16] proposed a fuzzy adaptive synovial control scheme for cable robots. In the proposed scheme, the intelligent method is combined with the traditional synovial control to achieve the optimal adjustment of control parameters. Arifi A et al. [
17] proposed an ASP modeling and control method based on Takagi–Sugeno (TS) and successfully implemented the method for carbon removal. The results show the effectiveness and superiority of the proposed control method based on TS fuzzy for dealing with complex and nonlinear biochemical processes. Han B et al. [
18] proposed an improved fuzzy control method based on the integrated line-of-sight (ILOS) guidance principle in order to meet the needs of autonomous navigation and high-precision ship trajectory control. Simulation results show that the algorithm has good following performance and can maintain smooth rudder angle output. The research results provide a reference for ship path tracking control. Li Y et al. [
19] proposed a berthing decision method for very large ships based on fuzzy logic. The research results provide theoretical and practical insights for the development of human-like decision-making methods for autonomous navigation in port waters and maritime safety management in the shipping industry. The model can also be further applied to develop more widely applicable autonomous navigation decision systems in narrow waters. Du L et al. [
20] proposed a model combining a computational fluid dynamics solver (ANN) to calibrate the efficiency and precision weights in high-dimensional problems of ship resistance optimization. The adaptive mechanism of the model reduced the calculation cost from 1638 min to 456 min, and the optimization efficiency increased by 72.16%. The results show that the proposed adaptive mechanism can dynamically rebalance the efficiency and accuracy of the framework and provide theoretical and technical support for ship design optimization. Unar S et al. [
21] proposed an artificial neural network controller for course and position control systems and selected a mathematical model with four effective thrusters to test the performance of the proposed controller. Rohit D et al. [
22] proposed a deep Q-learning method based on an artificial neural network to solve the ship heading control problem. This method can make optimal decisions based on sufficient learning experience and realize the interaction between the numerical model and waypoint tracking. Wakita K et al. [
23] proposed a system identification method using recurrent neural networks and free-running model testing to generate a low-speed maneuvering model, paying special attention to low-speed maneuvering in the last stage of berthing, so as to achieve automatic berthing course control. The results show that this method can accurately represent the low-speed motion of the ship. Bouaiss O et al. [
24] proposed a novel nested control strategy based on adaptive radial basis function neural networks (RBFNNs) and embedded integrators (IBS) for neural network supervised control to reduce modeling uncertainty, perceived noise, and external bounded interference, with robustness and effectiveness superior to PID controllers. Zhao et al. [
25] used radial basis neural networks to compress unknown system terms and external disturbances into unknown parameters, aiming at the problem of course control and maintenance with unknown environmental interference and model uncertainty. Finally, numerical simulation verified the effectiveness of the algorithm. Le et al. [
26] studied the application of artificial neural networks in ship heading control systems. A two-layer multi-layer feedforward neural network heading control system is proposed. The simulation results show that the course control system can maintain the predefined direction under various sea conditions, and the proposed method can be used to develop and apply the design of a real ship automatic driving system. To sum up, the combination of neural networks and fuzzy logic control can effectively resist the interference of the external environment. It has stability and generalization. This kind of controller meets the requirements of current navigation practice.
ANFIS combines the advantages of artificial neural networks (ANNs) and fuzzy inference systems (FISs). This hybrid control has the advantages of both neural network and fuzzy inference algorithms to achieve better control performance [
27]. Compared with the sigmoid PID controller, BELBIC PID controller, and other PID controllers mentioned above, the ANFIS controller can automatically adjust fuzzy rules and parameters through training data, and has strong learning ability without manual intervention. The sigmoid PID controller lacks adaptive learning ability and requires manual parameter adjustment. Although the BELBIC PID controller has certain adaptability, its learning mechanism is relatively complex and depends on the accuracy of the motion model. Therefore, the ANFIS controller can automatically adjust the control strategy by combining fuzzy rules and a neural network to adapt to different sea conditions and ship states. This integration enables the handling of intricate nonlinear relationships, enhancing control accuracy and robustness while maintaining ship course stability in complex maritime environments.
PID controllers require manual adjustment of parameters and cannot control complex nonlinear models. Robust controllers (SMC) are very sensitive to parameter selection, and small changes in parameters can lead to significant changes in controller performance. Therefore, using an ANFIS controller can overcome the shortcomings of the previous two.
In this study, the ANFIS controller based on the MMG model realizes stable ship course control. Rudder angle and propeller speed are used as input parameters to analyze the response performance of the controller. The main contributions can be summarized as follows:
(1) By establishing an MMG model considering the influence of waves, the accuracy of the MMG model is verified by the rotating circle test of the self-propelled model. A large amount of training data comes from a linear control system based on the MMG model, which takes propeller speed and rudder angle as two control inputs and yaw angle speed as the control output. After training, ANFIS takes the difference between the actual course and the expected course, yaw angular speed as input, and rudder angle as output. Course control is executed under both normal and adverse sea conditions. The effectiveness of the proposed ANFIS controller is verified. The MMG model and ANFIS controller can accurately describe the ship’s motion characteristics and provide a reliable theoretical basis for the design and verification of the ship’s course controller.
(2) By combining the learning ability of a neural network and the reasoning ability of fuzzy logic, a heading controller without manual parameter adjustment is designed. This kind of controller can realize the effective and high-precision control of the desired course and improve the automation level of ship course control.
(3) Simulation tests are carried out under normal sea conditions and bad sea conditions, and the results show that the ANFIS controller is superior to the traditional linear controller in course control performance. In normal sea conditions, the ANFIS controller is able to maintain course with greater accuracy, despite consuming slightly more energy. In harsh sea conditions, the ANFIS controller automatically obtains the best control response through the learning ability of the neural network, showing better robustness. Finally, the influence of propeller speed variation on ship course and rudder angle response is analyzed, which provides theoretical support for ship control in actual sailing.
3. Adaptive Neuro-Fuzzy Inference System
The adaptive neuro-fuzzy inference system aims to integrate the fuzzy inference system, which is built on the Takagi–Sugeno model’s characteristics and structure, with the learning abilities of neural networks. The Takagi–Sugeno model is a valuable tool for modeling uncertain systems, especially for approximating nonlinear functions and complex dynamic processes.
ANFIS has garnered interest for its innovative approach to system modeling, effectively mapping intricate relationships between input and output data through the integration of learning data and adjustments to membership functions and fuzzy rule parameters. This process involves a neural network-like structure, where the parameters of the fuzzy controller are iteratively optimized based on feedback until the control effect meets a predetermined standard. ANFIS shows promising potential in ship heading control applications.
Figure 3 shows the structure of the ANFIS control system based on the MMG model. The ANFIS controller calculates the rudder angle correction instruction according to the deviation between the set course and the actual course, and the instruction acts on the ship through the actuator to adjust the course. The MMG model simulates the dynamic response of a ship under the action of rudder angle and considers the influence of wave interference on ship motion. System outputs, including swing distance and heading, are displayed graphically to facilitate analysis of the ship’s navigational performance. The purpose of the entire system is to keep the ship’s course stable by automatically adjusting the rudder angle, even in the case of external disturbances such as waves.
The training data [
Y1,
Y2,
Y3] were added to the MATLAB working area. When the training period was set to 50 times, the convergence state was finally presented, and the training error was about 0.04°, as shown in
Figure 4, indicating that the accuracy of the training process was satisfactory.
3.1. ANFIS Ship Heading Controller Structure
The ship’s control system operates through a range of sensors, such as gyroscopes, heading sensors, speed sensors, rudder angle sensors, and wave sensors. The sensor feeds some data into the controller and then outputs it.
The ANFIS described in this study is a feedforward fuzzy neural network consisting of 5 layers, as illustrated in
Figure 5. It incorporates artificial neural network elements into a fuzzy neural system to create an artificial neural network and applies the learning algorithm of artificial neural networks to derive the inference rules of the fuzzy system.
Layer1: Input variable layer, the two input variables are the heading error and the head angular velocity . The first layer simply transmits the input values to the next layer.
Layer2: The input language layer is responsible for fuzzifying the input signal using two input languages ε and r, corresponding to membership functions μA1(x), μA2(x), μA3(x) and μB1(x), μB2(x), μB3(x), respectively. Each square neuron node represents a membership function, and the output of the fuzzification layer is the corresponding membership function. Data clustering technology is utilized to analyze sample data and determine the clustering center of input variables, leading to fuzzy partitioning based on the clustering results.
Layer3: The excitation intensity of each rule is calculated by controlling the rule layer and applying the formula , where i ranges from 1 to 3. In this system, 9 Sugeno-type reasoning rules are designed. The rule structure is defined as follows: if ε corresponds to mf1 and r also corresponds to mf1, then δ = wk, where k spans from 1 to 9.
Layer4: The output language layer represents the language value of the controller’s output language variable. The front end of the output language layer is the normalized result of all rule strengths and then calculates the output of each rule ui. Each neural network node corresponds to a specific membership function, which is responsible for delineating the fuzzy boundaries of the language value. It is worth noting that the membership function used adopts the Sugeno model, which is a first-order linear function. This is because of the efficient performance of the Sugeno model. In model construction, if the preconditions are fuzzy, the subsequent results will be clear quantities to ensure the output results’ accuracy and reliability.
Layer5: Output variable layer, representing the output variable value of the controller.
3.2. ANFIS Ship Heading Control Optimization Algorithm
In this study, the backpropagation learning algorithm was integrated with the least square method to optimize control parameters using the time backpropagation algorithm, resulting in a hybrid learning algorithm for ANFIS.
The network adjusts its internal parameters by comparing the output with the expected trajectory in each period and fine-tunes itself through error feedback to learn and approximate the desired model behavior. Jang introduced an adaptive neuro-fuzzy inference system by integrating time-backward propagation (TBP), enhancing the traditional backward propagation (BP) learning algorithm. By training the neural network with the TBP mechanism, the controlled system’s output can be more effectively guided to accurately track the desired path, leading to a significant enhancement in control system performance. The learning process of the ship heading ANFIS control system using the TBP learning algorithm is illustrated as a closed-loop dynamic simulation behavior in
Figure 6. The optimization criterion is to minimize the control performance metric, which is usually expressed as the error between the actual heading and the desired heading.
In
Figure 6, Δ represents the time shift factor,
denotes the heading command, the desired trajectory is formed based on the set heading
, and all
is stored to create the actual motion trajectory. The expression of the closed-loop control performance index is an optimization function, as shown in Equation (23). The consequent parameters {
pAk,
qBk,
p0k} of the Sugeno-type fuzzy rule in ANFIS are determined through the learning law provided by the BP algorithm, as shown in Equation (24).
Utilizing Equation (24) of the TBP algorithm to optimize the parameter ai, the ANFIS controller can be updated with these parameters and subsequently applied in the next control cycle.
ANFIS’s TBP parameter optimization algorithm consists of two main processes: forward calculation and reverse calculation. The forward calculation process addresses the storage and accumulation of data needed for learning through direct calculations, while the reverse calculation process utilizes the TBP algorithm to adjust parameters.
- (1)
Forward calculation of ANFIS
Layer1: The first layer determines that the two inputs are, respectively, the deviation
ε between the ship’s current course and the expected course and the heading angular speed
r.
Layer2: The generalized bell-shaped membership function is determined by the parameters
a,
b, and
c in Formula (26), with
a and
b typically being positive values. The parameter
c is utilized to specify the center of the curve.
Layer3: Calculate the excitation intensity of each rule, as depicted in Equation (27). Subsequently, normalize each excitation intensity to obtain Equation (28).
Layer4: The fourth layer is the output of fuzzy rules. The output of each rule is a linear combination of input variables.
Layer5: The output is the command rudder angle given by the ANFIS autopilot, which is affected by the consequent parameters {
pi, qi, p0k}.
- (2)
Reverse calculation of ANFIS
During a sampling period, the parameters in Equation (24) are represented with simplified symbols:
,
,
,
,
,
,
,
,
,
.
From Equation (33), Equation (34) can be derived.
By comprehensively applying Equations (23) to (34), we can solve the problem of updating the controller consequent parameters {pAk, qBk, p0k}.
To sum up, the ANFIS structure shown in
Figure 5 needs to be learned based on the TBP learning algorithm. The control object is the MMG model, which constitutes the control system shown in
Figure 2.
6. Conclusions
The three-degree-of-freedom MMG model was adopted and verified by the data of the S175 free model turning circle. In order to achieve efficient and stable course control performance, the ANFIS controller is designed by combining the backpropagation algorithm and the least square method. The MMG model is controlled by the linear control method and the ANFIS method, respectively, in normal sea states and bad sea states. Heading error, output rudder angle, and yaw angular speed in the linear controller are the training data sources of ANFIS. ANFIS trains and controls the MMG model through the powerful learning ability of the neural network, simulating and analyzing the performance of the two controllers.
In normal sea conditions, for course control performance, ANFIS can output the correct course trajectory according to the input rudder angle of the MMG model, and Aψ is lower than the linear controller, which has stronger course stability performance and faster response speed. The maximum output rudder angle of the ANFIS controller is greater than that of the linear controller, and the energy-saving effect is slightly weaker than that of the linear controller.
In harsh sea conditions, the ANFIS controller achieved an I delta improvement of nearly 16% and 13%, respectively, over the linear controller, both on the left and right rudder, while maintaining excellent course stability. On the premise of keeping the propeller speed unchanged, different control performance can be obtained by manually adjusting the performance parameter λψ in the linear controller to meet different engineering requirements. It is worth mentioning that the ANFIS controller can rely on the strong learning ability of the neural network to control whether the desired course is a large course (ψ = 120°) or a small course (ψ = 60°), it can maintain course stability and improve energy efficiency, even in harsh sea conditions. This is achieved without the need to manually adjust parameters and has significant advantages over traditional linear control methods. Keeping the performance parameters and the environment unchanged, changing only the propeller speed can improve the control performance of the controller, and the maximum steering angle does not change with the speed. The ANFIS-based course controller offers a promising ship course control scheme that strikes a balance between energy efficiency and control performance. Its adaptability and robustness make it suitable for engineering applications, with the potential to lead to safer, more economical, and environmentally friendly navigation practices.
Currently, our research focuses on the motion response performance of ships with three degrees of freedom. The number of degrees of freedom will be increased in the future to more accurately describe the motion of ships in complex sea conditions. Considering the coupling effect of wind, wave, current, and other environmental factors, the structure number of the controller and the accuracy of the model are further improved.