International Journal
on Marine Navigation
and Safety of Sea Transportation
Volume 2
Number 1
March 2008
77
Ship Control in Manoeuvring Situations with
Fuzzy Logic Controllers
L. Morawski
Gdynia Maritime University, Gdynia, Poland
V. Nguyen Cong
Vietnam Maritime University, Haiphong, Vietnam
ABSTRACT: In this paper, the ship control regulator in manoeuvring situation is presented. It consists of
three fuzzy logic controllers. Each controller controls one of motions: turning, transverse and longitude
motion of a ship. The regulator is built in the simulink of Matlab with the graphical interface. All experiments
are performed in the Matlab environment with the ship simulation.
1 INTRODUCTION
Nowadays, many vessels are equipped with thrusters
to support the manoeuvring activities. They are very
useful for manoeuvring activities in narrow place but
the controlling many thrusters at the same time is
challenger to the helmsman. Therefore, a regulator,
which controls all propulsion system to perform the
tasks in manoeuvring situation, is very necessary.
This problem has been examined by many
researchers using different methods, for different
vessel’s propulsion kinds, and as a consequence,
obtaining different results (Broel Plater B. 1998,
Passino K., 1998).
This article will introduce a regulator, which
controls three propellers: bow thruster, stern thruster
and main propeller to carry out the recently tasks in
manoeuvring such as moving vessel on a set path
with set heading, turning vessel at a fixed point and
so on. The algorithm of regulator and results of
experiments on simulation computer with scale
model in the real environment will be presented in
detail in the next sections.
2 THE OBJECT OF CONTROL
The training ship “Blue Lady” is the autonomous
scale model of the VLCC tanker. It is used by the
Foundation for Safety of Navigation and
Environment Protection at the Silm Lake near Ilawa
in Poland for training navigators. The vessel is built
of the epoxies resin laminate in 1:24 scale. It is
equipped with battery-fed electric drives and the
control steering post at the stern. The model is
equipped with the main propeller, rudder, two tunnel
thrusters, two azimuth pump thrusters which can be
rotated to the limited angles. The regulator presented
in this paper just controls two tunnel thrusters and
main propeller for manoeuvring tasks. The
arrangement of the model is shown in Figure 1 and
main characteristic data in Table 1.
Table 1. The main characteristic data of the model
Length over all LOA
13.78[m]
Beam B
2.38[m]
Draft (average) - load condition Tl
0.86[m]
Displacement - load condition D
22.83[T]
Speed
3.10[kn]
78
DGPS
antenna
Blade
rudder
Main
propelle
Rotating pump thrusters
Fig. 1. The arrangement of the model “Blue Lady”
3 THE REFERENCE FRAMES AND
DEFINITIONS
There are two reference frames used in control. They
are Geographic reference frame (x
n
y
n
) and Body
reference frame (Figure 2).
Geographic Reference Frame (x
n
y
n
or n-frame):
The coordinate system x
n
y
n
is defined relative to the
Earth reference ellipsoid (World Geodetic System
1984). In this coordinate system the x-axis points
towards true North, while the y-axis points towards
East (Fosen T.I., 2002).
Body Reference Frame (x
b
y
b
or b-frame): This is
moving coordinate frame which is fixed to the
vessel. The origin O
b
of the coordinate system is
chosen to coincide with the center of gravity (CG)
when CG is in the principal plane of symmetry. The
axes are defined as x - longitudinal axis, directed
from aft to fore and y - transversal axis, directed to
starboard (see Figure 2) (Fosen T.I., 2002)
dx
dy
R
O
b
y
b
y
n
x
n
O
n
y
s
d
y
x
R
y
R
y
Ob
x
Ob
x
b
Fig. 2. Reference frames
R reference point, required position of the vessel
dx position deviation in x-axis of b-frame
dy position deviation in x-axis of b-frame
ys set heading
dy course deviation
The position of vessel is fixed by GPS in n-frame
while the signals for control (deviations) are
measured in b-frame. The transfer functions of
coordinates and velocities between these frames as
following:
[ ]
[ ]
[ ]
[ ]
0
T
T
n
b b b b n Ob n Ob
T
T
n
bn n
x y Rx x y y
uvr Rx y r
y=
=

(1)
where
1
cos si n 0
si n cos 0
0 01
n
b
R
y− y


= yy



