Next Article in Journal
Application of Phase-Selective Organogelators (PSOGs) for Marine Oil Spill Remediation
Previous Article in Journal
Robust Optimization Design for Path Planning of Bionic Robotic Fish in the Presence of Ocean Currents
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Real-Time Weight Optimization of a Nonlinear Model Predictive Controller Using a Genetic Algorithm for Ship Trajectory Tracking

College of Mechanical and Electrical Engineering, Qingdao University of Science and Technology, Qingdao 266061, China
*
Authors to whom correspondence should be addressed.
J. Mar. Sci. Eng. 2022, 10(8), 1110; https://0-doi-org.brum.beds.ac.uk/10.3390/jmse10081110
Submission received: 6 July 2022 / Revised: 28 July 2022 / Accepted: 31 July 2022 / Published: 12 August 2022
(This article belongs to the Section Ocean Engineering)

Abstract

:
This paper presents a weight optimization method for a nonlinear model predictive controller (NMPC) based on the genetic algorithm (GA) for ship trajectory tracking. The weight coefficients Q and R of the objective function in NMPC are obtained via the real-time optimization of the genetic algorithm instead of the trial and error method, which improves the efficiency and accuracy of the controller. In addition, targeted improvements are made to the internal crossover operator, mutation operator, crossover rate, and mutation rate of the genetic algorithm. The simulation comparison of trajectory tracking between NMPC with real-time-optimized weight coefficients and the one with constant coefficients is performed. Finally, the simulation result shows that the controller with real-time-optimized weight coefficients has a better trajectory tracking effect than that with constant weight coefficients.

1. Introduction

With the rapid development of deep-sea applications, ship automatic control has received unprecedented attention. Trajectory tracking is one of the key technologies used in ship intelligent control. Therefore, the research and design of trajectory tracking control to ensure the accurate tracking of the desired trajectory plays an important role in the safe and effective implementation of marine engineering applications [1,2,3].
Relevant scholars have made many efforts and achievements in the field of ship trajectory tracking control. Katayama and Aoki [4] used the characteristics of the Euler approximation model of ship dynamics to design a reduced order observer and output feedback controller, which can effectively track a preset straight-line trajectory. Qu et al. [5] proposed an unmanned ship exponential tracking controller based on an observer to estimate external disturbances and system uncertainties, with the controller able to ensure exponential convergence and strong robustness. Liu et al. [6] improved the nonlinear robust control algorithm based on sliding mode control theory to simulate the maneuverability of the surface ship.
However, the above control methods cannot take the system input constraints directly into account due to the physical limits of the thrusters. Considering that the model predictive control (MPC) has a superior ability to establish constraints on optimization problems, it has been widely used in various fields, such as semiconductor, energy, and aerospace, to achieve advanced control [7,8,9,10]. In the field of marine vessel control, Oh and Sun [11] combined the LOS guidance algorithm with MPC to implement the tracking control in the presence of input constraints. Li and Sun [12] proposed a new disturbance-compensated MPC algorithm for ship heading control. Kapetanović et al. [13] proposed applied linear model predictive control (LMPC) for the trajectory tracking of underactuated ships under disturbance and input constraint saturation. Furthermore, since ship dynamics is highly nonlinear, in order to improve the control performance, it stimulates the development of nonlinear model predictive control (NMPC) [14]. Abdelaal et al. [15] proposed a combined NMPC for the position and velocity tracking of underactuated surface vessels. Yang et al. [16] designed a robust NMPC scheme based on a nonlinear disturbance observer for the trajectory tracking control of a dynamic positioning ship.
It can be seen from the above research that NMPC can perform well for trajectory tracking. However, in traditional NMPC, the most important parameters of weight coefficients in objective function are generally obtained through trial or experience, which is time-consuming and easily falls into local optimization. Therefore, many studies have been conducted for the optimal weight tuning of model predictive control. Based on the real-time weight adjustment strategy, Zhao et al. [17] designed a spacing control law for the adaptive cruise control system, which can adjust the weight coefficient according to actual output demand. In addition, the development of intelligent algorithms also provides good ideas for this. For example, the genetic algorithm (GA) is combined with NMPC for parameter optimization because of its superior characteristics of global optimization [18]. In addition, Ramasamy et al. [19] used GA to determine the MPC weights to minimize overall energy utilization, reduce tracking error, and realize optimal control of the cement kiln. Essa et al. [20] adopted the combination of the Rhododendron search algorithm and GA to adjust the weight coefficients of MPC, and gained strong stability and robustness in the electro-hydraulic servo system. Zhang and Zhuan [21] proposed an improved genetic algorithm of the variable chromosome length coevolution method to optimize the weight matrices Q and R in the electromagnetic isolation system, and received better damping performance.
Aiming to improve the optimization performance of GA, the crossover operator and mutation operator have been improved upon in many studies. For example, Tang and Tseng [22] proposed an adaptive directed mutation operator, which can enhance the global search ability and accelerate the convergence of GA by integrating local directional and adaptive random search strategy. Chuang et al. [23] proposed the use of the direction-based crossover operator and the dynamic random mutation operator. The crossover operator uses the ranking information of chromosome fitness value in the population to generate offspring chromosomes. The mutation operator generates new chromosomes through an adaptively adjusted mutation step and random disturbance vector. However, the crossover operators cannot effectively produce offspring in some specific areas where the initial population is located, which reduces the performance of the algorithm. For the mutation operators, due to their random variability, on the one hand, the optimal solution of the current population may be mutated, thus destroying the optimal solution. On the other hand, it may not make any mutation to the worst solution, which cannot improve the population diversity. In addition, the crossover rate and the mutation rate are two important control parameters in GA, and their values affect the convergence of the algorithm. The traditional determination method is to take a constant value according to the results of many experiments, which cannot ensure the algorithm to finally converge to the global optimal solution.
On the basis of the above analysis, this paper proposes a novel real-time weight optimization method of a nonlinear model predictive controller using a genetic algorithm for ship trajectory tracking, and the main contributions are as follows:
(1)
NMPC is applied to the ship trajectory tracking control, and the genetic algorithm is used to optimize the weight coefficients of the objective function in NMPC in real time;
(2)
The crossover operator, mutation operator, crossover rate, and mutation rate in the genetic algorithm are improved to enhance the performance of the genetic algorithm.
The rest of the paper is organized as follows: Section 2 introduces the structure of NMPC for ship control. Section 3 puts forward the GA-based real-time weight optimization algorithm of NMPC. In Section 4, simulations are conducted and results are discussed. The last section gives the conclusions.

