SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER...

112
SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A THESIS SUBMITTED TO THE GRADUATE SCHOOL OF NATURAL AND APPLIED SCIENCES OF MIDDLE EAST TECHNICAL UNIVERSITY BY FATİH GERİDÖNMEZ IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE IN AEROSPACE ENGINEERING SEPTEMBER 2007

Transcript of SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER...

Page 1: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

SIMULATION OF MOTION OF AN UNDERWATER VEHICLE

A THESIS SUBMITTED TO THE GRADUATE SCHOOL OF NATURAL AND APPLIED SCIENCES

OF MIDDLE EAST TECHNICAL UNIVERSITY

BY

FATİH GERİDÖNMEZ

IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR

THE DEGREE OF MASTER OF SCIENCE IN

AEROSPACE ENGINEERING

SEPTEMBER 2007

Page 2: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

Approval of the thesis:

SIMULATION OF MOTION OF AN UNDERWATER VEHICLE

Submitted by FATİH GERİDÖNMEZ in partial fulfillment of the requirements for the degree of Master of Science in Aerospace Engineering Department, Middle East Technical University by,

Prof. Dr. Canan Özgen ______________

Dean, Graduate School of Natural and Applied Sciences

Prof. Dr. İsmail H. Tuncer ______________

Head of Department, Aerospace Engineering Dept.

Prof. Dr. Nafiz Alemdaroğlu ______________

Supervisor, Aerospace Engineering Dept., METU

Şamil Korkmaz ______________

Co-Supervisor, TÜBİTAK-SAGE

Examining Committee Members:

Prof. Dr. Kahraman Albayrak ______________

Mechanical Engineering Dept., METU

Prof. Dr. Nafiz ALEMDAROĞLU ______________

Aerospace Engineering Dept., METU

Assoc. Prof. Dr. Altan Kayran ______________

Aerospace Engineering Dept., METU

Assoc. Prof. Dr. Serkan ÖZGEN ______________

Aerospace Engineering Dept., METU

Şamil KORKMAZ ______________

Head of Modeling And Simulation Dept., TÜBİTAK-SAGE

Date: 06.09.2007

Page 3: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

iii

PLAGIARISM

I hereby declare that all information in this document has been obtained and presented in accordance with academic rules and ethical conduct. I also declare that, as required by these rules and conduct, I have fully cited and referenced all material and results that are not original to this work. Name, Last Name : Fatih GERİDÖNMEZ Signature :

Page 4: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

iv

ABSTRACT

SIMULATION OF MOTION OF AN UNDERWATER VEHICLE

GERİDÖNMEZ, Fatih

Ms., Department of Aerospace Engineering

Supervisor: Prof. Dr. Nafiz ALEMDAROĞLU

Co-Supervisor: Şamil KORKMAZ

September 2007, 90 pages

In this thesis, a simulation package for the Six Degrees of Freedom (6DOF) motion

of an underwater vehicle is developed. Mathematical modeling of an underwater

vehicle is done and the parameters needed to write such a simulation package are

obtained from an existing underwater vehicle available in the literature.

Basic equations of motion are developed to simulate the motion of the underwater

vehicle and the parameters needed for the hydrodynamic modeling of the vehicle is

obtained from the available literature.

6DOF simulation package prepared for the underwater vehicle was developed using

the MATLAB environment. S-function hierarchy is developed using the same

platform with C++ programming language. With the usage of S-functions the

problems related to the speed of the platform have been eliminated. The use of S-

function hierarchy brought out the opportunity of running the simulation package

on other independent platforms and get results for the simulation.

Page 5: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

v

Keywords: Underwater Vehicle Simulation, Virtual Reality Modeling Language

(VRML), MATLAB S-function, Simulink, C++, 6DOF.

Page 6: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

vi

ÖZ

BİR SUALTI ARACININ HAREKETİNİN SİMÜLASYONU

GERİDÖNMEZ, Fatih

Yüksek Lisans., Havacılık ve Uzay Mühendisliği Bölümü

Tez yöneticisi: Prof. Dr. Nafiz ALEMDAROĞLU

Ortak tez yöneticisi: Şamil KORKMAZ

Eylül 2007, 90 sayfa

Bu çalışmada, bir sualtı aracının altı serbestlik dereceli hereketinin bilgisayar

ortamında simülasyonu geliştirilmiştir. Sualtı aracının matematiksel modeli

oluşturulmuş ve bu matematiksel modelde literatürde mevcut bir sualtı aracına ait

parametreler kullanılmıştır.

Bu tez kapsamında, bir sualtı aracının benzetiminin yapılabilmesi için literatürde

bulunan hidrodinamik modeller araştırılmış ve kullanılacak veriler belirlenmiştir.

Benzetim için MATLAB ve Simulink paltformu kullanılmıştır. Gene aynı

platformda yörünge benzetimi için C++ dilinde S-function hiyerarşisi tasarlanmıştır.

Bu sayede de benzetimin olası hız problemlerini önceden elemek mümkün

olmuştur. Ayrıca bağımsız platformlarda benzetimi koşturup sonuçlarını görme

olanağı elde edilmiştir.

Anahtar Kelimeler: Sualtı aracı simülasyonu, VRML, MATLAB S-function,

Simulink, C++, Altı serbestlik dereceli hareket simülasyonu.

Page 7: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

vii

To my father and mother, to my wife,

and also to all brothers and sisters

Page 8: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

viii

ACKNOWLEDGMENTS

I would like to express my sincere gratitude to Prof. Dr. Nafiz ALEMDAROĞLU

and Şamil KORKMAZ for their guidance and insight through out this study.

This work has been supported by TÜBİTAK-SAGE. I would also like to convey my

thanks to the TÜBİTAK-SAGE Flight Dynamics Group members for their

assistance and understanding.

I would like to thank to Dr. Gökmen MAHMUTYAZICIOĞLU and Koray

DAYANÇ for their support and advices. I would like to express very special thanks

to Dr. Umut DURAK for him support and for helpful discussions we have made

throughout the study. I would like to thank to my brothers Koray KÜÇÜK, Kamil

TULUM, Çağatay TANIL and Gökhan BİRCAN for being the best team members

whom I am proud and honored to be their friend.

I would like to express my thanks to my wife Serap GÜNGÖR GERİDÖNMEZ for

her valuable support on writing this thesis. Thanks also go to all of my friends who

kept me motivated. Finally, my deepest thanks go to my family who gave me the

endless support and love, which made this thesis possible.

Page 9: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

ix

TABLE OF CONTENTS

ABSTRACT............................................................................................................IV

ÖZ............................................................................................................................VI

ACKNOWLEDGMENTS ..................................................................................VIII

TABLE OF CONTENTS.......................................................................................IX

LIST OF TABLES ............................................................................................... XII

LIST OF FIGURES ............................................................................................XIII

LIST OF SYMBOLS ..........................................................................................XVI

CHAPTERS.............................................................................................................. 1

1 INTRODUCTION............................................................................................ 1

1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ............................ 1

1.2 LITERATURE SURVEY .................................................................................. 2

1.2.1 ARPA / Navy Unmanned Undersea Vehicle (UUV)........................... 3

1.2.2 MIT- Marie Polsenberg Manually Controlled AUV .......................... 4

1.2.3 GAVIA Great Northern Diver ............................................................ 4

1.2.4 Electric Glider.................................................................................... 5

1.2.5 REMUS............................................................................................... 6

1.2.6 Theseus AUV ...................................................................................... 7

1.3 SCOPE OF THE THESIS.................................................................................. 8

1.3.1 Vehicle Profile.................................................................................... 9

1.3.1.1 Main Dimensions and Properties ................................................... 9

1.4 ORGANIZATION OF THE THESIS ................................................................. 14

2 MATHEMATICAL MODELING OF UNDERWATER VEHICLE ....... 16

2.1 INTRODUCTION.......................................................................................... 16

Page 10: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

x

2.2 COORDINATE SYSTEMS, POSITIONAL DEFINITIONS AND KINEMATICS....... 17

2.2.1 Reference Frames............................................................................. 18

2.2.2 Euler Angles ..................................................................................... 20

2.2.3 Kinematics........................................................................................ 23

2.3 DYNAMIC EQUATIONS OF MOTION............................................................ 27

2.3.1 Translational Equations of Motion .................................................. 27

2.3.2 Rotational Equations of Motion....................................................... 28

2.3.3 Equations of Motion......................................................................... 29

2.4 HYDROSTATIC FORCES AND MOMENTS (RESTORING FORCES AND

MOMENTS)............................................................................................................ 31

2.5 HYDRODYNAMIC FORCES AND MOMENTS................................................. 32

2.6 VALIDATION OF EQUATIONS OF MOTION .................................................. 34

2.7 THRUSTER MODEL .................................................................................... 36

3 CONTROL SYSTEM DESIGN.................................................................... 38

3.1 INTRODUCTION.......................................................................................... 38

3.2 HEADING CONTROL SYSTEM DESIGN ........................................................ 39

3.2.1 Lateral Dynamics ............................................................................. 40

3.3 YAW ANGLE CONTROLLER DESIGN .......................................................... 51

3.4 PITCH ATTITUDE CONTROL SYSTEM DESIGN ............................................ 51

3.5 DEPTH CONTROLLER DESIGN.................................................................... 58

4 SIMULATION TECHNOLOGY ................................................................. 62

4.1 VIRTUAL REALITY MODELING LANGUAGE (VRML) ................................ 62

4.1.1 VRML: An Overview ........................................................................ 62

4.1.2 What is VRML? ................................................................................ 63

4.1.3 VRML Model of the NPS AUV Model Used In the Thesis ............... 63

4.2 SIMULINK S-FUNCTION ............................................................................. 66

4.2.1 S-functions (System-Functions)........................................................ 66

4.2.2 What is S-Function?......................................................................... 67

5 TEST CASES.................................................................................................. 69

Page 11: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

xi

5.1 INTRODUCTION.......................................................................................... 69

5.2 TEST CASES .............................................................................................. 71

5.2.1 Straight Line Path ............................................................................ 71

5.2.2 Path Following In a Vertical Plane ................................................. 77

5.2.3 Path Following In Horizontal Plane................................................ 80

6 CONCLUSION............................................................................................... 86

REFERENCES....................................................................................................... 88

Page 12: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

xii

LIST OF TABLES

Table 1 Physical properties of the underwater vehicle used in the simulation ........ 11

Table 2 Surge (Longitudinal) Non – Dimensional Hydrodynamic Coefficients ..... 12

Table 3 Sway (Lateral) Non – Dimensional Hydrodynamic Coefficients............... 12

Table 4 Heave (Vertical) Non – Dimensional Hydrodynamic Coefficients ............ 12

Table 5 Roll Non – Dimensional Hydrodynamic Coefficients ................................ 13

Table 6 Pitch Non – Dimensional Hydrodynamic Coefficients............................... 13

Table 7 Yaw Non – Dimensional Hydrodynamic Coefficients ............................... 13

Table 8 Standard underwater vehicle notation. The notation is adopted from [18]. 18

Table 9 Initial conditions for vacuum trajectory test ............................................... 35

Table 10 Thruster efforts, rpm vs. surge velocity .................................................... 37

Page 13: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

xiii

LIST OF FIGURES

Figure 1 ARPA picture captured from [6]. ................................................................ 3

Figure 2 A manual control example of an AUV [1] .................................................. 4

Figure 3 GAVIA modular AUV parts [9] .................................................................. 5

Figure 4 GAVIA AUV [9] ......................................................................................... 5

Figure 5 Force balance diagram of forces acting on Glider, angle of attack not included [8] ........................................................................................................ 6

Figure 6 A picture of Electric Glider. The glider at the back and swept back wings are the main interesting features [8]................................................................... 6

Figure 7 REMUS 600 [15]......................................................................................... 7

Figure 8 Theseus AUV [17]....................................................................................... 8

Figure 9 Schematic drawing of NPS AUV II [6]....................................................... 9

Figure 10 Exterior view of NPS AUV II ................................................................... 9

Figure 11 An underwater vehicle simulation architecture ....................................... 14

Figure 12 Body-fixed and earth fixed reference frames .......................................... 20

Figure 13 Body fixed coordinate system linear and angular velocity convention... 21

Figure 14 Test model prepared with Simulink 6 DOF Equations of Motion block (Aerospace Blockset). ...................................................................................... 35

Figure 15 Plot of vacuum trajectories for validation of the model. (Note that the trajectories are exactly equal, so they overlap) ................................................ 36

Figure 16 Heading of the vehicle illustrated in horizontal plane ............................. 39

Figure 17 Heading controller block diagram ........................................................... 43

Figure 18 Control architecture chosen from MATLAB Control and Estimation

Tools Manager ................................................................................................. 44

Figure 19 Root locus of the system and the Bode plot of the inner loop of the system given in Figure 17 Zero at -0.519, Poles at: -1.086, -0.298 and 0.0. ... 45

Page 14: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

xiv

Figure 20 Step and frequency response of the system given in Figure 17............... 46

Figure 21 Root locus of system and bode plot of the inner loop after tuning.......... 47

Figure 22 Root locus and the bode plot of the system after tuning.......................... 47

Figure 23 Step response and the bode diagram of the system after tuning.............. 48

Figure 24 Vehicle response to 10 degrees of heading change. ................................ 49

Figure 25 Response of the vehicle for zigzag maneuver command......................... 50

Figure 26 Yaw angle controller block diagram........................................................ 51

Figure 27 Buoyancy and Gravity forces acting to the CB and the CG position, respectively ...................................................................................................... 52

Figure 28 Depth change of vehicle during its mission for manual, automatic attitude controller and without any control. .................................................................. 53

Figure 29 Block diagram of pitch attitude controller............................................... 54

