|
FhSim
3.1.0
Marine systems simulation
|
Collaboration diagram for Cable attachment:A point mass that is held to a connection point by a PID-type spring-damper when it is attached, and falls freely under gravity when it is not. The mass moves with
\[ \dot v = \frac{a F_{reg} + F_{ext}}{m} + g \hat z \]
where \( a \) is the AttachState input, \( F_{ext} \) the ForceNED input, and \( F_{reg} = K_p (P_1 - P_0) + K_d (V_1 - V_0) + K_i e \) with \( P_0, V_0 \) the mass state, \( P_1, V_1 \) the connection point inputs, and \( e \) the integrated position error. \( F_{reg} \) is zero when the distance \( |P_1 - P_0| \) is at least AttachRadius. When AttachState is 0, a drag \( -0.1 v \) is added to the acceleration, and the error state decays with rate 2.
| Name | Width | Description |
|---|---|---|
| ForceNED | 3 | External (cable) force on the mass in the NED frame |
| PositionNED | 3 | Position of the connection point in the NED frame |
| VelocityNED | 3 | Velocity of the connection point in the NED frame |
| AttachState | 1 | Attached when not 0 (the force of the regulator is multiplied by this value; the integral error grows only when greater than 0) |
| Name | Width | Description |
|---|---|---|
| PositionNED | 3 | Position of the mass in the NED frame |
| VelocityNED | 3 | Velocity of the mass in the NED frame |
| ForceNED | 3 | ForceNED input times AttachState, as computed at the last evaluation of the derivatives |
| Name | Width | Description |
|---|---|---|
| Mass | 1 | Mass of the point. Default 10. Unit not stated in the code |
| Kp | 1 | Proportional gain on the position error. Default 0 |
| Kd | 1 | Gain on the velocity error. Default 0 |
| Ki | 1 | Gain on the integrated position error. Default 0 |
| AttachRadius | 1 | The regulator acts only when the distance to the connection point is less than this. Default 1.0 |
| Name | Width | Description |
|---|---|---|
| Position | 3 | Position of the mass in the NED frame. No default: set it as an initial condition |
| Velocity | 3 | Velocity of the mass. Initial value 0 |
| Error | 3 | Integrated position error. Initial value 0 |