2. Nonlinear Model Predictive Control for Trajectory Tracking

2.1. Ship Mathematical Model

For surface ships, the heave, pitch, and roll motions are neglected, and only the horizontal motions of surge, sway, and yaw need to be considered. According to Fossen [24,25], the inertial earth-fixed frame and the body-fixed frame attached to the moving vessel are constructed to build the nonlinear mathematical model of a surface ship as:
η ˙ = J ( ψ ) ν ,
M ν ˙ = D ν + τ + J T ( ψ ) d ,
where η = [ x , y , ψ ] T represents the ship’s position and heading vector in the inertial earth-fixed frame, ν = [ u , v , r ] T is the velocity vector in the body-fixed frame, J ( ψ ) is the transfer matrix, M is the mass matrix, including the added mass, and D is the damping matrix. These matrices are given as:
J ( ψ ) = c o s ( ψ ) s i n ( ψ ) 0 s i n ( ψ ) c o s ( ψ ) 0 0 0 1 ,   M = m X u ˙ 0 0 0 m Y v ˙ m X g Y r ˙ 0 m X g Y r ˙ I z N r ˙ , D = X u 0 0 0 Y v Y r 0 N v N r ,
In addition, τ = [ τ u , τ v , τ r ] T is the control force vector, composed of surge force τ u , sway force τ v , and yaw moment τ r , which are limited by the nonlinear saturation characteristic of the propeller:
τ min τ τ max ,
where τ min = [ τ u m i n , τ v m i n , τ r m i n ] T , τ max = [ τ u m a x , τ v m a x , τ r m a x ] T are the minimal and maximal force vectors, respectively, that can be provided by the thrusters. Furthermore, d = [ d 1 , d 2 , d 3 ] T refers to the unknown time-varying disturbance vector composed of wind, wave, and current environmental interference and model uncertainties.
Generally, the surface ship model can be expressed by the state-space equation as:
x ˙ ( t ) = A ( t ) x + B ( t ) u + Γ ( t ) d ( t ) , z ( t ) = C x ( t ) , t 0 ,
where x = [ x , y , ψ , u , v , r ] T is the state vector, u = τ is the control input vector, and z is the output vector. In combination with Equation (1), A ( t ) , B ( t ) , C ( t ) , Γ ( t ) can be expressed as:
A ( t ) = 0 3 × 3 J ( ψ ( t ) ) 0 3 × 3 M 1 D ) , B ( t ) = 0 3 × 3 M 1 , Γ ( t ) = 0 3 × 3 M 1 J T ( ψ ( t ) ) , C ( t ) = I 3 × 3 , 0 3 × 3 ,

2.2. Discrete-Time NMPC Scheme

