Modelling and Simulation of Marine Craft OVERVIEW Edin Omerdic Senior Research Fellow Mobile & Marine Robotics Research Centre University of Limerick
Modelling and Simulation of Marine Craft
OVERVIEWEdin OmerdicSenior Research FellowMobile & Marine Robotics Research CentreUniversity of Limerick
Outline
OverviewAgenda
Principles of Guidance, Navigation & Control
GNC Signal Flow Overview
GNC Signal Flow ↔ Lectures
Day 1: Modelling & Simulation of Marine CraftKinematics
Dynamics
Nonlinear 6 DoF Models (ROV)
Hands-on: Modelling & Simulation of ROV (MATLAB/Simulink)
Day 2: Control of Marine Craft
Control Allocation
Control System
Hands-on: Modelling & Simulation of ROV (MATLAB - LabVIEW)
Hands-on: Control of ROV/USV (LabVIEW)
Day 3: Brushless DC Motor Control using FPGA
Introduction
Motor Control with PWM Signal
Hands-on: Thruster Control using FPGA (LabVIEW)
Thor I. Fossen. Handbook of Marine Craft Hydrodynamics and Motion Control. ISBN 978-1-119-99149-6, John Wiley & Sons, 2011.
Navigation: subsystem to determine position/attitude, course, travelled distance and (optionally) velocity and acceleration of a marine craft.
Control: subsystem to determine necessary control forces and moments to be provided by the craft in order to satisfy certain control objective (in conjunction with the guidance system).
Guidance: subsystem that continuously computes the reference (desired) position, velocity and acceleration of a marine craft to be used by the motion control system.
GNC Signal Flow
Weather routing
program
Trajectory
Generator
Motion Control
System
Control
Allocation
Fusion Marine Craft INS (GNSS + AHRS)
OA Sensors
(Radar, Cameras, etc.)
Observer
Weather
data
Waypoints
Guidance
System
Control
System
Obstacle
Avoidance
Module
Estimated
positions and
velocities Navigation
System
Waves, wind
and ocean
currents
Principles of Guidance, Navigation & ControlGNC Signal Flow Overview
Principles of Guidance, Navigation & ControlGNC Signal Flow ↔ Lectures
GNC Signal Flow
Weather routing
program
Trajectory
Generator
Motion Control
System
Control
Allocation
Fusion Marine Craft INS (GNSS + AHRS)
OA Sensors
(Radar, Cameras, etc.)
Observer
Weather
data
Waypoints
Guidance
System
Control
System
Obstacle
Avoidance
Module
Estimated
positions and
velocities Navigation
System
Waves, wind
and ocean
currents
Day 1: Modelling & Simulation of Marine Craft
Principles of Guidance, Navigation & ControlGNC Signal Flow ↔ Lectures
GNC Signal Flow
Weather routing
program
Trajectory
Generator
Motion Control
System
Control
Allocation
Fusion Marine Craft INS (GNSS + AHRS)
OA Sensors
(Radar, Cameras, etc.)
Observer
Weather
data
Waypoints
Guidance
System
Control
System
Obstacle
Avoidance
Module
Estimated
positions and
velocities Navigation
System
Waves, wind
and ocean
currents
Day 1: Modelling & Simulation of Marine Craft
Day 2: Control of Marine Craft
Principles of Guidance, Navigation & ControlGNC Signal Flow ↔ Lectures
GNC Signal Flow
Weather routing
program
Trajectory
Generator
Motion Control
System
Control
Allocation
Fusion Marine Craft INS (GNSS + AHRS)
OA Sensors
(Radar, Cameras, etc.)
Observer
Weather
data
Waypoints
Guidance
System
Control
System
Obstacle
Avoidance
Module
Estimated
positions and
velocities Navigation
System
Waves, wind
and ocean
currents
Day 1: Modelling & Simulation of Marine Craft
Day 2: Control of Marine Craft
Day 3: Brushless DC Motor Control using FPGA
Principles of Guidance, Navigation & ControlDay 1: Modelling & Simulation of Marine CraftKinematics
ECEF
Body
NED
UTMLat, Lon
Unity
Reference Frames
Principles of Guidance, Navigation & ControlDay 1: Modelling & Simulation of Marine CraftKinematics
Transformations BODY - NED: Euler Angles
6 DOF Kinematic Equations
ሶ𝒑 Τ𝑏 𝑛𝑛
ሶ𝜽𝑛𝑏=
𝑹𝑏𝑛 𝜽𝑛𝑏 𝟎3×3𝟎3×3 𝑻𝜃 𝜽𝒏𝒃
𝒗 Τ𝑏 𝑛𝑏
𝒘 Τ𝑏 𝑛𝑏
ሶ𝜼 = 𝑱𝜣 𝜼 𝝂 Simulation ModelAttitude representation: Euler Angles
r
q
p
w
v
u
b
nb
b
nb
/
/
w
vv
nb
b
nb
θ
pη
/
Y
P
R
z
y
x
n
n
n
nb
b
nb
θ
pη /
Gain Integrator
0
00 /
nb
b
nb
θ
pη
KINEMATICS
Principles of Guidance, Navigation & ControlDay 1: Modelling & Simulation of Marine CraftKinematics
Transformations BODY - NED: Quaternions
6 DOF Kinematic Equations
ሶ𝒑 Τ𝑏 𝑛𝑛
ሶ𝒒=
𝑹𝑏𝑛 𝒒 𝟎3×3𝟎4×3 𝑻𝒒 𝒒
𝒗 Τ𝑏 𝑛𝑏
𝒘 Τ𝑏 𝑛𝑏
ሶ𝜼 = 𝑱𝒒 𝜼 𝝂 Simulation ModelAttitude representation: Quaternions
r
q
p
w
v
u
b
nb
b
nb
/
/
w
vv
q
pη
b
nb /
3
2
1
0
/
q
q
q
q
z
y
x
n
n
n
b
nb
q
pη
Gain Integrator
0
00 /
q
pη
b
nb
KINEMATICS
Principles of Guidance, Navigation & ControlDay 1: Modelling & Simulation of Marine CraftKinematics
Vector Rotation About General Axis:
Principles of Guidance, Navigation & ControlDay 1: Modelling & Simulation of Marine CraftKinematics
Vector Rotation About General Axis:
Principles of Guidance, Navigation & ControlDay 1: Modelling & Simulation of Marine CraftDynamics
6 DoF Rigid-Body Simulation ModelAttitude representation: Euler Angles
r
q
p
w
v
u
b
nb
b
nb
/
/
w
vv
nb
b
nb
θ
pη
/
Y
P
R
z
y
x
n
n
n
nb
b
nb
θ
pη /
Gain Integrator
0
00 /
nb
b
nb
θ
pη
0
00
/
/
b
nb
b
nb
w
vv
ሶ𝒑 Τ𝑏 𝑛𝑛
ሶ𝜽𝑛𝑏=
𝑹𝑏𝑛 𝜽𝑛𝑏 𝟎3×3𝟎3×3 𝑻𝜃 𝜽𝒏𝒃
𝒗 Τ𝑏 𝑛𝑏
𝒘 Τ𝑏 𝑛𝑏
ሶ𝜼 = 𝑱𝜣 𝜼 𝝂
b
nb
b
nb
/
/
w
vv
𝑴𝑅𝐵 ሶ𝝂 + 𝑪𝑅𝐵𝒗 = 𝝉𝑅𝐵
ሶ𝝂 = 𝑴𝑅𝐵−1 𝝉𝑅𝐵 − 𝑪𝑅𝐵𝒗
Gain
𝑪𝑅𝐵KINEMATICS
DYNAMICS
+
−
𝝉𝑅𝐵𝑴𝑅𝐵
−1
GainIntegrator
Principles of Guidance, Navigation & ControlDay 1: Modelling & Simulation of Marine CraftDynamics
6 DoF Rigid-Body Simulation ModelAttitude representation: Quaternions
r
q
p
w
v
u
b
nb
b
nb
/
/
w
vv
Gain Integrator
0
00
/
/
b
nb
b
nb
w
vv
b
nb
b
nb
/
/
w
vv
𝑴𝑅𝐵 ሶ𝝂 + 𝑪𝑅𝐵𝒗 = 𝝉𝑅𝐵
ሶ𝝂 = 𝑴𝑅𝐵−1 𝝉𝑅𝐵 − 𝑪𝑅𝐵𝒗
Gain
𝑪𝑅𝐵KINEMATICS
DYNAMICS
+
−
𝝉𝑅𝐵𝑴𝑅𝐵
−1
GainIntegrator
q
pη
b
nb /
3
2
1
0
/
q
q
q
q
z
y
x
n
n
n
b
nb
q
pη
ሶ𝒑 Τ𝑏 𝑛𝑛
ሶ𝒒=
𝑹𝑏𝑛 𝒒 𝟎3×3𝟎4×3 𝑻𝒒 𝒒
𝒗 Τ𝑏 𝑛𝑏
𝒘 Τ𝑏 𝑛𝑏
ሶ𝜼 = 𝑱𝒒 𝜼 𝝂
0
00 /
q
pη
b
nb
Principles of Guidance, Navigation & ControlDay 1: Modelling & Simulation of Marine CraftDynamics
6 DoF Equations of Motion including Ocean Currents (ROV)
𝑴𝑅𝐵 ሶ𝝂 + 𝑪𝑅𝐵 𝒗 𝒗 + 𝒈 𝜼 +𝑴𝐴 ሶ𝝂𝒓 + 𝑪𝐴 𝒗𝑟 𝒗𝑟 + 𝑫 𝒗𝑟 𝒗𝑟 = 𝝉𝑤𝑎𝑣𝑒 + 𝝉𝑝𝑟𝑜𝑝𝑢𝑙𝑠𝑖𝑜𝑛
rigid-body and hydrostatic terms hydrodynamic terms
Restoring Forces and Moments
Principles of Guidance, Navigation & ControlDay 1: Modelling & Simulation of Marine CraftDynamics
6 DoF Equations of Motion including Ocean Currents (ROV)
𝑴𝑅𝐵 ሶ𝝂 + 𝑪𝑅𝐵 𝒗 𝒗 + 𝒈 𝜼 +𝑴𝐴 ሶ𝝂𝒓 + 𝑪𝐴 𝒗𝑟 𝒗𝑟 + 𝑫 𝒗𝑟 𝒗𝑟 = 𝝉𝑤𝑎𝑣𝑒 + 𝝉𝑝𝑟𝑜𝑝𝑢𝑙𝑠𝑖𝑜𝑛
rigid-body and hydrostatic terms hydrodynamic terms
Ocean Current Velocity Vector(Irrotational Fluid)
n
cnb
n
b
n
cnb
b
n
b
c
b
c vθRvθRv0
vv
13
c
1,
Relative Velocity Vector
𝒗𝑟 = 𝒗 − 𝒗𝑐 =𝒗 Τ𝑏 𝑛𝑏
𝒘 Τ𝑏 𝑛𝑏 −
𝒗𝒄𝑏
𝟎3×1=
𝒗 Τ𝑏 𝑛𝑏 − 𝒗𝒄
𝑏
𝒘 Τ𝑏 𝑛𝑏
Principles of Guidance, Navigation & ControlDay 1: Modelling & Simulation of Marine CraftDynamics
6 DoF Equations of Motion including Ocean Currents (ROV)
𝑴𝑅𝐵 ሶ𝝂 + 𝑪𝑅𝐵 𝒗 𝒗 + 𝒈 𝜼 +𝑴𝐴 ሶ𝝂𝒓 + 𝑪𝐴 𝒗𝑟 𝒗𝑟 + 𝑫 𝒗𝑟 𝒗𝑟 = 𝝉𝑤𝑎𝑣𝑒 + 𝝉𝑝𝑟𝑜𝑝𝑢𝑙𝑠𝑖𝑜𝑛
rigid-body and hydrostatic terms hydrodynamic terms
Wave Spectra
Principles of Guidance, Navigation & ControlDay 1: Modelling & Simulation of Marine CraftDynamics
6 DoF Equations of Motion including Ocean Currents (ROV)
𝑴𝑅𝐵 ሶ𝝂 + 𝑪𝑅𝐵 𝒗 𝒗 + 𝒈 𝜼 +𝑴𝐴 ሶ𝝂𝒓 + 𝑪𝐴 𝒗𝑟 𝒗𝑟 + 𝑫 𝒗𝑟 𝒗𝑟 = 𝝉𝑤𝑎𝑣𝑒 + 𝝉𝑝𝑟𝑜𝑝𝑢𝑙𝑠𝑖𝑜𝑛
rigid-body and hydrostatic terms hydrodynamic terms
Propulsion System
Principles of Guidance, Navigation & ControlDay 1: Modelling & Simulation of Marine CraftDynamics
Nonlinear 6DoF ROV model (Euler Angles)
ሶ𝝂 = 𝑴𝑅𝐵 +𝑴𝐴−1 𝝉𝑤𝑎𝑣𝑒 + 𝝉𝑝𝑟𝑜𝑝𝑢𝑙𝑠𝑖𝑜𝑛 − 𝑪𝑅𝐵 𝒗𝑟 + 𝑪𝐴 𝒗𝑟 𝒗𝑟 − 𝑫 𝒗𝑟 𝒗𝑟 − 𝒈 𝜼
v η η
Gain Integrator
0η 0v
v
Gain
KINEMATICSDYNAMICS
+𝝉𝑝𝑟𝑜𝑝
GainIntegrator
n
cnb
n
b
n
cnb
b
n
b
c
b
c vθRvθRv0
vv
13
c
1
v
+
−
𝑴𝑅𝐵 +𝑴𝐴−1
𝝉𝑤𝑎𝑣𝑒
Gaincr vvv
𝑪𝑅𝐵 + 𝑪𝐴
−
𝑫
−−
𝒈
b
nb
b
nb
/
/
w
vv
nb
b
nb
θ
pη /
+
Principles of Guidance, Navigation & ControlDay 1: Modelling & Simulation of Marine CraftDynamics
v η η
Gain Integrator
0η 0v
v
Gain
KINEMATICSDYNAMICS
+𝝉𝑝𝑟𝑜𝑝
GainIntegrator
n
c
n
b
n
c
b
n
b
c
b
c vqRvqRv0
vv
13
c
1
v
+
−
𝑴𝑅𝐵 +𝑴𝐴−1
𝝉𝑤𝑎𝑣𝑒
Gaincr vvv
𝑪𝑅𝐵 + 𝑪𝐴
−
𝑫
−−
𝒈
b
nb
b
nb
/
/
w
vv
q
pη
b
nb /
+
Nonlinear 6DoF ROV model (Quaternions)
ሶ𝝂 = 𝑴𝑅𝐵 +𝑴𝐴−1 𝝉𝑤𝑎𝑣𝑒 + 𝝉𝑝𝑟𝑜𝑝𝑢𝑙𝑠𝑖𝑜𝑛 − 𝑪𝑅𝐵 𝒗𝑟 + 𝑪𝐴 𝒗𝑟 𝒗𝑟 − 𝑫 𝒗𝑟 𝒗𝑟 − 𝒈 𝜼
Principles of Guidance, Navigation & ControlDay 1: Modelling & Simulation of Marine CraftHands-on: Modelling & Simulation of ROV (MATLAB/Simulink)
Principles of Guidance, Navigation & ControlDay 2: Control of Marine CraftControl Allocation
SURGE
HEAVE
SWAY
YAW DoF controllable by horizontal thrusters
DoF controllable by vertical thruster
Final CA Problem
Principles of Guidance, Navigation & ControlDay 2: Control of Marine CraftControl Allocation
• Virtual control input
• True control input dv
v
v
• Control effectiveness matrix
• Actuator position constraint
• Weighted pseudoinverse solution
p
Principles of Guidance, Navigation & ControlDay 2: Control of Marine CraftControl Allocation
p
v
Weighted pseudoinverse
1 5
37
0
2 6
4
p
v
v
Principles of Guidance, Navigation & ControlDay 2: Control of Marine CraftControl Allocation
Hybrid Approach for Control Allocation
Weighted
Pseudoinverse
Fixed-Point
Method
Algorithm:
1. Find pseudoinverse solution.
2. If the solution is feasible, go to step 4.
3. Otherwise, use the fixed-point iterations to find feasible solution.
4. Deliver feasible solution as output.
Principles of Guidance, Navigation & ControlDay 2: Control of Marine CraftControl Allocation
Principles of Guidance, Navigation & ControlDay 2: Control of Marine CraftControl Allocation
Virtual Control SpaceTrue Control Space
Virtual Control Space
Principles of Guidance, Navigation & ControlDay 2: Control of Marine CraftControl Allocation
Principles of Guidance, Navigation & ControlDay 2: Control of Marine CraftControl Allocation
Error
𝒆𝐻𝑇 = 𝝉𝑑𝐻𝑇 − 𝝉𝐻𝑇
𝒇𝐹𝐹𝐻𝑇 = −𝐾𝒆𝐻𝑇
Force Feedback
Principles of Guidance, Navigation & ControlDay 2: Control of Marine CraftControl Allocation
Cruise: CV11026
Date: Dec 2011
Location: Bantry Bay
ROV: LATIS
SHIP: CELTIC VOYAGER (DP not available)
ROV Health: All Thrusters OK – simulated faults in HT4 & HT2
Principles of Guidance, Navigation & ControlDay 2: Control of Marine CraftControl System
ROV Control Architecture
Control Allocation
Navigation Data
(ROV)
Disturbances
ROV
Rigid-Body
Dynamics
Propulsion
System
Fault
Diagnosis
Fault Accommodation
dτControl Allocation
dn
HT Saturation Bounds VT Saturation Bounds
Low-Level Controllers
Winner Control Cluster
ROV Mode Control Cluster
ROV
AUV
Emergency Control Cluster
Emergency
Standard
Operation
Mode
Switch
Faults
Fusion Obstacle Avoidance Control Cluster
+
+
Standard Control Cluster Coordinator
Exclusive
Mode
Switch
Arbitration
Navigation Data
(Support Vessel)
Pilot Input Interface
Mission Planner
Map
Builder
Way Points
DatabaseMission Builder
Interface & Data Management
Trajectory Planner
Collaborative Behaviours
Exclusive Behaviours
LLCτ
VJτ Synthesis
Fusion
Principles of Guidance, Navigation & ControlDay 2: Control of Marine CraftControl System
Architecture
AutotuningImplementation
Low Level Controllers
Principles of Guidance, Navigation & ControlDay 2: Control of Marine CraftControl System
Description
ExamplesImplementation
Middle Level Controllers
Principles of Guidance, Navigation & ControlDay 2: Control of Marine CraftHands-on: Modelling & Simulation of ROV (MATLAB - LabVIEW)
Principles of Guidance, Navigation & ControlDay 2: Control of Marine CraftHands-on: Control of ROV/USV (LabVIEW)
Principles of Guidance, Navigation & ControlDay 3: Brushless DC Motor Control using FPGAIntroduction
myRIO T200 Thruster
Principles of Guidance, Navigation & ControlDay 3: Brushless DC Motor Control using FPGAMotor Control with PWM Signal
TPWM = 2.5 (ms)
Stopped
TS = 1.5 (ms)
TPWM = 2.5 (ms)
Max Forward
TS = 1.9 (ms)
TPWM = 2.5 (ms)
Max Reverse
TS = 1.1 (ms)
Duty Cycle = 0.60
Duty Cycle = 0.76
Duty Cycle = 0.44
Stopped Max Forward
Max Reverse
+1000-100
nd (%)
Duty Cycle
0.44
0.60
0.76
Motor friction (Dead Zone problem) neglected!
Principles of Guidance, Navigation & ControlDay 3: Brushless DC Motor Control using FPGAMotor Control with PWM Signal
nd > 0
nd < 0
nd = 0
Duty Cycle
Stopped Max Forward
Max Reverse
+1000-100
nd (%)
0.44
0.60
0.76
0.62
0.58
A+
B+
A-B-
Taking into account motor friction (Dead Zone)!
Principles of Guidance, Navigation & ControlDay 3: Brushless DC Motor Control using FPGAHands-on: Thruster Control using FPGA (LabVIEW)
Interconnection between myRIO and T200 Thruster