43. Stationkeeping using the RigidBody simple controller

The identification tag for this tutorial is PDS-ABZ. Pregenerated input files for this tutorial are found in the folder named PDS-ABZ in the provided tutorial input files.

43.1. Tutorial overview

This tutorial covers:

  • Creating a multi-feature RigidBody DObject
  • Controlling a RigidBody with an RBSimpleController
  • Using RBSimpleController to control the position and orientation of a RigidBody current and waves.

43.2. Creating a RigidBody vessel

  • Create a new project.
  • Create a RigidBody and name it vessel.
  • Add two cuboid features to vessel, and name them hull and bridge, respectively.
  • Shift the bridge cuboid by -30 m in the x-direction and -5 m in the z-direction with respect to the RigidBody frame.
  • Create the hull feature in the library and give it the following properties:
// Added Mass Coefficients
$CAx 1
$CAy 1
$CAz 1

// Dimensions
$LengthX 100
$LengthY 20
$LengthZ 5

// Drag Coefficients
$CDt 0
$CDx 1
$CDy 1
$CDz 1

// Fluid loading
$WindLoading 1
$HydroLoading 1
$HydrostaticFroudeKrylov 1

// Mesh
$SegmentsX 15
$SegmentsY 5
$SegmentsZ 8

// Soil loading
$SoilLoading 1

Note

  • The hull has dimensions of 100 m x 20 m x 5 m.
  • Create the bridge feature in the library and give it the following properties:
// Added Mass Coefficients
$CAx 1
$CAy 1
$CAz 1

// Dimensions
$LengthX 15
$LengthY 15
$LengthZ 5

// Drag Coefficients
$CDt 0
$CDx 1
$CDy 1
$CDz 1

// Fluid loading
$WindLoading 1
$HydroLoading 1
$HydrostaticFroudeKrylov 1

// Mesh
$SegmentsX 5
$SegmentsY 5
$SegmentsZ 5

// Soil loading
$SoilLoading 1

Note

  • The bridge has dimensions of 15 m x 15 m x 5 m.
  • Set the vessel moments of inertia to (1e6,1e7,1e7) and mass to 5e6 kg. The input file for vessel should look like the following:
  • Define the state of vessel to have a global position of (-10,20,0) m with no initial velocity and a heading of 45 degrees.

Note

  • The vessel geometry and mechanical properties should now be setup. In order to perform station keeping control with the vessel, a RBSimpleController will be added.

43.3. Setting up the Controller

  • Create a RBSimpleController and name it stationKeepingController.

Note

  • The controller will be used to control the surge, sway, and yaw of the RigidBody.
  • Add a connection with stationKeepingController as the master and vessel as the follower. Set the connection type to observe.
  • Set $Observed 6 to observe the surge of the vessel.
  • Set $ObservedOrder 0 to set the PID coefficient matrix column index number that the observed value corresponds to.

Note

  • Each observed value must be associated with only one column of the PID coefficient matrix.
  • Set $InitialSetPoint 0 to adjust the surge set point to 0 m.
  • Create a new observe connection between stationKeepingController and vessel with properties of $Observed 7 (sway), $ObservedOrder 1, and $InitialSetPoint 0.
  • Create a new observe connection between stationKeepingController and vessel with properties of $Observed 11 (yaw), $ObservedOrder 2, and $InitialSetPoint 0.

Note

  • Now that the observe connections for the vessel have been setup, the control connections must be created in order to control the observed states.
  • Add a connection with stationKeepingController as the master and vessel as the follower. Set the connection type to control.
  • Set the connection properties to the following:
// Controller
$Controlled 0

//the columns of Kp, Ki, Kd align to the observe order
//in this case, the values are associated with surge, sway, and yaw control
$Kp 8e4 0 0

$Ki 1000 0 0

$Kd 7e5 0 0

$FeedForward 0

Note

  • The columns of Kp, Ki, and Kd align to the observe order. In this case, the values are associated with surge, sway, and yaw control.
  • Create a new control connection between stationKeepingController and vessel.
  • Set the connection properties to the following:
// Controller
$Controlled 1

//the columns of Kp, Ki, Kd align to the observe order
//in this case, the values are associated with surge, sway, and yaw control
$Kp 0 5e4 0 

$Ki 0 1000 0 

$Kd 0 7e5 0 

$FeedForward 0
  • Create a new control connection between stationKeepingController and vessel.
  • Set the connection properties to the following:
// Controller
$Controlled 5

//the columns of Kp, Ki, Kd align to the observe order
//in this case, the values are associated with surge, sway, and yaw control
$Kp 0 0 1e8

$Ki 0 0 500

$Kd 0 0 1e8

$FeedForward 0

43.4. Simulating the vessel in a current

  • In the environment input file, set $CurrentProfile 1 to apply a uniform current. Set a current heading of 45 degrees and a speed of 0.75 m/s.
  • Set $WindProfile 0 to apply a uniform wind profile. Set a wind heading of 75 degrees and a constant wind spectrum with $WindSpectrum 0. Set a wind speed of 15 m/s.
  • In the simulation input file, set the simulation length to 150 s or more.
  • Run the simulation and view the results in PostPDS.

Note

  • The current will push the tug in the sway direction but the controller will prevent it from wandering off.

43.5. Simulating the vessel in current and waves

Note

  • Waves will be added to the simulation.
  • In the environment input file, add airy waves with $WaveType 1. Resolve follower properties, and set the wave height to 2 m, wave heading to 45 degrees and the wave period to 10 s.
  • Set a 10 second ramp for both current and waves. Specify $EnvironmentTransitionMode 1 and resolving follower properties. Set $CurrentTransitionMode 1 and $WaveTransitionMode 1 to ramp current and wave conditions. Set corresponding ramp durations to 10 seconds.
  • Run the simulation and view the results.