In general, the NMPC scheme is designed based on the discrete-time model of the system. Therefore, referring to Zhu et al. [26] and Veerasamy et al. [27], the ship model (5) can be discretized utilizing a sampling time of T s as:
x ( k + 1 ) = A ( k ) x ( k ) + B ( k ) u ( k ) + Γ ( k ) d ( k ) , z ( k ) = C x ( k ) ,
where k is the current time step with regard to the current time t, x ( k ) = [ x ( k ) , y ( k ) , ψ ( k ) , u ( k ) , v ( k ) , r ( k ) ] T , u ( k ) = [ τ u ( k ) , τ v ( k ) , τ r ( k ) ] T , d ( k ) = [ d 1 ( k ) , d 2 ( k ) , d 3 ( k ) ] T , z ( k ) = [ x ( k ) , y ( k ) , ψ ( k ) ] T are corresponding vectors of the continuous-time model (5), and the discrete-time matrices A ( k ) , B ( k ) , as well as Γ ( k ) , can be determined at each time step as:
A ( k ) = e A ( t ) T s , B ( k ) = A 1 ( t ) ( A ( k ) I ) B ( t ) , Γ ( k ) = A 1 ( t ) ( A ( k ) I ) Γ ( t ) ,
For trajectory tracking, the control objective is to operate the ship by thrusters to track the predefined reference trajectory under external disturbances and input saturation constraints. That is, for a given reference trajectory z r = [ x r , y r , ψ r ] T , we need to determine the control input to make lim x z ( t ) z r ( t ) = 0 . Thus, the objective function of NMPC can be constructed as:
min U ( k ) V ( k ) = n = 1 N p ( z n ( k ) z r ( k ) Q 2 + u n ( k ) R 2 ) , s . t . x n + 1 ( k ) = A ( k ) x n ( k ) + B ( k ) u n ( k ) + Γ ( k ) d n ( k ) , n = 0 , , N p 1 , z n ( k ) = C x n ( k ) , n = 1 , , N p , τ min u n ( k ) τ max ,
where U ( k ) = [ u 0 ( k ) T , , u N c 1 ( k ) T ] T is the control input sequence in the control horizon N c , and Z ( k ) = [ z 0 ( k ) T , , z N p ( k ) T ] T is the predictive output sequence in the predictive horizon N p . Since N c is less than N p , it is assumed that, when N c n N p , u n ( k ) = u n 1 ( k ) . In addition, Q = d i a g ( q 1 , q 2 , q 3 ) and R = d i a g ( r 1 , r 2 , r 3 ) are weight matrices that are positive and definite matrices, which proportionally allocate the state vector and the input vector in the objective function (9).
Note that the system is nonlinear; thus, the system matrices are time-varying during the predictive horizon. However, since the navigation state of the ship changes slowly, it can be assumed that A ( k ) , B ( k ) , and Γ ( k ) remain unchanged during the prediction horizon. Therefore, the predictive outputs can be calculated like a linear model, and the nonlinear optimization problem will be transformed into a relatively simple quadratic optimization problem. Thus, the optimal control sequence U * ( k ) = [ u 0 * ( k ) T , , u N c 1 * ( k ) T ] T is obtained by optimizing the objective function (9), and the first value u 0 * ( k ) is substituted into the process.
The estimated value of disturbance is introduced into the online optimization calculation of NMPC, so as to eliminate the influence of disturbance and realize robust control. Based on Yang et al. [16], the calculation method of interference estimation value is as follows:
d ^ ( t ) = p ( t ) + L 0 J ( ψ ) M ν , p ˙ ( t ) = L 0 p ( t ) L 0 [ J ˙ ( ψ ) M ν + J ( ψ ) ( D ν + τ ) + L 0 J ( ψ ) M ν ] ,
where d ^ ( t ) is the estimate of d ( t ) , p ( t ) is an auxiliary state vector of the disturbance observer, and L 0 is a positive definite symmetric matrix. In addition, the predictive output sequence Z ( k ) can be obtained from Equations (7) and (8) as:
Z ( k ) = Ω x ( k ) + Φ U ( k ) + Λ O d ( k ) ,
where O d ( k ) = Γ ( k ) d ^ ( k ) , and:
Γ = C A ( k ) C A 2 ( k ) C A N p ( k ) , Ω = C C ( A ( k ) + I 6 × 6 ) C ( i = 1 N p 1 A i k + I 6 × 6 ) , Φ = C A ( k ) 0 0 C A ( k ) B ( k ) C B ( k ) 0 C A N c 1 ( k ) B ( k ) C A N c 2 ( k ) B ( k ) C B ( k ) C A N c ( k ) B ( k ) C A N c 1 ( k ) B ( k ) C ( A ( k ) + I 6 × 6 ) B ( k ) C A N p 1 ( k ) B ( k ) C A N p 2 ( k ) B ( k ) C ( i = 1 N p N c A i k + I 6 × 6 ) B ( k ) ,

3. Genetic Algorithm-Based Weight Tuning of NMPC

