Marine systems simulation
Virtual current

Virtual sea current field.

+ Collaboration diagram for Virtual current:
Author
Joakim Haugen

VirtualCurrent is a manipulable current field. Error signals are used to change the magnitude and direction of the current at various depths. The adaptation is using a PID controller with integral saturation for each error signal. The sim object

Warning
This somObject does not work as expected.

Example configuration excerpt

Todo:
Add example excerpt.
<Lib
LibName = "fhsim_base"
SimObject = "Adaptive/Current"
Name = "C"
ProportionalGain = "1"
IntegralGain = "0"
IntegralSaturation = "1"
DerivativeGain = "0"
DerivativeTimeConstant = "10"
DepthLayerThickness = "5.0, 10.0, 15.0"
/>
...
<Connection
C.PlanarError_L1 = "0,0"
C.PlanarError_L2 = "0,0"
C.PlanarError_L3 = "0,0"
/>

Input ports

Name Width Description
PlanarError_L1 .. PlanarError_L<N> 2 Error signal to use in adaptation. One for each depth layer; in total N.

Output ports

Name Width Description
PlanarCurrent_L1 .. PlanarCurrent_L<N> 2 Estimated current at specified DepthLayersThicknesses.

Configuration parameters

Name Width Description
ProportionalGain 1 \(P_p (p_d - p_e)\).
IntegralGain 1 \(P_i\int_0^t (p_d - p_e)\).
IntegralSaturation 1 \(\text{abs}(\max(\int_0^t (p_d - p_e))) = sat\).
DerivativeGain 1 \(P_d (\dot{e})\).
DerivativeTimeConstant 1 Time contant of the dynamics of error derivative.
DepthLayerThickness N Array of depths at which the virtual inputs will manipulate the current. Between these points a linear interpolation is used (and below/above boundary depths: the closest one).

Initial conditions

Todo:
Add init conds.
Todo:
add default values for integral error and error derivative, and add this in doc
Name Width Description
Current_L1 .. Current_L<N> 2 Initial planar current at each depth layer.
IntegralError_L1 .. IntegralError_L<N> 2 Initial integral error (default: 0,0)
ErrorDerivative_L1 .. ErrorDerivative_L<N> 2 Initial derivative error (default: 0,0)

Full example file

Todo:
Add config file.

This SimObject is referred to as Adaptive/VirtualCurrent