You are on page 1of 11

TTK4190 Guidance and Control of Vehicles: Assignment 3

Edvard Grødem, Jae Hyeong Hwang and Michael Hoyer

October 2020
1 Problem 1
1.1 (a)

(1)

ρm = m/LBH; (2)

Izf un = @(x, y, z)(x.2 + y.2 ) ∗ rhom ; Iz = integral3(Izf un , −L/2, L/2, −B/2, B/2, −H/2, H/2);
Iz about center of gravity is 3.7544e+10
Products of inertia is a kind of a moment of inertia but considers both axis. Because the x axis
and y axis of prism is in symmetry, Ixy = Iyx = 0

1.2 (b)
According to the Huygens-Steiner’s Parallel-Axis Theorem,

Ibb = m(((rgb )T rbg


b b
I3 − rbg b T
(rbg ) ) (3)

So Iz respect to CO is IzCG + m(x2 + y 2 ), which is about 3.7777e+10


ratio between the moments of inertia for the prism and the real ship is about 0.5753

1.3 (c)
1.4 (d)
Skew-symmetric property is useful when designing a nonlinear motion control system since the
quadratic form ν top CRB (ν)ν ≡ 0 This is exploited in energy-based designs where Lyapunov func-
tions play a key role.[1]

1.5 (e)
Since ocean current is assumed to be irrotational and CRB does not depend on linear velocity
Coroiolis matrix is useful.

1
2 Problem 2
2.1 a)
Using Archimedes law:
mg = ρg∆
Solving for ∆
m
∆=
ρ
This gives us a numeric value of
17.0677 ∗ 106 kg
∆= = 16651.41m3
1025kg/m3

2.2 b)
Assuming roll and pitch angle low we can use
Awp = LB
This gives us the numeric value
Awp = 161m ∗ 21.8m = 3509.8m2
Since the Awp is constant along heave we have that
Zns = −ρgAwp z n
This gives the numeric value
kg m
Zns = −1025 ∗ 9.81 2 ∗ 3509.8m2 ∗ z n = 35.283z n M N
m3 s

2.3 c)
s
2T
T3 = 2π
g
Inserting numeric values gives us
r
2 ∗ 8.9
T3 = 2π s = 8.46s
9.81

2.4 d)
IT
GMT =

IL
GML =

Since we are calculating on a prism we have that
BL3
IL =
12
LB 3
IT =
12
This gives us
GMT = 455.30m
GML = 8.34m

2
2.5 e)
The ship is metacentrically stable because

GMT >> 0

and
GML >> 0

3
3 Problem 3
3.1 Task a
By assuming assuming small values for heave-roll-pitch as well as no coupling between them and
the rest of the system, we can rewrite M as
 
Xu̇ Xv̇ Xṙ
MA =  Yu̇ Yv̇ Yṙ  (4)
Nu̇ Nv̇ Nṙ

By further assuming no coupling between surge and sway-yaw, as well as a symmetric added mass
matrix we can simplify MA to  
Xu̇ 0 0
MA =  0 Yv̇ Yṙ  (5)
0 Yṙ Nṙ
where Xu̇ , Yv̇ , Yṙ andNṙ are coefficients describing the coupling between acceleration of the vessel
and the force applied to the water surrounding it.

3.2 Task b
By using property 6.2 to define CA in terms of MA we can write it as
   
0 0 a2 0 0 Yv̇ vr + Yṙ r
CA (νr ) =  0 0 −a1 =  0 0 −Xu̇ ur  (6)
−a2 a1 0 −Yv̇ vr − Yṙ r Xu̇ ur 0

4
4 Problem 4

Figure 1: Final plots part 1

Figure 2: Final plots part 1

% P r o j e c t i n TTK4190 Guidance and C o n t r o l o f V e h i c l e s


%
% Author : My name
% Study program : My s t u d y program
addMass = 1 ;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% USER INPUTS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
h = 0.05; % s a m p l i n g time [ s ]
Ns = 1 0 0 0 ; % no . o f s a m p l e s

5
p s i r e f = 10 ∗ pi / 1 8 0 ; % d e s i r e d yaw a n g l e ( rad )
u ref = 7; % d e s i r e d s u r g e s p e e d (m/ s )

% ship parameters
m = 1 7 . 0 6 7 7 e6 ; % mass ( kg )
I z = 2 . 1 7 3 2 e10 ; % yaw moment o f i n e r t i a ( kg mˆ3)
xg = −3.7; % CG x−c c o r d i n a t e (m)
L = 161; % l e n g t h (m)
Beam = 2 1 . 8 ; % beam (m)
T = 8.9; % d r a f t (m)
KT = 0 . 7 ; % p r o p e l l e r c o e f f i c i e n t (−)
Dia = 3 . 3 ; % p r o p e l l e r d i a m e t e r (m)
rho = 1 0 2 5 ; % d e n s i t y o f w a t e r (m/ s ˆ3)
k i n v i s c = 1 e −6; % k i n e m a t i c v i s c o s i t y (m/ s ˆ2)