The weight coefficients in objective function (9) are very important for the NMPC online optimization calculation. If not selected properly, it will lead to a non-optimal solution, or even non-convergence. However, the weight matrices Q and R are usually determined by trial or experience, which is usually time-consuming and cannot be adjusted in real time with the change of control state to maintain the optimal solution [28]. Therefore, it is necessary to adjust the weight matrices Q and R online in real time to improve the control accuracy of NMPC. In this way, the adjusted parameters will have the direct physical significance of making the optimization process faster and the results more accurate [29]. Considering that the genetic algorithm (GA) has the characteristics of strong adaptability and automatic search [30], it is selected to optimize the weight matrices Q and R.

3.1. General Principle of GA

GA is a method of searching an optimal solution by simulating the process of natural evolution. It transforms the problem-solving process into a process that is similar to the crossover and mutation of chromosome genes in biological evolution. The main components of GA are fitness function, selection operator, crossover operator, and mutation operator, etc. Fitness function is an index that is used to judge the quality of individuals in the group. It is evaluated according to the objective function of the problem. The function of the selection operator is to screen out individuals with excellent genes for follow-up. The crossover operator refers to the operation of replacing and reorganizing some structures of two parent individuals to generate new individuals. The content of the mutation operator is to change the gene value on some loci of the individual string in the population.
Generally, when using GA to solve an optimization problem, a population composed of multiple individuals should be constructed first. Each chromosome of individuals in the population represents a feasible solution to the problem. Additionally, each solution is substituted into the fitness function to evaluate the fitness of the individual. The solutions with low fitness are gradually eliminated, and those with high fitness are added. Then, the next generation is generated through replication, crossover, mutation, and other operations. In this way, individuals with high fitness will be obtained after n generations of evolution; thus, a relatively accurate solution to the problem can be obtained.
Herein, to obtain online the optimal weight factors of the weight matrices Q and R in the NMPC objective function, the weight factors q 1 , q 2 , q 3 , r 1 , r 2 , r 3 can be continuously optimized in GA. To improve the solution efficiency, a novel GA algorithm is proposed, considering the actual needs of ship track control, and utilizing the improved crossover operator, mutation operator, crossover rate, and mutation rate.

3.2. Application and Improvement of GA for Real-Time Weight Tuning

3.2.1. Fitness Function

Fitness function determines the direction of GA evolution, and is set according to practical problems. In NMPC, the best choice of Q and R is required to minimize the objective function (9) for the best trajectory tracking effect. Therefore, the Q and R optimized by the fitness function in this novel GA needs to meet the requirements of minimizing the objective function, and the fitness function is defined as follows:
F i t n e s s = 1 v ( k ) = 1 n = 1 N p ( z n ( k ) z r ( k ) Q 2 + u n ( k ) R 2 ) ,

3.2.2. Improvement of Crossover Operator

In order to ensure that the genes of better individuals can be inherited to the offspring, the tournament selection strategy is adopted for the genetic operator. The selected individuals will generate a new individual through the crossover operator, and the standard crossover algorithm can be expressed as follows:
Q 1 = ( T 1 + T 2 ) / 2 + β × ( T 1 T 2 ) / 2 ,
where Q 1 is the offspring chromosome; T 1 and T 2 are parent chromosomes. β is a random number between [0,1]. However, there is a certain chance that the tournament strategy will repeatedly choose parent chromosomes, which indirectly leads to insufficient diversity. In order to solve this problem, by introducing T 3 , the improved crossover strategy is as follows:
Q 2 = ( T 1 + T 2 + T 3 ) / 3 + β × ( 2 T 1 T 2 T 3 ) / 3 ,
Comparing Equations (14) and (15), the former is conducive to individual stability and less individual change range, due to less utilization of parent information. In Equation (15), each individual uses more information from the surrounding individuals, so that it is easy to quickly search a certain area in the early stage of the algorithm. Therefore, if the current number of iterations is less than T × G e n m a x , the crossover algorithm of Equation (15) is adopted. Otherwise, Formula (14) is adopted. The specific T and G e n m a x will be determined in subsequent experiments.

3.2.3. Adoption of Mutation Operator

Aiming to solve the problems of mutation operator, an improvement is made on the basis of the method proposed by Tsoulos et al. [31]. Firstly, chromosomes in the population are sorted according to their fitness values from high to low, and then the mutation scale is determined according to the mutation rate P m . In order to purposefully mutate the chromosome with low fitness rather than the optimal one, the mutation operator equation calculated using the PSO optimization method is as follows:
c i = l 1 m 1 ( c i b c i ) + l 2 m 2 ( c i b c i ) ,
where l 1 and l 2 are two positive constants, m 1 and m 2 are uniform random numbers between [0,1], and c b represents the chromosome with largest fitness currently found. The improvement can ensure that only the worst solutions will be mutated. This will improve the gene, increase the diversity of the population, and prevent the algorithm from falling into a local optimal solution.

