MAVLINKHUD

Overview

The SURFTRAK parameter group configures the Surface Tracking mode for ArduSub.

In this mode, the ROV maintains a constant distance from either the surface of the water or the seafloor (if a downward-facing rangefinder is used).

Key Concepts

1. Relative Depth Control

  • SURFTRAK_DEPTH: The target distance (cm) to maintain from the reference (surface or bottom).
  • SURFTRAK_MODE: Selects between Tracking the Surface or Tracking the Bottom.

Developer Notes

  • Library: ArduSub/Parameters.cpp.
  • Requirement: Requires a valid external pressure sensor or rangefinder.

SURFTRAK_DEPTH

cm
Default 50
Range 0 1000

SURFTRAK minimum depth (SURFTRAK_DEPTH)

Description

This parameter sets the target depth for the ROV when in Surface Tracking mode. Unlike standard Depth Hold which locks the absolute pressure/depth, Surface Tracking tries to maintain a constant distance below the water's surface (often using a rangefinder or inverted logic).

The Mathematics

$$ Z\_{\text{target}} = Z\_{\text{surface}} + \text{SURFTRAK\_DEPTH} $$

The Engineer's View

Defined in ArduSub/Parameters.cpp.

Tuning & Behavior

  • Default Value: 50 cm
  • Range: Ensure this is deep enough to prevent the thrusters from breaching the surface and cavitating.

SURFTRAK_MODE

Default 1
Range 0 2

SURFTRAK_MODE: Surface Tracking Mode

Description

Set which surface to track in surface tracking.

Values

Value Meaning
0 Do not track
1 Ground (Track distance to ground)
2 Ceiling (Track distance to ceiling)
  • Default: 1 (Ground)

Description

This parameter configures the Surface Tracking library, which allows the vehicle to maintain a set distance from a surface using a rangefinder (Lidar/Sonar).

  • Ground (1): Standard Terrain Following. The vehicle adjusts its altitude to maintain a constant height AGL (Above Ground Level).
  • Ceiling (2): Used for indoor inspection or tunnel flight. The vehicle uses an upward-facing rangefinder to maintain a constant distance from the roof.
  • Do not track (0): Disables surface tracking features.

SURFTRAK_TC

s
Default 1.0
Range 0 5

SURFTRAK_TC: Surface Tracking Filter Time Constant

Description

Time to achieve 63.2% of the surface altitude measurement change. If 0 filtering is disabled.

Values

  • Range: 0 to 5
  • Units: s
  • Default: 1.0

Description

This parameter smooths the data coming from the rangefinder before it is used for Surface Tracking flight modes.

  • Function: Rangefinders (especially Lidar over grass or Sonar over uneven ground) can be noisy. This Low-Pass Filter (LPF) smooths out spikes to prevent the drone from twitching vertically as it flies over small obstacles like bushes or rocks.
  • Trade-off:
    • Higher Value (More Filtering): Smoother flight, but the drone reacts slower to terrain changes. Dangerous if flying fast towards a steep hill.
    • Lower Value (Less Filtering): Faster reaction to terrain, but "jumpier" flight characteristics.