% damping
T1 = 2 0 ; % (s)
T2 = 2 0 ; % (s)
T6 = 1 0 ; % (s)
S = L ∗ Beam ; % (mˆ2)
k = 0.1;
Cr = 0 ;
epsilon = 0.001;

% rudder l i m i t a t i o n s
d e l t a m a x = 40 ∗ pi / 1 8 0 ; % max r u d d e r a n g l e ( rad )
Ddelta max = 5 ∗ pi / 1 8 0 ; % max r u d d e r d e r i v a t i v e ( rad / s )

% added mass m a t r i x
Xudot = −8.9830 e5 ;
Yvdot = −5.1996 e6 ;
Yrdot = 9 . 3 6 7 7 e5 ;
Nvdot = Yrdot ;
Nrdot = −2.4283 e10 ;

MA = − [ Xudot 0 0;
0 Yvdot Yrdot ;
0 Yrdot Nrdot ] ;

CA = @( u , v , r ) [ 0 0 Yvdot∗v + Yrdot ∗ r ;
0 0 −Xudot∗u ;
−Yvdot∗v−Yrdot ∗ r Xudot∗u 0];

% r i g i d −body mass m a t r i x
MRB = [ m 0 0
0 m m∗ xg
0 m∗ xg I z ] ;
i f addMass == 1
Minv = inv (MRB + MA) ;
else
Minv = inv (MRB) ;
end

% l i n e a r damping m a t r i x

6
Xu = − (m − Xudot ) / T1 ;
Yv = − (m − Yvdot ) / T2 ;
Nr = − ( I z − Nrdot ) / T6 ;
D = − diag ( [ Xu Yv Nr ] ) ;

% n o n l i n e a r damping param
Cf = @( ur ) 0 . 0 7 5 / ( ( ( log (L∗abs ( ur ) / k i n v i s c ) ) − 2 ) ˆ 2 + e p s i l o n ) ;
Cd = Hoerner (Beam , T ) ;

% input matrix
t thr = 0.05; % t h r u s t d e d u c t i o n number
X delta2 = 0; % rudder c o e f f i c i e n t s ( Section 9.5)
Y delta = 0;
N delta = 1;
B = [ (1− t t h r ) X delta2
0 Y delta
0 N delta ];

% initial states
eta = [0 0 0 ] ’ ;
nu = [ 0 . 1 0 0 . 1 ] ’ ;
delta = 0;
n = 0;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% MAIN LOOP
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
simdata = zeros ( Ns + 1 , 1 4 ) ; % t a b l e of simulation data

f o r i =1:Ns+1

t = ( i −1) ∗ h ; % time ( s )

% s t a t e −d e p e n d e n t time−v a r y i n g m a t r i c e s
CRB = m ∗ nu ( 3 ) ∗ [ 0 −1 −xg
1 0 0
xg 0 0 ] ;
i f addMass == 1
C = CRB + CA( nu ( 1 ) , nu ( 2 ) , nu ( 3 ) ) ;
else
C = CRB;
end
R = Rzyx ( 0 , 0 , e t a ( 3 ) ) ;

% r e f e r e n c e models
psi d = psi ref ;
r d = 0;
u d = u ref ;

% thrust
t h r = rho ∗ Dia ˆ4 ∗ KT ∗ abs ( n ) ∗ n ; % t h r u s t command (N)

% c o n t r o l law
delta c = 0.1; % r u d d e r a n g l e command ( rad )
n c = 10; % p r o p e l l e r speed ( rps )

7
% damping
u r = nu ( 1 ) ;
v r = nu ( 2 ) ;
r = nu ( 3 ) ;
X = − 0 . 5 ∗ rho ∗ S ∗ (1+k ) ∗ Cf ( u r ) ∗ u r ∗ abs ( u r ) ;

Yh = 0 ; % init
Nh = 0 ; % init
dx = L / 1 0 ; % 10 s t r i p s
f o r xL = −L / 2 : dx : L/2
Ucf = abs ( v r + xL∗ r ) ∗ ( v r + xL∗ r ) ;
Yh = Yh − 0 . 5 ∗ rho ∗T∗Cd∗ Ucf ∗dx ; % sway f o r c e
Nh = Nh − 0 . 5 ∗ rho ∗T∗Cd∗xL∗ Ucf ∗dx ; % yaw moment
end