3.2.4. Improvement of Crossover and Mutation Rate

According to the Darwinian evolution principle, in the early stage of genetic algorithm evolution, the crossover operator can enhance the global search ability of the algorithm, which can avoid falling into the local optimal solution. In the later stage of evolution, when getting closer to optimal solution, the crossover operator will affect the convergence speed. At this time, the mutation operator plays a more important role. Herein, the crossover rate P c and the mutation rate P m can be defined as follows:
P c = P 1 0.35 × ( g e n G e n m a x ) , P m = P 2 + 0.05 × ( g e n G e n m a x ) ,
where P 1 is the initial crossover rate and P 2 is the initial mutation rate. G e n m a x is the maximum number of iterations and g e n is the current number of iterations. With the progress of the search process, the crossover rate is getting smaller and smaller, while the mutation rate is getting larger and larger.

3.3. Optimization Procedure of GA-NMPC

The genetic algorithm-based nonlinear model predictive control (GA-NMPC) for vessel trajectory tracking is shown in Figure 1. The weight matrices Q and R of NMPC are optimized in real time using the genetic algorithm, and the implementation steps are concluded as follows.
(1)
Initialize the weight matrices Q and R, and obtain U ( k ) and Z ( k ) through Equations (9) and (10), respectively.
(2)
Define parent population size as N p o p , and q 1 , q 2 , q 3 , r 1 , r 2 , r 3 are the genes carried by each individual’s chromosome.
(3)
Encode chromosomes and calculate the fitness values through Equation (13), and sort the chromosomes from high to low according to fitness values.
(4)
Determine the number of chromosomes that need to be crossed according to crossover rate P c . Select a corresponding number of chromosomes with high fitness values through the tournament strategy, and then cross these chromosomes according to Equations (14) and (15) to obtain new chromosomes. Finally, the newly generated chromosomes are used to replace the chromosomes with the lowest fitness values in the parent population.
(5)
After crossover, the chromosome will be mutated according to the mutation rate P m . The individuals with low fitness values in the parent population are mutated based on Equation (16). Thus far, a new parent population has emerged.
(6)
If the number of iterations does not reach the maximum number of iterations G e n m a x , continue the cycle. Otherwise, the individual with largest fitness value is introduced into objective function (9) as weight matrices Q and R. The optimal solution sequence U * ( k ) = [ u 0 * ( k ) T , , u N c 1 * ( k ) T ] T is obtained by solving the objective function (9), and then the first element u 0 * ( k ) is input into the closed-loop system to complete the ship trajectory tracking.

4. Simulation Evaluation and Discussion

In this section, the simulation evaluation of the trajectory tracking performance using the proposed GA-NMPC is implemented. The CSII ship, which is a replica of the supply ship with a ratio of 1:70, is chosen as the simulation object. Its a priori identified dynamic parameters are shown in Table 1.

4.1. Main Parameters Setting

The maximal and minimal thrust limit in (4) is set as τ m a x = [2.0N, 2.0N, 1.5N·m] T , τ m i n = [–2.0N, –2.0N, –1.5N·m] T , respectively. The sample time step is set as T s = 0.1 . In GA-NMPC, the population size N p o p = 30 , and the initial crossover rate and mutation rate are P c = 0.9 , P m = 0.2 , respectively. The parameters defined in Section 3.2.2 are set as T = 0.6 , G e n m a x = 100 .
To demonstrate the effectiveness of the proposed real-time weight optimization algorithm for NMPC, the control effects of NMPC with different Q and R will be compared. Herein, three cases are simulated, which are:
(1)
The proposed GA-NMPC algorithm with real-time online weight optimization with initial Q = d i a g ( 50 , 50 , 50 ) , R = d i a g ( 1 , 1 , 1 ) ;
(2)
NMPC with constant weight matrices Q = d i a g ( 100 , 100 , 100 ) , R = d i a g ( 1 , 1 , 1 ) ;
(3)
NMPC with constant weight matrices Q = d i a g ( 5 , 5 , 5 ) , R = d i a g ( 1 , 1 , 1 ) .
In addition, two different reference trajectories are used to verify the performance, and they are set as follows:
(1)
Circle trajectory, with the expression described as:
x r = 3 3 cos ( 0.025 t ) , y r = 4 sin ( 0.025 t ) , t 0 ,
(2)
Sine curve trajectory, with the expression described as:
x r = 0.05 t , y r = 3 sin ( 0.025 t ) , t 0 .
The desired heading ψ r of the two trajectories are both taken as the direction of the tangent vector along the path.

4.2. Results Analysis