Figure 30 Response of the system with pitch attitude controller ............................. 57

Figure 31 Gain determination block of pitch attitude controller.............................. 58

Figure 32 Step response of system given in Figure 29 for 3 degrees of pitch angle change .............................................................................................................. 58

Figure 33 Depth controller block diagram............................................................... 59

Figure 34 Simulink model for depth controller gain determination ........................ 60

Figure 35 Dynamic response of the system with depth controller........................... 61

Figure 36 Step response of the block given in Figure 33......................................... 61

Figure 37 MATLAB – VRML interaction [13] ....................................................... 63

Figure 38 VR Sink Block. The body fixed positions are fed to block to visualize the vehicle in 3D environment ............................................................................... 64

Figure 39 A screen capture of Virtual Reality Toolbox Viewer.............................. 65

Figure 40 Parent system for VRML viewer. (Monitor Block )................................ 65

Figure 41 Parent system for VR Sink block (VRML viewer block)........................ 66

Page 15: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

xv

Figure 42 Auto scale and automatically drawn dashed line to the waypoint........... 70

Figure 43 Display blocks for vehicle position and body fixed velocities ................ 71

Figure 44 Straight line path with running constant depth of 3 meters ..................... 71

Figure 45 Range vs. Yaw graph of the straight line path following test.................. 72

Figure 46 Vehicle body-fixed velocities during straight line test 1 ......................... 73

Figure 47 Thrust values during the whole mission (Straight Line Test 1) .............. 74

Figure 48 Fin deflections during the whole mission (straight line test 1)................ 75

Figure 49 Range vs. Depth during the whole mission (straight line test 1) Note that negative depth implies positive depth with respect to body axes .................... 75

Figure 50 Straight line test case with automatic heading controller ........................ 76

Figure 51 Depth vs. Range and Rudder deflections vs. Range graphs for automatic heading controlled straight line test case ......................................................... 77

Figure 52 Path following in vertical plane............................................................... 78

Figure 53 Path following in vertical plane test result. Note tat negative depth indicates the positive z axis in earth frame ...................................................... 79

Figure 54 Fins deflections during the path following in vertical plane test [rad] .... 79

Figure 55 Path following in vertical plane test with depth controller...................... 80

Figure 56 Path following in horizontal plane (case 1) (waypoints on 2D grid)....... 81

Figure 57 Path following in horizontal plane test result with joystick control ........ 82

Figure 58 Fins deflections........................................................................................ 82

Figure 59 Propeller rpm ........................................................................................... 83

Figure 60 Thrusters efforts....................................................................................... 83

Figure 61 Depth change during the whole mission of path following in horizontal plane test .......................................................................................................... 84

Figure 62 Path following in a horizontal plane test with heading controller ........... 85

Page 16: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

xvi

LIST OF SYMBOLS

x, y, z Axes of body fixed reference frame

X, Y, Z Axes of earth fixed reference frame

x� Linear velocity along the North-South axis (earth)

y� Linear velocity along the East- West axis (earth)

z� Linear velocity along the vertical axis (earth)

φ Euler angle in North-South axis. Positive sense is

clockwise as seen from back of the vehicle (earth)

θ Euler angle in pitch plane. Positive sense is clockwise as

seen from port of the vehicle (earth)

ψ Euler angle in yaw plane. Positive sense is clockwise as

seen from above (earth)

φ� Roll Euler rate about North-South axis (earth)

θ� Pitch Euler rate about East-West axis (earth)

ψ� Roll Euler rate about North-South axis (earth)

u Linear velocity along longitudinal axis (body)

v Linear velocity along horizontal plane (body)

w Linear velocity along depth (body)

p Angular velocity component about body longitudinal axis

q Angular velocity component about body lateral axis

r Angular velocity component about body vertical axis

u� Time rate of change of velocity along the body

longitudinal axis

v� Time rate of change of velocity along the body lateral

Page 17: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

xvii

axis

w� Time rate of change of velocity along the body vertical

axis

p� Time rate of change of body roll angular velocity about

the body longitudinal axis

q� Time rate of change of body pitch angular velocity about

the body lateral axis

r� Time rate of change of body yaw angular velocity about

the body vertical axis