(2)
Reference point R: This is a point on which the
vessel position has to be maintained. The vessel
movement will be controlled through this point.
4 ALGORITHM OF CONTROL
4.1 Control forces and characteristic of the
controller
In this regulator, the controlling forces have the form
of pulses. Its magnitude is changed by steps and
plays the role of rough controlling while the acting
time is adjusted continuously and play the role of
fine controlling. By this control method, the vessel
responds quickly to the affect of the environment.
The relation of controlling force, deviations and
vessel dynamic character is displayed in the
Equations 3. In these equations, the values “0”,
“small”, “medium” and “big” are control force
magnitude levels, which are fixed with step values in
the controllers.
The controllers used in this regulator are fuzzy
logic controller, Mamdani type. To create the control
signals (controlling force) in the pulse, the
membership functions of controllers must have
narrow shape, not intersectional and the
defuzzification of controllers must be biosector type.
It is shown detail in the Section 5.
( )
( )
{ }
( )
,
, ; 0; small; medium; big
,, ,
t
F
dynami c
tf
Ff F
f mF
ηη
ηη
ηη
∆= εε
= εε = ± ± ±
ε= τ ε
(3)
where
t acting time of control force
F
magnitude of control force
η
ε
errors;
[,, ]dx dy d=
η
εy
m mass of control object
τ
forces act on the control object
79
4.2 Control vessel movement
Fig. 3. The forces in control vessel
a) Control heading
b) Control side-moving
c) Control longitudinal moving
The regulator has three fuzzy logic controllers.
They are course keeping, x-position keeping and y-
position keeping controller. Three controllers work
together to maintain the vessel position at the
reference point R with the set course ys.
Fig. 4. Moving reference point R along the set path
Because the controllers always keep the vessel
position stable at the reference point R so when the
coordinates of reference point are changed, the
vessel position is also changed. Hence, the
movement of vessel (track and speed) can be
controlled by changing coordinates of reference
point R. However, the power of propellers is limited
so the vessel can not follow the reference point if it
moves too fast. Hence, the movement of reference
point R is also depend on the actual status of the
vessel. The algorithm of control reference point R
movement is presented as following.
Assume that the accepted range of error course is
y
max
and the accepted range of deviation position is
l
max
(Figure 4). The reference point R is just moved
forwards when all above deviations are in the
accepted range. If error course and/or deviation
position are greater than accepted range, the
reference point is stopped to wait for the controllers
stabilize the vessel at set heading and reference
position. The flowchart in Figure 5 shows the
algorithm of controlling reference point R.
In the flowchart, (x
k
, y
k
) and (x
k+1
, y
k+1
) are
coordinates of two waypoints of the path segment.
The variable v
R
is the set speed on the set path
segment; it is also the set speed for referent point R.
The angle α is used to determine the relative
position of vessel to reference point R.
When vessel moves stable with l<l
max
, it means
the vessel has speed as same as reference point
speed. When l is equal or a bit greater than l
max
: 1) if
α
<90
o
, it means vessel speed is lower than speed of
the reference point (V < v
R
). In this case, the moving
forward of reference point is restrained by the vessel
movement. It can be imaged as the reference point R
pulls the vessel by a rope, which has the length l
max
(Figure 6a). 2) If α>90
o
, it means the vessel speed V
is faster than speed of reference point R (V > v
R
). In
this situation, the reference point R can move with
its set speed v
R
. The controller tries to curb the
moving forward of vessel to keep the deviation
position less than l
max
. It can be imaged as the
reference point R pulls the vessel back to reduce the
vessel speed to set speed v
R
(Figure 6b)
Fig. 5. Algorithm of moving reference point R
Fig. 6. The relative position of reference point R and actual
position of vessel O
b
x
k
, y
k
x
k+1
, y
k+1
O
b
l
max
α
R
x
k
, y
k
x
k+1
, y
k+1
O
b
l
max
α
R
a)
b)
V
V
x
k
, y
k
x
k+1
, y
k+1
v
R
O
b
l
l
max
α
y
max
Accepted
range of
position
Accepted range
of error course
R
l
max
dx
dy
R
O
b
x
b
y
b
y
s
-F
M
F
M
dy
R
O
b
x
b
y
b
y
s
F
y
F
y
dy
R
O
b
x
b
y
b
y
s
a)
b)
c)
F
x
dx
Begin
x
k
, y
k
, x
k+1
, y
k+1
,
y
s
x
R
= x
k
; y
R
= y
k
l = f(x
R
,y
R
, x, y);
α
= f(x
k
, y
k
, x
k+1
,
y
k+1
, x, y, )
((l < l
max
) or (
α
>90))
and (
y
<
y
)
x
R
= x
R
+ v
R
*
t*cos
y
k
y
y + v *
t*sin
y
(x
R
= x
k+1
)
and (y
R
= y
k+1
)
End
Ye
s
Yes
No
No
80
5 THE REGULATOR
The diagram of the regulator is shown on the
Figure 7. The database of a set path, it is a records
set of path segment, is stored in Data of trajectory
block. The information of a path segment consists of
coordinates of two waypoints, set heading and set
speed. The data of the path segments are sent to the
Processing block one by one in proper time. Basing
on actual data of the vessel x, y,
y
, r and data of
current path segment, the Processing block controls
the movement of reference point R with the
algorithm presented in Section 4.2.
Fig. 7. Regulator diagram
The Calculate speed block calculates the surge u
and sway v speed of vessel from the difference
positions of vessel in every second. The Kalman
filter is used in this block to reduce the noise and
abnormal signals. The Deviations calculate block
calculate the distances from vessel to the reference
point R. These deviations, in fact, are coordinates of
reference point R in the Body frame b-frame. The
control signals to the thrusters are sum of signals
from Course keeping controller and y-position
keeping controller so they may be out of range of
thruster’s input. To avoid this, the control signals are
processed by the Saturation signals block before
sending to thrusters. This block processes these
signals so that they are always in the input ranges of
thruster and their characters are as same as the
resultant signals of two these controllers.
Table 2. Fuzzy logic controllers’ properties
FIS type
Mamdani
# Inputs
2
# Outputs
1
AND method
min
OR method
max
Defuzzification
biosector
Implication
min
Aggregation
max
The three controllers are fuzzy logic type (Passino
K., 1998). They have same properties as shown in
Table 2 and their membership function and rules are
presented in the next paragraphs.
Course keeping controller: This controller
controls the bow thruster and stern thruster to keep
the vessel heading stably at the set heading. To fulfill
this task, the controller has to maintain the heading
error and turning rate at the value of 0. Due to this,
the inputs membership functions are established
symmetrically around 0 (Figure 8). The first input is
heading error
∆y
. Its range is [-180
o
+180
o
]. When
heading error is in the range [-30
o
+30
o
], the
controller controls the heading with different rules
depending on situations. When heading error is
greater than +30
o
, the controller controls the heading
with the rules for error heading +30
o
. It is similar for
the case heading error is less than -30
o
. The second
input is turning rate. Its input range is set to covers
range of turning rate of common vessels. In practice,
this range is [-1
o
/s +1
o
/s]. In the case, the rate of turn
is out of that range, the controller controls by the
rules for turning rate r of -1
o
/s or +1
o
/s.
Fig. 8. Inputs membership functions of the Course keeping
controller
The output membership functions and rules are
shown in the Figure 9. The levels are ±s, ±m and ±b
respective to 1/3, 2/3 and full power of the thruster.
The level ±s is used to stabilize vessel course. The
level ±m is used to turn vessel when the error course
is less than ±15
o
. The level ±b is used to accelerate
and turning vessel when error course is greater than
±15
o
.
This controller controls two thrusters (bow and
stern). Both control signals to these thrusters are
same amplitude but opposite sign (see Figure 7).
Fig. 9. Output membership functions and table of rules of the
Course keeping controller
y position keeping controller: This controller
controls side moving of vessel. The task of the
controller is keeping vessel position closest
reference point in y axis of b-frame. Two inputs
consist of dy deviation (m), sway v (m/s) with
-1 -0.5
0
0.5 1
0
0.2
0.4
0.6
0.8
1
Degree of membership
+b
+m+szer o-s-m-b
Power of thruster
-1 -0.5
0
0.5 1
0
0.2
0.4
0.6
0.8
1
Degree of membership
+b+m
+szer o-s-m-b
-30 -20 -10 0 10 20 30
0
0.2
0.4
0.6
0.8
1
Degree of membership
+b+m+szero-s-m-b
a) Heading error b) Rate of turn
r [Deg/s]
∆y [Deg]
81
membership functions are shown in Figure 10. The
input ranges are established basing on the dimension
of vessel. The model Blue Lady has 2.38 m in
breadth so the range of y deviation is set in [-5m
+5m]. It is approximate 4 times of the Blue Lady
width. In addition, the main task of the controller is
to maintain the vessel close to the reference point.
It means the y deviation is maintained around the
value 0. Due to these, the membership functions are
symmetry at 0 as shown in Figure 10.
Fig. 10. Inputs membership functions of y position keeping
controller
The output membership functions and rules of the
controller are shown in the Figure 11. The effect of
bow and stern thrusters are different in side moving
control so the signals sent to thrusters are set with
ratio k in the gain block (Figure 7). The ratio k is
chosen that to minimum the changing course of
vessel when she moves to side by its thrusters.
Fig. 11. Output membership functions and table of rules of y
position keeping controller
x position keeping controller: This controller
controls the longitudinal moving of vessel. The task
of the block is keeping vessel position closest
reference point in x axis of b-frame. The
membership functions of the controller have nine
zones. Seven of them (from -b to +b) are
proportional to the membership functions of y
position keeping controller. Two others (-vb and
+vb) are used in the case of braking up vessel when
vessel has speed higher than its maneuvering speed.
Fig. 12. Membership functions of inputs
Fig. 13. Output membership functions and table of rules of x
position keeping controller
In maneuvering situation, the movement in every
direction is same priority. So the output signals of
the x position keeping controller in levels ±b, ±m
and ±s must correspond to respective levels of y
position keeping controller. Beside it, the vessel hull
is designed with priority in longitudinal moving so
the resistance in this direction is small hence to
brake up vessel needs high power. Levels +vb/-vb
with full engine ahead/astern is reserved for this
task.
6 EXPERIMENTS AND RESULTS
Four experiments have been presented in this
section. They show the results of control vessel
movement in: 1) Oblique movement (longitudinal
and transverse at the same time), 2) Longitudinal/
Transverse movement and 3) Special trajectory
shape.
Fig. 14. Vessel track of the experiment No.1. (plotting every 10s)
-400
-200
0
200
400
0
0.2
0.4
0.6
0.8
1
Degree of membership
+ vb
+b
+m
+s
zer o
-s
-m
-b
-vb
r.p.m
-0.2
-0.1
0 0.1
0.2
0
0.2
0.4
0.6
0.8
1
Degree of membership
+ vb+b+m
+s
zero
-s
-m-b-vb
-5 0 5
0
0.2
0.4
0.6
0.8
1
Degree of membership
+ vb
+b+m
+szero-s-m
-b
-vb
u [m/s]
dx [m]
a) x deviation b) Surge
Power of thruster
-1
-0.5
0
0.5
1
0
0.2
0.4
0.6
0.8
1
Degree of membership
+b
+m+szero-s-m
-b
-5
0
5
0
0.2
0.4
0.6
0.8
1
Degree of membership
+b+m+szer o-s-m-b
-0.2 -0.1 0 0.1 0.2
0
0.2
0.4
0.6
0.8
1
Degree of membership
+b+m
+s
zer o
-s
-m-b
a) y deviation b) Sway
dy [m] v [m/s]
71 135
71 140
71 145
71 150
71 155
71 160
71 165
71 170
71 175
71 180
71 185
75 395
75 400
75 405
75 410
75 415
75 420
75 425
75 430
75 435
75 440
75 445
East [m]
North [m]
E
Set path
Vessel track
A
B
C
D
82
-1
0
1
y err. [m]
180
270
360
y
[
o
]
-5
0
5
y
[
o
]
-1
0
1
B.Thru.
-1
0
1
S.Thru.
-200
0
200
r.p.m
0 200 400 600 800 1000 1200 1400 1600 1800 2000
0
10
20
wind [m/s]
ti me [ s]
Fig. 15. Recorded data of the experiment No. 1
The experiment No. 1 was carried out to evaluate
the control in a single transverse/longitude
movement and the turning model at a waypoint. The
model left from the quay (Point A), performed side
movement in segment AB. Then, it moved forward
in segment BC. At point C, it turned 90
o
and then
ran astern in segment CD. In the last segment DE,
the model moved transversely and contacted to the
second quay.
The position deviation, error course are shown on
the Figure 15. The maximum value of cross
deviation was 0.5m, less than a quarter of the
model’s width. The model turned 90
o
at the
waypoint C in 200s and did not have any oscillation
after turning (see Figure 15).
Fig. 16. Vessel track of the experiment No. 2 (plotting every
10s)
-1
0
1
y err. [m]
120
130
140
y
[
o
]
-5
0
5
y
[
o
]
-1
0
1
B.Thru.
-1
0
1
S.Thru.
-200
0
200
r.p.m
0 200 400 600 800 1000 1200 1400 1600 1800
0
10
20
wind [m/s]
ti me [ s]
Fig. 17. Recorded data of the experiment No. 2
Experiment No. 2 was carried out to evaluate the
oblique movement. In this experiment, the model
was controlled to move in aft-port (AB), in fore-port
(BC), in fore-starboard (CD) and in aft-starboard
(DA) direction (Figure 16)
Comparing the results of experiment No.1 and
No.2, the accuracy of position control in oblique
movement was worse than it in transverse/longitude
movement. This caused by the difference between
the characteristic of main engine and thruster of the
vessel. The main engine is more powerful but it
responds very slowly in changing its mode. The
main engine simulated on Blue Lady is turbine type.
It takes several dozen seconds (in model scaled) to
change from the ahead engine mode to the astern
engine mode. On the contrary, thrusters are very
weak but respond very quickly. Therefore, it is very
difficult to combine main engine and thrusters in the
oblique movement.
Fig. 18. Vessel track of the experiment No. 3 (plotting every 60s)
71 155
71 160
71 165
71 170
71 175
71 180
71 185
71 190
75 380
75 385
75 390
75 395
75 400
75 405
75 410
75 415
East [m]
North [m]
Set path
Vessel track
A
B
C
D
-10
-5
0
5
10
15
20
25
30
35
40
45
50
-20
-15
-10
-5
0
5
10
15
20
East [ m]
North [m]
Set path
V l t k
83
-1
0
1
y err. [m]
85
90
95
y
[
o
]
-5
0
5
y
[
o
]
-1
0
1
B.Thru.
-1
0
1
S.Thru.
-200
0
200
r.p.m
0
500
1000
1500
2000
2500
3000
3500
4000
0
10
20
wind [m/s]
ti me [ s]
Fig. 19. Recorded data of the experiment No. 3
In the experiment No. 3 and No. 4, the model was
controlled with the special set path. The set path
is not segment lines as in the experiment No. 1 and
No. 2, they have the shape of the sin function and
spiral line.
Fig. 20. Vessel track of the experiment No.
4 (plotting every 60s)
In the experiment No. 3, the model was controlled
to move on the path, which has the shape of function
sin. The heading of the vessel was set at fixed value
90
o
. According to the recording data of the
experiments (Figure 19), the accuracy of position
and heading in the experiment No. 3 are same as the
accuracy of them in the experiment No. 2.
-1
0
1
y err. [m]
0
180
360
540
y
[
o
]
-5
0
5
y
[
o
]
-1
0
1
B.Thru.
-1
0
1
S.Thru.
-200
0
200
r.p.m
0
500
1000
1500
2000
2500
3000
0
10
20
wind [m/s]
ti me [ s]
Fig. 21. Recorded data of the experiment No. 4
In the experiment No. 4, the model was moved on
the spiral path. The vessel was moved changing
course from 0
o
to 540
o
(Figure 20). The radius was
increased from 5m to 26.6m. When vessel was close
to the center of spiral path (small radius), the
thrusters were working harder; the deviations of
position and heading were also lager. In contrary
when vessel was far from center, the thrusters were
working more easily and these deviations were
smaller (Figure 21).
7 CONCLUSIONS
The ship control regulator was tested with all of the
movements in manoeuvring situation: transverse,
longitude movement, oblique movement, turning at a
fix position. Moreover, the movements with special
shape of the trajectory such as function sin, spiral
line, were performed in the experiments.
In all experiments, the position deviations were
always less than a half of the vessel’s wide; the error
heading was always less than 3
o
.
According to experiments’ results, it can be
considered that the regulator satisfies with the
control ship in manoeuvring situations.
REFERENCES
Broel, Plater B, 1998, Fifth International Symposium on
Methods and Models in Automation and Robotics ‘Fuzzy
control for vessel motion’, pp. 697-702, Poland, 25-29
August.
Fosen T.I., 2002. Marine Control Systems. Marine Cybernetics,
Trondheim, Norway.
Gierusz W., 2001. In Proceedings of Int. IFAC Conf. Control
Applications in Marine ‘Simulation model of the
shiphandling training boat Blue Lady’, Glasgow, Scotland,
UK, 18-20 July.
-30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30 35
-35
-30
-25
-20
-15
-10
-5
0
5
10
15
20
25
30
East [ m]
North [m]
Set path
Vessel track
84
Grimble M.J., 2000. Industrial Control Systems Design.
JohnWiley and Sons, Chichester.
Passino K., 1998. Fuzzy Control, Longman.
The Mathworks Inc., 2005. Fuzzy Logic Toolbox User’s
Guide. The Mathworks Inc., Natick, MA