The simulation results of the three cases based on the two trajectories are shown in Figure 2, Figure 3, Figure 4 and Figure 5, where the results of cases (1)–(3) are represented by red, blue, and pink solid lines, respectively, while the reference trajectory is represented by green dotted lines. Figure 2a and Figure 4a are ship position and heading. Figure 2b and Figure 4b represent ship velocities in surge, sway, and yaw. Figure 3 and Figure 5 show the trajectory tracking results under different cases. For the circle trajectory, it can be seen from Figure 2a and Figure 3 that the trajectory tracking results of the three cases are ideal. However, by observing the local enlarged picture, we can see that the error of the result obtained by the controller using constant weight matrices is slightly larger than that of GA-NMPC. In addition, the heading angle of NMPC with constant matrices Q and R cannot return to zero in time after completing a circle, so there will be obvious fluctuations when starting a new voyage. This problem can also be reflected in Figure 2b that, at the end of a tracking cycle, the ship velocities will fluctuate significantly. However, the adoption of real-time-optimized Q and R solves this problem well.
Figure 4 and Figure 5 show the tracking results of the sine curve trajectory. In Figure 4a and Figure 5, the three cases have a good tracking effect on the trajectory. However, in contrast, the control result of NMPC with constant Q and R is slightly unstable compared with that of real-time-optimized Q and R. Additionally, when the element values in matrix Q are small, as can be seen from Figure 4b, the velocity ν fluctuates greatly. Therefore, by receiving ship feedback to optimize the weight matrices in real time, the tracking error can be reduced and obtain a better control effect.
Figure 2c,d and Figure 4c,d respectively show the matrices Q and R optimized in real time by GA-NMPC during ship tracking of the two trajectories. It can be seen that, at every step, the genetic algorithm adjusts elements in the Q and R according to the tracking error to improve population fitness, which can achieve the best control effect. Although using constant weight matrices can also obtain a relatively ideal result, it needs many attempts and adjustments, which is time-consuming and laborious. In addition, the final control effect may not be the best, due to the invariance of weights.

5. Conclusions

In this paper, a real-time weight tuning method based on the genetic algorithm (GA) is proposed and applied in a ship nonlinear model predictive controller for ship trajectory tracking. The weight matrices Q and R to be optimized in the NMPC objective function are taken as individuals in GA. The individuals with the highest fitness are obtained as weight factors in the matrices of Q and R; thus, the NMPC will solve the objective function online and obtain the optimal control action. In addition, the crossover operator, mutation operator, crossover rate, and mutation rate of the genetic algorithm are improved to enhance the diversity of the population and the efficiency of searching for the optimal solution. This optimization method adjusts the weight proportion of the input value in the objective function in real time according to the actual navigation and makes up for the defects of the traditional trial and error method, as well as the empirical method. The controller optimized by this method is simulated and compared with the traditional NMPC. The results show that the proposed GA-NMPC method makes it easy to implement NMPC and improves the control efficiency of ship trajectory control.

Author Contributions

Conceptualization, F.D.; Methodology, D.Y.; Formal analysis, D.Y.; Writing—Original Draft Preparation, D.Y.; Writing—Review and Editing, H.Y. and D.Y.; Software, D.Y. and X.H.; Investigation, T.S.; Funding Acquisition: F.D. and H.W.; Resources: F.D. and H.W.; Validation, X.H.; Supervision, F.D. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the National Natural Science Foundation of China (No. 52101401), the National Key R&D Program of China (No. 2021YFB3401400), and the Collaborative Innovation Center of Intelligent Green Manufacturing Technology and Equipment, Shandong (No. IGSD-2020-011).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

