42. RigidBody simple controller

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

42.1. Tutorial overview

This tutorial covers:

  • Creating a multi-feature RigidBody DObject
  • Creating a Cable DObject
  • Controlling a RigidBody with an RBSimpleController
alternate text

Fig. 42.1 Towed RigidBody glider

42.2. Introduction to the RBSimpleController

Note

  • The RBSimpleController is a PID controller in ProteusDS used for controlling a single degree of freedom of a RigidBody.
  • A PID (proportional-integral-derivative) controller continuously calculates an error (difference between setpoint and process variable) and attempts to minimize it by adjusting a control variable based on the following equation:
\(u(t)=K_{p}e(t) + K_{i}\int_{0}^{t}e(t)dt + K_{d}\frac{de(t)}{dt}\)
  • \(u(t)\) is the controller output, \(e(t)\) is the error, and \(K_{p}\), \(K_{i}\), and \(K_{d}\) are the proportional, integral, and derivative coefficients, respectively.
  • The RBSimpleController is connected to a RigidBody to control and a RigidBody to observe. Most commonly, the RigidBody being controlled is also observed. However, in cases where there are interactions between multiple RigidBodies (such as towed bodies), the RigidBody being observed can be different than the RigidBody being controlled.
  • The six possible degrees of freedom for a RigidBody include: surge, sway, heave, roll, pitch, and yaw.
  • If surge, sway, or heave are being controlled the RBSimpleController will apply a force at the RigidBody CG. If roll, pitch, or yaw are being controlled the RBSimpleController will apply a moment about the RigidBody CG.
  • The magnitude of force or moment applied to the RigidBody is dependent on the error and the PID coefficients.

42.3. Creating the RigidBody glider

  • Create a new RigidBody and name it Glider.

Note

  • The glider will be made up of a hull, wing, and tail section.
  • In the library, create a new RigidBodyCylinder feature and name it hull. Give the cylinder a length of 2 m and a diameter of 0.2 m. The hull feature should look like the following:
// Added Mass Coefficients
$CaAxial 1
$CaNormal 1

// Dimensions
$Diameter 0.2
$Length 2

// Drag Coefficients
$CDt 0
$CdAxial 1
$CdNormal 1

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

// Mesh
$AxialSegments 10
$RadialSegments 3
$AngularSegments 8

// Soil loading
$SoilLoading 1
  • Create a new RigidBodyCuboid feature and name it wing. Give the cuboid an x length of 0.2 m, a y length of 1.5 m, and a z length of 0.02 m. Reduce the amount of z mesh segments to 2. The wing feature should look like the following:
// Added Mass Coefficients
$CAx 1
$CAy 1
$CAz 1

// Dimensions
$LengthX 0.2
$LengthY 1.5
$LengthZ 0.02

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

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

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

// Soil loading
$SoilLoading 1
  • Create a new RigidBodyCuboid feature and name it tail. Give the cuboid an x length of 0.1 m, a y length of 0.02 m, and a z length of 0.3 m. Reduce the amount of y mesh segments to 2. The tail feature should look like the following:
// Added Mass Coefficients
$CAx 1
$CAy 1
$CAz 1

// Dimensions
$LengthX 0.1
$LengthY 0.02
$LengthZ 0.3

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

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

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

// Soil loading
$SoilLoading 1

Note

  • Now that all of the library features have been created for the RigidBody they must be used to create the geometry of the glider.
  • Add the following lines to RigidBody Glider input file:

$Cylinder hull 0 0 0 0 90 0
$Cuboid wing 0.3 0 0 0 0 0
$Cuboid tail -0.95 0.1 -0.15 60 0 0
$Cuboid tail -0.95 -0.1 -0.15 -60 0 0
  • In the RigidBody input file adjust the moments of inertia (Ix, Iy, and Iz) to 100.
  • Set $CGPosition 0 0 0.06 to lower the RigidBody center of gravity position by 6 cm.
  • Set $DefineInertiaAboutCG 1 to define all RigidBody inertia about the new CG position.
  • Set the mass of the RigidBody to 80.
  • In the RigidBody state set the initial depth of the glider to 10 m.

42.4. Creating a towline

  • Create a new Cable and name it Towline.
  • Adjust the Cable state properties to Node 0 at (0,0,0) and Node N at (0,0,9.9). Set the length of cable to 9.9 m with 8 elements.
  • Create a new DCableSegment feature in the library and name it rope. The DCableSegment feature should look like the following:
// Axial Rigidity
$AxialRigidityMode 0
$EA 1E5

// Fluid loading
$CDc 1.5
$CDt 0.01
$CAc 1

// Mechanical
$EI1 0
$EI2 0
$GJ 0
$Diameter 0.01
$Density 1100
$AxialDampingMode 1
$AxialReferenceDampingRatio 0.5
$BCID 0
$TCID 0
$CE 1

// Strain Limit
$ElongationLimitMode 0
  • Add $CableSegment rope 10 to the Cable input file.
  • Set $Node0Static 1 to ensure node 0 remains fixed.
  • Create a point connection and set Glider as the master and Towline as the follower.
  • Set $DCableFollowerNodeN 1 to ensure node N of the cable is used for the connection.
  • Set $DCableFollowerLocation 0 0 -0.1 to attach the towline to the top of the hull.

42.5. Running an initial simulation

Note

  • Before any controls are added to the towed glider an initial simulation will be run to allow the glider to reach a steady state in a steady current.
  • In the environment file set a uniform current with a heading of 180 degrees and a speed of 1 m/s. Set the water depth to 30 m.
  • Set the simulation run time to 60 s and run the simulation.
  • Open PostPDS to view the results.

Note

  • The glider begins at a depth of 10 m and settles at an approximate depth of 8.6 m due to the drag forces.
  • Create a new simulation folder and export the simulation to that folder. This will be used as the initial state for a new simulation with controls.

42.6. Using the RBSimpleController

42.6.1. Controlling pitch

  • In PST select the Create button and choose a RBSimpleController as the DObject type. Name the controller Depth_Control.
  • Create a connection with Depth_Control as the master and Glider as the follower. Set the connection type to Control.
  • Create another connection with the same master and follower but set the connection type to Observe.

Note

  • This RBSimpleController will use the same RigidBody to control and observe.
  • In the control connection properties set $Controlled 4 to control the RigidBody pitch.

Note

  • The controller will apply a pitching moment about the RigidBody CG.
  • Set the PID coefficients to the following:
// Controller
$Controlled 4
$Kp -7.5
$Ki -0.15
$Kd 0
$FeedForward 0

Note

For example, with Kp = −7.5 and an error of 1, the controller will induce a -7.5 Nm moment about the RigidBody CG.

  • In the observe connection properties set $Observed 8 to observe the heave (or depth) of the RigidBody.
  • Set $InitialSetPoint 5 to set the depth set point to 5 m.
  • Run the simulation and view the results.

Note

The controller will pitch the glider up to induce more drag thus causing the glider to be lifted to a new depth. The glider eventually settles to a depth of 5 m.

42.6.2. Controlling heave

  • Reset the simulation.
  • In the Control connection between Depth Control and Glider, set $Controlled 2 to control the heave of the RigidBody.

Note

  • The controller will apply a heave force at the RigidBody CG which could represent the glider releasing or taking on water to change its buoyancy.
  • Set the PID coefficients to the following:
// Controller
$Controlled 2
$Kp 70
$Ki 3.5
$Kd 0
$FeedForward 0
  • Rerun the simulation and view the results.

Note

  • The controller will heave the glider up causing it to be lifted to a new depth. The glider eventually settles to a depth of 5 m.