rδ Stern rudder deflection angle. (It is noted as Stern, since

the vehicle used in this thesis has both bow and stern

rudders. But just stern rudders are used throughout the

simulation.

eδ Stern planes (elevator) deflection angle. (It is noted as

Stern plane, since the vehicle used in this thesis has both

bow and stern planes. But just stern planes are used

throughout the simulation.

n Propeller revolutions per minute

W Weight of the vehicle

B Buoyancy of the vehicle

L Length of the vehicle. Also known as characteristic

length. Dynamic equations of motion are written to

explicitly utilize L as normalization coefficient. [6]

g Acceleration due to gravity

ρ Density of fluid

D2 0.5 ρL2

D3 0.5 ρL3

D4 0.5 ρL4

Page 18: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

xviii

D5 0.5 ρL5

W Weight

m mass

B Buoyancy

Ixx Mass Moment of Inertia about x-axis

Iyy Mass Moment of Inertia about y-axis

Izz Mass Moment of Inertia about z-axis

Ixy Cross Product of Inertia about xy-axes

Iyz Cross Product of Inertia about yz-axes

Ixz Cross Product of Inertia about xz-axes

CG Center of gravity

xG x Coordinate of CG From Body Fixed Origin

yG y Coordinate of CG From Body Fixed Origin

zG z Coordinate of CG From Body Fixed Origin

CB Center of buoyancy

xB x Coordinate of CB From Body Fixed Origin

yB y Coordinate of CB From Body Fixed Origin

zB z Coordinate of CB From Body Fixed Origin

Cd0 Drag coefficient along longitudinal axis (body)

K1, k1, K2, k2, kcd,

, ,q d

k k kθ θ , C1, C2

Controller gains

H, G Plants simulating the dynamic model

uX� Drag contribution in the longitudinal X direction due to

time rate of change of u [6]

ppX Drag force due to square of roll rate of body

qqX Drag force due to square of pitch rate of body

Page 19: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

xix

rrX Drag force due to square of yaw rate of body

prX Drag force due to r and p

wqX Drag force due to q and w

vpX Drag force due to p and v

vvX Drag force due to square of v

wwX Drag force due to square of w

η Steady state speed per maximum propeller revolutions per

minute (rpm)

r rXδ δ Drag force due to square deflection angle of rudder

respectively due to square of u

e eXδ δ Drag force due to square deflection angle of elevator

respectively due to square of u

ewX δ Drag force due to deflection angle of elevator

respectively due to w

rvX δ Drag force due to deflection angle of rudder and v

eqX δ Drag force due to deflection angle of elevator and q

rrX δ Drag force due to deflection angle of rudder and r.

pY� Sway force due to time rate of change of p

rY� Sway force due to time rate of change of r

pqY Sway force due to q and p

qrY Sway force due to r and q

vY� Sway force due to time rate of change of v

upY Sway force due to p and u

Page 20: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

xx

urY Sway force due to r and u

vqY Sway force due to q and v

pYω Sway force due to p and w

wrY Sway force due to r and w

vqY Sway force due to q and v

wpY Sway force due to p and w

wrY Sway force due to r and w

qZ� Heave force due to time rate of change of q

ppZ Heave force due square of p

prZ Heave force due to r and p

rrZ Heave force due to square of r

wZ� Heave force due to time rate of change of w

qZ Heave force due to q

vpZ Heave force due to p and v

vrZ Heave force due to r and v

wZ Heave force due to w

vvZ Heave force due to square of v

eZδ Heave force due to elevator deflection

pK� Roll moment due to time rate of change of p

rK� Roll moment due to time rate of change of r

pqK Roll moment due to q and p

qrK Roll moment due to r and q

Page 21: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

xxi

vK� Roll moment due to time rate of change of v

pK Roll moment due to time rate of change of p

rK Roll moment due to r

vqK Roll moment due to q and v

wpK Roll moment due to p and w

wrK Roll moment due to r and w

vK Roll moment due to v

vwK Roll moment due to w and v

qM� Pitch moment due to time rate of change of q

ppM Pitch moment due to square of p

prM Pitch moment due to r and p

rrM Pitch moment due to square of r

wM� Pitch moment due to time rate of change of w

uqM Pitch moment due to q and u

vpM Pitch moment due to p and v

vrM Pitch moment due to r and v

wM Pitch moment due to w

vvM Pitch moment due to square of v

eMδ Pitch moment due elevator deflection

pN� Yaw Moment due to time rate of change of p

rN� Yaw Moment due to time rate of change of r

pqN Yaw Moment due to q and p

Page 22: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

xxii

qrN Yaw Moment due to r and q

vN� Yaw Moment due to time rate of change of v

pN Yaw Moment due to p

rN Yaw Moment due to r

vqN Yaw Moment due to q and v

wpN Yaw Moment due to p and w

wrN Yaw Moment due to r and w

vN Yaw Moment due to v

vwN Yaw Moment due to w and v

rNδ Yaw Moment due to rudder deflection

Page 23: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

1

CHAPTER 1

1 INTRODUCTION

1.1 Simulation of Motion of an Underwater Vehicle

One of the safest ways to explore the underwater is using small unmanned vehicles

to carry out various missions and measurements, among others, can be done without

risking people's life. With the advent of underwater vehicles, the researchers

capability to investigate the deep waters is extremely improved. Today underwater

vehicles are becoming more popular especially for environmental monitoring and

for defense purposes.

The grooving importance of Autonomous Underwater Vehicles (AUVs) in research

areas can easily be understood if the Unmanned Underwater Vehicles (UUV)

program for the US Navy described below, is investigated [22]:

“UUV programs will extend knowledge and control of the undersea battle space

through the employment of cost-effective, covert, off-board sensors capable of

operating reliably in areas of high risk and political sensitivity. They will provide

unmanned systems capable of improving, supplementing, or replacing manned

systems in order to enhance force efficiency, reduce costs, and reduce risk to people

and platforms.”

Unmanned Underwater Vehicles (UUVs) fall between the “Remotely Operated

Vehicles (ROVs)” and the torpedo. They are being widely used in commercial,

scientific and military missions for explorations of water basin, temperature, and

composition of the surrounding fluid, current speed, tidal waters and life forms in

its natural habitats.

As a result there is a need to investigate the lakes and the coastal waters because of

the influences of all changes therein have on people. A platoon of unmanned

Page 24: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

2

vehicles could be used to explore the under water environments more thoroughly

and efficiently.

This simulation develops and describes software architecture for an underwater

vehicle. Interaction with human is realized by means of a joystick input to control

the depth and azimuth of the vehicle in 3D. 3D visualization is developed using

VRML.

1.2 Literature Survey

There are numerous research communities working on the design and construction

of underwater vehicles for different purposes as mentioned in the pervious section.

Key papers in this field are primarily found in the proceedings of annual

conferences which goes back to 1990s. These include the following conferences:

• IEEE Oceanic Engineering Society (OES) Autonomous Underwater Vehicle

(AUV) symposia and OCEANS conferences [12].

• AUV Laboratories MIT, There are several types of underwater vehicles built

by different companies. Some specifications of vehicles are presented [10].

• Autonomous Undersea Systems Institute (AUSI): AUSI has been mainly

funded through grants from the Office of Naval Research and the National

Science Foundation. AUSI also provides its facilities and expertise to

support research programs at other institutions and AUSI continues to

organize and conduct International Symposia on Unmanned Untethered

Submersible Technology. Many kinds of AUVs can be found through the

AUSI research center [2].

Also many papers and publications about the Autonomous Underwater Vehicles

(AUV) can be found from Center for Autonomous Underwater Vehicle

Research of Naval Postgraduate School [4].

Page 25: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

3

Some of representative and pertinent AUV projects are summarized below.

1.2.1 ARPA / Navy Unmanned Undersea Vehicle (UUV)

Laboratories were contracted to build two large UUVs for tactical naval missions,

particularly open-ocean minefield search.

Figure 1 ARPA picture captured from [6].

These vehicles are the largest, the most capable and the most expensive AUVs

(approximately $9 million) built to date. The ARPA UUVs use high-density silver

zinc batteries for 24 hours of operational endurance at 5-10 knots (2.57 – 5.14 m/s)

submerged. Weighing 15,000 pounds (680 kg) in air, the vehicles have titanium

hulls which permit a test depth of 1,000 feet (305 m) [6].

Page 26: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

4

1.2.2 MIT- Marie Polsenberg Manually Controlled AUV

Manually controlled AUVs can be found throughout literature [1]. For example Ann

Marie Polsenberg, MIT can be investigated for this purpose. In this example a lap

box is designed to control rudder and elevator of the vehicle displaying the rudder

and the elevator deflections on the LCD [1].

Figure 2 A manual control example of an AUV [1]

1.2.3 GAVIA Great Northern Diver

The small size and the deep-water research AUV GAVIA has modular parts

developed by Hafmynd Corporation Iceland [9].

Page 27: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

5

Figure 3 GAVIA modular AUV parts [9]

Figure 4 GAVIA AUV [9]

1.2.4 Electric Glider

Gliders are unique in the AUV world, in that the forward propulsion is created by

varying vehicle buoyancy [8]. Wings and control surfaces convert the vertical

velocity into forward velocity so that the vehicle glides downward when denser than

water and glides upward when buoyant (Figure 5). Gliders require no propeller and

operate in a vertical saw tooth trajectory.

Page 28: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

6

Figure 5 Force balance diagram of forces acting on Glider, angle of attack not

included [8]

Figure 6 A picture of Electric Glider. The glider at the back and swept back wings

are the main interesting features [8]

1.2.5 REMUS

There are over 70 REMUS (Remote Environmental Measuring Units) autonomous

underwater vehicle systems designed for operation in coastal environments from

Page 29: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

7

100 to 6000 meters in depth [15]. These AUVs are designed by Woods Hole

Oceanographic Institute (WHOI) and moved out of the institute and into

HYDROID Corporation. A picture of the REMUS 600 (Operating up to 600 meters

in depth) is given in Figure 7.

Figure 7 REMUS 600 [15]

1.2.6 Theseus AUV

Another interesting AUV Theseus (Figure 8) was developed by the U.S. and

Canadian Defense Establishments to lay long lengths of fiber-optic cable under the

Arctic ice pack. The vehicle completed successful deployments to the Arctic in

1995 and 1996. During the 1996 deployment, a 190 km cable was laid at 500 meter

depths under a 2.5 meter thick ice pack. The overall mission distance was 365 km,

making this the longest AUV mission to date. Its length is 10.7 meters, diameter:

1.27 meters, displacement: 8600 kg (with 220 km cable), nominal Speed: 4 knots

[17].

Page 30: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

8

Figure 8 Theseus AUV [17]

1.3 Scope of the Thesis

For modeling of underwater vehicle dynamics, the vehicle designed and operated by

the Naval Post Graduate School, NPS AUV II, is used. This vehicle is used as a

workbench to support the physics-based AUV modeling and for visualization of the

vehicle behavior, animation based on the vehicle-specific hydrodynamics is used.

All of the work done in this study can easily be configured to model arbitrary

vehicles.

Page 31: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

9

1.3.1 Vehicle Profile

In this thesis NPS AUV II is used as the underwater vehicle to be simulated. The

schematic drawing of NPS AUV II is shown in Figure 9. The vehicle dimensions

and major hydrodynamic components are described below.

Figure 9 Schematic drawing of NPS AUV II [6].

1.3.1.1 Main Dimensions and Properties

The NPS AUV II has four paired plane surfaces and bidirectional twin propellers.

The vehicle is ballasted to be neutrally buoyant at 53400 N. It is slender formed and

is 5.3m long. An external view of the vehicle is shown in Figure 10

Figure 10 Exterior view of NPS AUV II

Page 32: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

10

The main inertial and hydrodynamic parameters of the NPS AUV II are given in

Table 1 to Table 7. All of the hydrodynamic data given in these tables are taken

from [18].

Page 33: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

11

Table 1 Physical properties of the underwater vehicle used in the simulation

Parameter Description Value

ρ Density of fluid 1000 kg / m3

W Weight 53400 N

m Mass 5443.4 kg

B Buoyancy 53400 N

L Characteristic Length 5.3 m

Ixx Mass Moment of Inertia about x-axis 2038 Nms2

Iyy Mass Moment of Inertia about y-axis 13587 Nms2

Izz Mass Moment of Inertia about z-axis 13587 Nms2

Ixy Cross Product of Inertia about xy-axes -13.58 Nms2

Iyz Cross Product of Inertia about yz-axes -13.58 Nms2

Ixz Cross Product of Inertia about xz-axes -13.58 Nms2

xG x Coordinate of CG From Body Fixed Origin 0.0 m

yG y Coordinate of CG From Body Fixed Origin 0.0 m

zG z Coordinate of CG From Body Fixed Origin 0.061 m

xB x Coordinate of CB From Body Fixed Origin 0.0 m

yB y Coordinate of CB From Body Fixed Origin 0.0 m

zB z Coordinate of CB From Body Fixed Origin 0.0 m

Page 34: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

12

Table 2 Surge (Longitudinal) Non – Dimensional Hydrodynamic Coefficients

uX�= -7.6 ×10-3

prX = 7.5 ×10-4

wwX = 1.7 ×10-1

e eXδ δ = -1.0 ×10-1

ppX = -7.0 ×10-3

wqX = -2.0 ×10-1

rrX δ = -1.0 ×10-3

ewX δ = 4.6 ×10-2

qqX = -1.5 ×10-2

vpX = -3.0 ×10-3

r rXδ δ = -1.0 ×10-2

rvX δ = 1.7 ×10-3

rrX = 4.0 ×10-3

vvX = 5.3 ×10-2

eqX δ = 2.5 ×10-2

Table 3 Sway (Lateral) Non – Dimensional Hydrodynamic Coefficients

pY�= 1.2 ×10-4

vY�= -5.5 ×10-2

pYω = 2.3×10-1

uvY = -1.9 ×10-2

rY�= 1.2 ×10-3

upY = 3.0 ×10-3

wrY = -1.9 ×10-3

vwY = 6.8 ×10-2

pqY = 4.0 ×10-3

urY = 3.0 ×10-2

vqY = 2.4 ×10-2 uv

Y = -1.0 ×10-1

qrY = -6.5 ×10-3

vqY = 2.4 ×10-2

wpY = 2.3 ×10-1

rYδ =2.7 ×10-2

Table 4 Heave (Vertical) Non – Dimensional Hydrodynamic Coefficients

qZ�= -6.8 ×10-3

wZ�= -2.4 ×10-1

wZ = -3.0 ×10-1

ppZ = 1.3 ×10-4

qZ = -1.4 ×10-1

vvZ = -6.8 ×10-2

prZ = 6.7 ×10-3

pZυ = -4.8 ×10-2

eZδ = -7.3 ×10-2

rrZ = -7.4 ×10-3

rZυ = 4.5 ×10-2

Page 35: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

13

Table 5 Roll Non – Dimensional Hydrodynamic Coefficients

pK�= -1.0 ×10-3 Kυ� = 1.2 ×10-4

wpK = -1.3 ×10-4

rK�= -3.4 ×10-5

pK = -1.1 ×10-2

wrK = 1.4 ×10-2

pqK = -6.9 ×10-5

rK = -8.4 ×10-4

vK = 3.1 ×10-3

qrK = 1.7 ×10-2

qKυ = -5.1 ×10-3

vwK = -1.9 ×10-1

Table 6 Pitch Non – Dimensional Hydrodynamic Coefficients

qM�= -1.7 ×10-2

wM�= -6.8 ×10-3

uwM = 1.0 ×10-1

ppM = 5.3 ×10-5

uqM = -6.8 ×10-3

vvM = -2.6 ×10-2

prM = 5.0 ×10-3

pMυ = 1.2 ×10-3

eMδ = -4.1 ×10-2

rrM = 2.9 ×10-3

rMυ = 1.7 ×10-2

Table 7 Yaw Non – Dimensional Hydrodynamic Coefficients

pN�= -3.4 ×10-5 Nυ� = 1.2 ×10-3

wpN = -1.7 ×10-2

rNδ = -1.3 ×10-2

rN�= -3.4 ×10-3

pN = -8.4 ×10-4

wrN = 7.4 ×10-3

pqN = -2.1 ×10-2

rN = -1.6 ×10-2

vN = -7.4 ×10-3

qrN = 2.7 ×10-3

qNυ = -1.0 ×10-2

vwN = -2.7 ×10-2

Page 36: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

14

1.4 Organization of the Thesis

The purpose of the thesis is to put an effort on the simulation of underwater

vehicles. Figure 11 represents the general simulation architecture for the underwater

vehicle. Using this figure as a roadmap, the chapters of the thesis is arranged.

Figure 11 An underwater vehicle simulation architecture

Page 37: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

15

In Chapter II, complete set of nonlinear equations of motion for an underwater

vehicle are derived. Kinematics, Newton's laws of angular and linear momentum,

hydrodynamics and external force modeling are discussed in detail. Hydrodynamic

and thruster models are described including the implementation issues to the

simulation model interacting with the manual control inputs.

Chapter III explains the development of control system design for underwater

vehicle. In manual control mode of the vehicle, the vehicle can not perform the task

of following a desired path adequately. Hence some feedback controllers are

needed. This chapter describes the design and analysis of this feedback control

system. Two main controllers, for lateral and depth control are developed. In their

inner loops, these controllers include the yaw angle and the pitch attitude

controllers. Yaw angle and the pitch attitude controllers are separated from the main

controllers in order to keep the vehicle at the desired yaw angle and the pitch

attitude settings. As a result, overall vehicle has four controllers to perform the

desired maneuvers.

Chapter IV “Simulation Technology” describes the complete simulation design and

the tools used in the simulation. Simulink environment, S- function technologies,

VRML and joystick usage for manual control is described in detail.

Chapter V describes the test cases for visualizing the dynamic behavior of the

underwater vehicle under manual control inputs. Straight line flight, path following

in a vertical plane, path following in a horizontal plane test cases are created and are

tried to be kept along the desired path manually. Also the same tests are performed

by using the depth and the heading controllers. Results of the path followed are

recorded and are discussed in detail both for manually and automatic controlled

cases.

Chapter VI is the conclusion chapter and includes the discussions related to the

previous chapters. This chapter also presents the future work to complement the

work initiated by this thesis.

Page 38: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

16

CHAPTER 2

2 MATHEMATICAL MODELING OF UNDERWATER VEHICLE

2.1 Introduction

Mathematical modeling of underwater vehicles is a widely researched area and

unclassified information is available through the Internet and from other source of

written publications. The equations of motion for underwater vehicles are given in

detail in reference [18], including the hydrodynamic stability derivatives of some of

the underwater vehicles. The material presented in this chapter has been largely

adapted from references [6] and [18].

In this chapter, the generalized six-degree of freedom (6 – DOF) equations of

motion (EOM) for an underwater vehicle will be developed. The underlying

assumptions are that: The vehicle behaves as a rigid body; the earth's rotation is

negligible as far as acceleration components of the center of mass are concerned

and the hydrodynamic coefficients or parameters are constant. The assumptions

mentioned above eliminate the consideration of forces acting between individual

elements of mass and eliminate the forces due to the Earth's motion.

The primary forces that act on the vehicle are of inertial, gravitational, hydrostatic

and hydrodynamic origins. These primary forces are combined to build the

hydrodynamic behavior of the body.

The study of dynamics can be divided into two parts: kinematics, which treats only

the geometrical aspects of the motion, and kinetics, which is the analysis of the

forces causing the motion.

The chapter begins with an outline of the coordinate frames and the kinematics and

dynamic relationships used in modeling a vehicle operating in free space. Basic

Page 39: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

17

hydrodynamics are presented. This discussion develops the foundation for the

various force and moment expressions representing the vehicle’s interaction with its

fluid environment.

The control forces, resulting from propellers and thrusters and from control surfaces

or fins that enable the vehicle to maneuver are then be detailed. With the

hydrodynamic and control force and moment analysis complete full six degree of

freedom equations of motion are formed.

2.2 Coordinate Systems, Positional Definitions and Kinematics

It is necessary to discuss the motion of an underwater vehicle in six degrees of

freedom in order to determine its position and orientation in three dimensional

space and time.

The first 3 of 6 independent coordinates (x, y, z) are to determine position and

translational motion along X, Y, Z; the remaining 3 (ø,θ,ψ) are for orientation and

rotational motion (See Figure 12). Conventionally for underwater vehicles the

components mentioned above are defined as: surge, sway, heave, roll, pitch, and

yaw respectively.

Obviously position/translational motion and orientation/rotational motion of a rigid

body (a body in which the relative position of all its points is constant) can be

described with respect to a reference position. For this purpose, some set of

orthogonal coordinate axes are chosen and assumed to be rigidly connected to the

arbitrary origin of the body to build up the reference frame.

Similarly, the forces and moments acting on the underwater vehicle need to be

referenced to the same frame. In this thesis, standard notation from [18] and [6] is

used to describe the 6 DOF quantities mentioned above and are summarized in

Table 8.

Page 40: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

18

Note that by convention for underwater vehicles, the positive x-direction is taken as

forward, the positive y-direction is taken to the right, the positive z-direction is

taken as down, and the right hand rule applies for angles.

DOF Motions Forces and Moments

Linear and Angular

Velocities

Positions and Euler Angles

1 surge X u x

2 sway Y v y

3 heave Z w z

4 roll K p φ

5 pitch M q θ

6 yaw N r ψ

Table 8 Standard underwater vehicle notation. The notation is adopted from [18].

2.2.1 Reference Frames

As discussed earlier and outlined in Table 8 independent positions and angles are

required and it is very important to describe clearly the reference frames in order to

understand the kinematics equations of motion. There are two orthogonal reference

frames; the first one is the earth fixed frame XYZ which is defined with respect to

surface of the earth as illustrated in Figure 12. The earth fixed coordinate system to

be used in this thesis is defined by the three orthogonal axes which are assumed to

be stacked at an arbitrary point at the sea surface. These axes are aligned with

directions North, East and Down. This produces a right-hand reference frame with

unit vectors I�

, J�

, K�

. Ignoring the earth's rotation rate in comparison to the

angular rates produced by the vehicle's motion, it can be said that the XYZ

coordinate frame is an inertial reference frame in which Newton's Laws of Motion

will be valid.

A vehicle's position in this earth fixed frame will have the vector components:

Page 41: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

19

' [ ]O

r XI YJ ZK= + +� � �

(1)

Secondly, a body fixed frame of reference O'xyz, with the origin O', and unit vectors

i�

, j�

, k�

located on the vehicle centerline, moving and rotating with the vehicle is

defined. The origin O' will be the point about which all vehicle body force will be

computed. The vehicle's center of gravity (mass), CG, which is first moment

centroid of vehicle’s mass, and center of buoyancy, CB, which is the first centroid

of volumetric displacement of the fully submerged underwater vehicle do not

generally lie at the origin of the body fixed frame.

It should be implied that all of the forces and moments acting on the underwater

vehicle used in this thesis are assumed to be applied to the center of gravity location

(normally assumed to be for a rigid body). The origin of the body fixed frame is

exactly same as the center of buoyancy location. Therefore the center of buoyancy

location will be the point about where all the hydrodynamic forces will be

computed.

The positional vectors of the CG and CB relative to the origin of the body fixed

frame are ρG and ρB, respectively, and can be represented in component form as

[xG i + yG j + zG k] and [xB i + yB j + zB k].

Page 42: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

20

X

O'y

Y

O'r

O'x

O'z

GCBC

GρBρ

Z

Earth Fixed

Gr

NORTH

DOWN

EAST

Figure 12 Body-fixed and earth fixed reference frames

2.2.2 Euler Angles

When transforming from one Cartesian coordinate system to another, three

successive rotations are performed. According to Euler’s rotation theorem, an

arbitrary rotation may be described by only three parameters. This means that to

give an object a specific orientation it may be subjected to a sequence of three

rotations described by the Euler angles. As a result, rotation matrix can be

decomposed as a product of three elementary rotations.

Although the attitude of a vehicle can be described by several methods in earth

fixed reference frame, the most common method is the Euler Angles method, which

Page 43: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

21

is used in this thesis. This method represents the spatial orientation of any frame of

the space as a composition of rotations from a reference frame.

The earth fixed coordinate frame Euler angle orientation definitions of roll (φ),

pitch (θ) and yaw (ψ) implicitly require that these rotations be performed in order.

For the "roll, pitch, yaw" (XYZ) convention, a forward transformation is performed

beginning with a vector quantity originally referenced in the body fixed reference

frame. Then, through a sequence of three rotations it is transformed into a frame

that is assumed to be attached to the surface of the sea.

To start the transformation, begin by defining an azimuth rotation ψ, as a positive

rotation about the body Z-axis. Next define a subsequent rotation θ, (positive up)

about the new Y-axis, followed by a positive rotation φ, about the new X-axis. The

triple rotational transformation in terms of these three angles is then sufficient to

describe the angular orientation of the vehicle.

The rotation and angular velocity conventions of body fixed coordinate system are

given in and Figure 13.

Figure 13 Body fixed coordinate system linear and angular velocity convention

Page 44: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

22

As an example, any position vector, ro, in earth fixed reference frame given by

ro = [Xo, Yo

,Zo], will have different coordinates in a rotated frame when a rotation

by angle φ , is made about the earth fixed x0-axis.

If the new position is defined by r1 = [X1, Y1

,Z1], it can be seen that the vector's

coordinates in the new reference frame can be written with the coordinates in the

old reference frame as:

1 cos sino o

Y Y Zφ φ= + (2)

1 sin coso o

Z Y Zφ φ= − + (3)

with Z1=Zo. This relation can be expressed in matrix form by the rotation matrix

operation,

[ ]1

1 0,oxr R r

φ

−= (4)

where the rotation [R] is an orthogonal matrix and the inverse of [R] equals its

transpose.

[ ] [ ]1T

R R−

= (5)

Multiplication of this rotation matrix with any vector, ro, will produce the

components of the same vector in the rotated coordinate frame. Continuing with the

series of rotations results in a combined total rotational transformation,

[ ] [ ] [ ] [ ], , ,o o oz y x

R R R Rψ θ φ

= (6)

If Equation (6) is expanded it takes the form:

[ ]cos sin 0 cos 0 sin 1 0 0

sin cos 0 0 1 0 0 cos sin

0 0 1 sin 0 cos 0 sin cos

R

ψ ψ θ θ

ψ ψ φ φ

θ θ φ φ

− = − −

(7)

Page 45: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

23

If matrix multiplications in Equation (7) are performed, finally [R] takes the form:

cos cos cos sin sin sin cos sin cos sin sin

[ ] sin cos sin sin sin cos cos sin sin cos cos sin

sin cos sin cos cos

c

R

ψ θ ψ θ φ ψ φ ψ θ φ ψ φ

ψ θ ψ θ φ ψ φ ψ θ φ ψ φ

θ θ φ θ φ

=

− +

+ −

(8)

It can be said that any position vector in a rotated reference frame may be expressed

in terms of the coordinates of original reference frame given by the operation,

1[ ]ijk IJKr R r−= (9)

2.2.3 Kinematics

Kinematics defines the motion of an object without considering the mass and the

external forces acting on the object during its motion. So, linear and angular

velocities of the object are considered in kinematics. As mentioned in the previous

section the linear and angular velocities are expressed in body fixed coordinate

frame. The transformation of linear and angular velocities and prior to extending

these transformations to accelerations from body fixed coordinate frame to earth

fixed coordinate frame will be discussed in kinematics.

An earth fixed velocity vector can be written as,

X

r Y

Z

=

��

(10)

These three translation rates can be obtained by selecting the linear components of

the body fixed velocity vector and multiplying it by body to earth rotation matrix

which is the rotational transformation matrix given in Equation (8):

Page 46: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

24

[ ]X u

Y R v

Z w

=

(11)

Inversely, body coordinate frame velocities can be obtained by earth fixed

coordinate frame velocities in a similar manner:

[ ]T

u X

v R Y

w Z

=

(12)

The three earth fixed coordinate frame Euler angle rotation rates are obtained from

body coordinate frame rotation rates by the following non-orthogonal linear

transformations [6].

( ) ( ) ( ) ( )sin tan cos tanp q rφ φ θ φ θ= + +� (13)

( ) ( )cos cosq rθ φ φ= −� (14)

( ) ( )

( )sin cos

cos

q rφ φψ

θ

+=� (15)

In matrix notation, by defining a new transformation matrix from body to earth, it

can be written as:

[ ]p

T q

r

φ

θ

ψ

=

(16)

where T is:

Page 47: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

25

[ ]1 sin tan cos tan

0 cos sin

cos0 sin / cos

cos

T

φ θ φ θ

φ φ

φφ θ

θ

= −

(17)

Notice that for small angular rotations, (small angle assumption)

p

q

r

φ

θ

ψ

=

=

=

(18)

It should be noted that unlike the rotation matrix [R], [T] is not orthogonal,

therefore, [T]-1 ≠ [T]T.

Rates of change of the Euler angles in terms of the earth fixed components of the

angular velocity vector can be obtained by inverting Equation (17).

[ ]1

p

q T

r

φ

θ

ψ

=

(19)

[ ]1

1 0 sin

0 cos sin cos

0 sin cos cos

T

θ

φ φ θ

φ φ θ

− = −

(20)

In matrix form the whole velocity matrix definitions are as follows:

[ ]body

u

v

wV

p

q

r

=

(21)

Page 48: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

26

[ ]earth

X

Y

ZV

φ

θ

ψ

=

(22)

Matrix notation from body to earth transformation:

[ ][ ]

[ ][ ]

0

0earth body

R

V V

T

=

(23)

Matrix notation from earth to body transformation:

[ ][ ]

[ ]

[ ]1

0

0

T

body earth

R

V V

T−

=

(24)

Finally expanding the Equation (23) by replacing the equations (8), (17) and (21)

kinematic relationships between velocities, as seen from the body fixed frame, and

the rates of change of global positions and Euler angles can be produced as:

cos sin ( cos sin sin sin cos ) (sin sin cos sin cos

cos sin (cos cos sin sin sin ) ( sin cos cos sin sin )

sin sin cos cos cos

sin tan cos tan

u v wX

u v wY

u v wZ

p q r

q

θ ψ φ ψ φ θ ψ φ ψ φ θ ψ

θ ψ φ ψ φ θ ψ φ ψ φ θ ψ

θ φ θ φ θ

φ θ φ θφ

θ

ψ

+ − + + +

+ + + − + − + +

= + +

cos sin

( sin cos ) / cos

r

q r

φ φ

φ φ θ

+

(25)

Page 49: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

27

2.3 Dynamic Equations of Motion

General translational and rotational equations of motion of a rigid body are given in

this section. After derivation of the required parameters for dynamic equations of

motion, a matrix representation of the system is given to reflect the dynamic model

of the system used for MATLAB simulation.

2.3.1 Translational Equations of Motion

For a position vector r, in a frame rotating at an angular velocity ω, the total

derivative is given as

dr

r rdt

ω= + ×� (26)

Time rate of change of r is:

' 'G

O G O G

drr v

dtω ρ ω ρ= + × = + ×� (27)

Expression of vO' may be written in either earth fixed or body fixed coordinates as:

' ' [ ] [ ]O O

dX dY dZv r I J K ui vj wk

dt dt dt= = + + = + +� (28)

The earth fixed acceleration of the center of mass is derived by differentiating the

velocity vector, Gdr

dt, realizing that the center of mass lies in a rotating reference

frame. Considering the total differential, the earth fixed acceleration of the center of

mass becomes,

' 'G O G G Or v w vω ρ ω ω ρ= + × + × × + ×��� � (29)

Page 50: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

28

The translational equation of motion is found by equating the product of this

acceleration and the vehicle mass, to the net sum of all forces acting on the vehicle

in three translational degrees of freedom (X, Y, Z).

( )' 'Translational O G G OF m v vω ρ ω ω ρ ω= + × + × × + ×∑ �� (30)

2.3.2 Rotational Equations of Motion

To develop the rotational equations of motion, the sum of applied moments about

the vehicle's center of mass is equated to the rate of change of angular momentum of

the vehicle about its center of mass. The inertia tensor required to be computed is,

'

xx xy xz

o yx yy yz

zx zy zz

I I I

I I I I

I I I

=

(31)

where,

∑ =+=

N

i ixx zydmI1

22 )( , ∑=

−==N

i

iyxxy xydmII1

)( , 1

( )N

xz zx i

i

I I dm xz=

= = −∑ ,

2 2

1

( )N

yy i

i

I dm x z=

= +∑ , 1

( )N

yz zy i

i

I I dm yz=

= = −∑ , 2 2

1

( )N

zz i

i

I dm x y=

= +∑

Here, xx

I , yy

I and zz

I are the moments of inertia about the body X0, Y0

and Z0 axes

and the remaining cross terms in Equation (31) are the products of inertia [18].

The angular momentum of the body is given by,

' 'O OH I ω= (32)

The total applied rotational moments about the vehicle's reference frame origin is

given by,

Page 51: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

29

' ' ( )O O G GM H mvρ= + ×∑ � � (33)

Differentiating Equation (32), the rate of change of angular momentum is found to

be,

' ' 'O O OH I Hω ω= + ×� � (34)

The acceleration of the earth fixed position vector ro', is given by,

' ' 'O O Or v vω= + ×�� � (35)

Substituting equations (34) and (35) into Equation (33), the rotational equation of

motion in vector form is given by,

( )' '( )Rotational o o G o G oM I I m v vω ω ω ρ ρ ω= + × + × + × ×∑ � � (36)

2.3.3 Equations of Motion

There are three translational equations obtained from Equation (30), three rotational

equations obtained from equation (36), and six unknown velocities ) and ( ωωωωv . This

set of equations written in expanded form is [18]:

2 2[ ( ) ( ) ( )]G G G

m u vr wq x q r y pq r z pr q X− + − + + − + + =� � � (37)

2 2[ ( ) ( ) ( )]G G G

m v ur wp x pq r y p r z qr p Y+ − + + − + + − =� � � (38)

2 2[ ( ) ( ) ( )]G G G

m w uq vp x pr q y qr p z p q Z− + + − + + − + =� � � (39)

2 2( ) ( ) ( ) ( )

[ ( ) ( )]

x z y xy yz xz

G G

I p I I qr I pr q I q r I pq r

m y w uq vp z v ur wp K

+ − + − − − − + +

− + − + − =

� � �

� � (40)

Page 52: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

30

2 2( ) ( ) ( ) ( )

[ ( ) ( )]

y x z xy yz xz

G G

I q I I pr I qr p I pq r I p r

m x w uq vp z u vr wq M

+ − − + + − + − −

− + − − + =

� � �

� � (41)

and

2 2( ) ( ) ( ) ( )

[ ( ) ( )]

z y x xy yz xz

G G

I r I I pq I p q I pr q I qr p

m x v ur wp y u vr wq N

+ − − − − + + − +

+ − − − + =

� � �

� � (42)

Formulation given through Equations (37) - (42) can be rewritten in matrix form of

Newton’s Second Law as:

[ ] [ ]earth earth

dF MV

dt= (43)

In order to calculate the velocity components of the rigid body in earth fixed frame,

as stated at the right hand side of equations (43) and (30), calculation of the body

fixed velocity vector is needed following a transformation to the earth axis.

[ ][ ]

[ ][ ]

[ ]

[ ][ ]

0 0

0 0earth body body

R Rd d d

V V Vdt dt dt

T T

= +

(44)

Since for dynamic simulation of motion of a rigid body, new velocities of the body

is needed for each time step. This yields the integration of dynamics equations of

motion in body fixed coordinate frame.

Equation (43) can be redefined in body frame as:

[ ] [ ] [ ]( ) [ ]( )[ ] [ ] [ ]( )body body body body body body body

d d dF M V M V M V

dt dt dt= = + (45)

Considering the Equation (27), Equation (45) can be rewritten and as:

[ ] [ ] [ ]( )body body bodybodyF M V Vω = + ×

� (46)

Page 53: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

31

To obtain body acceleration, inverse of the body mass matrix can be multiplied with

both side of the Equation (46).

[ ] [ ] [ ]1

body body bodybodyV M F Vω

− = − × � (47)

In the open source literature [6], [18], general representation of the dynamics

equations of motion is done by leaving the external forces and moments at the right

hand side and the other body accelerations, inertial ,mass and added mass terms at

the left hand side.

Hydrostatic Forces and Moments

MassBody fixed

Inertia Hydrodynamic Forces and Momentsaccelerations

Added Mass

Thruster Forces and Moments

+ = +

(48)

2.4 Hydrostatic Forces and Moments (Restoring Forces and Moments)

The gravitational and buoyant forces are generally called restoring forces in

hydrodynamic terminology. The weight and buoyancy force vectors do not change

with vehicle attitude for bodies that are submerged. The expression of the Buoyant

and gravitational force in earth fixed frame can be as: 0 0W

F I J WK= + + and

0 0 -B

F I J BK= + . As mentioned above, the buoyant and weight components are

acting in the global vertical direction and they must be transformed into components

in the vehicle fixed frame in order to be added into the equations of motion. By

applying the transformation from earth to body axis given in Equation (6), the net

vertical force components can be obtained as:

sin

( ) cos sin

cos coshydrostaticF W B

θ

θ φ

θ φ

− = −

(49)

Page 54: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

32

The weight part of the vertical force acts at the center of gravity location of the

vehicle, while the buoyancy part of the vertical force acts at the center of buoyancy.

The resulting moment about the body center given by,

sin sin

cos sin cos sin

cos cos cos coshydrostatic G BM W B

θ θ

ρ θ φ ρ θ φ

θ φ θ φ

− − = × − ×

(50)

This moment will be non-zero even if W and B are equal or ρρρρG and ρρρρB are zero. The

center of gravity is needed to be located below the center of buoyancy considering

the static stability of the vehicle. The total hydrostatic forces and moments vector

can be written as:

( )sin

( ) cos sin

( ) cos cos

( )cos cos ( ) cos sin

( )cos cos ( )sin

( ) cos sin ( )sin

hydrostatic

hydrostatic G B G B

G B G B

G B G B

W B

W B

F W B

M y W y B z W z B

x W x B z W z B

x W x B y W y B

θ

θ φ

θ φ

θ φ θ φ

θ φ θ

θ φ θ

− − − −

= − − −

− − − −

− + −

(51)

and is added to the right hand side of the equations of motion.

2.5 Hydrodynamic Forces and Moments

Hydrodynamic force and moments related to the body velocities and the control

surface deflections are given in this section. These forces and moments are equated

to the right hand side of the Equations (37) - (42) to get the full dynamics equations

of motion used in the simulation.

External forces and moments given in Equation (48) are as follows [18]:

Surge:

Page 55: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

33

( )

( )

( )

2 2 24

3

2 22

H pp qq rr pr

u wq vp vr

vv ww

X D X p X q X r X pr

D X u X wq X vp X vr

D X v X w

= + + + +

+ + + +

+

�� (52)

22T propX D X u= (53)

( ) ( ) ( )( )( ) ( )( )

2 2 22

3

r r e e e r

e r

F r e w e v r

q e r r

X D u X X uw X uv X

D uq X ur X

δ δ δ δ δ δ

δ δ

δ δ δ δ

δ δ

= + + + +

+ (54)

Sway:

( )

( )( )

4

3

2

H p r pq qr

v up ur vq p wr

v vw

Y D Y p Y r Y pq Y qr

D Y v Y up Y ur Y vq Y wp Y wr

D Y uv Y vw

ω

= + + + +

+ + + + + +

+

� �

� �

� (55)

( )( )22F r r

Y D u Yδ δ= (56)

Heave:

( )

( )

( )

2 24

3

22

H q pp pr rr

w q vp vr

w vv

Z D Z q Z p Z pr Z r

D Z w Z uq Z vp Z vr

D Z uw Z v

= + + + +

+ + + +

+

� (57)

( )22 eF e

Z D u Zδ δ= (58)

Roll:

( )

( )( )

5

4

3

H p r pq qr

v p r vq wp wr

v vw

K D K p K r K pq K qr

D K v K up K ur K vq K wp K wr

D K uv K vw

= + + + +

+ + + + + +

+

� �

� �

� (59)

Page 56: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

34

Pitch:

( )

( )

( )

2 25

4

23

H q pp pr rr

w q vp vr

w vv

M D M q M p M pr M r

D M w M q M vp M vr

D M uw M v

= + + + +

+ + + +

+

� (60)

( )23 eF e

M D u Mδ δ= (61)

Yaw:

( )

( )( )

5

4

3

H p r pq qr

v p r vq wp wr

v vw

N D N p N r N pq N qr

D N v N up N ur N vq N wp N wr

D N uv N vw

= + + + +

+ + + + + +

+

� �

� �

� (62)

( )23 rF r

N D u Nδ δ= (63)

2.6 Validation of Equations of Motion

Six DOF Equations of motion given with equations (37) to (42) are applicable to

any rigid body motion in free space. On the other hand, these equations are needed

to be modified in order to reflect the real behavior of a vehicle which acts under

water. Although the modification that is mentioned above is not within the core

equations of motion but the calculation of forces acting on the vehicle, the equations

of motion code written needs to be tested against a known trajectory of a rigid body

traveling in vacuum without external forces and moments, except the gravitational

force.

For validation purposes, a simple test model is prepared with Simulink 6 DOF

Equations of Motion block (See Figure 14). This test is simply named “Vacuum

Trajectory Test”. The motion of the underwater vehicle (rigid body in this case,

Page 57: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

35

since it is in vacuum not under water) just under the influence of gravitational force

is determined by gravity, initial velocity of the body and initial Euler orientation.

The friction is negligible and trajectory describes a parabolic arc as illustrated in

Figure 15.

X_e

simout

Eval Forces and Moments

Euler angles

Forces

Moments

6DoF (Euler Angles )

Fxyz

(N)

Mxyz

(N-m)

Ve (m/s)

Xe (m)

φ θ ψ (rad )

DCMbe

Vb (m/s)

ω (rad /s)

dω /dt

Ab (m/s

2)

Body

Euler Angles

Fixed

Mass

double (3)

double (3)

3

double (3)

3

double (3)3

Figure 14 Test model prepared with Simulink 6 DOF Equations of Motion block

(Aerospace Blockset).

The inputs (initial conditions) used for both model is given in Table 9.

Table 9 Initial conditions for vacuum trajectory test

Initial velocity in body axis (u, v, w) [m/s] (100, 0, 0)

Initial Euler Orientation (Roll, Pitch, Yaw) [deg] (0, 45, 0)

The other inertia matrix and mass properties remained the same as the model used

in the thesis. Vacuum trajectory test can be performed by initializing the test

simulation by related MATLAB m-file and running the model. During the test run,

Page 58: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

36

vehicle’s positions are stored directly in Simulink workspace to be compared with

the results of model used in the thesis (See Figure 15).

This test guarantees that the model is solving the dynamic equations of motion of a

rigid body correctly. Once the equations of motion are derived, the remaining part

to complete the dynamic simulation is calculation of forces and moments. These

calculations can be validated by comparing the simulation code with the models

given in the literature [20], [18].

0 200 400 600 800 1000 12000

50

100

150

200

250

300

Range [m]

Heig

ht [m

]

Vacuum Trajectory

Model used in thesis

6DOF Simulink Blockset

Figure 15 Plot of vacuum trajectories for validation of the model. (Note that the

trajectories are exactly equal, so they overlap)

2.7 Thruster Model

Assuming the hydrodynamic forces acting on the vehicle in longitudinal axis are

mainly due to drag and the added mass, and considering the thrust force is due to

propellers alone, a simple thruster model for the vehicle can be derived from

Page 59: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

37

longitudinal equations of motion [6], [5]. In this thesis, thruster model is adapted

from the model given in [6], [5] and combined with the model given in reference

[14]. Some more sophisticated propeller thrust models can also be found through

out the literature [18].

The propeller thrust is related to the propeller rpm, base drag coefficient and surge

velocity of the vehicle. Reference [6] gives the total longitudinal body force

equation as:

( )22 0 1

x dF D u C η η= −∑ (64)

Where

Steady state speed n

Max rpm uη = (65)

xF is the total longitudinal body force including thrust, 2D =0.5 ρL2 where ρ is

density of fluid and L is the characteristic length of the vehicle, n is the propeller

revolutions per minute (rpm) and 0dC is drag coefficient along body longitudinal

direction.

Two thrust efforts obtained with different propeller revolutions per minute (rpm)

and reached steady state speeds are as follows:

Table 10 Thruster efforts, rpm vs. surge velocity

RPM ( )22 0Thrust D u Cd η η=

(N)

Reached steady state surge velocity (m/s)

1500 8662.5 12.6

750 2165.6 6.2

Page 60: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

38

CHAPTER 3

3 CONTROL SYSTEM DESIGN

3.1 Introduction

Two main controllers are designed in this thesis, the heading and the depth

controller, respectively. Depth controller includes the inner controller loop, which is

designed separately. The inner loop of the depth controller is in fact the pitch

attitude controller used to keep the vehicle at the desired pitch angle. Also inner

loop of heading controller includes yaw angle controller which is used to keep

vehicle’s yaw angle at zero degree. As a result, four controllers are to be used for

different mission types in this thesis.

In this chapter, the designs of these three controllers are given. Before the design of

the controllers, some basic concepts of controls that are used in each control design

are given below:

To get first order vector differential equation, commonly named state equation,

matrix representation of equations of motion of the underwater vehicle is

considered for each controller.

Common representation of the state equation is [7]:

x Ax Bu= +� (66)

Where, x nR∈ is the state vector, u mR∈ is the control vector. A and B are the state

coefficient and the driving matrices order of (nxn) and (nxm) respectively [7].

As the response of the system is investigated against the control vector, the output

equation is needed which is generally represented as:

y Cx Du= + (67)

Page 61: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

39

Where, y pR∈ , C is the output and the D is named the direct matrix [7].

3.2 Heading Control System design

This section describes the solution to the problem of controlling the heading of

AUV in a horizontal plane. The need for the heading controller is examined during

trial tests when the nonlinear model of the system is simulated and tried to be

controlled manually by joystick. The precise control of UV in horizontal plane is

getting harder if vertical maneuvers are performed during the mission (3-D motion).

The requirement for the heading control system is to keep the ψ of the vehicle at

the commanded reference heading ref

ψ .

0X

0Y

X

Y

Figure 16 Heading of the vehicle illustrated in horizontal plane

The lateral nonlinear dynamics of the UV is given and this is followed by the

control system design. The tools used for determination of linear controller gains

are given including the requirements that dictate the gain determination procedure.

Page 62: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

40

After development of the control system for precise control of the underwater

vehicle in horizontal plane, some simulation tests are performed for the final

performance of the vehicle with heading controller.

3.2.1 Lateral Dynamics

Lateral equations of motion of NPS AUV II can be written as [5]:

( ) ( ) ( )24 3 2G r v r v r r

m v ur x r D Y r D Y v Y ur D Y uv Y uδ δ+ + = + + + +� �

� � � � (68)

( ) ( )25 4 3z G G r v r v r r

I r mx v mx ur D N r D N v N ur D N uv N uδ δ+ + = + + + +� �

� � � � (69)

Here;

22

33

44

55

1

21

21

21

2

D L

D L

D L

D L

ρ

ρ

ρ

ρ

=

=

=

=

(70)

Assuming that the steady state linear velocity component of u0 is constant [18], the

three term matrix representation of the linearized horizontal plane equations of

motion can be written as [11]:

11 12 11 12

21 22 21 22

0 0

0 0

0 0 1 0 1 0 0r

a a v b b v Y

a a r b b r N

δ

δ δ

ψ ψ

= +

(71)

Where

Page 63: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

41

( )

( )

11

12

21

22

11 0

12 0

21 0

22

v

G r

G v

zz r

v

r

v

r G

a m Y

a mx Y

a mx N

a I N

b Y u

b Y m u

b N u

b N mx

= −

= −

= −

=

=

= −

=

= −

(72)

To develop the heading controller, the vehicle’s forward speed (u0) is assumed to be

constant. The nominal speed for the controller design is assumed to be u0 = 3.0 m/s.

In order to get state equation some matrix operations can be performed as:

[ ][ ]1 1 1

[ ][ ] [ ]

[ ] [ ][ ] [ ] [ ][ ] [ ] [ ][ ]

[ ] [ ][ ] [ ][ ]

a x b x d u

a a x a b x a d u

x A x B u

− − −

= +

⇒ = +

⇒ = +

(73)

-0.4462 -1.0563 0 0.337

-0.09 -0.939 0 , -0.413

0 1 0 0

A B

= =

(74)

The C and D matrices are as follows:

0 1 0 0

,0 0 1 0

C D

= =

(75)

The transfer function of the system, defined in equation (71), can be obtained by the

MATLAB function below [19]:

% obtain transfer function of the system

sys = ss(A,B,C,D)

tf(sys)

The output of the command given above is as follows:

Page 64: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

42

#1 in the MATLAB output above defines the transfer function of r to rudder

deflection:

( )( ) 2

-0.4131 - 0.2147

1.385 0.324r

r s s

s s sδ=

+ + (76)

And #2 defines psi to rudder deflection:

( )( ) 3 2

-0.4131 - 0.2147

1.385 0.324r

s s

s s s s

ψ

δ=

+ + (77)

To help the operator to maintain an ordered heading during long range missions, a

heading controller can be designed [5] as:

1 2r errorK Kδ ψ ψ= + � (78)

Where error ref

ψ ψ ψ= − is the error signal between the reference (desired) yaw

(ref

ψ ) and the current yaw angle setting of the underwater vehicle.

In order to use heading controller given with equation (78), ref

ψ has to be between

±180 degrees.

For heading controller the transfer function can be obtained by combining the

Equation (76) and the control law given by Equation (78) [5] as:

Transfer function from input to output...

-0.4131 s - 0.2147

#1: ---------------------

s^2 + 1.385 s + 0.324

-0.4131 s - 0.2147

#2: -------------------------

s^3 + 1.385 s^2 + 0.324 s

tf(sys)

Page 65: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

43

( )

( )( )

( )( )

( )

1 2

1 1 2

2

1

1

1 2

1

1 2

1

r ref

ref

ref

ref

ref

r n r n

d dK K r

rd K K K r n

r d K n

K n

K nr s

K n r d K n

K n

K K s n sd

δ ψ ψ

ψ ψ

ψ

ψ ψ

ψψψ

ψ ψ

ψ

ψ

= ⇒ =− +

⇒ = − +

−⇒ = −

⇒ = →− −

⇒ =+ −

(79)

Here, n is the numerator and d is the denominator of the transfer function given by

Equation (76).

( )( )

( )

( )( ) ( )1

2

1 2

-0.1033 - 0.02684

-0.1033 - 0.02684 0.6927 0.08099ref

s K s

s K K s s s s s

ψ

ψ=

+ − + + (80)

The control architecture of the model can be illustrated as in Figure 17.

Underwater

Vehicle Lateral Dynamics

x' = Ax+Bu

y = Cx+Dukl1

kl2

Demux

psi

r

ref yaw rudder

Figure 17 Heading controller block diagram

Using the MATLAB Simulink Single Input Single Output (SISO) tool, system

given in Figure 17 is converted to compensator control architecture for analyzing

the system behavior and to determine gains satisfying the design specifications that

will be discussed later.

Page 66: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

44

MATLAB’s control and estimation tools manager allows designer to choose one of

its different predefined control architectures. The suitable architecture to be chosen

for the heading controller design is given in Figure 18.

G

H

C2

C1ref yaw rudder

Figure 18 Control architecture chosen from MATLAB Control and Estimation

Tools Manager

C1 and C2 are the controller compensators for the heading controller. G and H are

the plants simulating the dynamic model.

According to the control system given Figure 17, the transfer functions for the SISO

tool’s control architecture given in Figure 18 can be written as: H=1, G = ( )( )r

s

s

ψ

δ,

C2 = s, C1 = 1, since C2 and C1 are the compensators to be determined.

Bode plot and the step response of the system is given in Figure 18.

Page 67: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

45

10-2

10-1

100

101

102

-90

-45

0

45

90

P.M.: Inf

Freq: NaN

Frequency (rad/sec)

-40

-35

-30

-25

-20

-15

-10

-5

G.M.: Inf

Freq: NaN

Stable loop

Open-Loop Bode Editor for Open Loop 2 (OL2)

-1.5 -1 -0.5 0-2

-1.5

-1

-0.5

0

0.5

1

1.5

2Root Locus Editor for Open Loop 1 (OL1)

Real Axis

Figure 19 Root locus of the system and the Bode plot of the inner loop of the

system given in Figure 17 Zero at -0.519, Poles at: -1.086, -0.298 and 0.0.

Page 68: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

46

Bode Diagram

Frequency (rad/sec)

Step Response

Time (sec)

Am

plit

ude

10-2

10-1

100

101

102

0

45

90

135

180

Ph

ase (

de

g)

-100

-50

0

Mag

nitu

de (

dB

)

0 2 4 6 8 10 12 14 16 18

-1

-0.5

0

Figure 20 Step and frequency response of the system given in Figure 17

Design specifications are as follows:

Steady state error after a step change in yaw angle or a step change in rudder

deflection should be zero. It is also required that the steady-state deflection of the

rudders in response to a step input command in horizontal plane should be very

close to zero.

The root locus and open loop bode diagrams are given Figure 21, Figure 22 for

inner (Output of C1 in Figure 18) and outer (Output of C2 in Figure 18) loops,

respectively.

Page 69: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

47

10-2

10-1

100

101

102

-180

-135

-90

-45

0

P.M.: 97.6 degFreq: 6.41 rad/sec

Frequency (rad/sec)

-20

-15

-10

-5

0

5

10

15

20

25

G.M.: InfFreq: NaNStable loop

Open-Loop Bode Editor for Open Loop 2 (OL2)

-1.5 -1 -0.5 0-2

-1.5

-1

-0.5

0

0.5

1

1.5

2Root Locus Editor for Open Loop 1 (OL1)

Real Axis

Figure 21 Root locus of system and bode plot of the inner loop after tuning

10-2

10-1

100

101

102

-180

-135

-90

P.M.: 26.7 degFreq: 1.61 rad/sec

Frequency (rad/sec)

-60

-40

-20

0

20

40

60

G.M.: InfFreq: InfStable loop

Open-Loop Bode Editor for Open Loop 1 (OL1)

-1.4 -1.2 -1 -0.8 -0.6 -0.4 -0.2-2

-1.5

-1

-0.5

0

0.5

1

1.5

2Root Locus Editor for Open Loop 1 (OL1)

Real Axis

Figure 22 Root locus and the bode plot of the system after tuning

Page 70: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

48

Bode Diagram

Frequency (rad/sec)

Step Response

Time (sec)

Am

plit

ude

10-2

10-1

100

101

102

103

0

90

180

Ph

ase (

deg)

-200

-100

0

Ma

gnitu

de

(dB

)

0 5 10 15-1

-0.8

-0.6

-0.4

-0.2

0

Figure 23 Step response and the bode diagram of the system after tuning.

After changing the phase margin to 26.4 and frequency to 1.61 rad/s manually from

SISO tool while observing the step response of the system, the inner and outer loop

gains are determined as: K1 = 7.3 and K2 = 15.7.

Step response of the vehicle from initial heading of zero to 10 degrees of heading is

shown in Figure 24. In about 22 meters of distance, the vehicle turned to the exactly

10 degrees of heading with maximum overshoot of 0.7 degrees. It must be noted

that the steady state error is almost zero (0.0001 deg) in heading after 22 meters of

range.

Page 71: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

49

0 2 4 6 8 10 12 14 16 18 20 22-2

0

2

4

deflection [

m]

0 2 4 6 8 10 12 14 16 18 20 22-20

0

20

rudder

deflection

[deg]

0 2 4 6 8 10 12 14 16 18 20 220

5

10

RANGE [m] for all graphs

yaw

angle

(psi)

[deg]

Figure 24 Vehicle response to 10 degrees of heading change.

According to the test results mentioned above it can be said that 10 degrees heading

change occurs in acceptable range with acceptable rudder deflections.

The following test is performed in order to visualize the zigzag maneuver and

rudder performance. First 60 seconds of the mission 30 degrees of heading is

commanded to vehicle after 60 seconds to 120 seconds of simulation time -30 of

heading angle is commanded. The response of the vehicle is shown in Figure 25.

Page 72: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

50

0 50 100 150 200 250 300-50

0

50

100

Range

Deflection [

m]

Range vs deflection

0 50 100 150 200 250 300-40

-20

0

20

40

Range

Yaw

[deg]

Range vs yaw angle

0 50 100 150 200 250 300-20

-10

0

10

20

Range [m]

Rudder

deflection [

deg]

Figure 25 Response of the vehicle for zigzag maneuver command.

As can be seen from Figure 25, yaw angle of the vehicle is settled at 30 degrees

without any overshoot in about 20 meters and it must be noted that the first full

deflection of the rudder is given 6th meter of the range. And as expected, the steady

state rudder deflections become zero when the desired yaw angle is reached. In the

second part of the mission, at the 60th second, total turning of 60 degrees (from 30

to -30) in heading is needed. The vehicle performed this turning maneuver in about

30 meters, again without any overshoot, and after reaching the desired yaw angle

the rudders have zero deflections. This performance seems to be acceptable.

Of course gain determination, depending on the usage of the underwater vehicle for

specific missions or considering the other physical properties of the vehicle can be

discussed.

Page 73: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

51

3.3 Yaw Angle Controller Design

Yaw angle controller is a part of heading controller. The difference of two models is

absence of addition of reference yaw (or it can be said the reference yaw angle is

always zero for yaw angle controller). So yaw angle controller block diagram

reduces to control architecture as given in Figure 26. Then this controller just tries

to make the yaw angle of the vehicle zero. The controller gains k1 and k2 given in

Figure 26 are same as the heading controller gains (k1=7.3 and k2=15.7).

Underwater

Vehicle Lateral Dynamics

x' = Ax+Bu

y = Cx+Du

k1

k2

Demux

psi

r

Figure 26 Yaw angle controller block diagram

3.4 Pitch Attitude Control System Design

As the underwater vehicle used in this thesis has stern planes for depth change

maneuvers, the underwater vehicle attitude control is mostly done by the use of

elevators.

As given in Table 1, the vehicle’s center of gravity is not at the center of buoyancy.

So, the metacentric height (difference between the CB and the CG position in

Page 74: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

52

vertical plane) produces restoring moment to any change in pitch angle of the

vehicle (See Figure 27).

x

z

GC

BC

Figure 27 Buoyancy and Gravity forces acting to the CB and the CG position,

respectively

This restoring moment is not enough to compensate the coupling effect of yawing

motion to the heave motion of the vehicle. Since, it can be seen from the

hydrodynamic equations given in (57) and (59), r

K�,

vK� and

vK are non zero

hydrodynamic parameters causing rolling motion against yawing, on the other hand,

ppZ ,

prZ ,

rrZ ,

vpZ ,

vvZ are the non zero hydrodynamic parameters causing heave

motion against rolling and yawing motion.

Changes in depth of the vehicle, caused by coupling motion can be compensated by

manual control by means of a joystick generally causing a relatively high oscillatory

motion in depth, but during the test cases with the model developed in Simulink, it

is observed that to control the vehicle at a certain depth is quite hard when the

operator has to give a turning command to a desired position in yaw. It becomes

harder to perform a desired mission if both depth change and turn maneuver is

needed.

Page 75: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

53

Figure 28 illustrates three different test missions of the vehicle including manual

control, attitude control, and without any control. Both of them are trying to keep

the vehicle’s initial depth of 3 meters. These three tests are performed with a

propeller speed of 750 rpm.

It can be seen from the mentioned figure that the attitude controller has the most

efficient behavior which settles the depth in range of 120 meters and with an error

of 20 cm while the other manual and free controls are settled the vehicle in its

desired depth in 300 and 600 meters respectively. On the other hand as discussed at

the second paragraph, initial negative pitching moment causes the vehicle to settle

at a depth of 9 meters if no control is applied.

0 20 40 60 80 100 120

2.98

2.99

3

3.01

3.02

3.03

Range [m]

Depth

[m

]

0 100 200 300 400 500 600 7002

4

6

8

10

Range [m]

Depth

[m

]

0 50 100 150 200 250 300 3502.8

3

3.2

3.4

3.6

Range [m]

Depth

[m

]

Manually controllled depth

Without control

Attitude controller

Figure 28 Depth change of vehicle during its mission for manual, automatic attitude

controller and without any control.

Page 76: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

54

Pitch attitude controller design considers the pitch angle and the pitch rate of the

system as feedback. And the control law that computes elevator deflection can be

illustrated as [7]:

gain 2

gain 1

gain 3 Underwater

Vehicle Vertical Plane Dynamics

x' = Ax+Bu

y = Cx+Du

kdtheta

ktheta

kq

Integrator

1

s

Demux

q

elevator theta

theta

Commanded Theta

Figure 29 Block diagram of pitch attitude controller

Assuming that the steady state linear velocity component of u0 is constant [18],

three term matrix representation of the linearized vertical plane equations of motion

can be written as [11]:

11 11 12

32

0 0 0

0 1 0 1 0 0 0

0 0 1 0 0 0e

a q b b q M

z b z

δ

θ θ δ

= +

(81)

where

11

11 0

12

32 0

( )

yy q

q G

G B G B

a I M

b M mx u

b (z W z B) W z z

b u

= −

= −

= − − = − −

= −

(82)

Page 77: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

55

Applying the same procedure given at equation (73) A and B matrices can be found

as:

-0.2231 -0.5282 0 0.0843

-0.0450 -0.4696 0 , -0.1033

0 1.0000 0 0

A B

= =

(83)

Since this pitch attitude controller is also a part of the depth controller, here state

coefficient matrix C is chosen as to take all the state variables as output. So C

matrix becomes:

1 0 0

0 1 0

0 0 1

C

=

(84)

The transfer function of the system defined by equation (81) can be obtained using

the MATLAB function given at 3.2 and is obtained as:

Transfer function from input to output...

0.08433 s + 0.09415

#1: ------------------------

s^2 + 0.6927 s + 0.08099

-0.1033 s - 0.02684

#2: ------------------------

s^2 + 0.6927 s + 0.08099

-0.1033 s - 0.02684

#3: ----------------------------

s^3 + 0.6927 s^2 + 0.08099 s

#1, #2 and #3 at the above MATLAB output implies the transfer function of depth,

q and theta to elevator deflection respectively:

( )( ) 2

0.08433 s + 0.09415

+ 0.6927 s + 0.08099e

z s

s sδ= (85)

Page 78: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

56

( )( ) 2

-0.1033 s - 0.02684

+ 0.6927 s + 0.08099e

q s

s sδ= (86)

( )( ) 3 2

-0.1033 s - 0.02684

0.6927 s + 0.08099se

s

s s

θ

δ=

+ (87)

An iterative process is performed during the gain determination for the pitch

attitude controller (Figure 31). The main requirement for the gains is to shorten the

settling time and to lower the overshoots. Considering this requirement, the

optimization started with a rise time of 0.3 seconds and settling time of 5 seconds

from total simulation time of 10 sec., and the gains set

of: 1.3, 83.6, 0.097q d

k k kθ θ= = = is determined.

Using the control law of [7]:

e q d

k k q k dtθ θδ θ θ= + + ∫ (88)

The vertical plane response of the system with the controller gains given above is

shown in Figure 30.

Page 79: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

57

0 20 40 60 80 100 1202

4

6

8

10

12

Range [m]

Depth

change [

m]

from

refe

rence d

epth

of

3

Response of the dynamic system

0 20 40 60 80 100 120-40

-30

-20

-10

0

10

20

Range [m]

Theta

[deg]

0 20 40 60 80 100 120

-20

-10

0

10

20

Range [m]

Ele

vato

r deflection [

deg]

Figure 30 Response of the system with pitch attitude controller

Figure 30 illustrates the dynamic response of the system. Up to 45 meters of

distance, the vehicle kept its initially commanded depth of 3 meters within about

0.02 meters of maximum overshoot. And at a distance of 45 meters a dive command

is given to the vehicle with maximum elevator deflection for 3 seconds. After

turning the elevators to zero state, vehicle is dived to the depth of 11.9 meters in 4

seconds and kept its depth.

The step response optimization for the system is done by the model given in Figure

29, and the step response of the controller can be seen in Figure 32.

Page 80: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

58

theta

r2d1

180 /pi

r2d

180 /pi

Underwater

Vehicle Vertical Plane Dynamics

x' = Ax+Bu

y = Cx+Du

Tunable

Parameters

[kq ktheta kdtheta ]

Step Response

Step

kdtheta

ktheta

kq

Integrator 1

1

s

Demux

Current

Values

1.334

83 .62

0.09745

q

elevator

theta

theta

theta

Figure 31 Gain determination block of pitch attitude controller

0 1 2 3 4 5 6 7 8 9 100

1

2

3

4

Time (s)

Theta

[deg]

Step response of system

Figure 32 Step response of system given in Figure 29 for 3 degrees of pitch angle

change

3.5 Depth Controller Design

When it is desired for the underwater vehicle to be dive to a desired depth, manual

control joystick can be used by the operator or the pitch attitude controller can be

used to change its depth to the desired level. But if the mission of the vehicle

consists of following some parts of terrain and if this terrain must be followed

Page 81: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

59

strictly (Example: Docking of the vehicle at the end of the run), the depth controller

is required to maintain a good dynamic response of the vehicle.

The block diagram representing the depth controller system is shown in Figure 33

[7]. The vehicle dynamics provides the depth of the vehicle as a feedback to be

added to the reference (desired) depth and the total error of the depth is going into

the controller denoted by kcd. The remaining part (the inner loop) of the block

diagram is pitch attitude controller which uses the pitch angle and its integral, pitch

rate of the system to estimate the elevator deflection. Pitch attitude controller

maintains and controls the height reached by lowering the pitch angle of the vehicle

and keeping it closely to zero [7].

So, depth controller is almost same as the pitch attitude controller. The depth

controller block diagram is given in Figure 33.

The same gain set of the pitch attitude controller is used in depth controller. So, just

depth controller gain (See Figure Figure 34) is determined by Simulink response

optimization block.

Underwater

Vehicle Vertical Plane Dynamics

x' = Ax+Bu

y = Cx+Du

0.1082

kcd 83 .62

1.334

Integrator

1

s

Demux

q

elevator theta

theta

Reference Depth

depth

depth

Figure 33 Depth controller block diagram

Page 82: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

60

thetar2d

180 /pi

depth

Underwater

Vehicle Vertical Plane Dynamics

x' = Ax+Bu

y = Cx+Du

Tunable

Parameters

[kq ktheta kdtheta khc 1]

Step Response

Step

0.1082

kcd 83 .62

1.334

Integrator

1

s

Demux

Current

Values

1.334

83 .62

0.1082

0.0988

q

elevator

theta

theta

theta

depth

depth

depth

Figure 34 Simulink model for depth controller gain determination

The optimization started with step change of depth of 3 meters. Desired response

signal is tried to make a smooth path without any overshoot over the desired depth.

50 percent of the response signal is desired to rise at first 35 seconds of total 100

seconds of Simulink simulation time and after optimization with this requirement

depth controller gain is determined as kcd = 0.089. The response of the state space

model and the simulation was acceptable for this gain as the fin deflection values

and the range vs. depth change performance is considered.

The dynamic responses for 5 meters of depth change command (from 3 to 8 meters)

as a test case are given in

Figure 35.

Page 83: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

61

0 10 20 30 40 50 60 70 802

4

6

8

10

Range [m]

Depth

change [

m]

from

depth

of

3 t

o 8

0 10 20 30 40 50 60 70 80

-20

-10

0

Range [m]

Theta

[deg]

0 10 20 30 40 50 60 70 80

-20

-10

0

10

20

Range [m]

Ele

vato

r deflection [

deg]

Desired depth

0.001 meters of staeady state error

Figure 35 Dynamic response of the system with depth controller

0 10 20 30 40 50 60 70 80 90 1000

0.5

1

1.5

2

2.5

3

3.5

Simulink time

Ste

p r

esponse [

m]

to

3 m

ete

rs o

f

depth

change c

om

mand

0.04 meters of error

Figure 36 Step response of the block given in Figure 33

Page 84: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

62

CHAPTER 4

4 SIMULATION TECHNOLOGY

4.1 Virtual Reality Modeling Language (VRML)

4.1.1 VRML: An Overview

VRML is Virtual Reality Modeling Language, the open standard for virtual reality

on the Internet. VRML files define worlds, which can represent 3D computer-

generated graphics, 3D sound, and hypermedia links [19].

The interaction between virtual worlds and a general computing / simulation

environment (MATLAB) is as follows:

MATLAB provides advanced mathematical algorithms, interoperation with

scientific and engineering projects, extensive programming and scripting

capabilities, multi-user environment to VRML technology. On the other hand

VRML provides optimized 3D rendering, web publishing, creating complex VR

scenes, and user interaction to MATLAB [13].

In order to use VRML technology; MATLAB, Virtual Reality Toolbox for

MATLAB, VRML viewer is needed. For more detailed description on the VRML

usage within MATLAB can be found from [19], [13].

Briefly the interaction between the MATLAB and the VRML can be described as

illustrated in Figure 37.

Page 85: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

63

Figure 37 MATLAB – VRML interaction [13]

4.1.2 What is VRML?

VRML can be described briefly as a simple text language for describing 3-D shapes

and interactive environments. Text files use “.wrl” extension [19].

VRML is useful for a variety of applications, including: data visualization, financial

analysis, entertainment, education, distributed simulation, computer-aided design,

product marketing, virtual malls, user interfaces to information, scientific

visualization.

4.1.3 VRML Model of the NPS AUV Model Used In the Thesis

The VRML model used in the simulations is adapted from the VRML literature

given in [16] that gives various types of example VRML models that can be used

for visualizing the underwater environment and different kind of vehicles. For

development environment the adaptation of the model to MATLAB is done by

using VRML Builder 2.0. Viewpoints, translational and rotational state of the

Simulink model is fed to VRML model by the addition of new child nodes.

VRML viewer block of the Simulink model is given in Figure 38.

Page 86: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

64

VR Sink

UnderwaterVehicle .rotation

UnderwaterVehicle .translation

From 6

BodyTranslation 2VRML

From 5

BodyRotation 2VRMLdouble (4)

double (3)

Figure 38 VR Sink Block. The body fixed positions are fed to block to visualize the

vehicle in 3D environment

During the simulation if VR sink block given in Figure 38 is clicked twice, Virtual

Reality Toolbox Viewer is opened automatically. Figure 39 shows a screen capture

of the VR viewer.

Using this viewer, user is able to: Start and stop the simulation, navigate between

viewpoints previously defined, capture, zoom in and zoom out over the view, record

the whole or scheduled simulation as Audio Video Interleave (AVI) or VRML

format.

Page 87: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

65

Figure 39 A screen capture of Virtual Reality Toolbox Viewer

This VRML viewer is a part of Monitor block of the Simulink model. Figure 39 and

Figure 40 illustrates the parent system for VR Sink block.

MonitorManual Control (Joy-stick ) Dynamics

Figure 40 Parent system for VRML viewer. (Monitor Block )

Page 88: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

66

VRML viewer

ScopeVehicleStateScopeBodyFixedForcesScope actuator and thruster commands

DisplayVehicleStateDisplayBodyFixedForcesDisplayActuatorCommands 1

Figure 41 Parent system for VR Sink block (VRML viewer block)

4.2 Simulink S-Function

4.2.1 S-functions (System-Functions)

The MATLAB environment is a high-level technical computing language for

algorithm development, data visualization, data analysis and numerical computing.

One of the key features of this tool is the integration ability with other languages.

MATLAB has the capability of running functions written in C. The files which hold

the source for these functions are called MEX-Files. The mex functions are a good

option if you need to code many loops and other things that MATLAB is not very

good at. In this thesis, the equations of motion of the underwater vehicle is written

in C s-functions and compiled with mex utility of MATLAB. Also calculation of

hydrodynamic, thruster and fins forces and moments are done by using C s-

functions.

Page 89: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

67

4.2.2 What is S-Function?

Briefly, an S-function is a computer language description of a Simulink block [19].

You can define a S-function using either MATLAB, C, C++, Ada, or Fortran. C,

C++, Ada, and Fortran S-functions are compiled as MEX-files using the mex

command. More detailed documentation about building MEX-Files can be found in

the MATLAB documentation [19].

In some applications, needed ODEs may be too complex to be represented via block

diagrams. In such situations it will be useful to take advantage of the readily

working MATLAB function files.

It is needed to understand the concept and the purpose of the state variables in a

dynamic model and Simulink simulation, and how to use the State Variables (both

continuous and discrete) in building a S-function:

The function of a state is to memorize the history of a variable, either the time-

integral of the variable's history (continuous state), or the value of the variable at a

specific time or times (discrete state). For memorizing data (but not model states)

between one S-function execution and another, work vectors can also be used [19].

In this thesis using S-functions brought the following advantages:

• By using s-functions, a simulation code working in MATLAB is

prepared. On the other hand these codes are convertible to the other

programming languages easily or can be used to build “dll” files

directly with Ada, etc. So, these s-functions can also be used for

other kind of development environments such as C, C++, Java etc.

• Executable simulations can be built by MATLAB, since usage of s-

functions allows this utility of MATLAB. But it must be noted that

the joystick input block of Simulink must be removed before creating

Page 90: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

68

executable simulation. Since MATLAB does not allow building

executable program if Joystick input is used in Simulink. As a result

by using executable simulations, simulation can be run on different

Windows platforms where MATLAB is not available.

On the other hand, some disadvantages come with using the S-functions especially

during the development phase.

• If the header files of C library that must be included are missed in the

S-function, the s-function can be compiled without any warning or

error and returns an answer without any warning or error also.

Unfortunately the answer would be wrong. For example if

#include <math.h> is missed in the file and if Sine of an angle is

calculated in the program, what the S-function return will be nothing

but most probably a uniform random number.

• If program crashes, MATLAB will shut down itself without saving

the works done and any warning or error message.

Page 91: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

69

CHAPTER 5

5 TEST CASES

5.1 Introduction

This chapter describes the test cases for visualizing the dynamic behavior of the

underwater vehicle against the manual and automatic control inputs. Straight line

flight, path following in a vertical plane and path following in a horizontal plane

test case are defined. For each case, the vehicle is tried to be kept on the desired

path manually. Results of the path following records are discussed in detail.

Positive rudder angles cause the vehicle to turn to port when moving forward (i.e.

Positive stern rudder angle with positive surge velocity produces negative change in

yaw.)

Positive elevator angles cause the vehicle to dive, in other words positive stern

plane angle with positive surge velocity produces negative change in pitch.

The user is able to see the vehicle state during the simulation either by VRML

illustration of the vehicle or the developed XY-Graphs of the Simulink blocks.

Reference [21] gives an Autoscale XY Graph for Simulink blocks. This XY Graph

is developed in this thesis in order to draw a straight dashed line from the current

position to the target position. The target position is fed to XY Graph by specifying

the coordinate of target position in depth or in deflection.

The developed XY-Graphs allow the user to follow a path that is drawn as dashed

directly from the current state of the vehicle to the desired waypoint (See Figure

42). These dashed lines to the desired waypoint are updated at every time step and

deleted at the end of the simulation.

Page 92: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

70

Figure 42 Auto scale and automatically drawn dashed line to the waypoint

Red circle in Figure 42 indicates the start point and the green circle is the waypoint.

Blue line indicates the vehicle’s position in horizontal plane and the dashed one to

the waypoint is automatically drawn by the developed XY-Graph.

Another monitor of the vehicle’s state is developed by the display block of the

Simulink. The user is able to watch the vehicle’s current position and the body fixed

velocities during the simulation. (See Figure 43)

Page 93: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

71

x y z rollPitchYaw

1.091290802800693 e+002

-6.218267239198604 e+000

7.922966250831392 e+000

1.788161704967540 e-004

-2.346541557601460 e-002

-2.999998557295074 e+001

u v w p q r

1.760426294495305 e+000

5.998227837703057 e-007

-2.977984263654383 e-003

6.528758710982028 e-004

-3.038683915958704 e-001

1.130839587474213 e-004

r2deg 1

(keep meters as is )

-K-

r2deg

(keep meters as is )

-K-

from :Dynamics (5)

bodyFixedVelocities

from Dynamics (1)

vehiclePosition

double (6)

double (6)

double (6)

double (6)

Figure 43 Display blocks for vehicle position and body fixed velocities

5.2 Test Cases

5.2.1 Straight Line Path

It is expected that the underwater vehicle is starting to its mission from (0,0) in X-Y

plane (the blue point in Figure 44) and reach the final point (325, -75) (red circle in

Figure 44).Initial running constant depth is 3 meters, right and left screws

revolutions per minute is 500. Control fins have been located at neutral position.

Figure 44 Straight line path with running constant depth of 3 meters

Page 94: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

72

Figure 44 implies the horizontal plane, Start point is 0.0, 0.0 (X,Y) respectively.

End point in this case is X: -75 (right side of origin) Y:325 (right side of origin).

0 50 100 150 200 250 300 350-80

-70

-60

-50

-40

-30

-20

-10

0

X: 325.1

Y: -75.03

Range vs. Deflection plot of Mission 1

Range [m]

Deflection [

m]

Figure 45 Range vs. Yaw graph of the straight line path following test

As illustrated in Figure 45, the targeted point was (325,-75), and the reached point

with manual (joystick) control was (325, -74.7).

As illustrated in Figure 45, manual control of AUV was poor in performance to

follow a straight line. But it reached the targeted waypoint with a relatively low

error when compared to its whole test range.

In general NPS AUV II gains hydrodynamic performance to perform successful

maneuvers in about 20 seconds of world time with max 500 rpm of propeller speed.

During the straight line test, in the first 40 of total 250 seconds of Simulink

simulation time, no thrust command was given. Up to that point, vehicle performed

Page 95: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

73

with initial speed of 0.01 m/s. So first 7 meters of mission was pure straight line

movement, after that point rudder deflection commands are given to the vehicle.

Figure 46 illustrates the body fixed velocities during the whole mission. Yellow line

indicates the velocity in body x - direction. This figure and the upcoming figures

related to the vehicle state during the simulations are taken from the scope blocks of

Simulink model. For Scope Block the order of colors is the following: Yellow,

Purple, Light Blue, Red, Green and Blue. Considering the Figure 46, the order of

the body fixed velocities are as follows: u, v, w, p, q and r.

Figure 46 Vehicle body-fixed velocities during straight line test 1

During the straight line test 1, max thrust reached was 385.9 N at 500 rpm.

According to NPS - AUV model of [20] max rpm is 1500. Thrust values during the

whole mission are given in Figure 47.

Page 96: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

74

Rudder and elevator deflections during the whole mission of straight line test 1 are

illustrated in Figure 48.

Figure 47 Thrust values during the whole mission (Straight Line Test 1)

Page 97: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

75

Figure 48 Fin deflections during the whole mission (straight line test 1)

Figure 49 Range vs. Depth during the whole mission (straight line test 1) Note that

negative depth implies positive depth with respect to body axes

Page 98: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

76

Normally to follow a path, the error between the actual position and the desired

position needs to be known and the related compensator for the error tries to

minimize it. Under manual control, there is no error calculation so it is not known

how much fin deflection is needed to force the vehicle to be on the desired path. For

that reason a new Simulink library block of extended XY – Graph is prepared. The

modification to the XY-Graph Auto Scale illustrates a line from given input start to

the end points in two dimensions. This line is updated at every time step of the XY-

graph.

The same test is performed as the vehicle is controlled by automatic heading

controller. The deflection versus range of the vehicle trajectory is given in Figure

50.

0 65 130 195 260 325 350-80

-75

-55

-30

-5

0

Range (m)

Deflectio

n (

m)

Vehicle's path

Desired path

Figure 50 Straight line test case with automatic heading controller

Page 99: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

77

With automatic heading controller, the vehicle reaches to the target point

successfully. As seen from Figure 50, there is no deviation from the desired straight

line path. On the other hand, as the pitch attitude controller is used during this test

case, the final depth at the target point is about 3.01 meters which is 3.0 meters at

the start of the simulation.

The rudder deflections, range versus depth of the vehicle during the simulation is

given in Figure 51.

0 65 130 195 260 3252.8

3

3.2

3.4

Range (m)

Depth

(m

)

0 65 130 195 260 325-20

-10

0

10

20

Range (m)

Rudder

deflection (

deg)

Figure 51 Depth vs. Range and Rudder deflections vs. Range graphs for automatic

heading controlled straight line test case

5.2.2 Path Following In a Vertical Plane

Figure 52 illustrates the test case of a vertical plane motion with changing depth.

Green line indicates the straight path on horizontal plane the blue path is the change

of depth with respect to. horizontal plane. Start points are illustrated with red circles

the arrow on the straight line indicates the direction of movement. Vertical scale

indicates the depth in meters. Horizontal scale is the range in meters.

Page 100: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

78

Figure 52 Path following in vertical plane

As illustrated in Figure 53, there is a difference between the desired and the actual

path at starting point of diving. That is caused by inefficient hydrodynamic

performance of the vehicle before performing the dive commands (Elevator

deflections to dive).

The first dive command is given at the 18th second of the total 165 seconds of

Simulink time (See Figure 54). On the other, hand the first non-zero elevator effort

for the corresponding elevator deflection was performed at 54th of the total

Simulink time, so corresponding step change in depth of the vehicle took place at

that time.

Another important argument is the thrust applied to the vehicle. The hydrodynamic

performance would change with various levels of thrust, effecting the velocity and

accelerations of the vehicle. So, turning and diving performances are highly

affected by proper usage of thrust button of joystick.

One should realize that, any test case that is performed by manual control during

this thesis can not be re - played. On the other hand, each test case can be re –

performed to get more successful results, depending on the capability of the

operator that controls the joystick.

Page 101: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

79

0 50 100 150 200 250-60

-50

-40

-30

-20

-10

0Range vs. Depth Mission 2

Range [m]

Depth

[m

]

Depth

Desired path

Figure 53 Path following in vertical plane with manual control test result. Note that

negative depth indicates the positive z axis in earth frame

Figure 54 Fins deflections during the path following in vertical plane with manual

control test [rad]

Page 102: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

80

The same test case is also performed with the depth controller. For this case the

desired depth is set to 50 meters at the start of the simulation with constant propeller

rpm of 250. At the range of 100 meters desired depth changed to the depth of 3

meters. The test result including elevator deflections during the simulation is given

in Figure 55.

Figure 55 Path following in vertical plane test with depth controller

5.2.3 Path Following In Horizontal Plane

In order to observe the turning performance for motion in a horizontal plane,

following a sharp corner, the path and the waypoints are laid down as illustrated in

Figure 56.

Page 103: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

81

Figure 56 Path following in horizontal plane (case 1) (waypoints on 2D grid)

In this test case, vehicle’s initial heading is set to 0 degrees to reach directly to the

first waypoint located at (0,100) on X – Y Plane. As expected and illustrated in

Figure 57 vehicle reaches directly to the first waypoint just giving depth commands

to restore its initial depth of 3 meters. On the other hand when rudder command is

given at the first waypoint to the right (with respect to body x – axis) to make the

heading of the vehicle zero, it took 46 meters to turn to the desired direction.

Precise propeller rpm setting for thrust force control is also needed to perform such

sharp turns. Manually controlled propeller rpm is given in Figure 59 and thrust

forces are illustrated in Figure 60. Maximum propeller rpm reached in this test case

was 1370 with corresponding thrust value of 7030 N. If a precise thruster control is

performed, the longitudinal speed of the vehicle can be lowered at the waypoint to

perform a sharp turn.

Page 104: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

82

Figure 57 Path following in horizontal plane test result with joystick control

Figure 58 Fins deflections

Page 105: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

83

Figure 59 Propeller rpm

Figure 60 Thruster forces

Page 106: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

84

Figure 61 Depth change during the whole mission of path following in horizontal

plane test

On the other hand, the same test case is also performed with the heading controller.

For this case the desired heading is set to 90 with initial heading of 0. The propeller

rpm was 250 during the whole simulation. When the vehicle reached the deflection

of 100 meters the desired heading changed to zero. The test result including rudder

deflections during the simulation is given in Figure 62.

Page 107: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

85

0 50 100 150 200 250

-20

-10

0

10

20

Time (sec)

Ele

vato

r deflections [

deg]

-50 0 50 100 150 200 250 3000

50

100

150

Range [m]

Deflection [

m]

Desired Path

Auto Controlled Path

Figure 62 Path following in a horizontal plane test with heading controller

Page 108: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

86

CHAPTER 6

6 CONCLUSION

In this thesis, a simulation package for the motion of an underwater vehicle is

developed. The six DOF dynamic equations of motion of an underwater vehicle are

obtained starting with kinematic and dynamic equations of motion of a rigid body.

The main purpose of the thesis was to illustrate the simulation of motion of an

underwater vehicle with rudder and elevator deflection commands given to the

vehicle by using a joystick operated by the user. This requirement is performed by

using the MATLAB Simulink joystick input utility. The capability of giving

thruster rpm commands through the joystick is also included to the simulation

package.

3-D visualization environment is used to illustrate the motion of the underwater

vehicle in a 3-D environment using the VRML technology. MATLAB – VRML

interaction is used for implementing the full 3-D solid model of the underwater

vehicle into the simulation package.

Understanding of the MATLAB – VRML interaction and implementation of the

external joystick may be considered as an important result of this thesis. VRML

technology used in this thesis may be used for dynamic simulation of other kind of

air or surface vehicles. On the other hand, the visualization of the motion against

manual control inputs may be useful for training purposes of real manually

controlled vehicles.

For designing the controller for an underwater vehicle, a starting point is stated.

Two main controllers are designed to control the depth and the heading of the

underwater vehicle. Also pitch attitude controller is designed which is used to keep

the vehicle at a constant level of depth after dive or up command is given to the

vehicle.

Page 109: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

87

The user is able to switch between the controllers and can also inhibit the control

commands using the buttons on the joystick. So the controlled and uncontrolled

performance of the vehicle can be observed during the simulation.

Some test cases are performed after completing the simulation package. The results

of these simulations are stored including the given commands and the respective

responses of the vehicle throughout the simulation.

One of the important results of this thesis by means of 6 DOF simulation is

contribution to the understanding of the coupling effects between the degrees of

freedoms such as effect of yawing motion on the rolling motion of the vehicle.

The investigation of these coupling effects are very staright forward by considering

the dynamic eqauations of motion and hydrodynamic properties of the underwater

vehicle. Performing some simulations to visualize the cuopling effects is possible

by using the reconfigurable initialization MATLAB file.

A more precise controller design and investigation of different control strategies for

specific mission types can be handled as future research topics. Also different

vehicle configurations can be considered such as torpedo shaped, or including bow

fins etc. Wave modeling and underwater currents can also be added to the

simulation to see the effects of these factors on the motion of the vehicle.

Another future work can be the development of a real underwater platform in

VRML to see the real performance against the obstacles and other types of

constraints that must be avoided in real life missions for specific undersea

operations.

Page 110: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

88

REFERENCES

[1] Ann Marie Polsenberg, MIT, Developing an AUV Remote Control System,

http://www.mbari.org/education/internship/00interns/00internpapers/annmarie.

pdf, Last accessed date: September 2007

[2] Autonomous Undersea Systems Institute, a survey of different Autonomous

Underwater Vehicles, http://www.ausi.org/auvs/auvs.html, Last accessed date:

August 2007

[3] Autonomous Underwater Vehicle systems, http://www.bp.com, Last accessed

date: August 2007

[4] Center for Autonomous Underwater Vehicle Research,

http://www.cs.nps.navy.mil/research/auv/auvframes.html, Last accessed date:

August 2007

[5] David C. Warner, Design, Simulation and Experimental Verification of a

Computer Model And Enhanced Position Estimator for The NPS AUV II, Naval

Post Graduate School, Monterey, California, December 1991

[6] Donald. P. Brutzman, A Virtual World for an Autonomous Underwater

Vehicle, Naval Post Graduate School, Monterey, California, December 1994

[7] Donald McLean, Automatic Flight Control Systems, Prentice Hall, UK, 1990

Page 111: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

89

[8] Electric Glider Autonomous Underwater Vehicles,

http://www.webbresearch.com/electric_glider.htm, Last accessed date: August

2007

[9] GAVIA AUV, http://www.gavia.is/, Last accessed date: August 2007

[10] Laboratory at MIT Sea Grant, http://auvlab.mit.edu/, Last accessed date:

September 2007

[11] Lingli Ni, Fault-Tolerant Control of Unmanned Underwater Vehicles,

Blacksburg, Virginia, June 29 2001

[12] Ocean Engineering Society. http://www.oceanicengineering.org/, Last

accessed date: September 2007

[13] Online Course Notes on MATLAB and VRML, http://jerry.c-

lab.de/web3d2001/Workshops/sim/vr_sim1.htm, Last accessed date: September

2007

[14] Trygve Lauvdal, A simulation code written for NPS AUV II, May1994,

http://www.cesos.ntnu.no/mss/MarineGNC/index.htm, Last accessed date:

August 2007

[15] REMUS, Autonomous Underwater Vehicle Systems,

http://www.hydroidinc.com/remus600.html, Last accessed date: August 2007

[16] SAVAGE, Scenario Authoring and Visualization for Advanced Graphical

Environments, http://web.nps.navy.mil/~brutzman/Savage/, Last accessed date:

March 2007

Page 112: SIMULATION OF MOTION OF AN UNDERWATER VEHICLE A … · 1.1 SIMULATION OF MOTION OF AN UNDERWATER VEHICLE ... Figure 49 Range vs. Depth during the whole mission (straight line test

90

[17] Theseus Autonomous Underwater Vehicle, http://www.ise.bc.ca/theseus.html,

Last accessed date: August 2007

[18] Thor I. Fossen, Guidance and Control of Ocean Vehicles, John Wiley,

Norway, 1994

[19] MATLAB Technical documentation, http://www.mathworks.com, 2007, Last

accessed date: September 2007

[20] Matlab toolbox for guidance, navigation, and control of marine vessels.

Version 3.1.1, http://www.cesos.ntnu.no/mss/MarineGNC.htm, Last accessed

date: September 2007

[21] Matlab Central File exchange, XY Graph Autoscale block for Simulink.

http://www.mathworks.com/matlabcentral/fileexchange, Last accessed date:

September 2007

[22] UUV programs, http://ftp.fas.org/irp/program/collect/uuv.htm, Last accessed

date: September 2007