References

  1. Moreira, L.; Fossen, T.I.; Soares, C.G. Path following control system for a tanker ship model. Ocean Eng. 2007, 34, 2074–2085. [Google Scholar] [CrossRef]
  2. Consolini, L.; Tosques, M. A minimum phase output in the exact tracking problem for the non-minimum phase underactuated surface ship. IEEE Trans. Autom. Control 2012, 57, 3174–3180. [Google Scholar] [CrossRef]
  3. Zhu, G.; Du, J. Global robust adaptive trajectory tracking control for surface ships under input saturation. IEEE J. Ocean. Eng. 2018, 45, 442–450. [Google Scholar] [CrossRef]
  4. Katayama, H.; Aoki, H. Straight-line trajectory tracking control for sampled-data underactuated ships. IEEE Trans. Control Syst. Technol. 2013, 22, 1638–1645. [Google Scholar]
  5. Qu, Y.; Xiao, B.; Fu, Z.; Yuan, D. Trajectory exponential tracking control of unmanned surface ships with external disturbance and system uncertainties. ISA Trans. 2018, 78, 47–55. [Google Scholar] [CrossRef] [PubMed]
  6. Liu, Y.; Bu, R.; Gao, X. Ship trajectory tracking control system design based on sliding mode control algorithm. Pol. Marit. Res. 2018, 25, 26–34. [Google Scholar] [CrossRef]
  7. Wang, W.; Rivera, D.E.; Kempf, K.G. Model predictive control strategies for supply chain management in semiconductor manufacturing. Int. J. Prod. Econ. 2007, 107, 56–77. [Google Scholar] [CrossRef]
  8. Brdys, M.A.; Grochowski, M.; Gminski, T.; Konarczak, K.; Drewa, M. Hierarchical predictive control of integrated wastewater treatment systems. Control Eng. Pract. 2008, 16, 751–767. [Google Scholar] [CrossRef]
  9. Salsbury, T.; Mhaskar, P.; Qin, S.J. Predictive control methods to improve energy efficiency and reduce demand in buildings. Comput. Chem. Eng. 2013, 51, 77–85. [Google Scholar] [CrossRef]
  10. Keviczky, T.; Balas, G.J. Receding horizon control of an F-16 aircraft: A comparative study. Control Eng. Pract. 2006, 14, 1023–1033. [Google Scholar] [CrossRef]
  11. Oh, S.R.; Sun, J. Path following of underactuated marine surface vessels using line-of-sight based model predictive control. Ocean Eng. 2010, 37, 289–295. [Google Scholar] [CrossRef]
  12. Li, Z.; Sun, J. Disturbance compensating model predictive control with application to ship heading control. IEEE Trans. Control Syst. Technol. 2011, 20, 257–265. [Google Scholar] [CrossRef]
  13. Kapetanović, N.; Bibuli, M.; Mišković, N.; Caccia, M. Real-time model predictive line following control for underactuated marine vehicles. IFAC-PapersOnLine 2017, 50, 12374–12379. [Google Scholar] [CrossRef]
  14. Henson, M.A. Nonlinear model predictive control: Current status and future directions. Comput. Chem. Eng. 1998, 23, 187–202. [Google Scholar] [CrossRef]
  15. Abdelaal, M.; Fränzle, M.; Hahn, A. Nonlinear model predictive control for trajectory tracking and collision avoidance of underactuated vessels with disturbances. Ocean Eng. 2018, 160, 168–180. [Google Scholar] [CrossRef]
  16. Yang, H.; Deng, F.; He, Y.; Jiao, D.; Han, Z. Robust nonlinear model predictive control for reference tracking of dynamic positioning ships based on nonlinear disturbance observer. Ocean Eng. 2020, 215, 107885. [Google Scholar] [CrossRef]
  17. Zhao, R.C.; Wong, P.K.; Xie, Z.C.; Zhao, J. Real-time weighted multi-objective model predictive controller for adaptive cruise control systems. Int. J. Automot. Technol. 2017, 18, 279–292. [Google Scholar] [CrossRef]
  18. Rankovic, V.; Radulović, J.; Grujovic, N.; Divac, D. Neural network model predictive control of nonlinear systems using genetic algorithms. Int. J. Comput. Commun. Control 2012, 7, 540–549. [Google Scholar] [CrossRef]
  19. Ramasamy, V.; Sidharthan, R.K.; Kannan, R.; Muralidharan, G. Optimal Tuning of Model Predictive Controller Weights Using Genetic Algorithm with Interactive Decision Tree for Industrial Cement Kiln Process. Processes 2019, 7, 938. [Google Scholar] [CrossRef]
  20. Essa, M.E.S.M.; Aboelela, M.A.S.; Hassan, M.A.; Abdrabbo, S.M. Design of model predictive force control for hydraulic servo system based on cuckoo search and genetic algorithms. Proc. Inst. Mech. Eng. Part I J. Syst. Control Eng. 2020, 234, 701–714. [Google Scholar] [CrossRef]
  21. Zhang, L.; Zhuan, X. Model predictive control method of a parallel electromagnetic isolation system based on the improved genetic algorithm. J. Vib. Control 2020, 26, 2001–2012. [Google Scholar] [CrossRef]
  22. Tang, P.H.; Tseng, M.H. Adaptive directed mutation for real-coded genetic algorithms. Appl. Soft Comput. J. 2013, 13, 600–614. [Google Scholar] [CrossRef]
  23. Chuang, Y.C.; Chen, C.T.; Hwang, C. A real-coded genetic algorithm with a direction-based crossover operator. Inf. Sci. 2015, 305, 320–348. [Google Scholar] [CrossRef]
  24. Fossen, T.I. Guidance and Control of Ocean Vehicles; John Wiley & Sons: Chichester, UK, 1999; pp. 5–56. [Google Scholar]
  25. Fossen, T.I. Handbook of Marine Craft Hydrodynamics and Motion Control; John Wiley & Sons: Chichester, UK, 2011; pp. 52–59. [Google Scholar]
  26. Zhu, H.; Zhao, G.; Sun, L.; Lee, K.Y. Nonlinear predictive control for a boiler–turbine unit based on a local model network and immune genetic algorithm. Sustainability 2019, 11, 5102. [Google Scholar] [CrossRef]
  27. Veerasamy, G.; Kannan, R.; Siddharthan, R.K.; Muralidharan, G.; Sivanandam, V.; Amirtharajan, R. Integration of genetic algorithm tuned adaptive fading memory Kalman filter with model predictive controller for active fault-tolerant control of cement kiln under sensor faults with inaccurate noise covariance. Math. Comput. Simul. 2022, 191, 256–277. [Google Scholar] [CrossRef]
  28. Mohammadi, A.; Asadi, H.; Mohamed, S.; Nelson, K.; Nahavandi, S. Multiobjective and interactive genetic algorithms for weight tuning of a model predictive control-based motion cueing algorithm. IEEE Trans. Cybern. 2018, 49, 3471–3481. [Google Scholar] [CrossRef] [PubMed]
  29. Maran, F. Model-Based Control Techniques for Automotive Applications. Ph.D. Thesis, University of Padova, Padova, Italy, 2013. [Google Scholar]
  30. Liu, J.; Yang, L.; Zhang, X.; Yan, R.; Chen, X. Intelligent time-domain parameters matching for shock response spectrum and its experimental validation in active vibration control systems. Shock Vib. 2019, 2019, 2920845. [Google Scholar] [CrossRef]
  31. Tsoulos, I.G.; Tzallas, A.; Tsalikakis, D. PDoublePop: An implementation of parallel genetic algorithm for function optimization. Comput. Phys. Commun. 2016, 209, 183–189. [Google Scholar] [CrossRef]
  32. Fannemel, Å.V. Dynamic Positioning by Nonlinear Model Predictive Control. Master’s Thesis, Institutt for Teknisk Kybernetikk, Trondheim, Norway, 2008. [Google Scholar]
