3.1. Simulation Preliminaries
A ship named KVLCC2 is selected as the case ship to verify the effectiveness of the P-PB controller. The main parameters of KVLCC2 are shown in
Table 1, other parameters are shown in Ref [
53].
After establishing the nonlinear ship model of KVLCC2 in
Section 2.1, the simulation results of the turning test, with an initial ship speed of 15.5 kn/h, rudder angle of ±35°, and initial course of 0°, are compared with the results of Yasukawa and Yoshimura [
53]. A comparison of ship’s trajectory is shown in
Figure 5.
The accuracy of the ship’s turning test can be verified using the formula below [
54]:
where
is the simulation result,
is the experimental result, and
is the consistency evaluation indicator.
Finally, a comparison of the ship’s turning test is shown in
Table 2. The consistency between simulation results in this study and Yasukawa [
53] is 97.52%. The simulation results are in line with the valid experimental results.
and are the advance and tactical diameter of the turning test, respectively.
To verify the efficiency of the P-PB controller under various environmental disturbances, simulation scenarios were established, as described in
Table 3.
Then, to balance the efficiency and accuracy of PSO when optimizing the P-PB controller, the main parameters of PSO were set, as described in
Table 4.
The change curve of the fitness value for iterations under each stage is shown in
Figure 6. The fitness value increased with each iteration and eventually stabilized in each stage, which ensured the effectiveness and completeness of the optimization.
3.2. Comparison and Analysis of Simulation Results
The P-PB controller was valid when compared to the improved PID controllers proposed by Diabac and He [
22,
23] and the controller based on backstepping control proposed by Zhang [
9]. The change in ship’s course under these three models and the proposed P-PB controller is compared in various scenarios, as shown in
Figure 7.
As seen in
Figure 7, all the controllers kept the ship on course under various environmental disturbances. When comparing the four controllers, it is obvious that the P-PB controller and the controller proposed by Dlabac [
22] and Zhang [
24] responded more quickly and tracked the target course satisfactorily in the initial stage when the target course was changing.
However, the overshoot of the backstepping controller proposed by Zhang [
24] increased rapidly as the environmental disturbances became harsher. This is because the yawing speed of the ship is considered one of the inputs of the improved backstepping controller proposed by Zhang [
24]. When an environmental disturbance is lower, consideration of the ship’s yawing speed is an effective way to improve the stability and accuracy of the course-keeping controller. Conversely, when an environmental disturbance is larger, external factors significantly interfere with the ship’s yawing speed, which causes the ship’s course-keeping error to increase rapidly.
The proposed P-PB controller also considers the ship’s yawing speed to achieve efficient course-keeping control when environmental disturbances are lower. Furthermore, when environmental disturbances gradually increase, an overshoot of ship course-keeping is avoided by adjusting the value of using PSO. Therefore, a smaller course-keeping error can be obtained under various scenarios.
The accumulated course-keeping error is compared in
Figure 8.
The mean course-keeping error, which is calculated by dividing the accumulated course-keeping error by time, is shown in
Figure 9. It illustrates the mean course-keeping error for each controller as a percentage of the accumulated mean course-keeping error for the four controllers, and each circle represents one percent. For example, when under a high-speed wind scenario, the accumulated mean course-keeping error of the four controllers is 8.77°, and the mean course-keeping error of the P-PB controller is 1.67°, which accounts for 19.04% of the mean course-keeping error and therefore occupies 19 circles.
The smaller the number of circles corresponding to the controllers, the smaller the average error of the controllers compared to the other controllers, and therefore the more efficient the controller is.
As indicated by
Figure 7,
Figure 8 and
Figure 9, it is clear that the P-PB controller and the controller proposed by Dlabac [
22] achieved course-keeping with the lowest and second-lowest accumulated course-keeping error, respectively, throughout the simulation tests under the three scenarios. Meanwhile, compared to the controller proposed by Dlabac [
22], the P-PB controller had a larger advantage in terms of accumulated course-keeping error when environmental disturbances were lower.
The accumulated course-keeping error of the controller proposed by Zhang [
24] performed better under lower environmental disturbances. However, its accumulated course-keeping error increased significantly under extreme environmental disturbances. The improved PID controller proposed by He performed stably in various scenarios, but was slightly slower to reach the target course.
The course-keeping error when the ship’s course is stabilized is shown in
Figure 10.
When there was no environmental disturbance, the stabilized course-keeping error of all four controllers was extremely small. Among them, the controller proposed by Dlabac [
22] and the P-PB controller had the lowest stabilized course-keeping error. However, with the gradual increase in environmental disturbances, the course-keeping error of Zhang’s [
24] proposed controller increased rapidly, and the errors of the P-PB and Dlabac’s [
22] proposed controllers also increased. He’s proposed controller maintained a lower error than the other controllers under environmental disturbances.
The average rudder angle in the various scenarios is shown in
Figure 11. The average rudder angles of all ship course-keeping controllers increased when the wind disturbance became harsher.
When comparing the four controllers, the controllers proposed by Zhang [
24] and He [
23] achieved course-keeping with a smaller rudder angle under all scenarios. Conversely, the P-PB controller and the controller proposed by Dlabac [
22] had a larger average rudder angle and therefore required relatively more energy for control. Furthermore, when comparing the above-two controllers with lower course-keeping errors, the P-PB controller had a relatively small average rudder angle, especially under lower environmental disturbances.
Finally, the mean course-keeping error for the four controllers is shown in
Table 5. Compared to other controllers, the P-PB controller improved course-keeping error by 4.19% on average.
When environmental disturbances increased, the reduction in the ship course-keeping error of some controllers was due the fact that the disturbance matched the direction of the ship’s course, and therefore the ship achieved the target course in a shorter period of time.
To provide a comprehensive analysis of the control effectiveness of the P-PB controller, time-response specifications have been compared. Among them, rise time is the time required to adjust the ship’s course to 90% of the target course, which represents the rapidity of the controller’s response. Overshoot characterizes the maximum deviation of the controller, and the smaller its value the better the stability of the controller. Settling time refers to the time it takes to maintain a course-keeping error within 2% and is a key factor of control stability. The mean value of each specification in the various scenarios is shown in
Table 6.
As seen in
Table 6, the proposed P-PB controller saw a 9.71% improvement on average in terms of time-response specification. Analyzing the time-response specification, the proposed controller has a faster response speed and better control stability compared to the other controllers, providing further confirmation of the controller’s effectiveness. However, some overshoot remains. This is attributed to the fact that the PSO-optimized controller retains a partial dependence on
to reduce the course-keeping error.
In summary, the P-PB controller proposed in this paper can realize a stabilized course-keeping of ships with lower error and better time-response performance, providing a new approach for the automatic control of ships.