t damp = − [X Yh Nh ] ’ ;

% s h i p dynamics
u = [ thr delta ] ’ ;
tau = B ∗ u ;
nu dot = Minv ∗ ( tau − C ∗ nu − D ∗ nu − t damp ) ; % added l i n e a r damping
e t a d o t = R ∗ nu ;

% Rudder s a t u r a t i o n and dynamics ( S e c t i o n s 9 . 5 . 2 )


i f abs ( d e l t a c ) >= d e l t a m a x
d e l t a c = sign ( d e l t a c ) ∗ d e l t a m a x ;
end

delta dot = delta c − delta ;


i f abs ( d e l t a d o t ) >= Ddelta max
d e l t a d o t = sign ( d e l t a d o t ) ∗ Ddelta max ;
end

% p r o p e l l e r dynamics
n dot = (1/10) ∗ ( n c − n ) ;

% s t o r e simulation data in a t a b l e ( f o r t e s t i n g )
simdata ( i , : ) = [ t n c d e l t a c n d e l t a eta ’ nu ’ u d p s i d r d ] ;

% Euler i n t e g r a t i o n
e t a = e u l e r 2 ( e t a d o t , eta , h ) ;
nu = e u l e r 2 ( nu dot , nu , h ) ;
delta = euler2 ( delta dot , delta , h ) ;
n = e u l e r 2 ( n dot , n , h ) ;

end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% PLOTS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
t = simdata ( : , 1 ) ; % s
n c = 60 ∗ simdata ( : , 2 ) ; % rpm
d e l t a c = ( 1 8 0 / pi ) ∗ simdata ( : , 3 ) ; % deg
n = 60 ∗ simdata ( : , 4 ) ; % rpm
delta = ( 1 8 0 / pi ) ∗ simdata ( : , 5 ) ; % deg
x = simdata ( : , 6 ) ; %m

8
y = simdata ( : , 7 ) ; % m
psi = ( 1 8 0 / pi ) ∗ simdata ( : ,8); % deg
u = simdata ( : , 9 ) ; % m/ s
v = simdata ( : , 1 0 ) ; % m/ s
r = ( 1 8 0 / pi ) ∗ simdata ( : ,11); % deg / s
u d = simdata ( : , 1 2 ) ; % m/ s
psi d = ( 1 8 0 / pi ) ∗ simdata ( : ,13); % deg
r d = ( 1 8 0 / pi ) ∗ simdata ( : ,14); % deg / s

figure (1)
f i g u r e ( gcf )
subplot ( 3 1 1 )
plot ( y , x , ’ l i n e w i d t h ’ , 2 ) ; axis ( ’ e q u a l ’ )
t i t l e ( ’ North−East p o s i t i o n s (m) ’ ) ; xlabel ( ’ (m) ’ ) ; ylabel ( ’ (m) ’ ) ;
subplot ( 3 1 2 )
plot ( t , p s i , t , p s i d , ’ l i n e w i d t h ’ , 2 ) ;
t i t l e ( ’ Actual and d e s i r e d yaw a n g l e s ( deg ) ’ ) ; xlabel ( ’ time ( s ) ’ ) ;
subplot ( 3 1 3 )
plot ( t , r , t , r d , ’ l i n e w i d t h ’ , 2 ) ;
t i t l e ( ’ Actual and d e s i r e d yaw r a t e s ( deg / s ) ’ ) ; xlabel ( ’ time ( s ) ’ ) ;

figure (2)
f i g u r e ( gcf )
subplot ( 3 1 1 )
plot ( t , u , t , u d , ’ l i n e w i d t h ’ , 2 ) ;
t i t l e ( ’ Actual and d e s i r e d s u r g e v e l o c i t i e s (m/ s ) ’ ) ; xlabel ( ’ time ( s ) ’ ) ;
subplot ( 3 1 2 )
plot ( t , n , t , n c , ’ l i n e w i d t h ’ , 2 ) ;
t i t l e ( ’ Actual and commanded p r o p e l l e r s p e e d ( rpm ) ’ ) ; xlabel ( ’ time ( s ) ’ ) ;
subplot ( 3 1 3 )
plot ( t , d e l t a , t , d e l t a c , ’ l i n e w i d t h ’ , 2 ) ;
t i t l e ( ’ Actual and commanded r u d d e r a n g l e s ( deg ) ’ ) ; xlabel ( ’ time ( s ) ’ ) ;

9
References
[1] Thor.I.Fossen, HANDBOOK OF MARINE CRAFT HYDRODYNAMICS AND MOTION
CONTROL. John Wiley Sons, 2011, 2021.

10

You might also like