Figure 1. GA-NMPC schematic diagram.
Figure 1. GA-NMPC schematic diagram.
Jmse 10 01110 g001
Figure 2. Simulation results for circle trajectory. (a) ship position and heading; (b) ship velocities in surge, sway, and yaw; (c) real-time optimized matrix Q; (d) real-time optimized matrix R.
Figure 2. Simulation results for circle trajectory. (a) ship position and heading; (b) ship velocities in surge, sway, and yaw; (c) real-time optimized matrix Q; (d) real-time optimized matrix R.
Jmse 10 01110 g002
Figure 3. Circle trajectory tracking results under different cases.
Figure 3. Circle trajectory tracking results under different cases.
Jmse 10 01110 g003
Figure 4. Simulation results for the sine curve trajectory. (a) ship position and heading; (b) ship velocities in surge, sway and yaw; (c) real-time optimized matrix Q; (d) real-time optimized matrix R.
Figure 4. Simulation results for the sine curve trajectory. (a) ship position and heading; (b) ship velocities in surge, sway and yaw; (c) real-time optimized matrix Q; (d) real-time optimized matrix R.
Jmse 10 01110 g004
Figure 5. Sine trajectory tracking results under different cases.
Figure 5. Sine trajectory tracking results under different cases.
Jmse 10 01110 g005
Table 1. CSII ship parameters [32].
Table 1. CSII ship parameters [32].
ParameterValueUnitParameterValueUnit
m23.8kg Y r –0.1kg· m/s
I z 1.76kg· m 2 Y v ˙ –10.0kg
X g 0.046m Y r ˙ –0.0kg· m
X u –2kg/s N v –1.0kg· m/s
X u ˙ –2.0kg N r –0.5kg· m 2 /s
Y v –0.7kg/s N r ˙ –1.0kg· m 2
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Yu, D.; Deng, F.; Wang, H.; Hou, X.; Yang, H.; Shan, T. Real-Time Weight Optimization of a Nonlinear Model Predictive Controller Using a Genetic Algorithm for Ship Trajectory Tracking. J. Mar. Sci. Eng. 2022, 10, 1110. https://0-doi-org.brum.beds.ac.uk/10.3390/jmse10081110

AMA Style

Yu D, Deng F, Wang H, Hou X, Yang H, Shan T. Real-Time Weight Optimization of a Nonlinear Model Predictive Controller Using a Genetic Algorithm for Ship Trajectory Tracking. Journal of Marine Science and Engineering. 2022; 10(8):1110. https://0-doi-org.brum.beds.ac.uk/10.3390/jmse10081110

Chicago/Turabian Style

Yu, Dunjing, Fang Deng, Hongyan Wang, Xiuhui Hou, Hualin Yang, and Tikun Shan. 2022. "Real-Time Weight Optimization of a Nonlinear Model Predictive Controller Using a Genetic Algorithm for Ship Trajectory Tracking" Journal of Marine Science and Engineering 10, no. 8: 1110. https://0-doi-org.brum.beds.ac.uk/10.3390/jmse10081110

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop